@wrdagency/blockout 1.0.35 → 1.0.37

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.
Files changed (340) hide show
  1. package/dist/{2NBKRL7C-DBbnghCe.js → 2NBKRL7C-CHy8TNQM.js} +20 -20
  2. package/dist/{2RSXSRCN-BxQ_v-Je.js → 2RSXSRCN-DO41jkxy.js} +17 -17
  3. package/dist/{4CMBR7SL-DezfZPUS.js → 4CMBR7SL-eq3_MGhO.js} +30 -30
  4. package/dist/{5JTVDSTH-CZ7mfyUK.js → 5JTVDSTH-Cb-3mCyv.js} +4 -4
  5. package/dist/{5VQZOHHZ-DLX-ulBK.js → 5VQZOHHZ-D1gSZFY3.js} +1 -1
  6. package/dist/{6VRAQV3D-BYmT0QTl.js → 6VRAQV3D-Dzur8C7A.js} +19 -19
  7. package/dist/{A3WPL2ZJ-24tGIJIQ.js → A3WPL2ZJ-BZG8SEll.js} +2 -2
  8. package/dist/{BM6PGYQY-DCbkDr5N.js → BM6PGYQY-CCtFEKyb.js} +4 -4
  9. package/dist/{EM5CXX6A-B4ZS4Hs_.js → EM5CXX6A-DJQcGr5c.js} +2 -2
  10. package/dist/F5MUBM3I-6mXn4Fpb.js +54 -0
  11. package/dist/{G7GW6PWC-Dk4hVbAk.js → G7GW6PWC-BbXlQk2u.js} +106 -106
  12. package/dist/{J2LQO3EC-BXJIaM2U.js → J2LQO3EC-CvdDteYO.js} +7 -7
  13. package/dist/JMHAJKUZ-B_CxAFEI.js +136 -0
  14. package/dist/{KFH4SEIX-DaQeP5D_.js → KFH4SEIX-CEb2cs5b.js} +16 -16
  15. package/dist/{LMDWO4NN-CpSMaD5G.js → LMDWO4NN-5r0-Qq-x.js} +59 -59
  16. package/dist/{MR26YJYP-CTh6rCwA.js → MR26YJYP-ev1_As0E.js} +82 -82
  17. package/dist/{MTZPJQMC-D2i4-LA_.js → MTZPJQMC-CeWFa7M2.js} +2 -2
  18. package/dist/{O2PQ2652-DIoegIkE.js → O2PQ2652-Cf1Ld8NU.js} +11 -11
  19. package/dist/{P7GR5CS5-3RsPGPTy.js → P7GR5CS5-DFBp00bC.js} +3 -5
  20. package/dist/{PFRGBC2K-BdRJd-gU.js → PFRGBC2K-a0iGk9xp.js} +78 -78
  21. package/dist/{RS7LB2H4-COOfOq9w.js → RS7LB2H4-C2VEpoD3.js} +1 -1
  22. package/dist/RZ4GPYOB-2HMGtCSt.js +37 -0
  23. package/dist/{S43UC3DV-HCi6u_G4.js → S43UC3DV-0FmlYtUL.js} +8 -8
  24. package/dist/{TIW3GMFC-BF0w2_9R.js → TIW3GMFC-DwYhiC0Y.js} +18 -18
  25. package/dist/{TP7N7UIH-C4jXJDlO.js → TP7N7UIH-BtuT6Y_M.js} +2 -2
  26. package/dist/{UQQRIHDV-DEGlgATx.js → UQQRIHDV-DtNzoFEE.js} +23 -23
  27. package/dist/{UYGDZTLQ-HiDKLOW5.js → UYGDZTLQ-BBLp-g5T.js} +2 -2
  28. package/dist/{VIIRIBF3-B-djNAU9.js → VIIRIBF3-Ds5aiXIU.js} +5 -5
  29. package/dist/{WMYDSCNQ-pGjWB-Pk.js → WMYDSCNQ-BdMfJmVD.js} +8 -8
  30. package/dist/{WYCIER3C-CxfgpZG_.js → WYCIER3C-eiMqR6-L.js} +4 -4
  31. package/dist/{YORGHBM4-D_fOXG5Y.js → YORGHBM4-DycYf9gS.js} +11 -11
  32. package/dist/{YV4JVR4I-CQnJhUSg.js → YV4JVR4I-BqDRuYuU.js} +60 -60
  33. package/dist/assets/index10.css +1 -1
  34. package/dist/assets/index11.css +1 -1
  35. package/dist/assets/index12.css +1 -1
  36. package/dist/assets/index13.css +1 -1
  37. package/dist/assets/index14.css +1 -1
  38. package/dist/assets/index2.css +1 -1
  39. package/dist/assets/index3.css +1 -1
  40. package/dist/assets/index4.css +1 -1
  41. package/dist/assets/index5.css +1 -1
  42. package/dist/assets/index6.css +1 -1
  43. package/dist/assets/index7.css +1 -1
  44. package/dist/assets/index8.css +1 -1
  45. package/dist/assets/index9.css +1 -1
  46. package/dist/assets/style.css +1 -1
  47. package/dist/assets/style10.css +1 -1
  48. package/dist/assets/style11.css +1 -1
  49. package/dist/assets/style2.css +1 -1
  50. package/dist/assets/style3.css +1 -1
  51. package/dist/assets/style4.css +1 -1
  52. package/dist/assets/style5.css +1 -1
  53. package/dist/assets/style6.css +1 -1
  54. package/dist/assets/style7.css +1 -1
  55. package/dist/assets/style8.css +1 -1
  56. package/dist/assets/style9.css +1 -1
  57. package/dist/assets/styles.css +1 -1
  58. package/dist/{base-jB1DIMnz.js → base-CPhsnNBF.js} +6 -6
  59. package/dist/combobox-popover-C6rwSpgq.js +1116 -0
  60. package/dist/components/avatar/index.js +13 -12
  61. package/dist/components/badge/index.js +9 -8
  62. package/dist/components/breadcrumbs/index.js +20 -19
  63. package/dist/components/button/button.js +12 -28
  64. package/dist/components/button/icon.js +12 -28
  65. package/dist/components/button/index.js +3 -8
  66. package/dist/components/button/row.js +4 -4
  67. package/dist/components/command-palette/dialog.js +8 -31
  68. package/dist/components/command-palette/index.js +3 -8
  69. package/dist/components/command-palette/presets.js +4 -5
  70. package/dist/components/command-palette/static.js +17 -70
  71. package/dist/components/controls/base-control/index.js +2 -3
  72. package/dist/components/controls/base-popover-control/index.js +20 -21
  73. package/dist/components/controls/card-number-control/index.js +1 -1
  74. package/dist/components/controls/checkbox-control/index.js +3 -4
  75. package/dist/components/controls/choice-control/choice.js +22 -22
  76. package/dist/components/controls/choice-control/index.js +1 -1
  77. package/dist/components/controls/date-control/index.js +16 -17
  78. package/dist/components/controls/date-control/picker.js +8 -9
  79. package/dist/components/controls/index.js +21 -22
  80. package/dist/components/controls/list-control/index.js +1 -1
  81. package/dist/components/controls/list-control/item.js +19 -18
  82. package/dist/components/controls/list-control/list.js +2 -2
  83. package/dist/components/controls/markdown-control/editor.js +3 -3
  84. package/dist/components/controls/markdown-control/index.js +1 -1
  85. package/dist/components/controls/markdown-control/slash/base.js +1 -1
  86. package/dist/components/controls/markdown-control/slash/mentions.js +1 -1
  87. package/dist/components/controls/markdown-control/toolbar.js +2 -2
  88. package/dist/components/controls/number-control/index.js +1 -1
  89. package/dist/components/controls/password-control/index.js +1 -1
  90. package/dist/components/controls/recurrence-control/index.js +37 -41
  91. package/dist/components/controls/select-control/control.js +8 -49
  92. package/dist/components/controls/select-control/index.js +3 -4
  93. package/dist/components/controls/select-control/select.js +23 -166
  94. package/dist/components/controls/tag-control/ariakit-experimental.js +550 -558
  95. package/dist/components/controls/tag-control/index.js +32 -36
  96. package/dist/components/controls/tag-control/props.js +14 -13
  97. package/dist/components/controls/text-control/index.js +1 -1
  98. package/dist/components/controls/textarea-control/index.js +1 -1
  99. package/dist/components/controls/toggle-control/index.js +8 -8
  100. package/dist/components/controls/toggle-group-control/index.js +8 -8
  101. package/dist/components/dashboard/context.d.ts +15 -0
  102. package/dist/components/dashboard/context.js +6 -0
  103. package/dist/components/dashboard/grid.d.ts +9 -0
  104. package/dist/components/dashboard/grid.js +266 -0
  105. package/dist/components/dashboard/index.d.ts +2 -0
  106. package/dist/components/dashboard/index.js +6 -0
  107. package/dist/components/dashboard/item.d.ts +9 -0
  108. package/dist/components/dashboard/item.js +5306 -0
  109. package/dist/components/dashboard/types.d.ts +13 -0
  110. package/dist/components/dashboard/types.js +1 -0
  111. package/dist/components/data-form/autosave.js +3 -3
  112. package/dist/components/data-form/index.js +5 -12
  113. package/dist/components/data-form/status.js +14 -32
  114. package/dist/components/data-form/submit.js +13 -31
  115. package/dist/components/data-view/api.js +1 -1
  116. package/dist/components/data-view/data/apply.js +139 -296
  117. package/dist/components/data-view/data/filter.js +21 -35
  118. package/dist/components/data-view/data/layout.js +9 -13
  119. package/dist/components/data-view/index.js +1 -1
  120. package/dist/components/data-view/layouts/grid/empty.js +1 -1
  121. package/dist/components/data-view/layouts/grid/group.js +15 -42
  122. package/dist/components/data-view/layouts/grid/index.js +4 -6
  123. package/dist/components/data-view/layouts/grid/item.js +17 -87
  124. package/dist/components/data-view/layouts/grid/root.js +1 -1
  125. package/dist/components/data-view/layouts/kanban/empty.js +2 -3
  126. package/dist/components/data-view/layouts/kanban/group.js +16 -43
  127. package/dist/components/data-view/layouts/kanban/index.js +3 -6
  128. package/dist/components/data-view/layouts/kanban/item.js +17 -87
  129. package/dist/components/data-view/layouts/kanban/root.js +13 -13
  130. package/dist/components/data-view/layouts/list/empty.js +1 -1
  131. package/dist/components/data-view/layouts/list/group.js +15 -42
  132. package/dist/components/data-view/layouts/list/index.js +4 -6
  133. package/dist/components/data-view/layouts/list/item.js +17 -66
  134. package/dist/components/data-view/layouts/list/root.js +1 -1
  135. package/dist/components/data-view/layouts/table/empty.js +15 -41
  136. package/dist/components/data-view/layouts/table/group.js +15 -61
  137. package/dist/components/data-view/layouts/table/index.js +2 -6
  138. package/dist/components/data-view/layouts/table/item.js +17 -67
  139. package/dist/components/data-view/layouts/table/root.js +17 -122
  140. package/dist/components/data-view/layouts/tile/empty.js +1 -1
  141. package/dist/components/data-view/layouts/tile/group.js +15 -42
  142. package/dist/components/data-view/layouts/tile/index.js +4 -6
  143. package/dist/components/data-view/layouts/tile/item.js +17 -69
  144. package/dist/components/data-view/layouts/tile/root.js +1 -1
  145. package/dist/components/data-view/parts/body/empty.js +13 -12
  146. package/dist/components/data-view/parts/body/index.js +20 -37
  147. package/dist/components/data-view/parts/controls/index.js +54 -73
  148. package/dist/components/data-view/parts/controls/search.js +24 -44
  149. package/dist/components/data-view/parts/filters/chip.js +14 -49
  150. package/dist/components/data-view/parts/filters/editor.js +17 -79
  151. package/dist/components/data-view/parts/filters/index.js +2 -7
  152. package/dist/components/data-view/parts/filters/list.js +6 -72
  153. package/dist/components/data-view/parts/footer/actions.js +33 -52
  154. package/dist/components/data-view/parts/footer/index.js +15 -33
  155. package/dist/components/data-view/parts/footer/selection.js +14 -32
  156. package/dist/components/data-view/parts/index.js +3 -3
  157. package/dist/components/data-view/parts/view-control/index.js +44 -60
  158. package/dist/components/data-view/root.js +18 -38
  159. package/dist/components/data-view/slots/group/checkbox.js +13 -28
  160. package/dist/components/data-view/slots/group/context.js +5 -21
  161. package/dist/components/data-view/slots/group/header.js +3 -10
  162. package/dist/components/data-view/slots/group/icon.js +2 -2
  163. package/dist/components/data-view/slots/group/index.js +2 -4
  164. package/dist/components/data-view/slots/group/label.js +1 -1
  165. package/dist/components/data-view/slots/index.js +4 -6
  166. package/dist/components/data-view/slots/item/actions.js +6 -28
  167. package/dist/components/data-view/slots/item/checkbox.js +17 -77
  168. package/dist/components/data-view/slots/item/depth.js +2 -4
  169. package/dist/components/data-view/slots/item/description.js +1 -1
  170. package/dist/components/data-view/slots/item/index.js +2 -5
  171. package/dist/components/data-view/slots/item/properties.js +2 -3
  172. package/dist/components/data-view/slots/item/relations.js +7 -9
  173. package/dist/components/data-view/slots/item/tags.js +2 -3
  174. package/dist/components/data-view/slots/item/thumbnail.js +2 -2
  175. package/dist/components/data-view/slots/item/title.js +8 -8
  176. package/dist/components/data-view/slots/item/util.js +2 -3
  177. package/dist/components/data-view/slots/property/field/editable.js +14 -29
  178. package/dist/components/data-view/slots/property/field/index.js +2 -3
  179. package/dist/components/data-view/slots/property/field/static.js +1 -1
  180. package/dist/components/data-view/slots/property/index.js +2 -2
  181. package/dist/components/data-view/slots/property/label.js +1 -1
  182. package/dist/components/data-view/slots/root/checkbox.js +13 -27
  183. package/dist/components/data-view/slots/root/index.js +1 -1
  184. package/dist/components/dialog/index.js +32 -33
  185. package/dist/components/filesystem/file.js +5 -5
  186. package/dist/components/filesystem/folder.js +5 -5
  187. package/dist/components/filesystem/icon.js +3 -863
  188. package/dist/components/filesystem/index.js +2 -2
  189. package/dist/components/filesystem/list.js +1 -1
  190. package/dist/components/filesystem/root.js +1 -1
  191. package/dist/components/form/components/index.js +7 -16
  192. package/dist/components/form/components/pagination.js +5 -106
  193. package/dist/components/form/components/progress.js +4 -19
  194. package/dist/components/form/index.js +1 -1
  195. package/dist/components/index.d.ts +1 -0
  196. package/dist/components/index.js +65 -73
  197. package/dist/components/menu/index.d.ts +10 -1
  198. package/dist/components/menu/index.js +9 -45
  199. package/dist/components/menu/item.js +1 -1
  200. package/dist/components/menu/items/action.js +1 -1
  201. package/dist/components/menu/items/spacer.js +1 -1
  202. package/dist/components/menu/items/submenu.js +4 -5
  203. package/dist/components/menu/items/toggle.js +1 -1
  204. package/dist/components/pagination/index.js +8 -8
  205. package/dist/components/progress/index.js +12 -50
  206. package/dist/components/shell/context.js +1 -1
  207. package/dist/components/shell/index.js +6 -16
  208. package/dist/components/shell/navigation.js +5 -49
  209. package/dist/components/shell/pane.js +13 -26
  210. package/dist/components/shell/sidebar-item.js +13 -45
  211. package/dist/components/tabs/index.js +1 -1
  212. package/dist/components/tabs/list.js +1 -1
  213. package/dist/components/tabs/panel.js +1 -1
  214. package/dist/components/tabs/root.js +1 -1
  215. package/dist/components/tabs/tab.js +1 -1
  216. package/dist/components/tag/index.js +2 -6
  217. package/dist/components/tag/list.js +4 -8
  218. package/dist/components/tag/tag.js +12 -20
  219. package/dist/components/toolbar/divider.js +1 -1
  220. package/dist/components/toolbar/index.js +6 -15
  221. package/dist/components/toolbar/root.js +1 -1
  222. package/dist/components/window/index.js +20 -20
  223. package/dist/{composite-provider-BPIeS4Cg.js → composite-provider-DlANhpbV.js} +2 -2
  224. package/dist/{disclosure-provider-cEVysvZT.js → disclosure-provider-Whga0UAw.js} +2 -2
  225. package/dist/filter-ClQxRPQl.js +120 -0
  226. package/dist/hooks/state.js +1 -1
  227. package/dist/hooks/theme.js +1 -1
  228. package/dist/icon-D6VWNg1e.js +909 -0
  229. package/dist/index-CcV1laBm.js +10 -0
  230. package/dist/{sortable.esm-BuV7eW2H.js → index-CrDFDRMM.js} +1247 -1089
  231. package/dist/{index-D7vLJIGX.js → index-D0xboB4V.js} +2 -2
  232. package/dist/index.js +133 -132
  233. package/dist/item-BHwNOBly.js +91 -0
  234. package/dist/menu-button-C7Wtq_Ny.js +488 -0
  235. package/dist/{menu-separator-Z6pSHpX5.js → menu-separator-1CpNYvfe.js} +3 -3
  236. package/dist/{picker-DyJogHYh.js → picker-BHIm3Cmb.js} +31 -32
  237. package/dist/{popover-provider-BJEfhgr1.js → popover-provider-DsS2XUBC.js} +2 -2
  238. package/dist/{presets-BDIhXP0C.js → presets-DevAa76r.js} +9 -10
  239. package/dist/primitives/colourway/index.js +8 -9
  240. package/dist/primitives/context-menu/index.d.ts +7 -0
  241. package/dist/primitives/context-menu/index.js +37 -0
  242. package/dist/primitives/icon-label/index.js +18 -19
  243. package/dist/primitives/index.d.ts +1 -0
  244. package/dist/primitives/index.js +34 -32
  245. package/dist/primitives/link/index.js +5 -6
  246. package/dist/primitives/nav-link/index.js +6 -7
  247. package/dist/primitives/popover/index.js +1 -1
  248. package/dist/primitives/popover/root.js +1 -1
  249. package/dist/primitives/popover/target.js +1 -1
  250. package/dist/primitives/popover/window.js +9 -9
  251. package/dist/primitives/resizable/index.d.ts +9 -2
  252. package/dist/primitives/resizable/index.js +120 -62
  253. package/dist/primitives/scroll-area/index.js +1 -1
  254. package/dist/primitives/tooltip/index.js +9 -10
  255. package/dist/primitives/truncate/index.d.ts +3 -2
  256. package/dist/primitives/truncate/index.js +30 -24
  257. package/dist/primitives/typography/heading.js +1 -1
  258. package/dist/primitives/typography/paragraph.js +1 -1
  259. package/dist/primitives/visually-hidden/index.js +6 -7
  260. package/dist/{style-CWAa57kN.js → style-DH642ww9.js} +1 -1
  261. package/dist/style-nHUEFY3u.js +4229 -0
  262. package/dist/{tab-DejwS4C8.js → tab-Cz1Iy2-6.js} +7 -7
  263. package/dist/{tab-list-CndMWcVv.js → tab-list-C-qZAxsl.js} +9 -9
  264. package/dist/{tab-panel-DedzuWUA.js → tab-panel-BaWZ3QU6.js} +11 -11
  265. package/dist/tab-provider-BqxRaJtd.js +170 -0
  266. package/dist/{tag-remove-Dz-sGbyZ.js → tag-remove-BgRiBB8K.js} +59 -59
  267. package/dist/{toolbar-PSaF1mdF.js → toolbar-BlMTPulL.js} +23 -23
  268. package/dist/{toolbar-CCiZ_PIy.js → toolbar-jAQLS8tL.js} +1 -1
  269. package/dist/toolbar-separator-ehmZmA72.js +16 -0
  270. package/dist/{tooltip-arrow-BVwULA6B.js → tooltip-arrow-gMwnY9fV.js} +47 -47
  271. package/dist/utils/array.d.ts +1 -0
  272. package/dist/utils/array.js +8 -7
  273. package/dist/utils/index.d.ts +1 -0
  274. package/dist/utils/index.js +29 -21
  275. package/dist/utils/math.d.ts +5 -0
  276. package/dist/utils/math.js +11 -0
  277. package/dist/utils/string.d.ts +1 -0
  278. package/dist/utils/string.js +13 -6
  279. package/package.json +2 -1
  280. package/dist/CaretRight.es-vnr78BGI.js +0 -32
  281. package/dist/Circle.es-B6Ug9Tpf.js +0 -30
  282. package/dist/DG5U6ZEL-DB0iwihy.js +0 -17
  283. package/dist/DotsThreeVertical.es-uadrGk3y.js +0 -36
  284. package/dist/F5MUBM3I-75qY3y0N.js +0 -54
  285. package/dist/IWEFDH56-BACkQ6dc.js +0 -19
  286. package/dist/IconBase.es-rM5tt24D.js +0 -48
  287. package/dist/JMHAJKUZ-D5KCN1Aj.js +0 -114
  288. package/dist/MAXQOH4L-BYWBWXpb.js +0 -459
  289. package/dist/MagnifyingGlass.es-CLstwG_v.js +0 -32
  290. package/dist/Plus.es-DJ5SuqNv.js +0 -38
  291. package/dist/RZ4GPYOB-CovncfhJ.js +0 -37
  292. package/dist/RadioButton.es-D3QVjfF9.js +0 -36
  293. package/dist/T7VMP3TM-C8D6mVva.js +0 -77
  294. package/dist/X.es-TbGOnXOO.js +0 -38
  295. package/dist/assets/button.css +0 -1
  296. package/dist/assets/index15.css +0 -1
  297. package/dist/assets/index16.css +0 -1
  298. package/dist/assets/index17.css +0 -1
  299. package/dist/assets/index18.css +0 -1
  300. package/dist/assets/index19.css +0 -1
  301. package/dist/assets/index20.css +0 -1
  302. package/dist/assets/index21.css +0 -1
  303. package/dist/assets/prosemirror.css +0 -1
  304. package/dist/assets/root.css +0 -1
  305. package/dist/assets/static.css +0 -1
  306. package/dist/assets/style12.css +0 -1
  307. package/dist/assets/style13.css +0 -1
  308. package/dist/assets/style14.css +0 -1
  309. package/dist/assets/style15.css +0 -1
  310. package/dist/assets/style16.css +0 -1
  311. package/dist/assets/style17.css +0 -1
  312. package/dist/assets/style18.css +0 -1
  313. package/dist/assets/style19.css +0 -1
  314. package/dist/assets/style20.css +0 -1
  315. package/dist/assets/style21.css +0 -1
  316. package/dist/assets/style23.css +0 -1
  317. package/dist/assets/style24.css +0 -1
  318. package/dist/assets/style25.css +0 -1
  319. package/dist/assets/style26.css +0 -1
  320. package/dist/assets/style27.css +0 -1
  321. package/dist/assets/style28.css +0 -1
  322. package/dist/assets/styles2.css +0 -1
  323. package/dist/assets/styles3.css +0 -1
  324. package/dist/assets/styles4.css +0 -1
  325. package/dist/assets/styles5.css +0 -1
  326. package/dist/combobox-group-hNvv1WJm.js +0 -27
  327. package/dist/combobox-popover-BZ_1wNrj.js +0 -95
  328. package/dist/filter-DHK0UoZG.js +0 -134
  329. package/dist/index-BLCPauyN.js +0 -76
  330. package/dist/index-BnbjJBS4.js +0 -252
  331. package/dist/index-CLl-PPjx.js +0 -56
  332. package/dist/item-CCOXuQUx.js +0 -62
  333. package/dist/match-sorter.esm-MNVE8H_6.js +0 -670
  334. package/dist/menu-button-GQO5dB3U.js +0 -416
  335. package/dist/select-popover-CGgkyRb4.js +0 -559
  336. package/dist/select-value-B3DYk9eV.js +0 -15
  337. package/dist/style-D1AX7G7x.js +0 -1735
  338. package/dist/tab-provider-B0BoLfST.js +0 -158
  339. package/dist/toolbar-separator-DJHiHbGj.js +0 -16
  340. /package/dist/assets/{style22.css → empty.css} +0 -0
@@ -1,1735 +0,0 @@
1
- import './assets/style28.css';var ae = [
2
- "MO",
3
- "TU",
4
- "WE",
5
- "TH",
6
- "FR",
7
- "SA",
8
- "SU"
9
- ], O = (
10
- /** @class */
11
- function() {
12
- function t(e, r) {
13
- if (r === 0)
14
- throw new Error("Can't create weekday with n == 0");
15
- this.weekday = e, this.n = r;
16
- }
17
- return t.fromStr = function(e) {
18
- return new t(ae.indexOf(e));
19
- }, t.prototype.nth = function(e) {
20
- return this.n === e ? this : new t(this.weekday, e);
21
- }, t.prototype.equals = function(e) {
22
- return this.weekday === e.weekday && this.n === e.n;
23
- }, t.prototype.toString = function() {
24
- var e = ae[this.weekday];
25
- return this.n && (e = (this.n > 0 ? "+" : "") + String(this.n) + e), e;
26
- }, t.prototype.getJsWeekday = function() {
27
- return this.weekday === 6 ? 0 : this.weekday + 1;
28
- }, t;
29
- }()
30
- ), T = function(t) {
31
- return t != null;
32
- }, _ = function(t) {
33
- return typeof t == "number";
34
- }, pe = function(t) {
35
- return typeof t == "string" && ae.includes(t);
36
- }, Y = Array.isArray, R = function(t, e) {
37
- e === void 0 && (e = t), arguments.length === 1 && (e = t, t = 0);
38
- for (var r = [], n = t; n < e; n++)
39
- r.push(n);
40
- return r;
41
- }, m = function(t, e) {
42
- var r = 0, n = [];
43
- if (Y(t))
44
- for (; r < e; r++)
45
- n[r] = [].concat(t);
46
- else
47
- for (; r < e; r++)
48
- n[r] = t;
49
- return n;
50
- }, ze = function(t) {
51
- return Y(t) ? t : [t];
52
- };
53
- function K(t, e, r) {
54
- r === void 0 && (r = " ");
55
- var n = String(t);
56
- return e = e >> 0, n.length > e ? String(n) : (e = e - n.length, e > r.length && (r += m(r, e / r.length)), r.slice(0, e) + String(n));
57
- }
58
- var Ke = function(t, e, r) {
59
- var n = t.split(e);
60
- return r ? n.slice(0, r).concat([n.slice(r).join(e)]) : n;
61
- }, U = function(t, e) {
62
- var r = t % e;
63
- return r * e < 0 ? r + e : r;
64
- }, re = function(t, e) {
65
- return { div: Math.floor(t / e), mod: U(t, e) };
66
- }, N = function(t) {
67
- return !T(t) || t.length === 0;
68
- }, x = function(t) {
69
- return !N(t);
70
- }, g = function(t, e) {
71
- return x(t) && t.indexOf(e) !== -1;
72
- }, P = function(t, e, r, n, a, i) {
73
- return n === void 0 && (n = 0), a === void 0 && (a = 0), i === void 0 && (i = 0), new Date(Date.UTC(t, e - 1, r, n, a, i));
74
- }, qe = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ae = 1e3 * 60 * 60 * 24, _e = 9999, Ne = P(1970, 1, 1), Fe = [6, 0, 1, 2, 3, 4, 5], X = function(t) {
75
- return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0;
76
- }, Re = function(t) {
77
- return t instanceof Date;
78
- }, G = function(t) {
79
- return Re(t) && !isNaN(t.getTime());
80
- }, Ze = function(t, e) {
81
- var r = t.getTime(), n = e.getTime(), a = r - n;
82
- return Math.round(a / Ae);
83
- }, ie = function(t) {
84
- return Ze(t, Ne);
85
- }, Ie = function(t) {
86
- return new Date(Ne.getTime() + t * Ae);
87
- }, Be = function(t) {
88
- var e = t.getUTCMonth();
89
- return e === 1 && X(t.getUTCFullYear()) ? 29 : qe[e];
90
- }, F = function(t) {
91
- return Fe[t.getUTCDay()];
92
- }, ve = function(t, e) {
93
- var r = P(t, e + 1, 1);
94
- return [F(r), Be(r)];
95
- }, Ce = function(t, e) {
96
- return e = e || t, new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
97
- }, oe = function(t) {
98
- var e = new Date(t.getTime());
99
- return e;
100
- }, be = function(t) {
101
- for (var e = [], r = 0; r < t.length; r++)
102
- e.push(oe(t[r]));
103
- return e;
104
- }, $ = function(t) {
105
- t.sort(function(e, r) {
106
- return e.getTime() - r.getTime();
107
- });
108
- }, fe = function(t, e) {
109
- e === void 0 && (e = !0);
110
- var r = new Date(t);
111
- return [
112
- K(r.getUTCFullYear().toString(), 4, "0"),
113
- K(r.getUTCMonth() + 1, 2, "0"),
114
- K(r.getUTCDate(), 2, "0"),
115
- "T",
116
- K(r.getUTCHours(), 2, "0"),
117
- K(r.getUTCMinutes(), 2, "0"),
118
- K(r.getUTCSeconds(), 2, "0"),
119
- e ? "Z" : ""
120
- ].join("");
121
- }, le = function(t) {
122
- var e = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/, r = e.exec(t);
123
- if (!r)
124
- throw new Error("Invalid UNTIL value: ".concat(t));
125
- return new Date(Date.UTC(parseInt(r[1], 10), parseInt(r[2], 10) - 1, parseInt(r[3], 10), parseInt(r[5], 10) || 0, parseInt(r[6], 10) || 0, parseInt(r[7], 10) || 0));
126
- }, me = function(t, e) {
127
- var r = t.toLocaleString("sv-SE", { timeZone: e });
128
- return r.replace(" ", "T") + "Z";
129
- }, Ge = function(t, e) {
130
- var r = Intl.DateTimeFormat().resolvedOptions().timeZone, n = new Date(me(t, r)), a = new Date(me(t, e ?? "UTC")), i = a.getTime() - n.getTime();
131
- return new Date(t.getTime() - i);
132
- }, q = (
133
- /** @class */
134
- function() {
135
- function t(e, r) {
136
- this.minDate = null, this.maxDate = null, this._result = [], this.total = 0, this.method = e, this.args = r, e === "between" ? (this.maxDate = r.inc ? r.before : new Date(r.before.getTime() - 1), this.minDate = r.inc ? r.after : new Date(r.after.getTime() + 1)) : e === "before" ? this.maxDate = r.inc ? r.dt : new Date(r.dt.getTime() - 1) : e === "after" && (this.minDate = r.inc ? r.dt : new Date(r.dt.getTime() + 1));
137
- }
138
- return t.prototype.accept = function(e) {
139
- ++this.total;
140
- var r = this.minDate && e < this.minDate, n = this.maxDate && e > this.maxDate;
141
- if (this.method === "between") {
142
- if (r)
143
- return !0;
144
- if (n)
145
- return !1;
146
- } else if (this.method === "before") {
147
- if (n)
148
- return !1;
149
- } else if (this.method === "after")
150
- return r ? !0 : (this.add(e), !1);
151
- return this.add(e);
152
- }, t.prototype.add = function(e) {
153
- return this._result.push(e), !0;
154
- }, t.prototype.getValue = function() {
155
- var e = this._result;
156
- switch (this.method) {
157
- case "all":
158
- case "between":
159
- return e;
160
- case "before":
161
- case "after":
162
- default:
163
- return e.length ? e[e.length - 1] : null;
164
- }
165
- }, t.prototype.clone = function() {
166
- return new t(this.method, this.args);
167
- }, t;
168
- }()
169
- ), se = function(t, e) {
170
- return se = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
171
- r.__proto__ = n;
172
- } || function(r, n) {
173
- for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (r[a] = n[a]);
174
- }, se(t, e);
175
- };
176
- function ce(t, e) {
177
- if (typeof e != "function" && e !== null)
178
- throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
179
- se(t, e);
180
- function r() {
181
- this.constructor = t;
182
- }
183
- t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
184
- }
185
- var M = function() {
186
- return M = Object.assign || function(e) {
187
- for (var r, n = 1, a = arguments.length; n < a; n++) {
188
- r = arguments[n];
189
- for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
190
- }
191
- return e;
192
- }, M.apply(this, arguments);
193
- };
194
- function h(t, e, r) {
195
- if (r || arguments.length === 2) for (var n = 0, a = e.length, i; n < a; n++)
196
- (i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
197
- return t.concat(i || Array.prototype.slice.call(e));
198
- }
199
- var we = (
200
- /** @class */
201
- function(t) {
202
- ce(e, t);
203
- function e(r, n, a) {
204
- var i = t.call(this, r, n) || this;
205
- return i.iterator = a, i;
206
- }
207
- return e.prototype.add = function(r) {
208
- return this.iterator(r, this._result.length) ? (this._result.push(r), !0) : !1;
209
- }, e;
210
- }(q)
211
- ), J = {
212
- dayNames: [
213
- "Sunday",
214
- "Monday",
215
- "Tuesday",
216
- "Wednesday",
217
- "Thursday",
218
- "Friday",
219
- "Saturday"
220
- ],
221
- monthNames: [
222
- "January",
223
- "February",
224
- "March",
225
- "April",
226
- "May",
227
- "June",
228
- "July",
229
- "August",
230
- "September",
231
- "October",
232
- "November",
233
- "December"
234
- ],
235
- tokens: {
236
- SKIP: /^[ \r\n\t]+|^\.$/,
237
- number: /^[1-9][0-9]*/,
238
- numberAsText: /^(one|two|three)/i,
239
- every: /^every/i,
240
- "day(s)": /^days?/i,
241
- "weekday(s)": /^weekdays?/i,
242
- "week(s)": /^weeks?/i,
243
- "hour(s)": /^hours?/i,
244
- "minute(s)": /^minutes?/i,
245
- "month(s)": /^months?/i,
246
- "year(s)": /^years?/i,
247
- on: /^(on|in)/i,
248
- at: /^(at)/i,
249
- the: /^the/i,
250
- first: /^first/i,
251
- second: /^second/i,
252
- third: /^third/i,
253
- nth: /^([1-9][0-9]*)(\.|th|nd|rd|st)/i,
254
- last: /^last/i,
255
- for: /^for/i,
256
- "time(s)": /^times?/i,
257
- until: /^(un)?til/i,
258
- monday: /^mo(n(day)?)?/i,
259
- tuesday: /^tu(e(s(day)?)?)?/i,
260
- wednesday: /^we(d(n(esday)?)?)?/i,
261
- thursday: /^th(u(r(sday)?)?)?/i,
262
- friday: /^fr(i(day)?)?/i,
263
- saturday: /^sa(t(urday)?)?/i,
264
- sunday: /^su(n(day)?)?/i,
265
- january: /^jan(uary)?/i,
266
- february: /^feb(ruary)?/i,
267
- march: /^mar(ch)?/i,
268
- april: /^apr(il)?/i,
269
- may: /^may/i,
270
- june: /^june?/i,
271
- july: /^july?/i,
272
- august: /^aug(ust)?/i,
273
- september: /^sep(t(ember)?)?/i,
274
- october: /^oct(ober)?/i,
275
- november: /^nov(ember)?/i,
276
- december: /^dec(ember)?/i,
277
- comma: /^(,\s*|(and|or)\s*)+/i
278
- }
279
- }, ke = function(t, e) {
280
- return t.indexOf(e) !== -1;
281
- }, Xe = function(t) {
282
- return t.toString();
283
- }, $e = function(t, e, r) {
284
- return "".concat(e, " ").concat(r, ", ").concat(t);
285
- }, C = (
286
- /** @class */
287
- function() {
288
- function t(e, r, n, a) {
289
- if (r === void 0 && (r = Xe), n === void 0 && (n = J), a === void 0 && (a = $e), this.text = [], this.language = n || J, this.gettext = r, this.dateFormatter = a, this.rrule = e, this.options = e.options, this.origOptions = e.origOptions, this.origOptions.bymonthday) {
290
- var i = [].concat(this.options.bymonthday), u = [].concat(this.options.bynmonthday);
291
- i.sort(function(c, y) {
292
- return c - y;
293
- }), u.sort(function(c, y) {
294
- return y - c;
295
- }), this.bymonthday = i.concat(u), this.bymonthday.length || (this.bymonthday = null);
296
- }
297
- if (T(this.origOptions.byweekday)) {
298
- var o = Y(this.origOptions.byweekday) ? this.origOptions.byweekday : [this.origOptions.byweekday], s = String(o);
299
- this.byweekday = {
300
- allWeeks: o.filter(function(c) {
301
- return !c.n;
302
- }),
303
- someWeeks: o.filter(function(c) {
304
- return !!c.n;
305
- }),
306
- isWeekdays: s.indexOf("MO") !== -1 && s.indexOf("TU") !== -1 && s.indexOf("WE") !== -1 && s.indexOf("TH") !== -1 && s.indexOf("FR") !== -1 && s.indexOf("SA") === -1 && s.indexOf("SU") === -1,
307
- isEveryDay: s.indexOf("MO") !== -1 && s.indexOf("TU") !== -1 && s.indexOf("WE") !== -1 && s.indexOf("TH") !== -1 && s.indexOf("FR") !== -1 && s.indexOf("SA") !== -1 && s.indexOf("SU") !== -1
308
- };
309
- var l = function(c, y) {
310
- return c.weekday - y.weekday;
311
- };
312
- this.byweekday.allWeeks.sort(l), this.byweekday.someWeeks.sort(l), this.byweekday.allWeeks.length || (this.byweekday.allWeeks = null), this.byweekday.someWeeks.length || (this.byweekday.someWeeks = null);
313
- } else
314
- this.byweekday = null;
315
- }
316
- return t.isFullyConvertible = function(e) {
317
- var r = !0;
318
- if (!(e.options.freq in t.IMPLEMENTED) || e.origOptions.until && e.origOptions.count)
319
- return !1;
320
- for (var n in e.origOptions) {
321
- if (ke(["dtstart", "tzid", "wkst", "freq"], n))
322
- return !0;
323
- if (!ke(t.IMPLEMENTED[e.options.freq], n))
324
- return !1;
325
- }
326
- return r;
327
- }, t.prototype.isFullyConvertible = function() {
328
- return t.isFullyConvertible(this.rrule);
329
- }, t.prototype.toString = function() {
330
- var e = this.gettext;
331
- if (!(this.options.freq in t.IMPLEMENTED))
332
- return e("RRule error: Unable to fully convert this rrule to text");
333
- if (this.text = [e("every")], this[p.FREQUENCIES[this.options.freq]](), this.options.until) {
334
- this.add(e("until"));
335
- var r = this.options.until;
336
- this.add(this.dateFormatter(r.getUTCFullYear(), this.language.monthNames[r.getUTCMonth()], r.getUTCDate()));
337
- } else this.options.count && this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count) ? e("times") : e("time"));
338
- return this.isFullyConvertible() || this.add(e("(~ approximate)")), this.text.join("");
339
- }, t.prototype.HOURLY = function() {
340
- var e = this.gettext;
341
- this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("hours") : e("hour"));
342
- }, t.prototype.MINUTELY = function() {
343
- var e = this.gettext;
344
- this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("minutes") : e("minute"));
345
- }, t.prototype.DAILY = function() {
346
- var e = this.gettext;
347
- this.options.interval !== 1 && this.add(this.options.interval.toString()), this.byweekday && this.byweekday.isWeekdays ? this.add(this.plural(this.options.interval) ? e("weekdays") : e("weekday")) : this.add(this.plural(this.options.interval) ? e("days") : e("day")), this.origOptions.bymonth && (this.add(e("in")), this._bymonth()), this.bymonthday ? this._bymonthday() : this.byweekday ? this._byweekday() : this.origOptions.byhour && this._byhour();
348
- }, t.prototype.WEEKLY = function() {
349
- var e = this.gettext;
350
- this.options.interval !== 1 && this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? e("weeks") : e("week")), this.byweekday && this.byweekday.isWeekdays ? this.options.interval === 1 ? this.add(this.plural(this.options.interval) ? e("weekdays") : e("weekday")) : this.add(e("on")).add(e("weekdays")) : this.byweekday && this.byweekday.isEveryDay ? this.add(this.plural(this.options.interval) ? e("days") : e("day")) : (this.options.interval === 1 && this.add(e("week")), this.origOptions.bymonth && (this.add(e("in")), this._bymonth()), this.bymonthday ? this._bymonthday() : this.byweekday && this._byweekday(), this.origOptions.byhour && this._byhour());
351
- }, t.prototype.MONTHLY = function() {
352
- var e = this.gettext;
353
- this.origOptions.bymonth ? (this.options.interval !== 1 && (this.add(this.options.interval.toString()).add(e("months")), this.plural(this.options.interval) && this.add(e("in"))), this._bymonth()) : (this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("months") : e("month"))), this.bymonthday ? this._bymonthday() : this.byweekday && this.byweekday.isWeekdays ? this.add(e("on")).add(e("weekdays")) : this.byweekday && this._byweekday();
354
- }, t.prototype.YEARLY = function() {
355
- var e = this.gettext;
356
- this.origOptions.bymonth ? (this.options.interval !== 1 && (this.add(this.options.interval.toString()), this.add(e("years"))), this._bymonth()) : (this.options.interval !== 1 && this.add(this.options.interval.toString()), this.add(this.plural(this.options.interval) ? e("years") : e("year"))), this.bymonthday ? this._bymonthday() : this.byweekday && this._byweekday(), this.options.byyearday && this.add(e("on the")).add(this.list(this.options.byyearday, this.nth, e("and"))).add(e("day")), this.options.byweekno && this.add(e("in")).add(this.plural(this.options.byweekno.length) ? e("weeks") : e("week")).add(this.list(this.options.byweekno, void 0, e("and")));
357
- }, t.prototype._bymonthday = function() {
358
- var e = this.gettext;
359
- this.byweekday && this.byweekday.allWeeks ? this.add(e("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext, e("or"))).add(e("the")).add(this.list(this.bymonthday, this.nth, e("or"))) : this.add(e("on the")).add(this.list(this.bymonthday, this.nth, e("and")));
360
- }, t.prototype._byweekday = function() {
361
- var e = this.gettext;
362
- this.byweekday.allWeeks && !this.byweekday.isWeekdays && this.add(e("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext)), this.byweekday.someWeeks && (this.byweekday.allWeeks && this.add(e("and")), this.add(e("on the")).add(this.list(this.byweekday.someWeeks, this.weekdaytext, e("and"))));
363
- }, t.prototype._byhour = function() {
364
- var e = this.gettext;
365
- this.add(e("at")).add(this.list(this.origOptions.byhour, void 0, e("and")));
366
- }, t.prototype._bymonth = function() {
367
- this.add(this.list(this.options.bymonth, this.monthtext, this.gettext("and")));
368
- }, t.prototype.nth = function(e) {
369
- e = parseInt(e.toString(), 10);
370
- var r, n = this.gettext;
371
- if (e === -1)
372
- return n("last");
373
- var a = Math.abs(e);
374
- switch (a) {
375
- case 1:
376
- case 21:
377
- case 31:
378
- r = a + n("st");
379
- break;
380
- case 2:
381
- case 22:
382
- r = a + n("nd");
383
- break;
384
- case 3:
385
- case 23:
386
- r = a + n("rd");
387
- break;
388
- default:
389
- r = a + n("th");
390
- }
391
- return e < 0 ? r + " " + n("last") : r;
392
- }, t.prototype.monthtext = function(e) {
393
- return this.language.monthNames[e - 1];
394
- }, t.prototype.weekdaytext = function(e) {
395
- var r = _(e) ? (e + 1) % 7 : e.getJsWeekday();
396
- return (e.n ? this.nth(e.n) + " " : "") + this.language.dayNames[r];
397
- }, t.prototype.plural = function(e) {
398
- return e % 100 !== 1;
399
- }, t.prototype.add = function(e) {
400
- return this.text.push(" "), this.text.push(e), this;
401
- }, t.prototype.list = function(e, r, n, a) {
402
- var i = this;
403
- a === void 0 && (a = ","), Y(e) || (e = [e]);
404
- var u = function(s, l, c) {
405
- for (var y = "", f = 0; f < s.length; f++)
406
- f !== 0 && (f === s.length - 1 ? y += " " + c + " " : y += l + " "), y += s[f];
407
- return y;
408
- };
409
- r = r || function(s) {
410
- return s.toString();
411
- };
412
- var o = function(s) {
413
- return r && r.call(i, s);
414
- };
415
- return n ? u(e.map(o), a, n) : e.map(o).join(a + " ");
416
- }, t;
417
- }()
418
- ), Je = (
419
- /** @class */
420
- function() {
421
- function t(e) {
422
- this.done = !0, this.rules = e;
423
- }
424
- return t.prototype.start = function(e) {
425
- return this.text = e, this.done = !1, this.nextSymbol();
426
- }, t.prototype.isDone = function() {
427
- return this.done && this.symbol === null;
428
- }, t.prototype.nextSymbol = function() {
429
- var e, r;
430
- this.symbol = null, this.value = null;
431
- do {
432
- if (this.done)
433
- return !1;
434
- var n = void 0;
435
- e = null;
436
- for (var a in this.rules) {
437
- n = this.rules[a];
438
- var i = n.exec(this.text);
439
- i && (e === null || i[0].length > e[0].length) && (e = i, r = a);
440
- }
441
- if (e != null && (this.text = this.text.substr(e[0].length), this.text === "" && (this.done = !0)), e == null) {
442
- this.done = !0, this.symbol = null, this.value = null;
443
- return;
444
- }
445
- } while (r === "SKIP");
446
- return this.symbol = r, this.value = e, !0;
447
- }, t.prototype.accept = function(e) {
448
- if (this.symbol === e) {
449
- if (this.value) {
450
- var r = this.value;
451
- return this.nextSymbol(), r;
452
- }
453
- return this.nextSymbol(), !0;
454
- }
455
- return !1;
456
- }, t.prototype.acceptNumber = function() {
457
- return this.accept("number");
458
- }, t.prototype.expect = function(e) {
459
- if (this.accept(e))
460
- return !0;
461
- throw new Error("expected " + e + " but found " + this.symbol);
462
- }, t;
463
- }()
464
- );
465
- function We(t, e) {
466
- e === void 0 && (e = J);
467
- var r = {}, n = new Je(e.tokens);
468
- if (!n.start(t))
469
- return null;
470
- return a(), r;
471
- function a() {
472
- n.expect("every");
473
- var f = n.acceptNumber();
474
- if (f && (r.interval = parseInt(f[0], 10)), n.isDone())
475
- throw new Error("Unexpected end");
476
- switch (n.symbol) {
477
- case "day(s)":
478
- r.freq = p.DAILY, n.nextSymbol() && (u(), y());
479
- break;
480
- // FIXME Note: every 2 weekdays != every two weeks on weekdays.
481
- // DAILY on weekdays is not a valid rule
482
- case "weekday(s)":
483
- r.freq = p.WEEKLY, r.byweekday = [p.MO, p.TU, p.WE, p.TH, p.FR], n.nextSymbol(), u(), y();
484
- break;
485
- case "week(s)":
486
- r.freq = p.WEEKLY, n.nextSymbol() && (i(), u(), y());
487
- break;
488
- case "hour(s)":
489
- r.freq = p.HOURLY, n.nextSymbol() && (i(), y());
490
- break;
491
- case "minute(s)":
492
- r.freq = p.MINUTELY, n.nextSymbol() && (i(), y());
493
- break;
494
- case "month(s)":
495
- r.freq = p.MONTHLY, n.nextSymbol() && (i(), y());
496
- break;
497
- case "year(s)":
498
- r.freq = p.YEARLY, n.nextSymbol() && (i(), y());
499
- break;
500
- case "monday":
501
- case "tuesday":
502
- case "wednesday":
503
- case "thursday":
504
- case "friday":
505
- case "saturday":
506
- case "sunday":
507
- r.freq = p.WEEKLY;
508
- var d = n.symbol.substr(0, 2).toUpperCase();
509
- if (r.byweekday = [p[d]], !n.nextSymbol())
510
- return;
511
- for (; n.accept("comma"); ) {
512
- if (n.isDone())
513
- throw new Error("Unexpected end");
514
- var v = s();
515
- if (!v)
516
- throw new Error("Unexpected symbol " + n.symbol + ", expected weekday");
517
- r.byweekday.push(p[v]), n.nextSymbol();
518
- }
519
- u(), c(), y();
520
- break;
521
- case "january":
522
- case "february":
523
- case "march":
524
- case "april":
525
- case "may":
526
- case "june":
527
- case "july":
528
- case "august":
529
- case "september":
530
- case "october":
531
- case "november":
532
- case "december":
533
- if (r.freq = p.YEARLY, r.bymonth = [o()], !n.nextSymbol())
534
- return;
535
- for (; n.accept("comma"); ) {
536
- if (n.isDone())
537
- throw new Error("Unexpected end");
538
- var k = o();
539
- if (!k)
540
- throw new Error("Unexpected symbol " + n.symbol + ", expected month");
541
- r.bymonth.push(k), n.nextSymbol();
542
- }
543
- i(), y();
544
- break;
545
- default:
546
- throw new Error("Unknown symbol");
547
- }
548
- }
549
- function i() {
550
- var f = n.accept("on"), d = n.accept("the");
551
- if (f || d)
552
- do {
553
- var v = l(), k = s(), b = o();
554
- if (v)
555
- k ? (n.nextSymbol(), r.byweekday || (r.byweekday = []), r.byweekday.push(p[k].nth(v))) : (r.bymonthday || (r.bymonthday = []), r.bymonthday.push(v), n.accept("day(s)"));
556
- else if (k)
557
- n.nextSymbol(), r.byweekday || (r.byweekday = []), r.byweekday.push(p[k]);
558
- else if (n.symbol === "weekday(s)")
559
- n.nextSymbol(), r.byweekday || (r.byweekday = [p.MO, p.TU, p.WE, p.TH, p.FR]);
560
- else if (n.symbol === "week(s)") {
561
- n.nextSymbol();
562
- var E = n.acceptNumber();
563
- if (!E)
564
- throw new Error("Unexpected symbol " + n.symbol + ", expected week number");
565
- for (r.byweekno = [parseInt(E[0], 10)]; n.accept("comma"); ) {
566
- if (E = n.acceptNumber(), !E)
567
- throw new Error("Unexpected symbol " + n.symbol + "; expected monthday");
568
- r.byweekno.push(parseInt(E[0], 10));
569
- }
570
- } else if (b)
571
- n.nextSymbol(), r.bymonth || (r.bymonth = []), r.bymonth.push(b);
572
- else
573
- return;
574
- } while (n.accept("comma") || n.accept("the") || n.accept("on"));
575
- }
576
- function u() {
577
- var f = n.accept("at");
578
- if (f)
579
- do {
580
- var d = n.acceptNumber();
581
- if (!d)
582
- throw new Error("Unexpected symbol " + n.symbol + ", expected hour");
583
- for (r.byhour = [parseInt(d[0], 10)]; n.accept("comma"); ) {
584
- if (d = n.acceptNumber(), !d)
585
- throw new Error("Unexpected symbol " + n.symbol + "; expected hour");
586
- r.byhour.push(parseInt(d[0], 10));
587
- }
588
- } while (n.accept("comma") || n.accept("at"));
589
- }
590
- function o() {
591
- switch (n.symbol) {
592
- case "january":
593
- return 1;
594
- case "february":
595
- return 2;
596
- case "march":
597
- return 3;
598
- case "april":
599
- return 4;
600
- case "may":
601
- return 5;
602
- case "june":
603
- return 6;
604
- case "july":
605
- return 7;
606
- case "august":
607
- return 8;
608
- case "september":
609
- return 9;
610
- case "october":
611
- return 10;
612
- case "november":
613
- return 11;
614
- case "december":
615
- return 12;
616
- default:
617
- return !1;
618
- }
619
- }
620
- function s() {
621
- switch (n.symbol) {
622
- case "monday":
623
- case "tuesday":
624
- case "wednesday":
625
- case "thursday":
626
- case "friday":
627
- case "saturday":
628
- case "sunday":
629
- return n.symbol.substr(0, 2).toUpperCase();
630
- default:
631
- return !1;
632
- }
633
- }
634
- function l() {
635
- switch (n.symbol) {
636
- case "last":
637
- return n.nextSymbol(), -1;
638
- case "first":
639
- return n.nextSymbol(), 1;
640
- case "second":
641
- return n.nextSymbol(), n.accept("last") ? -2 : 2;
642
- case "third":
643
- return n.nextSymbol(), n.accept("last") ? -3 : 3;
644
- case "nth":
645
- var f = parseInt(n.value[1], 10);
646
- if (f < -366 || f > 366)
647
- throw new Error("Nth out of range: " + f);
648
- return n.nextSymbol(), n.accept("last") ? -f : f;
649
- default:
650
- return !1;
651
- }
652
- }
653
- function c() {
654
- n.accept("on"), n.accept("the");
655
- var f = l();
656
- if (f)
657
- for (r.bymonthday = [f], n.nextSymbol(); n.accept("comma"); ) {
658
- if (f = l(), !f)
659
- throw new Error("Unexpected symbol " + n.symbol + "; expected monthday");
660
- r.bymonthday.push(f), n.nextSymbol();
661
- }
662
- }
663
- function y() {
664
- if (n.symbol === "until") {
665
- var f = Date.parse(n.text);
666
- if (!f)
667
- throw new Error("Cannot parse until date:" + n.text);
668
- r.until = new Date(f);
669
- } else n.accept("for") && (r.count = parseInt(n.value[0], 10), n.expect("number"));
670
- }
671
- }
672
- var w;
673
- (function(t) {
674
- t[t.YEARLY = 0] = "YEARLY", t[t.MONTHLY = 1] = "MONTHLY", t[t.WEEKLY = 2] = "WEEKLY", t[t.DAILY = 3] = "DAILY", t[t.HOURLY = 4] = "HOURLY", t[t.MINUTELY = 5] = "MINUTELY", t[t.SECONDLY = 6] = "SECONDLY";
675
- })(w || (w = {}));
676
- function de(t) {
677
- return t < w.HOURLY;
678
- }
679
- var Qe = function(t, e) {
680
- return e === void 0 && (e = J), new p(We(t, e) || void 0);
681
- }, Z = [
682
- "count",
683
- "until",
684
- "interval",
685
- "byweekday",
686
- "bymonthday",
687
- "bymonth"
688
- ];
689
- C.IMPLEMENTED = [];
690
- C.IMPLEMENTED[w.HOURLY] = Z;
691
- C.IMPLEMENTED[w.MINUTELY] = Z;
692
- C.IMPLEMENTED[w.DAILY] = ["byhour"].concat(Z);
693
- C.IMPLEMENTED[w.WEEKLY] = Z;
694
- C.IMPLEMENTED[w.MONTHLY] = Z;
695
- C.IMPLEMENTED[w.YEARLY] = ["byweekno", "byyearday"].concat(Z);
696
- var Ve = function(t, e, r, n) {
697
- return new C(t, e, r, n).toString();
698
- }, et = C.isFullyConvertible, Q = (
699
- /** @class */
700
- function() {
701
- function t(e, r, n, a) {
702
- this.hour = e, this.minute = r, this.second = n, this.millisecond = a || 0;
703
- }
704
- return t.prototype.getHours = function() {
705
- return this.hour;
706
- }, t.prototype.getMinutes = function() {
707
- return this.minute;
708
- }, t.prototype.getSeconds = function() {
709
- return this.second;
710
- }, t.prototype.getMilliseconds = function() {
711
- return this.millisecond;
712
- }, t.prototype.getTime = function() {
713
- return (this.hour * 60 * 60 + this.minute * 60 + this.second) * 1e3 + this.millisecond;
714
- }, t;
715
- }()
716
- ), tt = (
717
- /** @class */
718
- function(t) {
719
- ce(e, t);
720
- function e(r, n, a, i, u, o, s) {
721
- var l = t.call(this, i, u, o, s) || this;
722
- return l.year = r, l.month = n, l.day = a, l;
723
- }
724
- return e.fromDate = function(r) {
725
- return new this(r.getUTCFullYear(), r.getUTCMonth() + 1, r.getUTCDate(), r.getUTCHours(), r.getUTCMinutes(), r.getUTCSeconds(), r.valueOf() % 1e3);
726
- }, e.prototype.getWeekday = function() {
727
- return F(new Date(this.getTime()));
728
- }, e.prototype.getTime = function() {
729
- return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();
730
- }, e.prototype.getDay = function() {
731
- return this.day;
732
- }, e.prototype.getMonth = function() {
733
- return this.month;
734
- }, e.prototype.getYear = function() {
735
- return this.year;
736
- }, e.prototype.addYears = function(r) {
737
- this.year += r;
738
- }, e.prototype.addMonths = function(r) {
739
- if (this.month += r, this.month > 12) {
740
- var n = Math.floor(this.month / 12), a = U(this.month, 12);
741
- this.month = a, this.year += n, this.month === 0 && (this.month = 12, --this.year);
742
- }
743
- }, e.prototype.addWeekly = function(r, n) {
744
- n > this.getWeekday() ? this.day += -(this.getWeekday() + 1 + (6 - n)) + r * 7 : this.day += -(this.getWeekday() - n) + r * 7, this.fixDay();
745
- }, e.prototype.addDaily = function(r) {
746
- this.day += r, this.fixDay();
747
- }, e.prototype.addHours = function(r, n, a) {
748
- for (n && (this.hour += Math.floor((23 - this.hour) / r) * r); ; ) {
749
- this.hour += r;
750
- var i = re(this.hour, 24), u = i.div, o = i.mod;
751
- if (u && (this.hour = o, this.addDaily(u)), N(a) || g(a, this.hour))
752
- break;
753
- }
754
- }, e.prototype.addMinutes = function(r, n, a, i) {
755
- for (n && (this.minute += Math.floor((1439 - (this.hour * 60 + this.minute)) / r) * r); ; ) {
756
- this.minute += r;
757
- var u = re(this.minute, 60), o = u.div, s = u.mod;
758
- if (o && (this.minute = s, this.addHours(o, !1, a)), (N(a) || g(a, this.hour)) && (N(i) || g(i, this.minute)))
759
- break;
760
- }
761
- }, e.prototype.addSeconds = function(r, n, a, i, u) {
762
- for (n && (this.second += Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / r) * r); ; ) {
763
- this.second += r;
764
- var o = re(this.second, 60), s = o.div, l = o.mod;
765
- if (s && (this.second = l, this.addMinutes(s, !1, a, i)), (N(a) || g(a, this.hour)) && (N(i) || g(i, this.minute)) && (N(u) || g(u, this.second)))
766
- break;
767
- }
768
- }, e.prototype.fixDay = function() {
769
- if (!(this.day <= 28)) {
770
- var r = ve(this.year, this.month - 1)[1];
771
- if (!(this.day <= r))
772
- for (; this.day > r; ) {
773
- if (this.day -= r, ++this.month, this.month === 13 && (this.month = 1, ++this.year, this.year > _e))
774
- return;
775
- r = ve(this.year, this.month - 1)[1];
776
- }
777
- }
778
- }, e.prototype.add = function(r, n) {
779
- var a = r.freq, i = r.interval, u = r.wkst, o = r.byhour, s = r.byminute, l = r.bysecond;
780
- switch (a) {
781
- case w.YEARLY:
782
- return this.addYears(i);
783
- case w.MONTHLY:
784
- return this.addMonths(i);
785
- case w.WEEKLY:
786
- return this.addWeekly(i, u);
787
- case w.DAILY:
788
- return this.addDaily(i);
789
- case w.HOURLY:
790
- return this.addHours(i, n, o);
791
- case w.MINUTELY:
792
- return this.addMinutes(i, n, o, s);
793
- case w.SECONDLY:
794
- return this.addSeconds(i, n, o, s, l);
795
- }
796
- }, e;
797
- }(Q)
798
- );
799
- function He(t) {
800
- for (var e = [], r = Object.keys(t), n = 0, a = r; n < a.length; n++) {
801
- var i = a[n];
802
- g(Lt, i) || e.push(i), Re(t[i]) && !G(t[i]) && e.push(i);
803
- }
804
- if (e.length)
805
- throw new Error("Invalid options: " + e.join(", "));
806
- return M({}, t);
807
- }
808
- function rt(t) {
809
- var e = M(M({}, ye), He(t));
810
- if (T(e.byeaster) && (e.freq = p.YEARLY), !(T(e.freq) && p.FREQUENCIES[e.freq]))
811
- throw new Error("Invalid frequency: ".concat(e.freq, " ").concat(t.freq));
812
- if (e.dtstart || (e.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0))), T(e.wkst) ? _(e.wkst) || (e.wkst = e.wkst.weekday) : e.wkst = p.MO.weekday, T(e.bysetpos)) {
813
- _(e.bysetpos) && (e.bysetpos = [e.bysetpos]);
814
- for (var r = 0; r < e.bysetpos.length; r++) {
815
- var n = e.bysetpos[r];
816
- if (n === 0 || !(n >= -366 && n <= 366))
817
- throw new Error("bysetpos must be between 1 and 366, or between -366 and -1");
818
- }
819
- }
820
- if (!(e.byweekno || x(e.byweekno) || x(e.byyearday) || e.bymonthday || x(e.bymonthday) || T(e.byweekday) || T(e.byeaster)))
821
- switch (e.freq) {
822
- case p.YEARLY:
823
- e.bymonth || (e.bymonth = e.dtstart.getUTCMonth() + 1), e.bymonthday = e.dtstart.getUTCDate();
824
- break;
825
- case p.MONTHLY:
826
- e.bymonthday = e.dtstart.getUTCDate();
827
- break;
828
- case p.WEEKLY:
829
- e.byweekday = [F(e.dtstart)];
830
- break;
831
- }
832
- if (T(e.bymonth) && !Y(e.bymonth) && (e.bymonth = [e.bymonth]), T(e.byyearday) && !Y(e.byyearday) && _(e.byyearday) && (e.byyearday = [e.byyearday]), !T(e.bymonthday))
833
- e.bymonthday = [], e.bynmonthday = [];
834
- else if (Y(e.bymonthday)) {
835
- for (var a = [], i = [], r = 0; r < e.bymonthday.length; r++) {
836
- var n = e.bymonthday[r];
837
- n > 0 ? a.push(n) : n < 0 && i.push(n);
838
- }
839
- e.bymonthday = a, e.bynmonthday = i;
840
- } else e.bymonthday < 0 ? (e.bynmonthday = [e.bymonthday], e.bymonthday = []) : (e.bynmonthday = [], e.bymonthday = [e.bymonthday]);
841
- if (T(e.byweekno) && !Y(e.byweekno) && (e.byweekno = [e.byweekno]), !T(e.byweekday))
842
- e.bynweekday = null;
843
- else if (_(e.byweekday))
844
- e.byweekday = [e.byweekday], e.bynweekday = null;
845
- else if (pe(e.byweekday))
846
- e.byweekday = [O.fromStr(e.byweekday).weekday], e.bynweekday = null;
847
- else if (e.byweekday instanceof O)
848
- !e.byweekday.n || e.freq > p.MONTHLY ? (e.byweekday = [e.byweekday.weekday], e.bynweekday = null) : (e.bynweekday = [[e.byweekday.weekday, e.byweekday.n]], e.byweekday = null);
849
- else {
850
- for (var u = [], o = [], r = 0; r < e.byweekday.length; r++) {
851
- var s = e.byweekday[r];
852
- if (_(s)) {
853
- u.push(s);
854
- continue;
855
- } else if (pe(s)) {
856
- u.push(O.fromStr(s).weekday);
857
- continue;
858
- }
859
- !s.n || e.freq > p.MONTHLY ? u.push(s.weekday) : o.push([s.weekday, s.n]);
860
- }
861
- e.byweekday = x(u) ? u : null, e.bynweekday = x(o) ? o : null;
862
- }
863
- return T(e.byhour) ? _(e.byhour) && (e.byhour = [e.byhour]) : e.byhour = e.freq < p.HOURLY ? [e.dtstart.getUTCHours()] : null, T(e.byminute) ? _(e.byminute) && (e.byminute = [e.byminute]) : e.byminute = e.freq < p.MINUTELY ? [e.dtstart.getUTCMinutes()] : null, T(e.bysecond) ? _(e.bysecond) && (e.bysecond = [e.bysecond]) : e.bysecond = e.freq < p.SECONDLY ? [e.dtstart.getUTCSeconds()] : null, { parsedOptions: e };
864
- }
865
- function nt(t) {
866
- var e = t.dtstart.getTime() % 1e3;
867
- if (!de(t.freq))
868
- return [];
869
- var r = [];
870
- return t.byhour.forEach(function(n) {
871
- t.byminute.forEach(function(a) {
872
- t.bysecond.forEach(function(i) {
873
- r.push(new Q(n, a, i, e));
874
- });
875
- });
876
- }), r;
877
- }
878
- function ue(t) {
879
- var e = t.split(`
880
- `).map(at).filter(function(r) {
881
- return r !== null;
882
- });
883
- return M(M({}, e[0]), e[1]);
884
- }
885
- function V(t) {
886
- var e = {}, r = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);
887
- if (!r)
888
- return e;
889
- var n = r[1], a = r[2];
890
- return n && (e.tzid = n), e.dtstart = le(a), e;
891
- }
892
- function at(t) {
893
- if (t = t.replace(/^\s+|\s+$/, ""), !t.length)
894
- return null;
895
- var e = /^([A-Z]+?)[:;]/.exec(t.toUpperCase());
896
- if (!e)
897
- return ge(t);
898
- var r = e[1];
899
- switch (r.toUpperCase()) {
900
- case "RRULE":
901
- case "EXRULE":
902
- return ge(t);
903
- case "DTSTART":
904
- return V(t);
905
- default:
906
- throw new Error("Unsupported RFC prop ".concat(r, " in ").concat(t));
907
- }
908
- }
909
- function ge(t) {
910
- var e = t.replace(/^RRULE:/i, ""), r = V(e), n = t.replace(/^(?:RRULE|EXRULE):/i, "").split(";");
911
- return n.forEach(function(a) {
912
- var i = a.split("="), u = i[0], o = i[1];
913
- switch (u.toUpperCase()) {
914
- case "FREQ":
915
- r.freq = w[o.toUpperCase()];
916
- break;
917
- case "WKST":
918
- r.wkst = A[o.toUpperCase()];
919
- break;
920
- case "COUNT":
921
- case "INTERVAL":
922
- case "BYSETPOS":
923
- case "BYMONTH":
924
- case "BYMONTHDAY":
925
- case "BYYEARDAY":
926
- case "BYWEEKNO":
927
- case "BYHOUR":
928
- case "BYMINUTE":
929
- case "BYSECOND":
930
- var s = it(o), l = u.toLowerCase();
931
- r[l] = s;
932
- break;
933
- case "BYWEEKDAY":
934
- case "BYDAY":
935
- r.byweekday = ot(o);
936
- break;
937
- case "DTSTART":
938
- case "TZID":
939
- var c = V(t);
940
- r.tzid = c.tzid, r.dtstart = c.dtstart;
941
- break;
942
- case "UNTIL":
943
- r.until = le(o);
944
- break;
945
- case "BYEASTER":
946
- r.byeaster = Number(o);
947
- break;
948
- default:
949
- throw new Error("Unknown RRULE property '" + u + "'");
950
- }
951
- }), r;
952
- }
953
- function it(t) {
954
- if (t.indexOf(",") !== -1) {
955
- var e = t.split(",");
956
- return e.map(Ee);
957
- }
958
- return Ee(t);
959
- }
960
- function Ee(t) {
961
- return /^[+-]?\d+$/.test(t) ? Number(t) : t;
962
- }
963
- function ot(t) {
964
- var e = t.split(",");
965
- return e.map(function(r) {
966
- if (r.length === 2)
967
- return A[r];
968
- var n = r.match(/^([+-]?\d{1,2})([A-Z]{2})$/);
969
- if (!n || n.length < 3)
970
- throw new SyntaxError("Invalid weekday string: ".concat(r));
971
- var a = Number(n[1]), i = n[2], u = A[i].weekday;
972
- return new O(u, a);
973
- });
974
- }
975
- var ee = (
976
- /** @class */
977
- function() {
978
- function t(e, r) {
979
- if (isNaN(e.getTime()))
980
- throw new RangeError("Invalid date passed to DateWithZone");
981
- this.date = e, this.tzid = r;
982
- }
983
- return Object.defineProperty(t.prototype, "isUTC", {
984
- get: function() {
985
- return !this.tzid || this.tzid.toUpperCase() === "UTC";
986
- },
987
- enumerable: !1,
988
- configurable: !0
989
- }), t.prototype.toString = function() {
990
- var e = fe(this.date.getTime(), this.isUTC);
991
- return this.isUTC ? ":".concat(e) : ";TZID=".concat(this.tzid, ":").concat(e);
992
- }, t.prototype.getTime = function() {
993
- return this.date.getTime();
994
- }, t.prototype.rezonedDate = function() {
995
- return this.isUTC ? this.date : Ge(this.date, this.tzid);
996
- }, t;
997
- }()
998
- );
999
- function he(t) {
1000
- for (var e = [], r = "", n = Object.keys(t), a = Object.keys(ye), i = 0; i < n.length; i++)
1001
- if (n[i] !== "tzid" && g(a, n[i])) {
1002
- var u = n[i].toUpperCase(), o = t[n[i]], s = "";
1003
- if (!(!T(o) || Y(o) && !o.length)) {
1004
- switch (u) {
1005
- case "FREQ":
1006
- s = p.FREQUENCIES[t.freq];
1007
- break;
1008
- case "WKST":
1009
- _(o) ? s = new O(o).toString() : s = o.toString();
1010
- break;
1011
- case "BYWEEKDAY":
1012
- u = "BYDAY", s = ze(o).map(function(d) {
1013
- return d instanceof O ? d : Y(d) ? new O(d[0], d[1]) : new O(d);
1014
- }).toString();
1015
- break;
1016
- case "DTSTART":
1017
- r = st(o, t.tzid);
1018
- break;
1019
- case "UNTIL":
1020
- s = fe(o, !t.tzid);
1021
- break;
1022
- default:
1023
- if (Y(o)) {
1024
- for (var l = [], c = 0; c < o.length; c++)
1025
- l[c] = String(o[c]);
1026
- s = l.toString();
1027
- } else
1028
- s = String(o);
1029
- }
1030
- s && e.push([u, s]);
1031
- }
1032
- }
1033
- var y = e.map(function(d) {
1034
- var v = d[0], k = d[1];
1035
- return "".concat(v, "=").concat(k.toString());
1036
- }).join(";"), f = "";
1037
- return y !== "" && (f = "RRULE:".concat(y)), [r, f].filter(function(d) {
1038
- return !!d;
1039
- }).join(`
1040
- `);
1041
- }
1042
- function st(t, e) {
1043
- return t ? "DTSTART" + new ee(new Date(t), e).toString() : "";
1044
- }
1045
- function ut(t, e) {
1046
- return Array.isArray(t) ? !Array.isArray(e) || t.length !== e.length ? !1 : t.every(function(r, n) {
1047
- return r.getTime() === e[n].getTime();
1048
- }) : t instanceof Date ? e instanceof Date && t.getTime() === e.getTime() : t === e;
1049
- }
1050
- var ht = (
1051
- /** @class */
1052
- function() {
1053
- function t() {
1054
- this.all = !1, this.before = [], this.after = [], this.between = [];
1055
- }
1056
- return t.prototype._cacheAdd = function(e, r, n) {
1057
- r && (r = r instanceof Date ? oe(r) : be(r)), e === "all" ? this.all = r : (n._value = r, this[e].push(n));
1058
- }, t.prototype._cacheGet = function(e, r) {
1059
- var n = !1, a = r ? Object.keys(r) : [], i = function(c) {
1060
- for (var y = 0; y < a.length; y++) {
1061
- var f = a[y];
1062
- if (!ut(r[f], c[f]))
1063
- return !0;
1064
- }
1065
- return !1;
1066
- }, u = this[e];
1067
- if (e === "all")
1068
- n = this.all;
1069
- else if (Y(u))
1070
- for (var o = 0; o < u.length; o++) {
1071
- var s = u[o];
1072
- if (!(a.length && i(s))) {
1073
- n = s._value;
1074
- break;
1075
- }
1076
- }
1077
- if (!n && this.all) {
1078
- for (var l = new q(e, r), o = 0; o < this.all.length && l.accept(this.all[o]); o++)
1079
- ;
1080
- n = l.getValue(), this._cacheAdd(e, n, r);
1081
- }
1082
- return Y(n) ? be(n) : n instanceof Date ? oe(n) : n;
1083
- }, t;
1084
- }()
1085
- ), ft = h(h(h(h(h(h(h(h(h(h(h(h(h([], m(1, 31), !0), m(2, 28), !0), m(3, 31), !0), m(4, 30), !0), m(5, 31), !0), m(6, 30), !0), m(7, 31), !0), m(8, 31), !0), m(9, 30), !0), m(10, 31), !0), m(11, 30), !0), m(12, 31), !0), m(1, 7), !0), lt = h(h(h(h(h(h(h(h(h(h(h(h(h([], m(1, 31), !0), m(2, 29), !0), m(3, 31), !0), m(4, 30), !0), m(5, 31), !0), m(6, 30), !0), m(7, 31), !0), m(8, 31), !0), m(9, 30), !0), m(10, 31), !0), m(11, 30), !0), m(12, 31), !0), m(1, 7), !0), ct = R(1, 29), dt = R(1, 30), W = R(1, 31), S = R(1, 32), yt = h(h(h(h(h(h(h(h(h(h(h(h(h([], S, !0), dt, !0), S, !0), W, !0), S, !0), W, !0), S, !0), S, !0), W, !0), S, !0), W, !0), S, !0), S.slice(0, 7), !0), pt = h(h(h(h(h(h(h(h(h(h(h(h(h([], S, !0), ct, !0), S, !0), W, !0), S, !0), W, !0), S, !0), S, !0), W, !0), S, !0), W, !0), S, !0), S.slice(0, 7), !0), vt = R(-28, 0), bt = R(-29, 0), H = R(-30, 0), D = R(-31, 0), mt = h(h(h(h(h(h(h(h(h(h(h(h(h([], D, !0), bt, !0), D, !0), H, !0), D, !0), H, !0), D, !0), D, !0), H, !0), D, !0), H, !0), D, !0), D.slice(0, 7), !0), wt = h(h(h(h(h(h(h(h(h(h(h(h(h([], D, !0), vt, !0), D, !0), H, !0), D, !0), H, !0), D, !0), D, !0), H, !0), D, !0), H, !0), D, !0), D.slice(0, 7), !0), kt = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366], gt = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], Te = function() {
1086
- for (var t = [], e = 0; e < 55; e++)
1087
- t = t.concat(R(7));
1088
- return t;
1089
- }();
1090
- function Et(t, e) {
1091
- var r = P(t, 1, 1), n = X(t) ? 366 : 365, a = X(t + 1) ? 366 : 365, i = ie(r), u = F(r), o = M(M({ yearlen: n, nextyearlen: a, yearordinal: i, yearweekday: u }, Tt(t)), { wnomask: null });
1092
- if (N(e.byweekno))
1093
- return o;
1094
- o.wnomask = m(0, n + 7);
1095
- var s, l, c = s = U(7 - u + e.wkst, 7);
1096
- c >= 4 ? (c = 0, l = o.yearlen + U(u - e.wkst, 7)) : l = n - c;
1097
- for (var y = Math.floor(l / 7), f = U(l, 7), d = Math.floor(y + f / 4), v = 0; v < e.byweekno.length; v++) {
1098
- var k = e.byweekno[v];
1099
- if (k < 0 && (k += d + 1), k > 0 && k <= d) {
1100
- var b = void 0;
1101
- k > 1 ? (b = c + (k - 1) * 7, c !== s && (b -= 7 - s)) : b = c;
1102
- for (var E = 0; E < 7 && (o.wnomask[b] = 1, b++, o.wdaymask[b] !== e.wkst); E++)
1103
- ;
1104
- }
1105
- }
1106
- if (g(e.byweekno, 1)) {
1107
- var b = c + d * 7;
1108
- if (c !== s && (b -= 7 - s), b < n)
1109
- for (var v = 0; v < 7 && (o.wnomask[b] = 1, b += 1, o.wdaymask[b] !== e.wkst); v++)
1110
- ;
1111
- }
1112
- if (c) {
1113
- var L = void 0;
1114
- if (g(e.byweekno, -1))
1115
- L = -1;
1116
- else {
1117
- var z = F(P(t - 1, 1, 1)), B = U(7 - z.valueOf() + e.wkst, 7), te = X(t - 1) ? 366 : 365, j = void 0;
1118
- B >= 4 ? (B = 0, j = te + U(z - e.wkst, 7)) : j = n - c, L = Math.floor(52 + U(j, 7) / 4);
1119
- }
1120
- if (g(e.byweekno, L))
1121
- for (var b = 0; b < c; b++)
1122
- o.wnomask[b] = 1;
1123
- }
1124
- return o;
1125
- }
1126
- function Tt(t) {
1127
- var e = X(t) ? 366 : 365, r = P(t, 1, 1), n = F(r);
1128
- return e === 365 ? {
1129
- mmask: ft,
1130
- mdaymask: pt,
1131
- nmdaymask: wt,
1132
- wdaymask: Te.slice(n),
1133
- mrange: gt
1134
- } : {
1135
- mmask: lt,
1136
- mdaymask: yt,
1137
- nmdaymask: mt,
1138
- wdaymask: Te.slice(n),
1139
- mrange: kt
1140
- };
1141
- }
1142
- function xt(t, e, r, n, a, i) {
1143
- var u = {
1144
- lastyear: t,
1145
- lastmonth: e,
1146
- nwdaymask: []
1147
- }, o = [];
1148
- if (i.freq === p.YEARLY)
1149
- if (N(i.bymonth))
1150
- o = [[0, r]];
1151
- else
1152
- for (var s = 0; s < i.bymonth.length; s++)
1153
- e = i.bymonth[s], o.push(n.slice(e - 1, e + 1));
1154
- else i.freq === p.MONTHLY && (o = [n.slice(e - 1, e + 1)]);
1155
- if (N(o))
1156
- return u;
1157
- u.nwdaymask = m(0, r);
1158
- for (var s = 0; s < o.length; s++)
1159
- for (var l = o[s], c = l[0], y = l[1] - 1, f = 0; f < i.bynweekday.length; f++) {
1160
- var d = void 0, v = i.bynweekday[f], k = v[0], b = v[1];
1161
- b < 0 ? (d = y + (b + 1) * 7, d -= U(a[d] - k, 7)) : (d = c + (b - 1) * 7, d += U(7 - a[d] + k, 7)), c <= d && d <= y && (u.nwdaymask[d] = 1);
1162
- }
1163
- return u;
1164
- }
1165
- function St(t, e) {
1166
- e === void 0 && (e = 0);
1167
- var r = t % 19, n = Math.floor(t / 100), a = t % 100, i = Math.floor(n / 4), u = n % 4, o = Math.floor((n + 8) / 25), s = Math.floor((n - o + 1) / 3), l = Math.floor(19 * r + n - i - s + 15) % 30, c = Math.floor(a / 4), y = a % 4, f = Math.floor(32 + 2 * u + 2 * c - l - y) % 7, d = Math.floor((r + 11 * l + 22 * f) / 451), v = Math.floor((l + f - 7 * d + 114) / 31), k = (l + f - 7 * d + 114) % 31 + 1, b = Date.UTC(t, v - 1, k + e), E = Date.UTC(t, 0, 1);
1168
- return [Math.ceil((b - E) / (1e3 * 60 * 60 * 24))];
1169
- }
1170
- var Dt = (
1171
- /** @class */
1172
- function() {
1173
- function t(e) {
1174
- this.options = e;
1175
- }
1176
- return t.prototype.rebuild = function(e, r) {
1177
- var n = this.options;
1178
- if (e !== this.lastyear && (this.yearinfo = Et(e, n)), x(n.bynweekday) && (r !== this.lastmonth || e !== this.lastyear)) {
1179
- var a = this.yearinfo, i = a.yearlen, u = a.mrange, o = a.wdaymask;
1180
- this.monthinfo = xt(e, r, i, u, o, n);
1181
- }
1182
- T(n.byeaster) && (this.eastermask = St(e, n.byeaster));
1183
- }, Object.defineProperty(t.prototype, "lastyear", {
1184
- get: function() {
1185
- return this.monthinfo ? this.monthinfo.lastyear : null;
1186
- },
1187
- enumerable: !1,
1188
- configurable: !0
1189
- }), Object.defineProperty(t.prototype, "lastmonth", {
1190
- get: function() {
1191
- return this.monthinfo ? this.monthinfo.lastmonth : null;
1192
- },
1193
- enumerable: !1,
1194
- configurable: !0
1195
- }), Object.defineProperty(t.prototype, "yearlen", {
1196
- get: function() {
1197
- return this.yearinfo.yearlen;
1198
- },
1199
- enumerable: !1,
1200
- configurable: !0
1201
- }), Object.defineProperty(t.prototype, "yearordinal", {
1202
- get: function() {
1203
- return this.yearinfo.yearordinal;
1204
- },
1205
- enumerable: !1,
1206
- configurable: !0
1207
- }), Object.defineProperty(t.prototype, "mrange", {
1208
- get: function() {
1209
- return this.yearinfo.mrange;
1210
- },
1211
- enumerable: !1,
1212
- configurable: !0
1213
- }), Object.defineProperty(t.prototype, "wdaymask", {
1214
- get: function() {
1215
- return this.yearinfo.wdaymask;
1216
- },
1217
- enumerable: !1,
1218
- configurable: !0
1219
- }), Object.defineProperty(t.prototype, "mmask", {
1220
- get: function() {
1221
- return this.yearinfo.mmask;
1222
- },
1223
- enumerable: !1,
1224
- configurable: !0
1225
- }), Object.defineProperty(t.prototype, "wnomask", {
1226
- get: function() {
1227
- return this.yearinfo.wnomask;
1228
- },
1229
- enumerable: !1,
1230
- configurable: !0
1231
- }), Object.defineProperty(t.prototype, "nwdaymask", {
1232
- get: function() {
1233
- return this.monthinfo ? this.monthinfo.nwdaymask : [];
1234
- },
1235
- enumerable: !1,
1236
- configurable: !0
1237
- }), Object.defineProperty(t.prototype, "nextyearlen", {
1238
- get: function() {
1239
- return this.yearinfo.nextyearlen;
1240
- },
1241
- enumerable: !1,
1242
- configurable: !0
1243
- }), Object.defineProperty(t.prototype, "mdaymask", {
1244
- get: function() {
1245
- return this.yearinfo.mdaymask;
1246
- },
1247
- enumerable: !1,
1248
- configurable: !0
1249
- }), Object.defineProperty(t.prototype, "nmdaymask", {
1250
- get: function() {
1251
- return this.yearinfo.nmdaymask;
1252
- },
1253
- enumerable: !1,
1254
- configurable: !0
1255
- }), t.prototype.ydayset = function() {
1256
- return [R(this.yearlen), 0, this.yearlen];
1257
- }, t.prototype.mdayset = function(e, r) {
1258
- for (var n = this.mrange[r - 1], a = this.mrange[r], i = m(null, this.yearlen), u = n; u < a; u++)
1259
- i[u] = u;
1260
- return [i, n, a];
1261
- }, t.prototype.wdayset = function(e, r, n) {
1262
- for (var a = m(null, this.yearlen + 7), i = ie(P(e, r, n)) - this.yearordinal, u = i, o = 0; o < 7 && (a[i] = i, ++i, this.wdaymask[i] !== this.options.wkst); o++)
1263
- ;
1264
- return [a, u, i];
1265
- }, t.prototype.ddayset = function(e, r, n) {
1266
- var a = m(null, this.yearlen), i = ie(P(e, r, n)) - this.yearordinal;
1267
- return a[i] = i, [a, i, i + 1];
1268
- }, t.prototype.htimeset = function(e, r, n, a) {
1269
- var i = this, u = [];
1270
- return this.options.byminute.forEach(function(o) {
1271
- u = u.concat(i.mtimeset(e, o, n, a));
1272
- }), $(u), u;
1273
- }, t.prototype.mtimeset = function(e, r, n, a) {
1274
- var i = this.options.bysecond.map(function(u) {
1275
- return new Q(e, r, u, a);
1276
- });
1277
- return $(i), i;
1278
- }, t.prototype.stimeset = function(e, r, n, a) {
1279
- return [new Q(e, r, n, a)];
1280
- }, t.prototype.getdayset = function(e) {
1281
- switch (e) {
1282
- case w.YEARLY:
1283
- return this.ydayset.bind(this);
1284
- case w.MONTHLY:
1285
- return this.mdayset.bind(this);
1286
- case w.WEEKLY:
1287
- return this.wdayset.bind(this);
1288
- case w.DAILY:
1289
- return this.ddayset.bind(this);
1290
- default:
1291
- return this.ddayset.bind(this);
1292
- }
1293
- }, t.prototype.gettimeset = function(e) {
1294
- switch (e) {
1295
- case w.HOURLY:
1296
- return this.htimeset.bind(this);
1297
- case w.MINUTELY:
1298
- return this.mtimeset.bind(this);
1299
- case w.SECONDLY:
1300
- return this.stimeset.bind(this);
1301
- }
1302
- }, t;
1303
- }()
1304
- );
1305
- function Ot(t, e, r, n, a, i) {
1306
- for (var u = [], o = 0; o < t.length; o++) {
1307
- var s = void 0, l = void 0, c = t[o];
1308
- c < 0 ? (s = Math.floor(c / e.length), l = U(c, e.length)) : (s = Math.floor((c - 1) / e.length), l = U(c - 1, e.length));
1309
- for (var y = [], f = r; f < n; f++) {
1310
- var d = i[f];
1311
- T(d) && y.push(d);
1312
- }
1313
- var v = void 0;
1314
- s < 0 ? v = y.slice(s)[0] : v = y[s];
1315
- var k = e[l], b = Ie(a.yearordinal + v), E = Ce(b, k);
1316
- g(u, E) || u.push(E);
1317
- }
1318
- return $(u), u;
1319
- }
1320
- function je(t, e) {
1321
- var r = e.dtstart, n = e.freq, a = e.interval, i = e.until, u = e.bysetpos, o = e.count;
1322
- if (o === 0 || a === 0)
1323
- return I(t);
1324
- var s = tt.fromDate(r), l = new Dt(e);
1325
- l.rebuild(s.year, s.month);
1326
- for (var c = Ut(l, s, e); ; ) {
1327
- var y = l.getdayset(n)(s.year, s.month, s.day), f = y[0], d = y[1], v = y[2], k = Mt(f, d, v, l, e);
1328
- if (x(u))
1329
- for (var b = Ot(u, c, d, v, l, f), E = 0; E < b.length; E++) {
1330
- var L = b[E];
1331
- if (i && L > i)
1332
- return I(t);
1333
- if (L >= r) {
1334
- var z = xe(L, e);
1335
- if (!t.accept(z) || o && (--o, !o))
1336
- return I(t);
1337
- }
1338
- }
1339
- else
1340
- for (var E = d; E < v; E++) {
1341
- var B = f[E];
1342
- if (T(B))
1343
- for (var te = Ie(l.yearordinal + B), j = 0; j < c.length; j++) {
1344
- var Pe = c[j], L = Ce(te, Pe);
1345
- if (i && L > i)
1346
- return I(t);
1347
- if (L >= r) {
1348
- var z = xe(L, e);
1349
- if (!t.accept(z) || o && (--o, !o))
1350
- return I(t);
1351
- }
1352
- }
1353
- }
1354
- if (e.interval === 0 || (s.add(e, k), s.year > _e))
1355
- return I(t);
1356
- de(n) || (c = l.gettimeset(n)(s.hour, s.minute, s.second, 0)), l.rebuild(s.year, s.month);
1357
- }
1358
- }
1359
- function Yt(t, e, r) {
1360
- var n = r.bymonth, a = r.byweekno, i = r.byweekday, u = r.byeaster, o = r.bymonthday, s = r.bynmonthday, l = r.byyearday;
1361
- return x(n) && !g(n, t.mmask[e]) || x(a) && !t.wnomask[e] || x(i) && !g(i, t.wdaymask[e]) || x(t.nwdaymask) && !t.nwdaymask[e] || u !== null && !g(t.eastermask, e) || (x(o) || x(s)) && !g(o, t.mdaymask[e]) && !g(s, t.nmdaymask[e]) || x(l) && (e < t.yearlen && !g(l, e + 1) && !g(l, -t.yearlen + e) || e >= t.yearlen && !g(l, e + 1 - t.yearlen) && !g(l, -t.nextyearlen + e - t.yearlen));
1362
- }
1363
- function xe(t, e) {
1364
- return new ee(t, e.tzid).rezonedDate();
1365
- }
1366
- function I(t) {
1367
- return t.getValue();
1368
- }
1369
- function Mt(t, e, r, n, a) {
1370
- for (var i = !1, u = e; u < r; u++) {
1371
- var o = t[u];
1372
- i = Yt(n, o, a), i && (t[o] = null);
1373
- }
1374
- return i;
1375
- }
1376
- function Ut(t, e, r) {
1377
- var n = r.freq, a = r.byhour, i = r.byminute, u = r.bysecond;
1378
- return de(n) ? nt(r) : n >= p.HOURLY && x(a) && !g(a, e.hour) || n >= p.MINUTELY && x(i) && !g(i, e.minute) || n >= p.SECONDLY && x(u) && !g(u, e.second) ? [] : t.gettimeset(n)(e.hour, e.minute, e.second, e.millisecond);
1379
- }
1380
- var A = {
1381
- MO: new O(0),
1382
- TU: new O(1),
1383
- WE: new O(2),
1384
- TH: new O(3),
1385
- FR: new O(4),
1386
- SA: new O(5),
1387
- SU: new O(6)
1388
- }, ye = {
1389
- freq: w.YEARLY,
1390
- dtstart: null,
1391
- interval: 1,
1392
- wkst: A.MO,
1393
- count: null,
1394
- until: null,
1395
- tzid: null,
1396
- bysetpos: null,
1397
- bymonth: null,
1398
- bymonthday: null,
1399
- bynmonthday: null,
1400
- byyearday: null,
1401
- byweekno: null,
1402
- byweekday: null,
1403
- bynweekday: null,
1404
- byhour: null,
1405
- byminute: null,
1406
- bysecond: null,
1407
- byeaster: null
1408
- }, Lt = Object.keys(ye), p = (
1409
- /** @class */
1410
- function() {
1411
- function t(e, r) {
1412
- e === void 0 && (e = {}), r === void 0 && (r = !1), this._cache = r ? null : new ht(), this.origOptions = He(e);
1413
- var n = rt(e).parsedOptions;
1414
- this.options = n;
1415
- }
1416
- return t.parseText = function(e, r) {
1417
- return We(e, r);
1418
- }, t.fromText = function(e, r) {
1419
- return Qe(e, r);
1420
- }, t.fromString = function(e) {
1421
- return new t(t.parseString(e) || void 0);
1422
- }, t.prototype._iter = function(e) {
1423
- return je(e, this.options);
1424
- }, t.prototype._cacheGet = function(e, r) {
1425
- return this._cache ? this._cache._cacheGet(e, r) : !1;
1426
- }, t.prototype._cacheAdd = function(e, r, n) {
1427
- if (this._cache)
1428
- return this._cache._cacheAdd(e, r, n);
1429
- }, t.prototype.all = function(e) {
1430
- if (e)
1431
- return this._iter(new we("all", {}, e));
1432
- var r = this._cacheGet("all");
1433
- return r === !1 && (r = this._iter(new q("all", {})), this._cacheAdd("all", r)), r;
1434
- }, t.prototype.between = function(e, r, n, a) {
1435
- if (n === void 0 && (n = !1), !G(e) || !G(r))
1436
- throw new Error("Invalid date passed in to RRule.between");
1437
- var i = {
1438
- before: r,
1439
- after: e,
1440
- inc: n
1441
- };
1442
- if (a)
1443
- return this._iter(new we("between", i, a));
1444
- var u = this._cacheGet("between", i);
1445
- return u === !1 && (u = this._iter(new q("between", i)), this._cacheAdd("between", u, i)), u;
1446
- }, t.prototype.before = function(e, r) {
1447
- if (r === void 0 && (r = !1), !G(e))
1448
- throw new Error("Invalid date passed in to RRule.before");
1449
- var n = { dt: e, inc: r }, a = this._cacheGet("before", n);
1450
- return a === !1 && (a = this._iter(new q("before", n)), this._cacheAdd("before", a, n)), a;
1451
- }, t.prototype.after = function(e, r) {
1452
- if (r === void 0 && (r = !1), !G(e))
1453
- throw new Error("Invalid date passed in to RRule.after");
1454
- var n = { dt: e, inc: r }, a = this._cacheGet("after", n);
1455
- return a === !1 && (a = this._iter(new q("after", n)), this._cacheAdd("after", a, n)), a;
1456
- }, t.prototype.count = function() {
1457
- return this.all().length;
1458
- }, t.prototype.toString = function() {
1459
- return he(this.origOptions);
1460
- }, t.prototype.toText = function(e, r, n) {
1461
- return Ve(this, e, r, n);
1462
- }, t.prototype.isFullyConvertibleToText = function() {
1463
- return et(this);
1464
- }, t.prototype.clone = function() {
1465
- return new t(this.origOptions);
1466
- }, t.FREQUENCIES = [
1467
- "YEARLY",
1468
- "MONTHLY",
1469
- "WEEKLY",
1470
- "DAILY",
1471
- "HOURLY",
1472
- "MINUTELY",
1473
- "SECONDLY"
1474
- ], t.YEARLY = w.YEARLY, t.MONTHLY = w.MONTHLY, t.WEEKLY = w.WEEKLY, t.DAILY = w.DAILY, t.HOURLY = w.HOURLY, t.MINUTELY = w.MINUTELY, t.SECONDLY = w.SECONDLY, t.MO = A.MO, t.TU = A.TU, t.WE = A.WE, t.TH = A.TH, t.FR = A.FR, t.SA = A.SA, t.SU = A.SU, t.parseString = ue, t.optionsToString = he, t;
1475
- }()
1476
- );
1477
- function At(t, e, r, n, a, i) {
1478
- var u = {}, o = t.accept;
1479
- function s(f, d) {
1480
- r.forEach(function(v) {
1481
- v.between(f, d, !0).forEach(function(k) {
1482
- u[Number(k)] = !0;
1483
- });
1484
- });
1485
- }
1486
- a.forEach(function(f) {
1487
- var d = new ee(f, i).rezonedDate();
1488
- u[Number(d)] = !0;
1489
- }), t.accept = function(f) {
1490
- var d = Number(f);
1491
- return isNaN(d) ? o.call(this, f) : !u[d] && (s(new Date(d - 1), new Date(d + 1)), !u[d]) ? (u[d] = !0, o.call(this, f)) : !0;
1492
- }, t.method === "between" && (s(t.args.after, t.args.before), t.accept = function(f) {
1493
- var d = Number(f);
1494
- return u[d] ? !0 : (u[d] = !0, o.call(this, f));
1495
- });
1496
- for (var l = 0; l < n.length; l++) {
1497
- var c = new ee(n[l], i).rezonedDate();
1498
- if (!t.accept(new Date(c.getTime())))
1499
- break;
1500
- }
1501
- e.forEach(function(f) {
1502
- je(t, f.options);
1503
- });
1504
- var y = t._result;
1505
- switch ($(y), t.method) {
1506
- case "all":
1507
- case "between":
1508
- return y;
1509
- case "before":
1510
- return y.length && y[y.length - 1] || null;
1511
- case "after":
1512
- default:
1513
- return y.length && y[0] || null;
1514
- }
1515
- }
1516
- var Se = {
1517
- dtstart: null,
1518
- cache: !1,
1519
- unfold: !1,
1520
- forceset: !1,
1521
- compatible: !1,
1522
- tzid: null
1523
- };
1524
- function _t(t, e) {
1525
- var r = [], n = [], a = [], i = [], u = V(t), o = u.dtstart, s = u.tzid, l = Wt(t, e.unfold);
1526
- return l.forEach(function(c) {
1527
- var y;
1528
- if (c) {
1529
- var f = Ct(c), d = f.name, v = f.parms, k = f.value;
1530
- switch (d.toUpperCase()) {
1531
- case "RRULE":
1532
- if (v.length)
1533
- throw new Error("unsupported RRULE parm: ".concat(v.join(",")));
1534
- r.push(ue(c));
1535
- break;
1536
- case "RDATE":
1537
- var b = (y = /RDATE(?:;TZID=([^:=]+))?/i.exec(c)) !== null && y !== void 0 ? y : [], E = b[1];
1538
- E && !s && (s = E), n = n.concat(Oe(k, v));
1539
- break;
1540
- case "EXRULE":
1541
- if (v.length)
1542
- throw new Error("unsupported EXRULE parm: ".concat(v.join(",")));
1543
- a.push(ue(k));
1544
- break;
1545
- case "EXDATE":
1546
- i = i.concat(Oe(k, v));
1547
- break;
1548
- case "DTSTART":
1549
- break;
1550
- default:
1551
- throw new Error("unsupported property: " + d);
1552
- }
1553
- }
1554
- }), {
1555
- dtstart: o,
1556
- tzid: s,
1557
- rrulevals: r,
1558
- rdatevals: n,
1559
- exrulevals: a,
1560
- exdatevals: i
1561
- };
1562
- }
1563
- function Nt(t, e) {
1564
- var r = _t(t, e), n = r.rrulevals, a = r.rdatevals, i = r.exrulevals, u = r.exdatevals, o = r.dtstart, s = r.tzid, l = e.cache === !1;
1565
- if (e.compatible && (e.forceset = !0, e.unfold = !0), e.forceset || n.length > 1 || a.length || i.length || u.length) {
1566
- var c = new jt(l);
1567
- return c.dtstart(o), c.tzid(s || void 0), n.forEach(function(f) {
1568
- c.rrule(new p(ne(f, o, s), l));
1569
- }), a.forEach(function(f) {
1570
- c.rdate(f);
1571
- }), i.forEach(function(f) {
1572
- c.exrule(new p(ne(f, o, s), l));
1573
- }), u.forEach(function(f) {
1574
- c.exdate(f);
1575
- }), e.compatible && e.dtstart && c.rdate(o), c;
1576
- }
1577
- var y = n[0] || {};
1578
- return new p(ne(y, y.dtstart || e.dtstart || o, y.tzid || e.tzid || s), l);
1579
- }
1580
- function De(t, e) {
1581
- return e === void 0 && (e = {}), Nt(t, Rt(e));
1582
- }
1583
- function ne(t, e, r) {
1584
- return M(M({}, t), { dtstart: e, tzid: r });
1585
- }
1586
- function Rt(t) {
1587
- var e = [], r = Object.keys(t), n = Object.keys(Se);
1588
- if (r.forEach(function(a) {
1589
- g(n, a) || e.push(a);
1590
- }), e.length)
1591
- throw new Error("Invalid options: " + e.join(", "));
1592
- return M(M({}, Se), t);
1593
- }
1594
- function It(t) {
1595
- if (t.indexOf(":") === -1)
1596
- return {
1597
- name: "RRULE",
1598
- value: t
1599
- };
1600
- var e = Ke(t, ":", 1), r = e[0], n = e[1];
1601
- return {
1602
- name: r,
1603
- value: n
1604
- };
1605
- }
1606
- function Ct(t) {
1607
- var e = It(t), r = e.name, n = e.value, a = r.split(";");
1608
- if (!a)
1609
- throw new Error("empty property name");
1610
- return {
1611
- name: a[0].toUpperCase(),
1612
- parms: a.slice(1),
1613
- value: n
1614
- };
1615
- }
1616
- function Wt(t, e) {
1617
- if (e === void 0 && (e = !1), t = t && t.trim(), !t)
1618
- throw new Error("Invalid empty string");
1619
- if (!e)
1620
- return t.split(/\s/);
1621
- for (var r = t.split(`
1622
- `), n = 0; n < r.length; ) {
1623
- var a = r[n] = r[n].replace(/\s+$/g, "");
1624
- a ? n > 0 && a[0] === " " ? (r[n - 1] += a.slice(1), r.splice(n, 1)) : n += 1 : r.splice(n, 1);
1625
- }
1626
- return r;
1627
- }
1628
- function Ht(t) {
1629
- t.forEach(function(e) {
1630
- if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))
1631
- throw new Error("unsupported RDATE/EXDATE parm: " + e);
1632
- });
1633
- }
1634
- function Oe(t, e) {
1635
- return Ht(e), t.split(",").map(function(r) {
1636
- return le(r);
1637
- });
1638
- }
1639
- function Ye(t) {
1640
- var e = this;
1641
- return function(r) {
1642
- if (r !== void 0 && (e["_".concat(t)] = r), e["_".concat(t)] !== void 0)
1643
- return e["_".concat(t)];
1644
- for (var n = 0; n < e._rrule.length; n++) {
1645
- var a = e._rrule[n].origOptions[t];
1646
- if (a)
1647
- return a;
1648
- }
1649
- };
1650
- }
1651
- var jt = (
1652
- /** @class */
1653
- function(t) {
1654
- ce(e, t);
1655
- function e(r) {
1656
- r === void 0 && (r = !1);
1657
- var n = t.call(this, {}, r) || this;
1658
- return n.dtstart = Ye.apply(n, ["dtstart"]), n.tzid = Ye.apply(n, ["tzid"]), n._rrule = [], n._rdate = [], n._exrule = [], n._exdate = [], n;
1659
- }
1660
- return e.prototype._iter = function(r) {
1661
- return At(r, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());
1662
- }, e.prototype.rrule = function(r) {
1663
- Me(r, this._rrule);
1664
- }, e.prototype.exrule = function(r) {
1665
- Me(r, this._exrule);
1666
- }, e.prototype.rdate = function(r) {
1667
- Ue(r, this._rdate);
1668
- }, e.prototype.exdate = function(r) {
1669
- Ue(r, this._exdate);
1670
- }, e.prototype.rrules = function() {
1671
- return this._rrule.map(function(r) {
1672
- return De(r.toString());
1673
- });
1674
- }, e.prototype.exrules = function() {
1675
- return this._exrule.map(function(r) {
1676
- return De(r.toString());
1677
- });
1678
- }, e.prototype.rdates = function() {
1679
- return this._rdate.map(function(r) {
1680
- return new Date(r.getTime());
1681
- });
1682
- }, e.prototype.exdates = function() {
1683
- return this._exdate.map(function(r) {
1684
- return new Date(r.getTime());
1685
- });
1686
- }, e.prototype.valueOf = function() {
1687
- var r = [];
1688
- return !this._rrule.length && this._dtstart && (r = r.concat(he({ dtstart: this._dtstart }))), this._rrule.forEach(function(n) {
1689
- r = r.concat(n.toString().split(`
1690
- `));
1691
- }), this._exrule.forEach(function(n) {
1692
- r = r.concat(n.toString().split(`
1693
- `).map(function(a) {
1694
- return a.replace(/^RRULE:/, "EXRULE:");
1695
- }).filter(function(a) {
1696
- return !/^DTSTART/.test(a);
1697
- }));
1698
- }), this._rdate.length && r.push(Le("RDATE", this._rdate, this.tzid())), this._exdate.length && r.push(Le("EXDATE", this._exdate, this.tzid())), r;
1699
- }, e.prototype.toString = function() {
1700
- return this.valueOf().join(`
1701
- `);
1702
- }, e.prototype.clone = function() {
1703
- var r = new e(!!this._cache);
1704
- return this._rrule.forEach(function(n) {
1705
- return r.rrule(n.clone());
1706
- }), this._exrule.forEach(function(n) {
1707
- return r.exrule(n.clone());
1708
- }), this._rdate.forEach(function(n) {
1709
- return r.rdate(new Date(n.getTime()));
1710
- }), this._exdate.forEach(function(n) {
1711
- return r.exdate(new Date(n.getTime()));
1712
- }), r;
1713
- }, e;
1714
- }(p)
1715
- );
1716
- function Me(t, e) {
1717
- if (!(t instanceof p))
1718
- throw new TypeError(String(t) + " is not RRule instance");
1719
- g(e.map(String), String(t)) || e.push(t);
1720
- }
1721
- function Ue(t, e) {
1722
- if (!(t instanceof Date))
1723
- throw new TypeError(String(t) + " is not Date instance");
1724
- g(e.map(Number), Number(t)) || (e.push(t), $(e));
1725
- }
1726
- function Le(t, e, r) {
1727
- var n = !r || r.toUpperCase() === "UTC", a = n ? "".concat(t, ":") : "".concat(t, ";TZID=").concat(r, ":"), i = e.map(function(u) {
1728
- return fe(u.valueOf(), n);
1729
- }).join(",");
1730
- return "".concat(a).concat(i);
1731
- }
1732
- export {
1733
- w as F,
1734
- p as R
1735
- };