jamespot-react-core 1.3.4 → 1.3.6

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 (37) hide show
  1. package/build/534.606ae244f89e01f0c5fa.chunk.js +2 -0
  2. package/build/534.606ae244f89e01f0c5fa.chunk.js.map +1 -0
  3. package/build/605.2ea491387427c666537a.chunk.js +707 -0
  4. package/build/605.2ea491387427c666537a.chunk.js.map +1 -0
  5. package/build/app.bundle.js +4038 -3965
  6. package/build/app.bundle.js.map +1 -1
  7. package/build/src/App.d.ts +1 -0
  8. package/build/src/components/LayoutProvider.component.d.ts +14 -0
  9. package/build/src/components/calendar/CalendarToolbar.d.ts +1 -1
  10. package/build/src/components/calendar/CalendarWrapper.d.ts +2 -20
  11. package/build/src/components/calendar/CreateCalendarEventModal.d.ts +15 -0
  12. package/build/src/components/calendar/ExportCalendarModal.d.ts +5 -0
  13. package/build/src/components/calendar/UpdateCalendarEventModal.d.ts +14 -0
  14. package/build/src/components/calendar/meeting/CreateMeetingModal.d.ts +5 -0
  15. package/build/src/components/calendar/meeting/MeetingForm.d.ts +29 -0
  16. package/build/src/components/calendar/meeting/UpdateMeetingModal.d.ts +7 -0
  17. package/build/src/components/calendar/socialEvent/CreateSocialEventOrRecurringEventModal.d.ts +10 -0
  18. package/build/src/components/calendar/socialEvent/SocialEventOrRecurringEventForm.d.ts +35 -0
  19. package/build/src/components/calendar/socialEvent/UpdateRecurringEventModal.d.ts +7 -0
  20. package/build/src/components/calendar/socialEvent/UpdateSocialEventModal.d.ts +7 -0
  21. package/build/src/components/widgets/wrapper/JRCWidgetColorWrapper.d.ts +8 -0
  22. package/build/src/hooks/index.d.ts +3 -1
  23. package/build/src/hooks/useApplication.d.ts +1 -0
  24. package/build/src/hooks/useLayout.d.ts +2 -0
  25. package/build/src/redux/store.d.ts +3 -3
  26. package/build/src/registry/core-component-list.d.ts +3 -0
  27. package/build/src/registry/coreComponents.d.ts +3 -0
  28. package/build/src/registry/ext-component-list.d.ts +4 -1
  29. package/build/src/utils/eventRecurrence.d.ts +10 -0
  30. package/build/src/utils/jamespot.d.ts +14 -0
  31. package/build/src/utils/reactHookForm.d.ts +2 -0
  32. package/build/src/utils/types.d.ts +2 -0
  33. package/package.json +5 -4
  34. package/build/605.f594e89c1007934615b9.chunk.js +0 -2
  35. package/build/605.f594e89c1007934615b9.chunk.js.map +0 -1
  36. package/build/818.3f23be9d7323f83e9353.chunk.js +0 -685
  37. package/build/818.3f23be9d7323f83e9353.chunk.js.map +0 -1
@@ -19,4 +19,5 @@ export * from './types';
19
19
  export { useAppDispatch, useAppSelector };
20
20
  export { createBodyElement, createExtension, createSimpleExtension, mountRootExtension } from './utils/extensions';
21
21
  export { getTinyMCEMentionsQueries } from './utils/tinymce';
22
+ export * from './utils/jamespot';
22
23
  export default App;
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ export type LayoutCapacities = {
3
+ setTitle: (title: string) => void;
4
+ };
5
+ type InternalLayoutCapacities = {
6
+ resetTitle: () => void;
7
+ };
8
+ export declare const LayoutContext: import("react").Context<(LayoutCapacities & InternalLayoutCapacities) | undefined>;
9
+ export type LayoutProviderProps = {
10
+ children: ReactNode;
11
+ capacities: LayoutCapacities & InternalLayoutCapacities;
12
+ };
13
+ export declare const LayoutProvider: ({ children, capacities }: LayoutProviderProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { CalendarApi, CalendarView } from 'jamespot-react-components';
2
- type Filter = ('socialEvent' | 'meeting' | 'animatedMeeting' | 'boardCard')[];
2
+ type Filter = ('socialEvent' | 'meeting' | 'animatedMeeting' | 'boardCard' | 'recurringEvent')[];
3
3
  type OptionView = {
4
4
  label: string;
5
5
  value: CalendarView;
@@ -1,27 +1,9 @@
1
- import { CalendarEvent, JRCCalendarProps } from 'jamespot-react-components';
2
- import { ReactNode } from 'react';
3
- export declare const CalendarWrapper: ({ views, mode, withPadding, withHeader, withToolbar, fluid, children, onSelect, }: {
1
+ import { JRCCalendarProps } from 'jamespot-react-components';
2
+ export declare const CalendarWrapper: ({ views, mode, withPadding, withHeader, withToolbar, fluid, }: {
4
3
  views: Array<"dayGridMonth" | "timeGridWeek" | "timeGridDay" | "list">;
5
4
  mode?: JRCCalendarProps["mode"];
6
5
  fluid?: boolean;
7
6
  withPadding?: boolean;
8
7
  withHeader?: boolean;
9
8
  withToolbar?: boolean;
10
- onSelect?: (params: {
11
- start: Date;
12
- end: Date;
13
- allDay: boolean;
14
- } | null) => void;
15
- children?({ dates, eventToUpdate, creationType, isExportModalOpen, setCreationType, setEventToUpdate, setExportModalOpen, }: {
16
- dates?: {
17
- start: string;
18
- end: string;
19
- };
20
- eventToUpdate?: CalendarEvent | null;
21
- creationType: string | null;
22
- isExportModalOpen: boolean;
23
- setEventToUpdate: React.Dispatch<React.SetStateAction<CalendarEvent | null>>;
24
- setCreationType: React.Dispatch<React.SetStateAction<"socialEvent" | "meeting" | "animatedMeeting" | null>>;
25
- setExportModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
26
- }): ReactNode;
27
9
  }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { UseFormReturn } from 'react-hook-form';
2
+ export type CreateCalendarEventModalProps = {
3
+ open: boolean;
4
+ closeHandler: () => void;
5
+ onSubmit: () => void;
6
+ onSchedule: () => void;
7
+ children?: React.ReactNode;
8
+ form: UseFormReturn<any, any, any>;
9
+ uploadLoading: boolean;
10
+ type: 'socialEvent' | 'meeting';
11
+ scheduleLoading: boolean;
12
+ publishLoading: boolean;
13
+ isValid: boolean;
14
+ };
15
+ export declare const CreateCalendarEventModal: ({ open, closeHandler, onSubmit, onSchedule, children, form, uploadLoading, type, scheduleLoading, publishLoading, isValid, }: CreateCalendarEventModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export type ExportCalendarModalProps = {
2
+ open: boolean;
3
+ closeHandler: () => void;
4
+ };
5
+ export declare const ExportCalendarModal: ({ open, closeHandler }: ExportCalendarModalProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import { UseFormReturn } from 'react-hook-form';
2
+ import { FormEvent } from 'react';
3
+ export type UpdateCalendarEventModalProps = {
4
+ closeHandler: () => void;
5
+ onSubmit: (e: FormEvent<Element>) => Promise<void>;
6
+ children?: React.ReactNode;
7
+ form: UseFormReturn<any, any, any>;
8
+ uploadLoading: boolean;
9
+ type: 'socialEvent' | 'meeting' | 'recurringEvent';
10
+ loading: boolean;
11
+ articleId?: number;
12
+ isValid: boolean;
13
+ };
14
+ export declare const UpdateCalendarEventModal: ({ closeHandler, onSubmit, children, form, uploadLoading, type, loading, articleId, }: UpdateCalendarEventModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { CreateCalendarEventModalProps } from '../CreateCalendarEventModal';
2
+ export type CreateMeetingModalProps = Pick<CreateCalendarEventModalProps, 'open' | 'closeHandler'> & {
3
+ onCreate: () => void;
4
+ };
5
+ export declare const CreateMeetingModal: ({ open, closeHandler, onCreate }: CreateMeetingModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { AudienceAutocomplete, CalendarEventWithExtensions, jFileLittle, jMeetingView, MeetingCreation } from 'jamespot-user-api';
2
+ import { UseFormReturn } from 'react-hook-form';
3
+ export type MeetingFormExtraInitialValues = {
4
+ eventMode: 'onSpot' | 'visio' | 'hybrid';
5
+ customColors: boolean;
6
+ attachments: Array<jFileLittle>;
7
+ reportFile: jFileLittle | null;
8
+ tags: Record<string, unknown>;
9
+ };
10
+ export type MeetingFormProps = {
11
+ form: UseFormReturn<MeetingFormValues, null, any>;
12
+ setUploadLoading: (loading: boolean) => void;
13
+ meeting?: CalendarEventWithExtensions<jMeetingView, ['socialEventRecord']>;
14
+ extraInitialValues?: MeetingFormExtraInitialValues;
15
+ mode: 'create' | 'update';
16
+ };
17
+ export type MeetingFormValues = Omit<MeetingCreation, 'publishTo' | 'uiObjectLink' | 'alertAuthor' | 'sendAlert' | 'type'> & {
18
+ publishTo: AudienceAutocomplete[];
19
+ uiObjectLink?: {
20
+ uri: string;
21
+ title: string;
22
+ icon?: string;
23
+ color?: string;
24
+ };
25
+ image?: object;
26
+ alertAuthor?: boolean;
27
+ sendAlert?: boolean;
28
+ };
29
+ export declare const MeetingForm: ({ form, setUploadLoading, extraInitialValues, mode }: MeetingFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { CalendarEventWithExtensions, jMeetingView } from 'jamespot-user-api';
2
+ export type UpdateMeetingModalProps = {
3
+ onUpdate: () => void;
4
+ meeting?: CalendarEventWithExtensions<jMeetingView, ['socialEventRecord']>;
5
+ closeHandler: () => void;
6
+ };
7
+ export declare const UpdateMeetingModal: ({ closeHandler, onUpdate, meeting }: UpdateMeetingModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { CreateCalendarEventModalProps } from '../CreateCalendarEventModal';
2
+ export type CreateSocialEventOrRecurringEventModalProps = Pick<CreateCalendarEventModalProps, 'open' | 'closeHandler'> & {
3
+ onCreate: () => void;
4
+ defaultDateSelection?: {
5
+ start: Date;
6
+ end: Date;
7
+ allDay: boolean;
8
+ } | null;
9
+ };
10
+ export declare const CreateSocialEventOrRecurringEventModal: ({ open, closeHandler, onCreate, defaultDateSelection, }: CreateSocialEventOrRecurringEventModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { CalendarEventWithExtensions, jFileLittle, Join, jRecurringEventView, jSocialEventView, Recurrence, RecurringEventCreation, RecurringEventUpdate, SocialEventCreation, SocialEventUpdate } from 'jamespot-user-api';
2
+ import { UseFormReturn } from 'react-hook-form';
3
+ export type SocialEventFormExtraInitialValues = {
4
+ eventMode: 'onSpot' | 'visio' | 'hybrid';
5
+ customColors: boolean;
6
+ attachments: Array<jFileLittle>;
7
+ tags: Record<string, unknown>;
8
+ until?: string;
9
+ };
10
+ export type SocialEventOrRecurringFormProps = {
11
+ form: UseFormReturn<SocialEventOrRecurringEventFormValues, null, any>;
12
+ setUploadLoading: (loading: boolean) => void;
13
+ event?: CalendarEventWithExtensions<jSocialEventView | jRecurringEventView, [
14
+ 'socialEventRecord' | 'recurringEventRecord'
15
+ ]>;
16
+ extraInitialValues?: SocialEventFormExtraInitialValues;
17
+ mode: 'create' | 'update';
18
+ };
19
+ export type SocialEventOrRecurringEventFormValues = Omit<Join<Join<Join<SocialEventCreation, SocialEventUpdate>, RecurringEventCreation>, RecurringEventUpdate>, 'publishTo' | 'uiObjectLink' | 'alertAuthor' | 'sendAlert' | 'type'> & {
20
+ publishTo: {
21
+ uri: string;
22
+ title: string;
23
+ }[];
24
+ uiObjectLink?: {
25
+ uri: string;
26
+ title: string;
27
+ icon?: string;
28
+ color?: string;
29
+ };
30
+ image?: object;
31
+ alertAuthor?: boolean;
32
+ sendAlert?: boolean;
33
+ recurrenceRule?: Recurrence;
34
+ };
35
+ export declare const SocialEventOrRecurringEventForm: ({ form, setUploadLoading, extraInitialValues, mode, }: SocialEventOrRecurringFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { CalendarEventWithExtensions, jRecurringEventOccurrenceView } from 'jamespot-user-api';
2
+ export type UpdateRecurringEventModalProps = {
3
+ onUpdate: () => void;
4
+ event?: CalendarEventWithExtensions<jRecurringEventOccurrenceView, ['socialEventRecord', 'recurringEventRecord']>;
5
+ closeHandler: () => void;
6
+ };
7
+ export declare const UpdateRecurringEventModal: ({ closeHandler, onUpdate, event: recurringEventOccurrence, }: UpdateRecurringEventModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { CalendarEventWithExtensions, jSocialEventView } from 'jamespot-user-api';
2
+ export type UpdateSocialEventModalProps = {
3
+ onUpdate: () => void;
4
+ event?: CalendarEventWithExtensions<jSocialEventView, ['socialEventRecord']>;
5
+ closeHandler: () => void;
6
+ };
7
+ export declare const UpdateSocialEventModal: ({ closeHandler, onUpdate, event }: UpdateSocialEventModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { WidgetColorType, WidgetDisplayMode } from 'jamespot-user-api';
2
+ type JRCWidgetColorWrapperProps = {
3
+ widget: WidgetColorType;
4
+ inplace: boolean;
5
+ mode?: WidgetDisplayMode;
6
+ };
7
+ export declare const JRCWidgetColorWrapper: ({ widget, mode }: JRCWidgetColorWrapperProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -1,8 +1,10 @@
1
1
  import useAbortController from './useAbortController';
2
2
  import { useActivities } from './useActivities';
3
+ import { useApplication } from './useApplication';
3
4
  import useCommentRT from './useCommentRT';
5
+ import { useLayout } from './useLayout';
4
6
  import { useMessengerUnread } from './useMessengerUnread';
5
7
  import { useNGEvent } from './useNGEvent';
6
8
  import useToggleFullScreen from './useToggleFullScreen';
7
9
  import useWindowDimension from './useWindowDimension';
8
- export { useAbortController, useActivities, useCommentRT, useMessengerUnread, useNGEvent, useToggleFullScreen, useWindowDimension, };
10
+ export { useAbortController, useActivities, useApplication, useCommentRT, useLayout, useMessengerUnread, useNGEvent, useToggleFullScreen, useWindowDimension, };
@@ -0,0 +1 @@
1
+ export declare const useApplication: (application: string) => void;
@@ -0,0 +1,2 @@
1
+ import { LayoutCapacities } from '../components/LayoutProvider.component';
2
+ export declare const useLayout: () => LayoutCapacities;
@@ -165,7 +165,7 @@ declare function createStore(initialAsyncReducers: AsyncReducers): import("@redu
165
165
  } & {
166
166
  list: import("jamespot-user-api").CalendarEventWithExtensions<import("jamespot-user-api").CalendarEventViewAbstractType, ["socialEventRecord"]>[];
167
167
  statuses: import("jamespot-user-api").EventStatusFilter[];
168
- types: Array<"socialEvent" | "meeting" | "animatedMeeting" | "boardCard">;
168
+ types: Array<"socialEvent" | "meeting" | "animatedMeeting" | "boardCard" | "recurringEvent">;
169
169
  dates?: {
170
170
  start: string;
171
171
  end: string;
@@ -366,7 +366,7 @@ declare function createStore(initialAsyncReducers: AsyncReducers): import("@redu
366
366
  } & {
367
367
  list: import("jamespot-user-api").CalendarEventWithExtensions<import("jamespot-user-api").CalendarEventViewAbstractType, ["socialEventRecord"]>[];
368
368
  statuses: import("jamespot-user-api").EventStatusFilter[];
369
- types: Array<"socialEvent" | "meeting" | "animatedMeeting" | "boardCard">;
369
+ types: Array<"socialEvent" | "meeting" | "animatedMeeting" | "boardCard" | "recurringEvent">;
370
370
  dates?: {
371
371
  start: string;
372
372
  end: string;
@@ -572,7 +572,7 @@ export declare const useAppDispatch: () => import("@reduxjs/toolkit").ThunkDispa
572
572
  } & {
573
573
  list: import("jamespot-user-api").CalendarEventWithExtensions<import("jamespot-user-api").CalendarEventViewAbstractType, ["socialEventRecord"]>[];
574
574
  statuses: import("jamespot-user-api").EventStatusFilter[];
575
- types: Array<"socialEvent" | "meeting" | "animatedMeeting" | "boardCard">;
575
+ types: Array<"socialEvent" | "meeting" | "animatedMeeting" | "boardCard" | "recurringEvent">;
576
576
  dates?: {
577
577
  start: string;
578
578
  end: string;
@@ -4,6 +4,9 @@
4
4
  export declare const coreComponentsMapping: {
5
5
  readonly Avatar: "Avatar";
6
6
  readonly AddReportModal: "AddReportModal";
7
+ readonly 'Calendar.CreateMeetingModal': "CreateMeetingModal";
8
+ readonly 'Calendar.CreateSocialEventOrRecurringEventModal': "CreateSocialEventOrRecurringEventModal";
9
+ readonly 'Calendar.ExportCalendarModal': "ExportCalendarModal";
7
10
  readonly CalendarWrapper: "CalendarWrapper";
8
11
  readonly CalendarToolbar: "CalendarToolbar";
9
12
  readonly CommentsBloc: "CommentsBloc";
@@ -8,10 +8,13 @@ export { AddReportModal } from '../components/comments/AddReportModal';
8
8
  export { CalendarWrapper } from '../components/calendar/CalendarWrapper';
9
9
  export { CalendarToolbar } from '../components/calendar/CalendarToolbar';
10
10
  export { CommentsBloc } from '../components/CommentsBloc';
11
+ export { CreateMeetingModal } from '../components/calendar/meeting/CreateMeetingModal';
12
+ export { CreateSocialEventOrRecurringEventModal } from '../components/calendar/socialEvent/CreateSocialEventOrRecurringEventModal';
11
13
  export { DisplayForm } from '../displayer/DisplayForm.component';
12
14
  export { EditorsPortal } from '../components/editors/EditorsPortal';
13
15
  export { Empty } from '../components/Empty';
14
16
  export { Editor } from '../components/editors/Editor';
17
+ export { ExportCalendarModal } from '../components/calendar/ExportCalendarModal';
15
18
  export { FullPageLayout } from '../components/FullPageLayout';
16
19
  export { GifsModal } from '../components/tinymce/extension/GifsModal';
17
20
  export { JRCInputTinyMCEWithExt } from '../components/tinymce/JRCInputTinyMCEWithExt';
@@ -19,7 +19,6 @@ declare const mapping: {
19
19
  Card: "JRCCard";
20
20
  CardImg: "JRCCardImg";
21
21
  Checkbox: "JRCCheckbox";
22
- ClickAwayListener: "ClickAwayListener";
23
22
  Collapse: "JRCCollapse";
24
23
  Column: "JRCColumn";
25
24
  ColumnCenter: "JRCColumnCenter";
@@ -29,6 +28,7 @@ declare const mapping: {
29
28
  Container: "JRCContainer";
30
29
  CropImage: "JRCCropImage";
31
30
  Date: "JRCDate";
31
+ Deprecated_ClickAwayListener: "Deprecated_ClickAwayListener";
32
32
  Deprecated_Ellipsis: "Deprecated_JRCEllipsis";
33
33
  DisplayCard: "JRCDisplayCard";
34
34
  DndProvider: "DndProvider";
@@ -69,6 +69,7 @@ declare const mapping: {
69
69
  InputCommunity: "JRCInputCommunity";
70
70
  InputDate: "JRCInputDate";
71
71
  InputDateTime: "JRCInputDateTime";
72
+ InputDateTimeRaw: "JRCInputDateTimeRaw";
72
73
  InputEmail: "JRCInputEmail";
73
74
  InputFile: "JRCInputFile";
74
75
  InputFileAdvancedRaw: "JRCInputFileAdvancedRaw";
@@ -152,6 +153,8 @@ declare const mapping: {
152
153
  WidgetCalendarCalDavEditor: "JRCWidgetCalendarCalDavEditor";
153
154
  WidgetCheckList: "JRCWidgetCheckList";
154
155
  WidgetCheckListEditor: "JRCWidgetCheckListEditor";
156
+ WidgetColor: "JRCWidgetColor";
157
+ WidgetColorEditor: "JRCWidgetColorEditor";
155
158
  WidgetContactCardDav: "JRCWidgetContactCardDav";
156
159
  WidgetContactCardDavEditor: "JRCWidgetContactCardDavEditor";
157
160
  WidgetDatasourceTableEditor: "JRCWidgetDatasourceTableEditor";
@@ -0,0 +1,10 @@
1
+ import { Recurrence } from 'jamespot-user-api';
2
+ type RecurrencePreset = {
3
+ label: string;
4
+ value: Recurrence;
5
+ };
6
+ export declare const recurrencePresets: Array<RecurrencePreset>;
7
+ export declare const isPreset: (a: Recurrence, b: Recurrence) => boolean;
8
+ export declare const hasPreset: (recurrence?: Recurrence | null) => boolean | null | undefined;
9
+ export declare const getRecurrencePresetLabel: (recurrence: Recurrence) => (typeof recurrencePresets)[number]["label"];
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Dispatch } from 'react';
2
+ import { IntlShape } from 'react-intl';
3
+ export declare function getUri(object: any): any;
4
+ export declare function maybeIntl(intl: IntlShape, message: {
5
+ id: string;
6
+ values: Record<string, string | number>;
7
+ } | string | undefined): string | undefined;
8
+ export declare function displayApiErrorToast(e: any, dispatch: Dispatch<any>): void;
9
+ export declare const slugify: (sentence: string) => string;
10
+ export declare const truncate: (text: string, length: number) => string;
11
+ export declare const stringifyAutocomplete: (publishTo?: {
12
+ uri: string;
13
+ }[]) => string | undefined;
14
+ export declare const isAbortError: (error: unknown) => boolean;
@@ -0,0 +1,2 @@
1
+ import { FieldValues, Resolver } from 'react-hook-form';
2
+ export declare const withPreprocess: <T extends FieldValues, R extends FieldValues>(resolver: Resolver<R>, preprocess: (data: T) => R) => Resolver<T, null, R>;
@@ -73,6 +73,8 @@ type WindowJNG = {
73
73
  type?: string;
74
74
  }) => void;
75
75
  togglePageBodyFullscreen: () => Promise<boolean>;
76
+ setTitle: (title: string) => void;
77
+ resetTitle: () => void;
76
78
  };
77
79
  export type JType = {
78
80
  cssClass: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-core",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Jamespot React Core",
5
5
  "main": "./build/app.bundle.js",
6
6
  "types": "./build/src/App.d.ts",
@@ -19,6 +19,7 @@
19
19
  "@typescript-eslint/eslint-plugin": "^5.62.0",
20
20
  "@typescript-eslint/parser": "^5.62.0",
21
21
  "copy-webpack-plugin": "^6.4.1",
22
+ "date-fns": "^4.1.0",
22
23
  "eslint": "^8.57.1",
23
24
  "eslint-config-prettier": "^8.10.2",
24
25
  "eslint-import-resolver-typescript": "^4.4.4",
@@ -30,9 +31,9 @@
30
31
  "fork-ts-checker-webpack-plugin": "^9.1.0",
31
32
  "history": "^5.3.0",
32
33
  "husky": "^7.0.4",
33
- "jamespot-front-business": "^1.3.4",
34
- "jamespot-react-components": "^1.3.4",
35
- "jamespot-user-api": "^1.3.4",
34
+ "jamespot-front-business": "^1.3.6",
35
+ "jamespot-react-components": "^1.3.6",
36
+ "jamespot-user-api": "^1.3.6",
36
37
  "jest": "^30.2.0",
37
38
  "jest-environment-jsdom": "^30.2.0",
38
39
  "knip": "^5.67.1",
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[605],{605:(e,t,n)=>{n.d(t,{xI:()=>ke});var r={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function s(e){r=e}var l={exec:()=>null};function i(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(a.caret,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}var a={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,c=/(?:[*+-]|\d{1,9}[.)])/,h=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,p=i(h).replace(/bull/g,c).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),u=i(h).replace(/bull/g,c).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),g=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,k=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,d=i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",k).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),f=i(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,c).getRegex(),x="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",b=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,w=i("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",b).replace("tag",x).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m=i(g).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex(),y={blockquote:i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",m).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:d,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:o,html:w,lheading:p,list:f,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:m,table:l,text:/^[^\n]+/},$=i("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex(),R={...y,lheading:u,table:$,paragraph:i(g).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex()},S={...y,html:i("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",b).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:l,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:i(g).replace("hr",o).replace("heading"," *#{1,6} *[^\n]").replace("lheading",p).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},T=/^( {2,}|\\)\n(?!\s*$)/,z=/[\p{P}\p{S}]/u,A=/[\s\p{P}\p{S}]/u,_=/[^\s\p{P}\p{S}]/u,P=i(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,A).getRegex(),I=/(?!~)[\p{P}\p{S}]/u,C=i(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),L=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,B=i(L,"u").replace(/punct/g,z).getRegex(),q=i(L,"u").replace(/punct/g,I).getRegex(),E="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",v=i(E,"gu").replace(/notPunctSpace/g,_).replace(/punctSpace/g,A).replace(/punct/g,z).getRegex(),Z=i(E,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,I).getRegex(),D=i("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_).replace(/punctSpace/g,A).replace(/punct/g,z).getRegex(),M=i(/\\(punct)/,"gu").replace(/punct/g,z).getRegex(),Q=i(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),H=i(b).replace("(?:--\x3e|$)","--\x3e").getRegex(),N=i("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",H).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),O=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,j=i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",O).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),G=i(/^!?\[(label)\]\[(ref)\]/).replace("label",O).replace("ref",k).getRegex(),F=i(/^!?\[(ref)\](?:\[\])?/).replace("ref",k).getRegex(),W=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:l,anyPunctuation:M,autolink:Q,blockSkip:C,br:T,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:l,emStrongLDelim:B,emStrongRDelimAst:v,emStrongRDelimUnd:D,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:j,nolink:F,punctuation:P,reflink:G,reflinkSearch:i("reflink|nolink(?!\\()","g").replace("reflink",G).replace("nolink",F).getRegex(),tag:N,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:l},U={...X,link:i(/^!?\[(label)\]\((.*?)\)/).replace("label",O).getRegex(),reflink:i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",O).getRegex()},J={...X,emStrongRDelimAst:Z,emStrongLDelim:q,url:i(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",W).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:i(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",W).getRegex()},K={...J,br:i(T).replace("{2,}","*").getRegex(),text:i(J.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},V={normal:y,gfm:R,pedantic:S},Y={normal:X,gfm:J,breaks:K,pedantic:U},ee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},te=e=>ee[e];function ne(e,t){if(t){if(a.escapeTest.test(e))return e.replace(a.escapeReplace,te)}else if(a.escapeTestNoEncode.test(e))return e.replace(a.escapeReplaceNoEncode,te);return e}function re(e){try{e=encodeURI(e).replace(a.percentDecode,"%")}catch{return null}return e}function se(e,t){let n=e.replace(a.findPipe,(e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"}).split(a.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(a.slashPipe,"|");return n}function le(e,t,n){let r=e.length;if(0===r)return"";let s=0;for(;s<r;){let l=e.charAt(r-s-1);if(l!==t||n){if(l===t||!n)break;s++}else s++}return e.slice(0,r-s)}function ie(e,t,n,r,s){let l=t.href,i=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:l,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,o}var ae=class{options;rules;lexer;constructor(e){this.options=e||r}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:le(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let s=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=s.length?e.slice(s.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=le(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:le(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=le(t[0],"\n").split("\n"),n="",r="",s=[];for(;e.length>0;){let t,l=!1,i=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))i.push(e[t]),l=!0;else{if(l)break;i.push(e[t])}e=e.slice(t);let a=i.join("\n"),o=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${o}`:o;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,s,!0),this.lexer.state.top=c,0===e.length)break;let h=s.at(-1);if("code"===h?.type)break;if("blockquote"===h?.type){let t=h,l=t.raw+"\n"+e.join("\n"),i=this.blockquote(l);s[s.length-1]=i,n=n.substring(0,n.length-t.raw.length)+i.raw,r=r.substring(0,r.length-t.text.length)+i.text;break}if("list"===h?.type){let t=h,l=t.raw+"\n"+e.join("\n"),i=this.list(l);s[s.length-1]=i,n=n.substring(0,n.length-h.raw.length)+i.raw,r=r.substring(0,r.length-t.raw.length)+i.raw,e=l.substring(s.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let l=this.rules.other.listItemRegex(n),i=!1;for(;e;){let n=!1,r="",a="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let o=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],h=!o.trim(),p=0;if(this.options.pedantic?(p=2,a=o.trimStart()):h?p=t[1].length+1:(p=t[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,a=o.slice(p),p+=t[1].length),h&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),s=this.rules.other.fencesBeginRegex(p),l=this.rules.other.headingBeginRegex(p),i=this.rules.other.htmlBeginRegex(p);for(;e;){let u,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),u=c):u=c.replace(this.rules.other.tabCharGlobal," "),s.test(c)||l.test(c)||i.test(c)||t.test(c)||n.test(c))break;if(u.search(this.rules.other.nonSpaceChar)>=p||!c.trim())a+="\n"+u.slice(p);else{if(h||o.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||s.test(o)||l.test(o)||n.test(o))break;a+="\n"+c}!h&&!c.trim()&&(h=!0),r+=g+"\n",e=e.substring(g.length+1),o=u.slice(p)}}s.loose||(i?s.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(i=!0));let u,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(a),g&&(u="[ ] "!==g[0],a=a.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:r,task:!!g,checked:u,loose:!1,text:a,tokens:[]}),s.raw+=r}let a=s.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){let t=s.items[e].tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));s.loose=n}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=se(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?l.align.push("right"):this.rules.other.tableAlignCenter.test(e)?l.align.push("center"):this.rules.other.tableAlignLeft.test(e)?l.align.push("left"):l.align.push(null);for(let e=0;e<n.length;e++)l.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:l.align[e]});for(let e of s)l.rows.push(se(e,l.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:l.align[t]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=le(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ie(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ie(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,s,l=[...r[0]].length-1,i=l,a=0,o="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+l);null!=(r=o.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(s=[...n].length,r[3]||r[4]){i+=s;continue}if((r[5]||r[6])&&l%3&&!((l+s)%3)){a+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+a);let t=[...r[0]][0].length,o=e.slice(0,l+r.index+t+s);if(Math.min(l,s)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let c=o.slice(2,-2);return{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},oe=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:a,block:V.normal,inline:Y.normal};this.options.pedantic?(t.block=V.pedantic,t.inline=Y.pedantic):this.options.gfm&&(t.block=V.gfm,this.options.breaks?t.inline=Y.breaks:t.inline=Y.gfm),this.tokenizer.rules=t}static get rules(){return{block:V,inline:Y}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(a.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(a.tabCharGlobal," ").replace(a.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let l=t.at(-1);n&&"paragraph"===l?.type?(l.raw+=(l.raw.endsWith("\n")?"":"\n")+r.raw,l.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(r),n=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,l="";for(;e;){let r;if(s||(l=""),s=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,l)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(l=r.raw.slice(-1)),s=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},ce=class{options;parser;constructor(e){this.options=e||r}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(a.notSpaceStart)?.[0],s=e.replace(a.endingNewline,"")+"\n";return r?'<pre><code class="language-'+ne(r)+'">'+(n?s:ne(s,!0))+"</code></pre>\n":"<pre><code>"+(n?s:ne(s,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+s+">\n"}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+ne(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let s=e.rows[t];n="";for(let e=0;e<s.length;e++)n+=this.tablecell(s[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ne(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),s=re(e);if(null===s)return r;let l='<a href="'+(e=s)+'"';return t&&(l+=' title="'+ne(t)+'"'),l+=">"+r+"</a>",l}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=re(e);if(null===s)return ne(n);let l=`<img src="${e=s}" alt="${n}"`;return t&&(l+=` title="${ne(t)}"`),l+=">",l}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ne(e.text)}},he=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},pe=class e{options;renderer;textRenderer;constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new he}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let e=s,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){n+=t||"";continue}}let l=s;switch(l.type){case"space":n+=this.renderer.space(l);continue;case"hr":n+=this.renderer.hr(l);continue;case"heading":n+=this.renderer.heading(l);continue;case"code":n+=this.renderer.code(l);continue;case"table":n+=this.renderer.table(l);continue;case"blockquote":n+=this.renderer.blockquote(l);continue;case"list":n+=this.renderer.list(l);continue;case"html":n+=this.renderer.html(l);continue;case"def":n+=this.renderer.def(l);continue;case"paragraph":n+=this.renderer.paragraph(l);continue;case"text":{let s=l,i=this.renderer.text(s);for(;r+1<e.length&&"text"===e[r+1].type;)s=e[++r],i+="\n"+this.renderer.text(s);n+=t?this.renderer.paragraph({type:"paragraph",raw:i,text:i,tokens:[{type:"text",raw:i,text:i,escaped:!0}]}):i;continue}default:{let e='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}let l=s;switch(l.type){case"escape":case"text":n+=t.text(l);break;case"html":n+=t.html(l);break;case"link":n+=t.link(l);break;case"image":n+=t.image(l);break;case"strong":n+=t.strong(l);break;case"em":n+=t.em(l);break;case"codespan":n+=t.codespan(l);break;case"br":n+=t.br(l);break;case"del":n+=t.del(l);break;default:{let e='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},ue=class{options;block;constructor(e){this.options=e||r}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?oe.lex:oe.lexInline}provideParser(){return this.block?pe.parse:pe.parseInline}},ge=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=pe;Renderer=ce;TextRenderer=he;Lexer=oe;Tokenizer=ae;Hooks=ue;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ce(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,s=e.renderer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ae(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,s=e.tokenizer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ue;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,s=e.hooks[r],l=t[r];ue.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&ue.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await s.call(t,e);return l.call(t,n)})();let r=s.call(t,e);return l.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await s.apply(t,e);return!1===n&&(n=await l.apply(t,e)),n})();let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return oe.lex(e,t??this.defaults)}parser(e,t){return pe.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},l=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===r.async)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(t):t,r=await(s.hooks?await s.hooks.provideLexer():e?oe.lex:oe.lexInline)(n,s),l=s.hooks?await s.hooks.processAllTokens(r):r;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let i=await(s.hooks?await s.hooks.provideParser():e?pe.parse:pe.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(i):i})().catch(l);try{s.hooks&&(t=s.hooks.preprocess(t));let n=(s.hooks?s.hooks.provideLexer():e?oe.lex:oe.lexInline)(t,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let r=(s.hooks?s.hooks.provideParser():e?pe.parse:pe.parseInline)(n,s);return s.hooks&&(r=s.hooks.postprocess(r)),r}catch(e){return l(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+ne(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ke(e,t){return ge.parse(e,t)}ke.options=ke.setOptions=function(e){return ge.setOptions(e),ke.defaults=ge.defaults,s(ke.defaults),ke},ke.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},ke.defaults=r,ke.use=function(...e){return ge.use(...e),ke.defaults=ge.defaults,s(ke.defaults),ke},ke.walkTokens=function(e,t){return ge.walkTokens(e,t)},ke.parseInline=ge.parseInline,ke.Parser=pe,ke.parser=pe.parse,ke.Renderer=ce,ke.TextRenderer=he,ke.Lexer=oe,ke.lexer=oe.lex,ke.Tokenizer=ae,ke.Hooks=ue,ke.parse=ke,ke.options,ke.setOptions,ke.use,ke.walkTokens,ke.parseInline,pe.parse,oe.lex}}]);
2
- //# sourceMappingURL=605.f594e89c1007934615b9.chunk.js.map