@digi-frontend/dgate-api-documentation 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_modules/dom-serializer/lib/foreignNames.js +2 -0
- package/dist/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
- package/dist/node_modules/dom-serializer/lib/index.js +2 -0
- package/dist/node_modules/dom-serializer/lib/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/index.js +2 -0
- package/dist/node_modules/domhandler/lib/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/node.js +2 -0
- package/dist/node_modules/domhandler/lib/node.js.map +1 -0
- package/dist/node_modules/domutils/lib/feeds.js +2 -0
- package/dist/node_modules/domutils/lib/feeds.js.map +1 -0
- package/dist/node_modules/domutils/lib/helpers.js +2 -0
- package/dist/node_modules/domutils/lib/helpers.js.map +1 -0
- package/dist/node_modules/domutils/lib/index.js +2 -0
- package/dist/node_modules/domutils/lib/index.js.map +1 -0
- package/dist/node_modules/domutils/lib/legacy.js +2 -0
- package/dist/node_modules/domutils/lib/legacy.js.map +1 -0
- package/dist/node_modules/domutils/lib/manipulation.js +2 -0
- package/dist/node_modules/domutils/lib/manipulation.js.map +1 -0
- package/dist/node_modules/domutils/lib/querying.js +2 -0
- package/dist/node_modules/domutils/lib/querying.js.map +1 -0
- package/dist/node_modules/domutils/lib/stringify.js +2 -0
- package/dist/node_modules/domutils/lib/stringify.js.map +1 -0
- package/dist/node_modules/domutils/lib/traversal.js +2 -0
- package/dist/node_modules/domutils/lib/traversal.js.map +1 -0
- package/dist/node_modules/entities/lib/decode.js +2 -0
- package/dist/node_modules/entities/lib/decode.js.map +1 -0
- package/dist/node_modules/entities/lib/decode_codepoint.js +2 -0
- package/dist/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/dist/node_modules/entities/lib/encode.js +2 -0
- package/dist/node_modules/entities/lib/encode.js.map +1 -0
- package/dist/node_modules/entities/lib/escape.js +2 -0
- package/dist/node_modules/entities/lib/escape.js.map +1 -0
- package/dist/node_modules/entities/lib/generated/decode-data-html.js +2 -0
- package/dist/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/dist/node_modules/entities/lib/generated/decode-data-xml.js +2 -0
- package/dist/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/dist/node_modules/entities/lib/generated/encode-html.js +2 -0
- package/dist/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/dist/node_modules/entities/lib/index.js +2 -0
- package/dist/node_modules/entities/lib/index.js.map +1 -0
- package/dist/node_modules/html-dom-parser/lib/server/html-to-dom.js +1 -1
- package/dist/node_modules/html-dom-parser/lib/server/html-to-dom.js.map +1 -1
- package/dist/node_modules/html-react-parser/lib/index.js +1 -1
- package/dist/node_modules/html-react-parser/lib/index.js.map +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/index.js +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/index.js.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/src/components/InfoForm/InfoForm.js +1 -1
- package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
- package/dist/src/helpers/layout.helper.js +1 -1
- package/dist/src/helpers/layout.helper.js.map +1 -1
- package/dist/src/layout/layout.js +1 -1
- package/dist/src/layout/layout.js.map +1 -1
- package/dist/src/layout/layout.module.css.js +1 -1
- package/dist/src/validator/form.scheme.js +1 -1
- package/dist/src/validator/form.scheme.js.map +1 -1
- package/dist/styles.css +310 -304
- package/package.json +1 -1
- package/src/components/InfoForm/InfoForm.tsx +34 -21
- package/src/components/LivePreview/LivePreview.module.scss +6 -0
- package/src/components/MethodAccordion/MethodAccordion.tsx +3 -1
- package/src/helpers/layout.helper.ts +5 -0
- package/src/layout/layout.module.css +2 -1
- package/src/layout/layout.tsx +9 -8
- package/src/validator/form.scheme.ts +1 -1
- package/dist/_virtual/index20.js +0 -2
- package/dist/_virtual/index20.js.map +0 -1
- package/dist/_virtual/index21.js +0 -2
- package/dist/_virtual/index21.js.map +0 -1
- package/dist/_virtual/node2.js +0 -2
- package/dist/_virtual/node2.js.map +0 -1
- package/dist/_virtual/node3.js +0 -2
- package/dist/_virtual/node3.js.map +0 -1
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js +0 -2
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js.map +0 -1
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js +0 -2
- package/dist/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js.map +0 -1
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/index.js +0 -2
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/index.js.map +0 -1
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/node.js +0 -2
- package/dist/node_modules/html-react-parser/node_modules/domhandler/lib/node.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/encode.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/escape.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/index.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities/lib/index.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/index.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/index.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/node.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domhandler/lib/node.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/index.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/index.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/querying.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js.map +0 -1
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +0 -2
- package/dist/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js.map +0 -1
- package/dist/src/assets/icons/CheckMarkSquare.svg.js +0 -2
- package/dist/src/assets/icons/CheckMarkSquare.svg.js.map +0 -1
- package/dist/src/assets/icons/CloseIcon.svg.js +0 -2
- package/dist/src/assets/icons/CloseIcon.svg.js.map +0 -1
- package/dist/src/assets/icons/UpArrow.svg.js +0 -2
- package/dist/src/assets/icons/UpArrow.svg.js.map +0 -1
- package/dist/src/components/Chips/Chips.js +0 -2
- package/dist/src/components/Chips/Chips.js.map +0 -1
- package/dist/types/types/index.d.ts +0 -18
|
@@ -182,24 +182,27 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
|
|
|
182
182
|
),
|
|
183
183
|
externalDocs: (
|
|
184
184
|
<div className={styles.paramDescContainer}>
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
185
|
+
{values.tags[index].externalDocs?.description && values.tags[index].externalDocs?.url && (
|
|
186
|
+
<a
|
|
187
|
+
className={styles.externalDocsLink}
|
|
188
|
+
href={values.tags[index].externalDocs?.url}
|
|
189
|
+
target="_blank"
|
|
190
|
+
style={
|
|
191
|
+
!values.tags[index].externalDocs?.description
|
|
192
|
+
? { textDecoration: 'none', pointerEvents: 'none' }
|
|
193
|
+
: {}
|
|
194
|
+
}
|
|
195
|
+
>
|
|
196
|
+
{values.tags[index].externalDocs?.description
|
|
197
|
+
? values.tags[index].externalDocs?.description?.substring(0, 12)
|
|
198
|
+
: readOnly && '-'}
|
|
199
|
+
{values.tags[index].externalDocs?.description &&
|
|
200
|
+
values.tags[index].externalDocs?.description?.length > 12
|
|
201
|
+
? '...'
|
|
202
|
+
: ''}
|
|
203
|
+
</a>
|
|
204
|
+
)}
|
|
205
|
+
|
|
203
206
|
<Tooltip
|
|
204
207
|
arrowWithBorder
|
|
205
208
|
placement="bottom-end"
|
|
@@ -258,7 +261,15 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
|
|
|
258
261
|
setURL('')
|
|
259
262
|
externalTooltipRefs[index]?.hide()
|
|
260
263
|
}}
|
|
261
|
-
disabled={
|
|
264
|
+
disabled={
|
|
265
|
+
!(
|
|
266
|
+
(values.tags[index].externalDocs?.description &&
|
|
267
|
+
values.tags[index].externalDocs?.url &&
|
|
268
|
+
!description?.trim() &&
|
|
269
|
+
!url?.trim()) ||
|
|
270
|
+
(description?.trim() && url?.trim() && regex.urlRegex.test(url))
|
|
271
|
+
)
|
|
272
|
+
}
|
|
262
273
|
>
|
|
263
274
|
Apply
|
|
264
275
|
</Button>
|
|
@@ -291,7 +302,9 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
|
|
|
291
302
|
}}
|
|
292
303
|
>
|
|
293
304
|
{readOnly ||
|
|
294
|
-
(
|
|
305
|
+
(values.tags[index]?.externalDocs &&
|
|
306
|
+
(values.tags[index]?.externalDocs?.url ||
|
|
307
|
+
values.tags[index].externalDocs?.description))
|
|
295
308
|
? 'View '
|
|
296
309
|
: 'Add '}{' '}
|
|
297
310
|
External Docs Link
|
|
@@ -358,7 +371,7 @@ const InfoForm = ({ readOnly }: { readOnly?: boolean }) => {
|
|
|
358
371
|
onClear={() => {
|
|
359
372
|
setFieldValue('info.description', '')
|
|
360
373
|
}}
|
|
361
|
-
|
|
374
|
+
errorMsg={errors?.info?.description}
|
|
362
375
|
/>
|
|
363
376
|
<div className={styles.paramsTable}>
|
|
364
377
|
<TagsTable
|
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
align-items: center;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
gap: 1.25rem;
|
|
6
9
|
|
|
7
10
|
p.apiName {
|
|
8
11
|
font-size: 40px;
|
|
9
12
|
line-height: 30px;
|
|
10
13
|
font-weight: 500;
|
|
14
|
+
word-wrap: break-word;
|
|
15
|
+
overflow-wrap: break-word;
|
|
16
|
+
word-break: break-all;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
.livePreviewChip {
|
|
@@ -149,6 +149,7 @@ const MethodsAccordion = ({
|
|
|
149
149
|
placeholder="Describe parameter..."
|
|
150
150
|
value={item.description}
|
|
151
151
|
disabled={readOnly}
|
|
152
|
+
maxLength={120}
|
|
152
153
|
onChange={(value) => {
|
|
153
154
|
if (value === '' || regex.ASCII.test(value))
|
|
154
155
|
onTableChange('description', value, index)
|
|
@@ -247,7 +248,7 @@ const MethodsAccordion = ({
|
|
|
247
248
|
|
|
248
249
|
useEffect(() => {
|
|
249
250
|
// prepare tags selection list
|
|
250
|
-
if (method?.tags.length || tags
|
|
251
|
+
if (method?.tags.length || tags?.length) {
|
|
251
252
|
const convertedStringArray = (method?.tags || [])?.map((item) => ({
|
|
252
253
|
label: capitalize(item),
|
|
253
254
|
value: item,
|
|
@@ -322,6 +323,7 @@ const MethodsAccordion = ({
|
|
|
322
323
|
className={styles.methodDesc}
|
|
323
324
|
label="Description"
|
|
324
325
|
placeholder="Describe the method's purpose and functionality..."
|
|
326
|
+
maxLength={120}
|
|
325
327
|
value={method?.description}
|
|
326
328
|
onChange={(value) => {
|
|
327
329
|
if (value === '' || regex.ASCII.test(value)) setFieldValue('description', value)
|
|
@@ -22,6 +22,10 @@ export const transformOpenApiObject = (openApiJson: OpenAPIFile): TransformedOpe
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
if (!openApiJson.tags) {
|
|
26
|
+
openApiJson.tags = []
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
return {
|
|
26
30
|
...openApiJson,
|
|
27
31
|
paths: transformPathsToArray(openApiJson.paths),
|
|
@@ -105,6 +109,7 @@ export const transformPathsToArray = (paths: OpenAPIFile['paths']): TransformedP
|
|
|
105
109
|
return obj
|
|
106
110
|
}),
|
|
107
111
|
}))
|
|
112
|
+
|
|
108
113
|
return transformedPaths
|
|
109
114
|
}
|
|
110
115
|
|
package/src/layout/layout.tsx
CHANGED
|
@@ -37,18 +37,19 @@ const Layout = ({ openApiJson, handleSave, setIsFormDirty }: ILayoutProps): JSX.
|
|
|
37
37
|
validateForm(values)
|
|
38
38
|
},
|
|
39
39
|
})
|
|
40
|
+
const { dirty, isValid, isSubmitting, values, setFieldValue, handleSubmit } = formik
|
|
40
41
|
const [isPublishDialogOpen, setIsPublishDialogOpen] = useState(false)
|
|
41
42
|
const [openMethodIndex, setOpenMethodIndex] = useState<number | null>(null)
|
|
42
43
|
|
|
43
44
|
useEffect(() => {
|
|
44
45
|
if (setIsFormDirty) {
|
|
45
|
-
setIsFormDirty(
|
|
46
|
+
setIsFormDirty(dirty)
|
|
46
47
|
}
|
|
47
|
-
}, [
|
|
48
|
+
}, [dirty])
|
|
48
49
|
|
|
49
50
|
return (
|
|
50
51
|
<div className={styles.docsLayout}>
|
|
51
|
-
{
|
|
52
|
+
{dirty && (
|
|
52
53
|
<Alert className={styles.apiDocAlert} color="warning" severity="warning">
|
|
53
54
|
There are changes you made may not be saved
|
|
54
55
|
</Alert>
|
|
@@ -68,7 +69,7 @@ const Layout = ({ openApiJson, handleSave, setIsFormDirty }: ILayoutProps): JSX.
|
|
|
68
69
|
variant="contained"
|
|
69
70
|
color="primary"
|
|
70
71
|
onClick={() => setIsPublishDialogOpen(true)}
|
|
71
|
-
disabled={!
|
|
72
|
+
disabled={!isValid || isSubmitting || !dirty}
|
|
72
73
|
>
|
|
73
74
|
Save
|
|
74
75
|
</Button>
|
|
@@ -80,7 +81,7 @@ const Layout = ({ openApiJson, handleSave, setIsFormDirty }: ILayoutProps): JSX.
|
|
|
80
81
|
</FormikProvider>
|
|
81
82
|
<SectionHead className={styles.editorSectionHead} text="Endpoints" />
|
|
82
83
|
<FormikProvider value={formik}>
|
|
83
|
-
{
|
|
84
|
+
{values.paths.map((path, pathIndex) => (
|
|
84
85
|
<>
|
|
85
86
|
{path.methods
|
|
86
87
|
.sort(
|
|
@@ -88,12 +89,12 @@ const Layout = ({ openApiJson, handleSave, setIsFormDirty }: ILayoutProps): JSX.
|
|
|
88
89
|
)
|
|
89
90
|
.map((method, methodIndex) => (
|
|
90
91
|
<MethodsAccordion
|
|
91
|
-
tags={
|
|
92
|
+
tags={values.tags}
|
|
92
93
|
method={method}
|
|
93
94
|
path={path.path}
|
|
94
95
|
setFieldValue={(key, value) => {
|
|
95
96
|
const h = `paths[${pathIndex}].methods[${methodIndex}].${key}`
|
|
96
|
-
|
|
97
|
+
setFieldValue(h, value)
|
|
97
98
|
}}
|
|
98
99
|
isOpen={openMethodIndex === methodIndex}
|
|
99
100
|
setIsOpen={(open) => setOpenMethodIndex(open ? methodIndex : null)}
|
|
@@ -127,7 +128,7 @@ const Layout = ({ openApiJson, handleSave, setIsFormDirty }: ILayoutProps): JSX.
|
|
|
127
128
|
}
|
|
128
129
|
onSubmit={{
|
|
129
130
|
onClick: () => {
|
|
130
|
-
|
|
131
|
+
handleSubmit()
|
|
131
132
|
setIsPublishDialogOpen(false)
|
|
132
133
|
},
|
|
133
134
|
text: 'Publish',
|
|
@@ -4,7 +4,7 @@ export const schemaValidation = yup.object({
|
|
|
4
4
|
info: yup
|
|
5
5
|
.object({
|
|
6
6
|
title: yup.string().trim().required('API Name is required.'),
|
|
7
|
-
description: yup.string().trim().required(),
|
|
7
|
+
description: yup.string().trim().required('API Description is required.'),
|
|
8
8
|
version: yup.string().required('API Version is required'),
|
|
9
9
|
})
|
|
10
10
|
.required(),
|
package/dist/_virtual/index20.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index20.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/_virtual/index21.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index21.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/_virtual/node2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/_virtual/node3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__exports as t}from"../../../../../_virtual/index15.js";import{__require as e}from"../../../../domelementtype/lib/index.js";import{__require as n}from"./node.js";var o;function i(){return o||(o=1,function(o){var i=t&&t.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),s=t&&t.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(o,"__esModule",{value:!0}),o.DomHandler=void 0;var r=e(),a=n();s(n(),o);var d={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function t(t,e,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof e&&(n=e,e=d),"object"==typeof t&&(e=t,t=void 0),this.callback=null!=t?t:null,this.options=null!=e?e:d,this.elementCB=null!=n?n:null}return t.prototype.onparserinit=function(t){this.parser=t},t.prototype.onreset=function(){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},t.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},t.prototype.onerror=function(t){this.handleCallback(t)},t.prototype.onclosetag=function(){this.lastNode=null;var t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)},t.prototype.onopentag=function(t,e){var n=this.options.xmlMode?r.ElementType.Tag:void 0,o=new a.Element(t,e,void 0,n);this.addNode(o),this.tagStack.push(o)},t.prototype.ontext=function(t){var e=this.lastNode;if(e&&e.type===r.ElementType.Text)e.data+=t,this.options.withEndIndices&&(e.endIndex=this.parser.endIndex);else{var n=new a.Text(t);this.addNode(n),this.lastNode=n}},t.prototype.oncomment=function(t){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment)this.lastNode.data+=t;else{var e=new a.Comment(t);this.addNode(e),this.lastNode=e}},t.prototype.oncommentend=function(){this.lastNode=null},t.prototype.oncdatastart=function(){var t=new a.Text(""),e=new a.CDATA([t]);this.addNode(e),t.parent=e,this.lastNode=t},t.prototype.oncdataend=function(){this.lastNode=null},t.prototype.onprocessinginstruction=function(t,e){var n=new a.ProcessingInstruction(t,e);this.addNode(n)},t.prototype.handleCallback=function(t){if("function"==typeof this.callback)this.callback(t,this.dom);else if(t)throw t},t.prototype.addNode=function(t){var e=this.tagStack[this.tagStack.length-1],n=e.children[e.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),e.children.push(t),n&&(t.prev=n,n.next=t),t.parent=e,this.lastNode=null},t}();o.DomHandler=l,o.default=l}(t)),t}export{i as __require};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/html-dom-parser/node_modules/domhandler/lib/index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DomHandler = void 0;\nvar domelementtype_1 = require(\"domelementtype\");\nvar node_js_1 = require(\"./node.js\");\n__exportStar(require(\"./node.js\"), exports);\n// Default options\nvar defaultOpts = {\n withStartIndices: false,\n withEndIndices: false,\n xmlMode: false,\n};\nvar DomHandler = /** @class */ (function () {\n /**\n * @param callback Called once parsing has completed.\n * @param options Settings for the handler.\n * @param elementCB Callback whenever a tag is closed.\n */\n function DomHandler(callback, options, elementCB) {\n /** The elements of the DOM */\n this.dom = [];\n /** The root element for the DOM */\n this.root = new node_js_1.Document(this.dom);\n /** Indicated whether parsing has been completed. */\n this.done = false;\n /** Stack of open tags. */\n this.tagStack = [this.root];\n /** A data node that is still being written to. */\n this.lastNode = null;\n /** Reference to the parser instance. Used for location information. */\n this.parser = null;\n // Make it possible to skip arguments, for backwards-compatibility\n if (typeof options === \"function\") {\n elementCB = options;\n options = defaultOpts;\n }\n if (typeof callback === \"object\") {\n options = callback;\n callback = undefined;\n }\n this.callback = callback !== null && callback !== void 0 ? callback : null;\n this.options = options !== null && options !== void 0 ? options : defaultOpts;\n this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;\n }\n DomHandler.prototype.onparserinit = function (parser) {\n this.parser = parser;\n };\n // Resets the handler back to starting state\n DomHandler.prototype.onreset = function () {\n this.dom = [];\n this.root = new node_js_1.Document(this.dom);\n this.done = false;\n this.tagStack = [this.root];\n this.lastNode = null;\n this.parser = null;\n };\n // Signals the handler that parsing is done\n DomHandler.prototype.onend = function () {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n };\n DomHandler.prototype.onerror = function (error) {\n this.handleCallback(error);\n };\n DomHandler.prototype.onclosetag = function () {\n this.lastNode = null;\n var elem = this.tagStack.pop();\n if (this.options.withEndIndices) {\n elem.endIndex = this.parser.endIndex;\n }\n if (this.elementCB)\n this.elementCB(elem);\n };\n DomHandler.prototype.onopentag = function (name, attribs) {\n var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;\n var element = new node_js_1.Element(name, attribs, undefined, type);\n this.addNode(element);\n this.tagStack.push(element);\n };\n DomHandler.prototype.ontext = function (data) {\n var lastNode = this.lastNode;\n if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {\n lastNode.data += data;\n if (this.options.withEndIndices) {\n lastNode.endIndex = this.parser.endIndex;\n }\n }\n else {\n var node = new node_js_1.Text(data);\n this.addNode(node);\n this.lastNode = node;\n }\n };\n DomHandler.prototype.oncomment = function (data) {\n if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {\n this.lastNode.data += data;\n return;\n }\n var node = new node_js_1.Comment(data);\n this.addNode(node);\n this.lastNode = node;\n };\n DomHandler.prototype.oncommentend = function () {\n this.lastNode = null;\n };\n DomHandler.prototype.oncdatastart = function () {\n var text = new node_js_1.Text(\"\");\n var node = new node_js_1.CDATA([text]);\n this.addNode(node);\n text.parent = node;\n this.lastNode = text;\n };\n DomHandler.prototype.oncdataend = function () {\n this.lastNode = null;\n };\n DomHandler.prototype.onprocessinginstruction = function (name, data) {\n var node = new node_js_1.ProcessingInstruction(name, data);\n this.addNode(node);\n };\n DomHandler.prototype.handleCallback = function (error) {\n if (typeof this.callback === \"function\") {\n this.callback(error, this.dom);\n }\n else if (error) {\n throw error;\n }\n };\n DomHandler.prototype.addNode = function (node) {\n var parent = this.tagStack[this.tagStack.length - 1];\n var previousSibling = parent.children[parent.children.length - 1];\n if (this.options.withStartIndices) {\n node.startIndex = this.parser.startIndex;\n }\n if (this.options.withEndIndices) {\n node.endIndex = this.parser.endIndex;\n }\n parent.children.push(node);\n if (previousSibling) {\n node.prev = previousSibling;\n previousSibling.next = node;\n }\n node.parent = parent;\n this.lastNode = null;\n };\n return DomHandler;\n}());\nexports.DomHandler = DomHandler;\nexports.default = DomHandler;\n"],"names":["__createBinding","this","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__exportStar","exports","p","prototype","hasOwnProperty","call","value","DomHandler","domelementtype_1","require$$0","node_js_1","require$$1","defaultOpts","withStartIndices","withEndIndices","xmlMode","callback","options","elementCB","dom","root","Document","done","tagStack","lastNode","parser","onparserinit","onreset","onend","handleCallback","onerror","error","onclosetag","elem","pop","endIndex","onopentag","name","attribs","type","ElementType","Tag","element","Element","addNode","push","ontext","data","Text","node","oncomment","Comment","oncommentend","oncdatastart","text","CDATA","parent","oncdataend","onprocessinginstruction","ProcessingInstruction","length","previousSibling","children","startIndex","prev","next","default"],"mappings":"uNACA,IAAIA,EAAmBC,GAAQA,EAAKD,kBAAqBE,OAAOC,OAAM,SAAaC,EAAGC,EAAGC,EAAGC,QAC7EC,IAAPD,IAAkBA,EAAKD,GAC3B,IAAIG,EAAOP,OAAOQ,yBAAyBL,EAAGC,GACzCG,KAAS,QAASA,GAAQJ,EAAEM,WAAaF,EAAKG,UAAYH,EAAKI,gBAClEJ,EAAO,CAAEK,YAAY,EAAMC,IAAK,WAAa,OAAOV,EAAEC,EAAG,IAE3DJ,OA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AAUkD,aAAe,WAChC,IAAIC,EAAO,IAAI5C,EAAUsC,KAAK,IAC1BC,EAAO,IAAIvC,EAAU6C,MAAM,CAACD,IAChCtE,KAAK4D,QAAQK,GACbK,EAAKE,OAASP,EACdjE,KAAKwC,SAAW8B,GAEpB/C,EAAWJ,UAAUsD,WAAa,WAC9BzE,KAAKwC,SAAW,MAEpBjB,EAAWJ,UAAUuD,wBAA0B,SAAUrB,EAAMU,GAC3D,IAAIE,EAAO,IAAIvC,EAAUiD,sBAAsBtB,EAAMU,GACrD/D,KAAK4D,QAAQK,IAEjB1C,EAAWJ,UAAU0B,eAAiB,SAAUE,GAC5C,GAA6B,mBAAlB/C,KAAKgC,SACZhC,KAAKgC,SAASe,EAAO/C,KAAKmC,UAEzB,GAAIY,EACL,MAAMA,GAGdxB,EAAWJ,UAAUyC,QAAU,SAAUK,GACrC,IAAIO,EAASxE,KAAKuC,SAASvC,KAAKuC,SAASqC,OAAS,GAC9CC,EAAkBL,EAAOM,SAASN,EAAOM,SAASF,OAAS,GAC3D5E,KAAKiC,QAAQJ,mBACboC,EAAKc,WAAa/E,KAAKyC,OAAOsC,YAE9B/E,KAAKiC,QAAQH,iBACbmC,EAAKd,SAAWnD,KAAKyC,OAAOU,UAEhCqB,EAAOM,SAASjB,KAAKI,GACjBY,IACAZ,EAAKe,KAAOH,EACZA,EAAgBI,KAAOhB,GAE3BA,EAAKO,OAASA,EACdxE,KAAKwC,SAAW,MAEbjB,CACV,CAxIa,GAyIdN,EAAAM,WAAqBA,EACrBN,EAAAiE,QAAkB3D"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__exports as e}from"../../../../../_virtual/node2.js";import{__require as t}from"../../../../domelementtype/lib/index.js";var n;function r(){if(n)return e;n=1;var r,i=e&&e.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=e&&e.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var u=t(),a=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),O(this,e)},e}();e.Node=a;var c=function(e){function t(t){var n=e.call(this)||this;return n.data=t,n}return i(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(a);e.DataNode=c;var l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.Text,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(c);e.Text=l;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.Comment,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(c);e.Comment=p;var s=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=u.ElementType.Directive,r}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(c);e.ProcessingInstruction=s;var f=function(e){function t(t){var n=e.call(this)||this;return n.children=t,n}return i(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);e.NodeWithChildren=f;var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.CDATA,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(f);e.CDATA=d;var y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.Root,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(f);e.Document=y;var m=function(e){function t(t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i="script"===t?u.ElementType.Script:"style"===t?u.ElementType.Style:u.ElementType.Tag);var o=e.call(this,r)||this;return o.name=t,o.attribs=n,o.type=i,o}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(f);function h(e){return(0,u.isTag)(e)}function b(e){return e.type===u.ElementType.CDATA}function v(e){return e.type===u.ElementType.Text}function g(e){return e.type===u.ElementType.Comment}function x(e){return e.type===u.ElementType.Directive}function T(e){return e.type===u.ElementType.Root}function O(e,t){var n;if(void 0===t&&(t=!1),v(e))n=new l(e.data);else if(g(e))n=new p(e.data);else if(h(e)){var r=t?P(e.children):[],i=new m(e.name,o({},e.attribs),r);r.forEach((function(e){return e.parent=i})),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=o({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=o({},e["x-attribsPrefix"])),n=i}else if(b(e)){r=t?P(e.children):[];var u=new d(r);r.forEach((function(e){return e.parent=u})),n=u}else if(T(e)){r=t?P(e.children):[];var a=new y(r);r.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!x(e))throw new Error("Not implemented yet: ".concat(e.type));var c=new s(e.name,e.data);null!=e["x-name"]&&(c["x-name"]=e["x-name"],c["x-publicId"]=e["x-publicId"],c["x-systemId"]=e["x-systemId"]),n=c}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function P(e){for(var t=e.map((function(e){return O(e,!0)})),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}return e.Element=m,e.isTag=h,e.isCDATA=b,e.isText=v,e.isComment=g,e.isDirective=x,e.isDocument=T,e.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},e.cloneNode=O,e}export{r as __require};
|
|
2
|
-
//# sourceMappingURL=node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sources":["../../../../../../node_modules/html-dom-parser/node_modules/domhandler/lib/node.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;\nvar domelementtype_1 = require(\"domelementtype\");\n/**\n * This object will be used as the prototype for Nodes when creating a\n * DOM-Level-1-compliant structure.\n */\nvar Node = /** @class */ (function () {\n function Node() {\n /** Parent of the node */\n this.parent = null;\n /** Previous sibling */\n this.prev = null;\n /** Next sibling */\n this.next = null;\n /** The start index of the node. Requires `withStartIndices` on the handler to be `true. */\n this.startIndex = null;\n /** The end index of the node. Requires `withEndIndices` on the handler to be `true. */\n this.endIndex = null;\n }\n Object.defineProperty(Node.prototype, \"parentNode\", {\n // Read-write aliases for properties\n /**\n * Same as {@link parent}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.parent;\n },\n set: function (parent) {\n this.parent = parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"previousSibling\", {\n /**\n * Same as {@link prev}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.prev;\n },\n set: function (prev) {\n this.prev = prev;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"nextSibling\", {\n /**\n * Same as {@link next}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.next;\n },\n set: function (next) {\n this.next = next;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clone this node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\n Node.prototype.cloneNode = function (recursive) {\n if (recursive === void 0) { recursive = false; }\n return cloneNode(this, recursive);\n };\n return Node;\n}());\nexports.Node = Node;\n/**\n * A node that contains some data.\n */\nvar DataNode = /** @class */ (function (_super) {\n __extends(DataNode, _super);\n /**\n * @param data The content of the data node\n */\n function DataNode(data) {\n var _this = _super.call(this) || this;\n _this.data = data;\n return _this;\n }\n Object.defineProperty(DataNode.prototype, \"nodeValue\", {\n /**\n * Same as {@link data}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.data;\n },\n set: function (data) {\n this.data = data;\n },\n enumerable: false,\n configurable: true\n });\n return DataNode;\n}(Node));\nexports.DataNode = DataNode;\n/**\n * Text within the document.\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n function Text() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Text;\n return _this;\n }\n Object.defineProperty(Text.prototype, \"nodeType\", {\n get: function () {\n return 3;\n },\n enumerable: false,\n configurable: true\n });\n return Text;\n}(DataNode));\nexports.Text = Text;\n/**\n * Comments within the document.\n */\nvar Comment = /** @class */ (function (_super) {\n __extends(Comment, _super);\n function Comment() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Comment;\n return _this;\n }\n Object.defineProperty(Comment.prototype, \"nodeType\", {\n get: function () {\n return 8;\n },\n enumerable: false,\n configurable: true\n });\n return Comment;\n}(DataNode));\nexports.Comment = Comment;\n/**\n * Processing instructions, including doc types.\n */\nvar ProcessingInstruction = /** @class */ (function (_super) {\n __extends(ProcessingInstruction, _super);\n function ProcessingInstruction(name, data) {\n var _this = _super.call(this, data) || this;\n _this.name = name;\n _this.type = domelementtype_1.ElementType.Directive;\n return _this;\n }\n Object.defineProperty(ProcessingInstruction.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n return ProcessingInstruction;\n}(DataNode));\nexports.ProcessingInstruction = ProcessingInstruction;\n/**\n * A `Node` that can have children.\n */\nvar NodeWithChildren = /** @class */ (function (_super) {\n __extends(NodeWithChildren, _super);\n /**\n * @param children Children of the node. Only certain node types can have children.\n */\n function NodeWithChildren(children) {\n var _this = _super.call(this) || this;\n _this.children = children;\n return _this;\n }\n Object.defineProperty(NodeWithChildren.prototype, \"firstChild\", {\n // Aliases\n /** First child of the node. */\n get: function () {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"lastChild\", {\n /** Last child of the node. */\n get: function () {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"childNodes\", {\n /**\n * Same as {@link children}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.children;\n },\n set: function (children) {\n this.children = children;\n },\n enumerable: false,\n configurable: true\n });\n return NodeWithChildren;\n}(Node));\nexports.NodeWithChildren = NodeWithChildren;\nvar CDATA = /** @class */ (function (_super) {\n __extends(CDATA, _super);\n function CDATA() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.CDATA;\n return _this;\n }\n Object.defineProperty(CDATA.prototype, \"nodeType\", {\n get: function () {\n return 4;\n },\n enumerable: false,\n configurable: true\n });\n return CDATA;\n}(NodeWithChildren));\nexports.CDATA = CDATA;\n/**\n * The root node of the document.\n */\nvar Document = /** @class */ (function (_super) {\n __extends(Document, _super);\n function Document() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Root;\n return _this;\n }\n Object.defineProperty(Document.prototype, \"nodeType\", {\n get: function () {\n return 9;\n },\n enumerable: false,\n configurable: true\n });\n return Document;\n}(NodeWithChildren));\nexports.Document = Document;\n/**\n * An element within the DOM.\n */\nvar Element = /** @class */ (function (_super) {\n __extends(Element, _super);\n /**\n * @param name Name of the tag, eg. `div`, `span`.\n * @param attribs Object mapping attribute names to attribute values.\n * @param children Children of the node.\n */\n function Element(name, attribs, children, type) {\n if (children === void 0) { children = []; }\n if (type === void 0) { type = name === \"script\"\n ? domelementtype_1.ElementType.Script\n : name === \"style\"\n ? domelementtype_1.ElementType.Style\n : domelementtype_1.ElementType.Tag; }\n var _this = _super.call(this, children) || this;\n _this.name = name;\n _this.attribs = attribs;\n _this.type = type;\n return _this;\n }\n Object.defineProperty(Element.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"tagName\", {\n // DOM Level 1 aliases\n /**\n * Same as {@link name}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.name;\n },\n set: function (name) {\n this.name = name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"attributes\", {\n get: function () {\n var _this = this;\n return Object.keys(this.attribs).map(function (name) {\n var _a, _b;\n return ({\n name: name,\n value: _this.attribs[name],\n namespace: (_a = _this[\"x-attribsNamespace\"]) === null || _a === void 0 ? void 0 : _a[name],\n prefix: (_b = _this[\"x-attribsPrefix\"]) === null || _b === void 0 ? void 0 : _b[name],\n });\n });\n },\n enumerable: false,\n configurable: true\n });\n return Element;\n}(NodeWithChildren));\nexports.Element = Element;\n/**\n * @param node Node to check.\n * @returns `true` if the node is a `Element`, `false` otherwise.\n */\nfunction isTag(node) {\n return (0, domelementtype_1.isTag)(node);\n}\nexports.isTag = isTag;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `CDATA`, `false` otherwise.\n */\nfunction isCDATA(node) {\n return node.type === domelementtype_1.ElementType.CDATA;\n}\nexports.isCDATA = isCDATA;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Text`, `false` otherwise.\n */\nfunction isText(node) {\n return node.type === domelementtype_1.ElementType.Text;\n}\nexports.isText = isText;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Comment`, `false` otherwise.\n */\nfunction isComment(node) {\n return node.type === domelementtype_1.ElementType.Comment;\n}\nexports.isComment = isComment;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDirective(node) {\n return node.type === domelementtype_1.ElementType.Directive;\n}\nexports.isDirective = isDirective;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDocument(node) {\n return node.type === domelementtype_1.ElementType.Root;\n}\nexports.isDocument = isDocument;\n/**\n * @param node Node to check.\n * @returns `true` if the node has children, `false` otherwise.\n */\nfunction hasChildren(node) {\n return Object.prototype.hasOwnProperty.call(node, \"children\");\n}\nexports.hasChildren = hasChildren;\n/**\n * Clone a node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\nfunction cloneNode(node, recursive) {\n if (recursive === void 0) { recursive = false; }\n var result;\n if (isText(node)) {\n result = new Text(node.data);\n }\n else if (isComment(node)) {\n result = new Comment(node.data);\n }\n else if (isTag(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_1 = new Element(node.name, __assign({}, node.attribs), children);\n children.forEach(function (child) { return (child.parent = clone_1); });\n if (node.namespace != null) {\n clone_1.namespace = node.namespace;\n }\n if (node[\"x-attribsNamespace\"]) {\n clone_1[\"x-attribsNamespace\"] = __assign({}, node[\"x-attribsNamespace\"]);\n }\n if (node[\"x-attribsPrefix\"]) {\n clone_1[\"x-attribsPrefix\"] = __assign({}, node[\"x-attribsPrefix\"]);\n }\n result = clone_1;\n }\n else if (isCDATA(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_2 = new CDATA(children);\n children.forEach(function (child) { return (child.parent = clone_2); });\n result = clone_2;\n }\n else if (isDocument(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_3 = new Document(children);\n children.forEach(function (child) { return (child.parent = clone_3); });\n if (node[\"x-mode\"]) {\n clone_3[\"x-mode\"] = node[\"x-mode\"];\n }\n result = clone_3;\n }\n else if (isDirective(node)) {\n var instruction = new ProcessingInstruction(node.name, node.data);\n if (node[\"x-name\"] != null) {\n instruction[\"x-name\"] = node[\"x-name\"];\n instruction[\"x-publicId\"] = node[\"x-publicId\"];\n instruction[\"x-systemId\"] = node[\"x-systemId\"];\n }\n result = instruction;\n }\n else {\n throw new Error(\"Not implemented yet: \".concat(node.type));\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n if (node.sourceCodeLocation != null) {\n result.sourceCodeLocation = node.sourceCodeLocation;\n }\n return result;\n}\nexports.cloneNode = cloneNode;\nfunction cloneChildren(childs) {\n var children = childs.map(function (child) { return cloneNode(child, true); });\n for (var i = 1; i < children.length; i++) {\n children[i].prev = children[i - 1];\n children[i - 1].next = children[i];\n }\n return children;\n}\n"],"names":["extendStatics","__extends","this","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","defineProperty","node","value","cloneNode","hasChildren","isDocument","isDirective","isComment","isCDATA","isTag","Element","Document","CDATA","NodeWithChildren","Comment","Text","DataNode","Node","domelementtype_1","require$$0","parent","prev","next","startIndex","endIndex","get","set","enumerable","configurable","recursive","_super","data","_this","type","ElementType","ProcessingInstruction","name","Directive","children","_a","Root","attribs","Script","Style","Tag","keys","map","_b","namespace","prefix","isText","result","cloneChildren","clone_1","forEach","child","clone_2","clone_3","Error","concat","instruction","sourceCodeLocation","childs"],"mappings":"sKACA,IACQA,EADJC,EAAaC,GAAQA,EAAKD,YACtBD,EAAgB,SAAUG,EAAGC,GAI7B,OAHAJ,EAAgBK,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAE,GACzE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,KACzFT,EAAcG,EAAGC,IAErB,SAAUD,EAAGC,GAChB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIS,UAAU,uBAAyBC,OAAOV,GAAK,iCAE7D,SAASW,IAAOb,KAAKc,YAAcb,CAAE,CADrCH,EAAcG,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOY,OAAOb,IAAMW,EAAGL,UAAYN,EAAEM,UAAW,IAAIK,KAGnFG,EAAYhB,GAAQA,EAAKgB,UAAa,WAStC,OARAA,EAAWb,OAAOc,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIb,KADTY,EAAIG,UAAUF,GACOjB,OAAOK,UAAUC,eAAeC,KAAKS,EAAGZ,KACzDW,EAAEX,GAAKY,EAAEZ,IAEjB,OAAOW,GAEJF,EAASQ,MAAMxB,KAAMsB,YAEhCnB,OAAOsB,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtDD,EAAAE,UAAoBF,EAAAG,YAAsBH,EAAAI,WAAqBJ,EAAmBK,YAAGL,EAAiBM,UAAGN,SAAiBA,EAAAO,QAAkBP,EAAAQ,MAAgBR,EAAeS,QAAGT,EAAgBU,SAAGV,EAAaW,MAAGX,EAAwBY,iBAAGZ,wBAAgCA,EAAAa,QAAkBb,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AS,OAAQA,EAAMnC,OAASqC,CAAS,IAChExD,EAAK,YACLwD,EAAQ,UAAYxD,EAAK,WAE7BkD,EAASM,CACjB,KACS,KAAInD,EAAYL,GAUjB,MAAM,IAAIyD,MAAM,wBAAwBC,OAAO1D,EAAKgC,OATpD,IAAI2B,EAAc,IAAIzB,EAAsBlC,EAAKmC,KAAMnC,EAAK8B,MACtC,MAAlB9B,EAAK,YACL2D,EAAY,UAAY3D,EAAK,UAC7B2D,EAAY,cAAgB3D,EAAK,cACjC2D,EAAY,cAAgB3D,EAAK,eAErCkD,EAASS,CAIjB,CAMI,OALAT,EAAO5B,WAAatB,EAAKsB,WACzB4B,EAAO3B,SAAWvB,EAAKuB,SACQ,MAA3BvB,EAAK4D,qBACLV,EAAOU,mBAAqB5D,EAAK4D,oBAE9BV,CACX,CAEA,SAASC,EAAcU,GAEnB,IADA,IAAIxB,EAAWwB,EAAOhB,KAAI,SAAUS,GAAS,OAAOpD,EAAUoD,GAAO,EAAQ,IACpE5D,EAAI,EAAGA,EAAI2C,EAASxC,OAAQH,IACjC2C,EAAS3C,GAAG0B,KAAOiB,EAAS3C,EAAI,GAChC2C,EAAS3C,EAAI,GAAG2B,KAAOgB,EAAS3C,GAEpC,OAAO2C,CACX,QAjIArC,EAAAS,QAAkBA,EAQlBT,EAAAQ,MAAgBA,EAQhBR,EAAAO,QAAkBA,EAQlBP,EAAAiD,OAAiBA,EAQjBjD,EAAAM,UAAoBA,EAQpBN,EAAAK,YAAsBA,EAQtBL,EAAAI,WAAqBA,EAQrBJ,EAAAG,YAHA,SAAqBH,GACjB,OAAOvB,OAAOK,UAAUC,eAAeC,KAAKgB,EAAM,WACtD,EAkEAA,EAAAE,UAAoBA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__exports as t}from"../../../../../_virtual/index12.js";import{__require as e}from"../../../../domelementtype/lib/index.js";import{__require as n}from"./node.js";var o;function i(){return o||(o=1,function(o){var i=t&&t.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),s=t&&t.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(o,"__esModule",{value:!0}),o.DomHandler=void 0;var r=e(),a=n();s(n(),o);var d={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function t(t,e,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof e&&(n=e,e=d),"object"==typeof t&&(e=t,t=void 0),this.callback=null!=t?t:null,this.options=null!=e?e:d,this.elementCB=null!=n?n:null}return t.prototype.onparserinit=function(t){this.parser=t},t.prototype.onreset=function(){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},t.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},t.prototype.onerror=function(t){this.handleCallback(t)},t.prototype.onclosetag=function(){this.lastNode=null;var t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)},t.prototype.onopentag=function(t,e){var n=this.options.xmlMode?r.ElementType.Tag:void 0,o=new a.Element(t,e,void 0,n);this.addNode(o),this.tagStack.push(o)},t.prototype.ontext=function(t){var e=this.lastNode;if(e&&e.type===r.ElementType.Text)e.data+=t,this.options.withEndIndices&&(e.endIndex=this.parser.endIndex);else{var n=new a.Text(t);this.addNode(n),this.lastNode=n}},t.prototype.oncomment=function(t){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment)this.lastNode.data+=t;else{var e=new a.Comment(t);this.addNode(e),this.lastNode=e}},t.prototype.oncommentend=function(){this.lastNode=null},t.prototype.oncdatastart=function(){var t=new a.Text(""),e=new a.CDATA([t]);this.addNode(e),t.parent=e,this.lastNode=t},t.prototype.oncdataend=function(){this.lastNode=null},t.prototype.onprocessinginstruction=function(t,e){var n=new a.ProcessingInstruction(t,e);this.addNode(n)},t.prototype.handleCallback=function(t){if("function"==typeof this.callback)this.callback(t,this.dom);else if(t)throw t},t.prototype.addNode=function(t){var e=this.tagStack[this.tagStack.length-1],n=e.children[e.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),e.children.push(t),n&&(t.prev=n,n.next=t),t.parent=e,this.lastNode=null},t}();o.DomHandler=l,o.default=l}(t)),t}export{i as __require};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/html-react-parser/node_modules/domhandler/lib/index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DomHandler = void 0;\nvar domelementtype_1 = require(\"domelementtype\");\nvar node_js_1 = require(\"./node.js\");\n__exportStar(require(\"./node.js\"), exports);\n// Default options\nvar defaultOpts = {\n withStartIndices: false,\n withEndIndices: false,\n xmlMode: false,\n};\nvar DomHandler = /** @class */ (function () {\n /**\n * @param callback Called once parsing has completed.\n * @param options Settings for the handler.\n * @param elementCB Callback whenever a tag is closed.\n */\n function DomHandler(callback, options, elementCB) {\n /** The elements of the DOM */\n this.dom = [];\n /** The root element for the DOM */\n this.root = new node_js_1.Document(this.dom);\n /** Indicated whether parsing has been completed. */\n this.done = false;\n /** Stack of open tags. */\n this.tagStack = [this.root];\n /** A data node that is still being written to. */\n this.lastNode = null;\n /** Reference to the parser instance. Used for location information. */\n this.parser = null;\n // Make it possible to skip arguments, for backwards-compatibility\n if (typeof options === \"function\") {\n elementCB = options;\n options = defaultOpts;\n }\n if (typeof callback === \"object\") {\n options = callback;\n callback = undefined;\n }\n this.callback = callback !== null && callback !== void 0 ? callback : null;\n this.options = options !== null && options !== void 0 ? options : defaultOpts;\n this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;\n }\n DomHandler.prototype.onparserinit = function (parser) {\n this.parser = parser;\n };\n // Resets the handler back to starting state\n DomHandler.prototype.onreset = function () {\n this.dom = [];\n this.root = new node_js_1.Document(this.dom);\n this.done = false;\n this.tagStack = [this.root];\n this.lastNode = null;\n this.parser = null;\n };\n // Signals the handler that parsing is done\n DomHandler.prototype.onend = function () {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n };\n DomHandler.prototype.onerror = function (error) {\n this.handleCallback(error);\n };\n DomHandler.prototype.onclosetag = function () {\n this.lastNode = null;\n var elem = this.tagStack.pop();\n if (this.options.withEndIndices) {\n elem.endIndex = this.parser.endIndex;\n }\n if (this.elementCB)\n this.elementCB(elem);\n };\n DomHandler.prototype.onopentag = function (name, attribs) {\n var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;\n var element = new node_js_1.Element(name, attribs, undefined, type);\n this.addNode(element);\n this.tagStack.push(element);\n };\n DomHandler.prototype.ontext = function (data) {\n var lastNode = this.lastNode;\n if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {\n lastNode.data += data;\n if (this.options.withEndIndices) {\n lastNode.endIndex = this.parser.endIndex;\n }\n }\n else {\n var node = new node_js_1.Text(data);\n this.addNode(node);\n this.lastNode = node;\n }\n };\n DomHandler.prototype.oncomment = function (data) {\n if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {\n this.lastNode.data += data;\n return;\n }\n var node = new node_js_1.Comment(data);\n this.addNode(node);\n this.lastNode = node;\n };\n DomHandler.prototype.oncommentend = function () {\n this.lastNode = null;\n };\n DomHandler.prototype.oncdatastart = function () {\n var text = new node_js_1.Text(\"\");\n var node = new node_js_1.CDATA([text]);\n this.addNode(node);\n text.parent = node;\n this.lastNode = text;\n };\n DomHandler.prototype.oncdataend = function () {\n this.lastNode = null;\n };\n DomHandler.prototype.onprocessinginstruction = function (name, data) {\n var node = new node_js_1.ProcessingInstruction(name, data);\n this.addNode(node);\n };\n DomHandler.prototype.handleCallback = function (error) {\n if (typeof this.callback === \"function\") {\n this.callback(error, this.dom);\n }\n else if (error) {\n throw error;\n }\n };\n DomHandler.prototype.addNode = function (node) {\n var parent = this.tagStack[this.tagStack.length - 1];\n var previousSibling = parent.children[parent.children.length - 1];\n if (this.options.withStartIndices) {\n node.startIndex = this.parser.startIndex;\n }\n if (this.options.withEndIndices) {\n node.endIndex = this.parser.endIndex;\n }\n parent.children.push(node);\n if (previousSibling) {\n node.prev = previousSibling;\n previousSibling.next = node;\n }\n node.parent = parent;\n this.lastNode = null;\n };\n return DomHandler;\n}());\nexports.DomHandler = DomHandler;\nexports.default = DomHandler;\n"],"names":["__createBinding","this","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__exportStar","exports","p","prototype","hasOwnProperty","call","value","DomHandler","domelementtype_1","require$$0","node_js_1","require$$1","defaultOpts","withStartIndices","withEndIndices","xmlMode","callback","options","elementCB","dom","root","Document","done","tagStack","lastNode","parser","onparserinit","onreset","onend","handleCallback","onerror","error","onclosetag","elem","pop","endIndex","onopentag","name","attribs","type","ElementType","Tag","element","Element","addNode","push","ontext","data","Text","node","oncomment","Comment","oncommentend","oncdatastart","text","CDATA","parent","oncdataend","onprocessinginstruction","ProcessingInstruction","length","previousSibling","children","startIndex","prev","next","default"],"mappings":"uNACA,IAAIA,EAAmBC,GAAQA,EAAKD,kBAAqBE,OAAOC,OAAM,SAAaC,EAAGC,EAAGC,EAAGC,QAC7EC,IAAPD,IAAkBA,EAAKD,GAC3B,IAAIG,EAAOP,OAAOQ,yBAAyBL,EAAGC,GACzCG,KAAS,QAASA,GAAQJ,EAAEM,WAAaF,EAAKG,UAAYH,EAAKI,gBAClEJ,EAAO,CAAEK,YAAY,EAAMC,IAAK,WAAa,OAAOV,EAAEC,EAAG,IAE3DJ,OAAOc,eAAeZ,EAAGG,EAAIE,EAChC,EAAA,SAAcL,EAAGC,EAAGC,EAAGC,QACTC,IAAPD,IAAkBA,EAAKD,GAC3BF,EAAEG,GAAMF,EAAEC,EACb,GACGW,EAAgBhB,GAAQA,EAAKgB,cAAiB,SAASZ,EAAGa,GAC1D,IAAK,IAAIC,KAAKd,EAAa,YAANc,GAAoBjB,OAAOkB,UAAUC,eAAeC,KAAKJ,EAASC,IAAInB,EAAgBkB,EAASb,EAAGc,IAE3HjB,OAAOc,eAAcE,EAAU,aAAc,CAAEK,OAAO,IACtDL,EAAAM,gBAAqB,EACrB,IAAIC,EAA4CC,IAC5CC,EAAgCC,IACpCX,EAAaW,IAAsBV,GAEnC,IAAIW,EAAc,CACdC,kBAAkB,EAClBC,gBAAgB,EAChBC,SAAS,GAETR,EAA4B,WAM5B,SAASA,EAAWS,EAAUC,EAASC,GAEnClC,KAAKmC,IAAM,GAEXnC,KAAKoC,KAAO,IAAIV,EAAUW,SAASrC,KAAKmC,KAExCnC,KAAKsC,MAAO,EAEZtC,KAAKuC,SAAW,CAACvC,KAAKoC,MAEtBpC,KAAKwC,SAAW,KAEhBxC,KAAKyC,OAAS,KAES,mBAAZR,IACPC,EAAYD,EACZA,EAAUL,GAEU,iBAAbI,IACPC,EAAUD,EACVA,OAAWzB,GAEfP,KAAKgC,SAAWA,QAA2CA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KAAOhB,GAE3BA,EAAKO,OAASA,EACdxE,KAAKwC,SAAW,MAEbjB,CACV,CAxIa,GAyIdN,EAAAM,WAAqBA,EACrBN,EAAAiE,QAAkB3D"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__exports as e}from"../../../../../_virtual/node.js";import{__require as t}from"../../../../domelementtype/lib/index.js";var n;function r(){if(n)return e;n=1;var r,i=e&&e.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=e&&e.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var u=t(),a=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),O(this,e)},e}();e.Node=a;var c=function(e){function t(t){var n=e.call(this)||this;return n.data=t,n}return i(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(a);e.DataNode=c;var l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.Text,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(c);e.Text=l;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.Comment,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(c);e.Comment=p;var s=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=u.ElementType.Directive,r}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(c);e.ProcessingInstruction=s;var f=function(e){function t(t){var n=e.call(this)||this;return n.children=t,n}return i(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);e.NodeWithChildren=f;var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.CDATA,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(f);e.CDATA=d;var y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=u.ElementType.Root,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(f);e.Document=y;var m=function(e){function t(t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i="script"===t?u.ElementType.Script:"style"===t?u.ElementType.Style:u.ElementType.Tag);var o=e.call(this,r)||this;return o.name=t,o.attribs=n,o.type=i,o}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(f);function h(e){return(0,u.isTag)(e)}function b(e){return e.type===u.ElementType.CDATA}function v(e){return e.type===u.ElementType.Text}function g(e){return e.type===u.ElementType.Comment}function x(e){return e.type===u.ElementType.Directive}function T(e){return e.type===u.ElementType.Root}function O(e,t){var n;if(void 0===t&&(t=!1),v(e))n=new l(e.data);else if(g(e))n=new p(e.data);else if(h(e)){var r=t?P(e.children):[],i=new m(e.name,o({},e.attribs),r);r.forEach((function(e){return e.parent=i})),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=o({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=o({},e["x-attribsPrefix"])),n=i}else if(b(e)){r=t?P(e.children):[];var u=new d(r);r.forEach((function(e){return e.parent=u})),n=u}else if(T(e)){r=t?P(e.children):[];var a=new y(r);r.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!x(e))throw new Error("Not implemented yet: ".concat(e.type));var c=new s(e.name,e.data);null!=e["x-name"]&&(c["x-name"]=e["x-name"],c["x-publicId"]=e["x-publicId"],c["x-systemId"]=e["x-systemId"]),n=c}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function P(e){for(var t=e.map((function(e){return O(e,!0)})),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}return e.Element=m,e.isTag=h,e.isCDATA=b,e.isText=v,e.isComment=g,e.isDirective=x,e.isDocument=T,e.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},e.cloneNode=O,e}export{r as __require};
|
|
2
|
-
//# sourceMappingURL=node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sources":["../../../../../../node_modules/html-react-parser/node_modules/domhandler/lib/node.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;\nvar domelementtype_1 = require(\"domelementtype\");\n/**\n * This object will be used as the prototype for Nodes when creating a\n * DOM-Level-1-compliant structure.\n */\nvar Node = /** @class */ (function () {\n function Node() {\n /** Parent of the node */\n this.parent = null;\n /** Previous sibling */\n this.prev = null;\n /** Next sibling */\n this.next = null;\n /** The start index of the node. Requires `withStartIndices` on the handler to be `true. */\n this.startIndex = null;\n /** The end index of the node. Requires `withEndIndices` on the handler to be `true. */\n this.endIndex = null;\n }\n Object.defineProperty(Node.prototype, \"parentNode\", {\n // Read-write aliases for properties\n /**\n * Same as {@link parent}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.parent;\n },\n set: function (parent) {\n this.parent = parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"previousSibling\", {\n /**\n * Same as {@link prev}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.prev;\n },\n set: function (prev) {\n this.prev = prev;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"nextSibling\", {\n /**\n * Same as {@link next}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.next;\n },\n set: function (next) {\n this.next = next;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clone this node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\n Node.prototype.cloneNode = function (recursive) {\n if (recursive === void 0) { recursive = false; }\n return cloneNode(this, recursive);\n };\n return Node;\n}());\nexports.Node = Node;\n/**\n * A node that contains some data.\n */\nvar DataNode = /** @class */ (function (_super) {\n __extends(DataNode, _super);\n /**\n * @param data The content of the data node\n */\n function DataNode(data) {\n var _this = _super.call(this) || this;\n _this.data = data;\n return _this;\n }\n Object.defineProperty(DataNode.prototype, \"nodeValue\", {\n /**\n * Same as {@link data}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.data;\n },\n set: function (data) {\n this.data = data;\n },\n enumerable: false,\n configurable: true\n });\n return DataNode;\n}(Node));\nexports.DataNode = DataNode;\n/**\n * Text within the document.\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n function Text() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Text;\n return _this;\n }\n Object.defineProperty(Text.prototype, \"nodeType\", {\n get: function () {\n return 3;\n },\n enumerable: false,\n configurable: true\n });\n return Text;\n}(DataNode));\nexports.Text = Text;\n/**\n * Comments within the document.\n */\nvar Comment = /** @class */ (function (_super) {\n __extends(Comment, _super);\n function Comment() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Comment;\n return _this;\n }\n Object.defineProperty(Comment.prototype, \"nodeType\", {\n get: function () {\n return 8;\n },\n enumerable: false,\n configurable: true\n });\n return Comment;\n}(DataNode));\nexports.Comment = Comment;\n/**\n * Processing instructions, including doc types.\n */\nvar ProcessingInstruction = /** @class */ (function (_super) {\n __extends(ProcessingInstruction, _super);\n function ProcessingInstruction(name, data) {\n var _this = _super.call(this, data) || this;\n _this.name = name;\n _this.type = domelementtype_1.ElementType.Directive;\n return _this;\n }\n Object.defineProperty(ProcessingInstruction.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n return ProcessingInstruction;\n}(DataNode));\nexports.ProcessingInstruction = ProcessingInstruction;\n/**\n * A `Node` that can have children.\n */\nvar NodeWithChildren = /** @class */ (function (_super) {\n __extends(NodeWithChildren, _super);\n /**\n * @param children Children of the node. Only certain node types can have children.\n */\n function NodeWithChildren(children) {\n var _this = _super.call(this) || this;\n _this.children = children;\n return _this;\n }\n Object.defineProperty(NodeWithChildren.prototype, \"firstChild\", {\n // Aliases\n /** First child of the node. */\n get: function () {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"lastChild\", {\n /** Last child of the node. */\n get: function () {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"childNodes\", {\n /**\n * Same as {@link children}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.children;\n },\n set: function (children) {\n this.children = children;\n },\n enumerable: false,\n configurable: true\n });\n return NodeWithChildren;\n}(Node));\nexports.NodeWithChildren = NodeWithChildren;\nvar CDATA = /** @class */ (function (_super) {\n __extends(CDATA, _super);\n function CDATA() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.CDATA;\n return _this;\n }\n Object.defineProperty(CDATA.prototype, \"nodeType\", {\n get: function () {\n return 4;\n },\n enumerable: false,\n configurable: true\n });\n return CDATA;\n}(NodeWithChildren));\nexports.CDATA = CDATA;\n/**\n * The root node of the document.\n */\nvar Document = /** @class */ (function (_super) {\n __extends(Document, _super);\n function Document() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Root;\n return _this;\n }\n Object.defineProperty(Document.prototype, \"nodeType\", {\n get: function () {\n return 9;\n },\n enumerable: false,\n configurable: true\n });\n return Document;\n}(NodeWithChildren));\nexports.Document = Document;\n/**\n * An element within the DOM.\n */\nvar Element = /** @class */ (function (_super) {\n __extends(Element, _super);\n /**\n * @param name Name of the tag, eg. `div`, `span`.\n * @param attribs Object mapping attribute names to attribute values.\n * @param children Children of the node.\n */\n function Element(name, attribs, children, type) {\n if (children === void 0) { children = []; }\n if (type === void 0) { type = name === \"script\"\n ? domelementtype_1.ElementType.Script\n : name === \"style\"\n ? domelementtype_1.ElementType.Style\n : domelementtype_1.ElementType.Tag; }\n var _this = _super.call(this, children) || this;\n _this.name = name;\n _this.attribs = attribs;\n _this.type = type;\n return _this;\n }\n Object.defineProperty(Element.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"tagName\", {\n // DOM Level 1 aliases\n /**\n * Same as {@link name}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.name;\n },\n set: function (name) {\n this.name = name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"attributes\", {\n get: function () {\n var _this = this;\n return Object.keys(this.attribs).map(function (name) {\n var _a, _b;\n return ({\n name: name,\n value: _this.attribs[name],\n namespace: (_a = _this[\"x-attribsNamespace\"]) === null || _a === void 0 ? void 0 : _a[name],\n prefix: (_b = _this[\"x-attribsPrefix\"]) === null || _b === void 0 ? void 0 : _b[name],\n });\n });\n },\n enumerable: false,\n configurable: true\n });\n return Element;\n}(NodeWithChildren));\nexports.Element = Element;\n/**\n * @param node Node to check.\n * @returns `true` if the node is a `Element`, `false` otherwise.\n */\nfunction isTag(node) {\n return (0, domelementtype_1.isTag)(node);\n}\nexports.isTag = isTag;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `CDATA`, `false` otherwise.\n */\nfunction isCDATA(node) {\n return node.type === domelementtype_1.ElementType.CDATA;\n}\nexports.isCDATA = isCDATA;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Text`, `false` otherwise.\n */\nfunction isText(node) {\n return node.type === domelementtype_1.ElementType.Text;\n}\nexports.isText = isText;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Comment`, `false` otherwise.\n */\nfunction isComment(node) {\n return node.type === domelementtype_1.ElementType.Comment;\n}\nexports.isComment = isComment;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDirective(node) {\n return node.type === domelementtype_1.ElementType.Directive;\n}\nexports.isDirective = isDirective;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDocument(node) {\n return node.type === domelementtype_1.ElementType.Root;\n}\nexports.isDocument = isDocument;\n/**\n * @param node Node to check.\n * @returns `true` if the node has children, `false` otherwise.\n */\nfunction hasChildren(node) {\n return Object.prototype.hasOwnProperty.call(node, \"children\");\n}\nexports.hasChildren = hasChildren;\n/**\n * Clone a node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\nfunction cloneNode(node, recursive) {\n if (recursive === void 0) { recursive = false; }\n var result;\n if (isText(node)) {\n result = new Text(node.data);\n }\n else if (isComment(node)) {\n result = new Comment(node.data);\n }\n else if (isTag(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_1 = new Element(node.name, __assign({}, node.attribs), children);\n children.forEach(function (child) { return (child.parent = clone_1); });\n if (node.namespace != null) {\n clone_1.namespace = node.namespace;\n }\n if (node[\"x-attribsNamespace\"]) {\n clone_1[\"x-attribsNamespace\"] = __assign({}, node[\"x-attribsNamespace\"]);\n }\n if (node[\"x-attribsPrefix\"]) {\n clone_1[\"x-attribsPrefix\"] = __assign({}, node[\"x-attribsPrefix\"]);\n }\n result = clone_1;\n }\n else if (isCDATA(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_2 = new CDATA(children);\n children.forEach(function (child) { return (child.parent = clone_2); });\n result = clone_2;\n }\n else if (isDocument(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_3 = new Document(children);\n children.forEach(function (child) { return (child.parent = clone_3); });\n if (node[\"x-mode\"]) {\n clone_3[\"x-mode\"] = node[\"x-mode\"];\n }\n result = clone_3;\n }\n else if (isDirective(node)) {\n var instruction = new ProcessingInstruction(node.name, node.data);\n if (node[\"x-name\"] != null) {\n instruction[\"x-name\"] = node[\"x-name\"];\n instruction[\"x-publicId\"] = node[\"x-publicId\"];\n instruction[\"x-systemId\"] = node[\"x-systemId\"];\n }\n result = instruction;\n }\n else {\n throw new Error(\"Not implemented yet: \".concat(node.type));\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n if (node.sourceCodeLocation != null) {\n result.sourceCodeLocation = node.sourceCodeLocation;\n }\n return result;\n}\nexports.cloneNode = cloneNode;\nfunction cloneChildren(childs) {\n var children = childs.map(function (child) { return cloneNode(child, true); });\n for (var i = 1; i < children.length; i++) {\n children[i].prev = children[i - 1];\n children[i - 1].next = children[i];\n }\n return children;\n}\n"],"names":["extendStatics","__extends","this","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","defineProperty","node","value","cloneNode","hasChildren","isDocument","isDirective","isComment","isCDATA","isTag","Element","Document","CDATA","NodeWithChildren","Comment","Text","DataNode","Node","domelementtype_1","require$$0","parent","prev","next","startIndex","endIndex","get","set","enumerable","configurable","recursive","_super","data","_this","type","ElementType","ProcessingInstruction","name","Directive","children","_a","Root","attribs","Script","Style","Tag","keys","map","_b","namespace","prefix","isText","result","cloneChildren","clone_1","forEach","child","clone_2","clone_3","Error","concat","instruction","sourceCodeLocation","childs"],"mappings":"qKACA,IACQA,EADJC,EAAaC,GAAQA,EAAKD,YACtBD,EAAgB,SAAUG,EAAGC,GAI7B,OAHAJ,EAAgBK,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAE,GACzE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,KACzFT,EAAcG,EAAGC,IAErB,SAAUD,EAAGC,GAChB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIS,UAAU,uBAAyBC,OAAOV,GAAK,iCAE7D,SAASW,IAAOb,KAAKc,YAAcb,CAAE,CADrCH,EAAcG,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOY,OAAOb,IAAMW,EAAGL,UAAYN,EAAEM,UAAW,IAAIK,KAGnFG,EAAYhB,GAAQA,EAAKgB,UAAa,WAStC,OARAA,EAAWb,OAAOc,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIb,KADTY,EAAIG,UAAUF,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A,EAQlBP,EAAAiD,OAAiBA,EAQjBjD,EAAAM,UAAoBA,EAQpBN,EAAAK,YAAsBA,EAQtBL,EAAAI,WAAqBA,EAQrBJ,EAAAG,YAHA,SAAqBH,GACjB,OAAOvB,OAAOK,UAAUC,eAAeC,KAAKgB,EAAM,WACtD,EAkEAA,EAAAE,UAAoBA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__exports as e}from"../../../../../_virtual/foreignNames.js";var t;function n(){return t||(t=1,Object.defineProperty(e,"__esModule",{value:!0}),e.attributeNames=e.elementNames=void 0,e.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((function(e){return[e.toLowerCase(),e]}))),e.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((function(e){return[e.toLowerCase(),e]})))),e}export{n as __require};
|
|
2
|
-
//# sourceMappingURL=foreignNames.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"foreignNames.js","sources":["../../../../../../node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.attributeNames = exports.elementNames = void 0;\nexports.elementNames = new Map([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"clipPath\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feDropShadow\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"foreignObject\",\n \"glyphRef\",\n \"linearGradient\",\n \"radialGradient\",\n \"textPath\",\n].map(function (val) { return [val.toLowerCase(), val]; }));\nexports.attributeNames = new Map([\n \"definitionURL\",\n \"attributeName\",\n \"attributeType\",\n \"baseFrequency\",\n \"baseProfile\",\n \"calcMode\",\n \"clipPathUnits\",\n \"diffuseConstant\",\n \"edgeMode\",\n \"filterUnits\",\n \"glyphRef\",\n \"gradientTransform\",\n \"gradientUnits\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keyPoints\",\n \"keySplines\",\n \"keyTimes\",\n \"lengthAdjust\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerUnits\",\n \"markerWidth\",\n \"maskContentUnits\",\n \"maskUnits\",\n \"numOctaves\",\n \"pathLength\",\n \"patternContentUnits\",\n \"patternTransform\",\n \"patternUnits\",\n \"pointsAtX\",\n \"pointsAtY\",\n \"pointsAtZ\",\n \"preserveAlpha\",\n \"preserveAspectRatio\",\n \"primitiveUnits\",\n \"refX\",\n \"refY\",\n \"repeatCount\",\n \"repeatDur\",\n \"requiredExtensions\",\n \"requiredFeatures\",\n \"specularConstant\",\n \"specularExponent\",\n \"spreadMethod\",\n \"startOffset\",\n \"stdDeviation\",\n \"stitchTiles\",\n \"surfaceScale\",\n \"systemLanguage\",\n \"tableValues\",\n \"targetX\",\n \"targetY\",\n \"textLength\",\n \"viewBox\",\n \"viewTarget\",\n \"xChannelSelector\",\n \"yChannelSelector\",\n \"zoomAndPan\",\n].map(function (val) { return [val.toLowerCase(), val]; }));\n"],"names":["Object","defineProperty","foreignNames","value","attributeNames","elementNames","Map","map","val","toLowerCase"],"mappings":"sGACAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtDD,EAAAE,eAAyBF,EAAAG,kBAAuB,EAC5BH,EAAAG,aAAG,IAAIC,IAAI,CAC3B,WACA,cACA,eACA,eACA,gBACA,mBACA,WACA,UACA,gBACA,sBACA,cACA,mBACA,oBACA,oBACA,iBACA,eACA,UACA,UACA,UACA,UACA,UACA,iBACA,UACA,UACA,cACA,eACA,WACA,eACA,qBACA,cACA,SACA,eACA,gBACA,WACA,iBACA,iBACA,YACFC,KAAI,SAAUC,GAAO,MAAO,CAACA,EAAIC,cAAeD,EAAO,KACnCN,EAAAE,eAAG,IAAIE,IAAI,CAC7B,gBACA,gBACA,gBACA,gBACA,cACA,WACA,gBACA,kBACA,WACA,cACA,WACA,oBACA,gBACA,eACA,mBACA,YACA,aACA,WACA,eACA,oBACA,eACA,cACA,cACA,mBACA,YACA,aACA,aACA,sBACA,mBACA,eACA,YACA,YACA,YACA,gBACA,sBACA,iBACA,OACA,OACA,cACA,YACA,qBACA,mBACA,mBACA,mBACA,eACA,cACA,eACA,cACA,eACA,iBACA,cACA,UACA,UACA,aACA,UACA,aACA,mBACA,mBACA,cACFC,KAAI,SAAUC,GAAO,MAAO,CAACA,EAAIC,cAAeD,EAAO"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__exports as e}from"../../../../../_virtual/index20.js";import{__require as t}from"../../../../domelementtype/lib/index.js";import{__require as n}from"../node_modules/entities/lib/index.js";import{__require as r}from"./foreignNames.js";var a;function o(){if(a)return e;a=1;var o=e&&e.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},o.apply(this,arguments)},i=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return c(t,e),t};Object.defineProperty(e,"__esModule",{value:!0}),e.render=void 0;var u=l(t()),s=n(),d=r(),m=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function f(e){return e.replace(/"/g,""")}var p=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function v(e,t){void 0===t&&(t={});for(var n=("length"in e?e:[e]),r="",a=0;a<n.length;a++)r+=g(n[a],t);return r}function g(e,t){switch(e.type){case u.Root:return v(e.children,t);case u.Doctype:case u.Directive:return"<".concat(e.data,">");case u.Comment:return function(e){return"\x3c!--".concat(e.data,"--\x3e")}(e);case u.CDATA:return function(e){return"<![CDATA[".concat(e.children[0].data,"]]>")}(e);case u.Script:case u.Style:case u.Tag:return function(e,t){var n;"foreign"===t.xmlMode&&(e.name=null!==(n=d.elementNames.get(e.name))&&void 0!==n?n:e.name,e.parent&&b.has(e.parent.name)&&(t=o(o({},t),{xmlMode:!1})));!t.xmlMode&&x.has(e.name)&&(t=o(o({},t),{xmlMode:"foreign"}));var r="<".concat(e.name),a=function(e,t){var n;if(e){var r=!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)?f:t.xmlMode||"utf8"!==t.encodeEntities?s.encodeXML:s.escapeAttribute;return Object.keys(e).map((function(n){var a,o,i=null!==(a=e[n])&&void 0!==a?a:"";return"foreign"===t.xmlMode&&(n=null!==(o=d.attributeNames.get(n))&&void 0!==o?o:n),t.emptyAttrs||t.xmlMode||""!==i?"".concat(n,'="').concat(r(i),'"'):n})).join(" ")}}(e.attribs,t);a&&(r+=" ".concat(a));0===e.children.length&&(t.xmlMode?!1!==t.selfClosingTags:t.selfClosingTags&&p.has(e.name))?(t.xmlMode||(r+=" "),r+="/>"):(r+=">",e.children.length>0&&(r+=v(e.children,t)),!t.xmlMode&&p.has(e.name)||(r+="</".concat(e.name,">")));return r}(e,t);case u.Text:return function(e,t){var n,r=e.data||"";!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)||!t.xmlMode&&e.parent&&m.has(e.parent.name)||(r=t.xmlMode||"utf8"!==t.encodeEntities?(0,s.encodeXML)(r):(0,s.escapeText)(r));return r}(e,t)}}e.render=v,e.default=v;var b=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),x=new Set(["svg","math"]);return e}export{o as __require};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js"],"sourcesContent":["\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.render = void 0;\n/*\n * Module dependencies\n */\nvar ElementType = __importStar(require(\"domelementtype\"));\nvar entities_1 = require(\"entities\");\n/**\n * Mixed-case SVG and MathML tags & attributes\n * recognized by the HTML parser.\n *\n * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign\n */\nvar foreignNames_js_1 = require(\"./foreignNames.js\");\nvar unencodedElements = new Set([\n \"style\",\n \"script\",\n \"xmp\",\n \"iframe\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"noscript\",\n]);\nfunction replaceQuotes(value) {\n return value.replace(/\"/g, \""\");\n}\n/**\n * Format attributes\n */\nfunction formatAttributes(attributes, opts) {\n var _a;\n if (!attributes)\n return;\n var encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false\n ? replaceQuotes\n : opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? entities_1.encodeXML\n : entities_1.escapeAttribute;\n return Object.keys(attributes)\n .map(function (key) {\n var _a, _b;\n var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : \"\";\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case attribute names */\n key = (_b = foreignNames_js_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;\n }\n if (!opts.emptyAttrs && !opts.xmlMode && value === \"\") {\n return key;\n }\n return \"\".concat(key, \"=\\\"\").concat(encode(value), \"\\\"\");\n })\n .join(\" \");\n}\n/**\n * Self-enclosing tags\n */\nvar singleTag = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\n/**\n * Renders a DOM node or an array of DOM nodes to a string.\n *\n * Can be thought of as the equivalent of the `outerHTML` of the passed node(s).\n *\n * @param node Node to be rendered.\n * @param options Changes serialization behavior\n */\nfunction render(node, options) {\n if (options === void 0) { options = {}; }\n var nodes = \"length\" in node ? node : [node];\n var output = \"\";\n for (var i = 0; i < nodes.length; i++) {\n output += renderNode(nodes[i], options);\n }\n return output;\n}\nexports.render = render;\nexports.default = render;\nfunction renderNode(node, options) {\n switch (node.type) {\n case ElementType.Root:\n return render(node.children, options);\n // @ts-expect-error We don't use `Doctype` yet\n case ElementType.Doctype:\n case ElementType.Directive:\n return renderDirective(node);\n case ElementType.Comment:\n return renderComment(node);\n case ElementType.CDATA:\n return renderCdata(node);\n case ElementType.Script:\n case ElementType.Style:\n case ElementType.Tag:\n return renderTag(node, options);\n case ElementType.Text:\n return renderText(node, options);\n }\n}\nvar foreignModeIntegrationPoints = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignObject\",\n \"desc\",\n \"title\",\n]);\nvar foreignElements = new Set([\"svg\", \"math\"]);\nfunction renderTag(elem, opts) {\n var _a;\n // Handle SVG / MathML in HTML\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case element names */\n elem.name = (_a = foreignNames_js_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;\n /* Exit foreign mode at integration points */\n if (elem.parent &&\n foreignModeIntegrationPoints.has(elem.parent.name)) {\n opts = __assign(__assign({}, opts), { xmlMode: false });\n }\n }\n if (!opts.xmlMode && foreignElements.has(elem.name)) {\n opts = __assign(__assign({}, opts), { xmlMode: \"foreign\" });\n }\n var tag = \"<\".concat(elem.name);\n var attribs = formatAttributes(elem.attribs, opts);\n if (attribs) {\n tag += \" \".concat(attribs);\n }\n if (elem.children.length === 0 &&\n (opts.xmlMode\n ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags\n opts.selfClosingTags !== false\n : // User explicitly asked for self-closing tags, even in HTML mode\n opts.selfClosingTags && singleTag.has(elem.name))) {\n if (!opts.xmlMode)\n tag += \" \";\n tag += \"/>\";\n }\n else {\n tag += \">\";\n if (elem.children.length > 0) {\n tag += render(elem.children, opts);\n }\n if (opts.xmlMode || !singleTag.has(elem.name)) {\n tag += \"</\".concat(elem.name, \">\");\n }\n }\n return tag;\n}\nfunction renderDirective(elem) {\n return \"<\".concat(elem.data, \">\");\n}\nfunction renderText(elem, opts) {\n var _a;\n var data = elem.data || \"\";\n // If entities weren't decoded, no need to encode them back\n if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&\n !(!opts.xmlMode &&\n elem.parent &&\n unencodedElements.has(elem.parent.name))) {\n data =\n opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? (0, entities_1.encodeXML)(data)\n : (0, entities_1.escapeText)(data);\n }\n return data;\n}\nfunction renderCdata(elem) {\n return \"<![CDATA[\".concat(elem.children[0].data, \"]]>\");\n}\nfunction renderComment(elem) {\n return \"<!--\".concat(elem.data, \"-->\");\n}\n"],"names":["__assign","this","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","__createBinding","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__setModuleDefault","v","value","__importStar","mod","result","lib","render","ElementType","entities_1","require$$1","foreignNames_js_1","require$$2","unencodedElements","Set","replaceQuotes","replace","singleTag","node","options","nodes","output","renderNode","type","Root","children","Doctype","Directive","concat","data","Comment","elem","renderComment","CDATA","renderCdata","Script","Style","Tag","opts","_a","xmlMode","name","elementNames","parent","foreignModeIntegrationPoints","has","foreignElements","tag","attribs","attributes","encode","encodeEntities","decodeEntities","encodeXML","escapeAttribute","keys","map","key","_b","attributeNames","emptyAttrs","join","formatAttributes","selfClosingTags","renderTag","Text","escapeText","renderText","default"],"mappings":"wRACA,IAAIA,EAAYC,GAAQA,EAAKD,UAAa,WAStC,OARAA,EAAWE,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,GAEJJ,EAASc,MAAMb,KAAMO,YAE5BO,EAAmBd,GAAQA,EAAKc,kBAAqBb,OAAOc,OAAM,SAAaC,EAAGC,EAAGC,EAAGC,QAC7EC,IAAPD,IAAkBA,EAAKD,GAC3B,IAAIG,EAAOpB,OAAOqB,yBAAyBL,EAAGC,GACzCG,KAAS,QAASA,GAAQJ,EAAEM,WAAaF,EAAKG,UAAYH,EAAKI,gBAClEJ,EAAO,CAAEK,YAAY,EAAMC,IAAK,WAAa,OAAOV,EAAEC,EAAG,IAE3DjB,OAAO2B,eAAeZ,EAAGG,EAAIE,EAChC,EAAA,SAAcL,EAAGC,EAAGC,EAAGC,QACTC,IAAPD,IAAkBA,EAAKD,GAC3BF,EAAEG,GAAMF,EAAEC,EACb,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
|
-
import{__exports as e}from"../../../../../../../_virtual/decode2.js";import{__require as t}from"./generated/decode-data-html.js";import{__require as r}from"./generated/decode-data-xml.js";import{__require as i}from"./decode_codepoint.js";var n;function o(){return n||(n=1,function(n){var o=e&&e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return s(t,e),t},u=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.decodeXML=n.decodeHTMLStrict=n.decodeHTMLAttribute=n.decodeHTML=n.determineBranch=n.EntityDecoder=n.DecodingMode=n.BinTrieFlags=n.fromCodePoint=n.replaceCodePoint=n.decodeCodePoint=n.xmlDecodeTree=n.htmlDecodeTree=void 0;var a=u(t());n.htmlDecodeTree=a.default;var d=u(r());n.xmlDecodeTree=d.default;var m=c(i());n.decodeCodePoint=m.default;var h,f=i();Object.defineProperty(n,"replaceCodePoint",{enumerable:!0,get:function(){return f.replaceCodePoint}}),Object.defineProperty(n,"fromCodePoint",{enumerable:!0,get:function(){return f.fromCodePoint}}),function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(h||(h={}));var E,l,N;function _(e){return e>=h.ZERO&&e<=h.NINE}function y(e){return e===h.EQUALS||function(e){return e>=h.UPPER_A&&e<=h.UPPER_Z||e>=h.LOWER_A&&e<=h.LOWER_Z||_(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(E=n.BinTrieFlags||(n.BinTrieFlags={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(l||(l={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(N=n.DecodingMode||(n.DecodingMode={}));var p=function(){function e(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r,this.state=l.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=N.Strict}return e.prototype.startEntity=function(e){this.decodeMode=e,this.state=l.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},e.prototype.write=function(e,t){switch(this.state){case l.EntityStart:return e.charCodeAt(t)===h.NUM?(this.state=l.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=l.NamedEntity,this.stateNamedEntity(e,t));case l.NumericStart:return this.stateNumericStart(e,t);case l.NumericDecimal:return this.stateNumericDecimal(e,t);case l.NumericHex:return this.stateNumericHex(e,t);case l.NamedEntity:return this.stateNamedEntity(e,t)}},e.prototype.stateNumericStart=function(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===h.LOWER_X?(this.state=l.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=l.NumericDecimal,this.stateNumericDecimal(e,t))},e.prototype.addToNumericResult=function(e,t,r,i){if(t!==r){var n=r-t;this.result=this.result*Math.pow(i,n)+parseInt(e.substr(t,n),i),this.consumed+=n}},e.prototype.stateNumericHex=function(e,t){for(var r,i=t;t<e.length;){var n=e.charCodeAt(t);if(!(_(n)||(r=n,r>=h.UPPER_A&&r<=h.UPPER_F||r>=h.LOWER_A&&r<=h.LOWER_F)))return this.addToNumericResult(e,i,t,16),this.emitNumericEntity(n,3);t+=1}return this.addToNumericResult(e,i,t,16),-1},e.prototype.stateNumericDecimal=function(e,t){for(var r=t;t<e.length;){var i=e.charCodeAt(t);if(!_(i))return this.addToNumericResult(e,r,t,10),this.emitNumericEntity(i,2);t+=1}return this.addToNumericResult(e,r,t,10),-1},e.prototype.emitNumericEntity=function(e,t){var r;if(this.consumed<=t)return null===(r=this.errors)||void 0===r||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===h.SEMI)this.consumed+=1;else if(this.decodeMode===N.Strict)return 0;return this.emitCodePoint((0,m.replaceCodePoint)(this.result),this.consumed),this.errors&&(e!==h.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},e.prototype.stateNamedEntity=function(e,t){for(var r=this.decodeTree,i=r[this.treeIndex],n=(i&E.VALUE_LENGTH)>>14;t<e.length;t++,this.excess++){var o=e.charCodeAt(t);if(this.treeIndex=P(r,i,this.treeIndex+Math.max(1,n),o),this.treeIndex<0)return 0===this.result||this.decodeMode===N.Attribute&&(0===n||y(o))?0:this.emitNotTerminatedNamedEntity();if(0!==(n=((i=r[this.treeIndex])&E.VALUE_LENGTH)>>14)){if(o===h.SEMI)return this.emitNamedEntityData(this.treeIndex,n,this.consumed+this.excess);this.decodeMode!==N.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},e.prototype.emitNotTerminatedNamedEntity=function(){var e,t=this.result,r=(this.decodeTree[t]&E.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed},e.prototype.emitNamedEntityData=function(e,t,r){var i=this.decodeTree;return this.emitCodePoint(1===t?i[e]&~E.VALUE_LENGTH:i[e+1],r),3===t&&this.emitCodePoint(i[e+2],r),r},e.prototype.end=function(){var e;switch(this.state){case l.NamedEntity:return 0===this.result||this.decodeMode===N.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case l.NumericDecimal:return this.emitNumericEntity(0,2);case l.NumericHex:return this.emitNumericEntity(0,3);case l.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case l.EntityStart:return 0}},e}();function L(e){var t="",r=new p(e,(function(e){return t+=(0,m.fromCodePoint)(e)}));return function(e,i){for(var n=0,o=0;(o=e.indexOf("&",o))>=0;){t+=e.slice(n,o),r.startEntity(i);var s=r.write(e,o+1);if(s<0){n=o+r.end();break}n=o+s,o=0===s?n+1:n}var c=t+e.slice(n);return t="",c}}function P(e,t,r,i){var n=(t&E.BRANCH_LENGTH)>>7,o=t&E.JUMP_TABLE;if(0===n)return 0!==o&&i===o?r:-1;if(o){var s=i-o;return s<0||s>=n?-1:e[r+s]-1}for(var c=r,u=c+n-1;c<=u;){var a=c+u>>>1,d=e[a];if(d<i)c=a+1;else{if(!(d>i))return e[a+n];u=a-1}}return-1}n.EntityDecoder=p,n.determineBranch=P;var v=L(a.default),R=L(d.default);n.decodeHTML=function(e,t){return void 0===t&&(t=N.Legacy),v(e,t)},n.decodeHTMLAttribute=function(e){return v(e,N.Attribute)},n.decodeHTMLStrict=function(e){return v(e,N.Strict)},n.decodeXML=function(e){return R(e,N.Strict)}}(e)),e}export{o as __require};
|
|
2
|
-
//# sourceMappingURL=decode.js.map
|