From 8f8d0775c78cb47de9c50698605df43ea4211ff1 Mon Sep 17 00:00:00 2001 From: Jussiles Date: Tue, 5 Sep 2023 15:23:38 +0300 Subject: [PATCH 01/18] UHF-8081: UHF-8081: add sentry react package. --- package-lock.json | 181 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 182 insertions(+) diff --git a/package-lock.json b/package-lock.json index 139499d84..a70564b54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "license": "MIT", "dependencies": { "@nuxt/friendly-errors-webpack-plugin": "^2.5.1", + "@sentry/react": "^7.66.0", "@sideway/address": "^5.0.0", "@sideway/formula": "^3.0.0", "@sideway/pinpoint": "^2.0.0", @@ -4950,6 +4951,100 @@ "node": ">= 10" } }, + "node_modules/@sentry-internal/tracing": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.66.0.tgz", + "integrity": "sha512-3vCgC2hC3T45pn53yTDVcRpHoJTBxelDPPZVsipAbZnoOVPkj7n6dNfDhj3I3kwWCBPahPkXmE+R4xViR8VqJg==", + "dependencies": { + "@sentry/core": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/browser": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.66.0.tgz", + "integrity": "sha512-rW037rf8jkhyykG38+HUdwkRCKHJEMM5NkCqPIO5zuuxfLKukKdI2rbvgJ93s3/9UfsTuDFcKFL1u43mCn6sDw==", + "dependencies": { + "@sentry-internal/tracing": "7.66.0", + "@sentry/core": "7.66.0", + "@sentry/replay": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/core": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.66.0.tgz", + "integrity": "sha512-WMAEPN86NeCJ1IT48Lqiz4MS5gdDjBwP4M63XP4msZn9aujSf2Qb6My5uT87AJr9zBtgk8MyJsuHr35F0P3q1w==", + "dependencies": { + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/react": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.66.0.tgz", + "integrity": "sha512-TC7kCkLoo+Klp9uywdV6tg8DDyn1CrTdndJghO6PoGz6sCa9k+t7K+z4E7MlgDoh3wiZwS2G2zhkT/xVeDRvJA==", + "dependencies": { + "@sentry/browser": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "hoist-non-react-statics": "^3.3.2", + "tslib": "^2.4.1 || ^1.9.3" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "react": "15.x || 16.x || 17.x || 18.x" + } + }, + "node_modules/@sentry/replay": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.66.0.tgz", + "integrity": "sha512-5Y2SlVTOFTo3uIycv0mRneBakQtLgWkOnsJaC5LB0Ip0TqVKiMCbQ578vvXp+yvRj4LcS1gNd98xTTNojBoQNg==", + "dependencies": { + "@sentry/core": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@sentry/types": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.66.0.tgz", + "integrity": "sha512-uUMSoSiar6JhuD8p7ON/Ddp4JYvrVd2RpwXJRPH1A4H4Bd4DVt1mKJy1OLG6HdeQv39XyhB1lPZckKJg4tATPw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/utils": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.66.0.tgz", + "integrity": "sha512-9GYUVgXjK66uXXcLXVMXVzlptqMtq1eJENCuDeezQiEFrNA71KkLDg00wESp+LL+bl3wpVTBApArpbF6UEG5hQ==", + "dependencies": { + "@sentry/types": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@sideway/address": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-5.0.0.tgz", @@ -11387,6 +11482,14 @@ "node": ">= 8" } }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dependencies": { + "react-is": "^16.7.0" + } + }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -25873,6 +25976,76 @@ "dev": true, "optional": true }, + "@sentry-internal/tracing": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.66.0.tgz", + "integrity": "sha512-3vCgC2hC3T45pn53yTDVcRpHoJTBxelDPPZVsipAbZnoOVPkj7n6dNfDhj3I3kwWCBPahPkXmE+R4xViR8VqJg==", + "requires": { + "@sentry/core": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + } + }, + "@sentry/browser": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.66.0.tgz", + "integrity": "sha512-rW037rf8jkhyykG38+HUdwkRCKHJEMM5NkCqPIO5zuuxfLKukKdI2rbvgJ93s3/9UfsTuDFcKFL1u43mCn6sDw==", + "requires": { + "@sentry-internal/tracing": "7.66.0", + "@sentry/core": "7.66.0", + "@sentry/replay": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + } + }, + "@sentry/core": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.66.0.tgz", + "integrity": "sha512-WMAEPN86NeCJ1IT48Lqiz4MS5gdDjBwP4M63XP4msZn9aujSf2Qb6My5uT87AJr9zBtgk8MyJsuHr35F0P3q1w==", + "requires": { + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + } + }, + "@sentry/react": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.66.0.tgz", + "integrity": "sha512-TC7kCkLoo+Klp9uywdV6tg8DDyn1CrTdndJghO6PoGz6sCa9k+t7K+z4E7MlgDoh3wiZwS2G2zhkT/xVeDRvJA==", + "requires": { + "@sentry/browser": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0", + "hoist-non-react-statics": "^3.3.2", + "tslib": "^2.4.1 || ^1.9.3" + } + }, + "@sentry/replay": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.66.0.tgz", + "integrity": "sha512-5Y2SlVTOFTo3uIycv0mRneBakQtLgWkOnsJaC5LB0Ip0TqVKiMCbQ578vvXp+yvRj4LcS1gNd98xTTNojBoQNg==", + "requires": { + "@sentry/core": "7.66.0", + "@sentry/types": "7.66.0", + "@sentry/utils": "7.66.0" + } + }, + "@sentry/types": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.66.0.tgz", + "integrity": "sha512-uUMSoSiar6JhuD8p7ON/Ddp4JYvrVd2RpwXJRPH1A4H4Bd4DVt1mKJy1OLG6HdeQv39XyhB1lPZckKJg4tATPw==" + }, + "@sentry/utils": { + "version": "7.66.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.66.0.tgz", + "integrity": "sha512-9GYUVgXjK66uXXcLXVMXVzlptqMtq1eJENCuDeezQiEFrNA71KkLDg00wESp+LL+bl3wpVTBApArpbF6UEG5hQ==", + "requires": { + "@sentry/types": "7.66.0", + "tslib": "^2.4.1 || ^1.9.3" + } + }, "@sideway/address": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-5.0.0.tgz", @@ -30703,6 +30876,14 @@ } } }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + }, "hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", diff --git a/package.json b/package.json index 0ca9878f9..68c93a9da 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@nuxt/friendly-errors-webpack-plugin": "^2.5.1", + "@sentry/react": "^7.66.0", "@sideway/address": "^5.0.0", "@sideway/formula": "^3.0.0", "@sideway/pinpoint": "^2.0.0", From 34f2a47ee06b0c384cf41cc082e31b26a3173b6c Mon Sep 17 00:00:00 2001 From: Jussiles Date: Wed, 6 Sep 2023 08:47:54 +0300 Subject: [PATCH 02/18] UHF-8081: UHF-8081: add sentry init. --- src/js/react/apps/job-search/helpers/Sentry.ts | 16 ++++++++++++++++ src/js/react/apps/job-search/index.tsx | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 src/js/react/apps/job-search/helpers/Sentry.ts diff --git a/src/js/react/apps/job-search/helpers/Sentry.ts b/src/js/react/apps/job-search/helpers/Sentry.ts new file mode 100644 index 000000000..c95bdc8e4 --- /dev/null +++ b/src/js/react/apps/job-search/helpers/Sentry.ts @@ -0,0 +1,16 @@ +import * as Sentry from '@sentry/react'; + +const initSentry = () => { + Sentry.init({ + // If this value is not provided, the SDK will try to read it from the SENTRY_DSN environment variable. + // If that variable also does not exist, the SDK will just not send any events. + // PHP/Drupal sentry is using the SENTRY_DSN on PLATTA. + // if you need to test this locally, check SENTRY_DSN_REACT test enviroment value from Azure. + dsn: drupalSettings?.helfi_react_search?.sentry_dsn_react, + // Setting ensures that 100% of transactions will be sent to Sentry, if it's too much it should be lowered. + tracesSampleRate: 1.0, + }); +}; + +export default initSentry; + diff --git a/src/js/react/apps/job-search/index.tsx b/src/js/react/apps/job-search/index.tsx index a7b238a18..9262ddc18 100644 --- a/src/js/react/apps/job-search/index.tsx +++ b/src/js/react/apps/job-search/index.tsx @@ -2,6 +2,9 @@ import React from 'react'; import ReactDOM from 'react-dom'; import SearchContainer from './containers/SearchContainer'; +import initSentry from './helpers/Sentry'; + +initSentry(); const rootSelector: string = 'helfi-rekry-job-search'; const rootElement: HTMLElement | null = document.getElementById(rootSelector); From 0889ff5d6a3b6358187eef81a030e4a156c9b656 Mon Sep 17 00:00:00 2001 From: Jussiles Date: Wed, 6 Sep 2023 08:49:35 +0300 Subject: [PATCH 03/18] UHF-8081: UHF-8081: remove react_app envs. Cleaning. --- hdbt.theme | 5 --- .../containers/ResultsContainer.tsx | 2 +- .../job-search/containers/SearchContainer.tsx | 16 ++++----- .../apps/job-search/hooks/useIndexQuery.tsx | 4 +-- src/js/react/apps/job-search/store.tsx | 34 +++++++++---------- src/js/types/drupalSettings.d.ts | 4 +-- 6 files changed, 30 insertions(+), 35 deletions(-) diff --git a/hdbt.theme b/hdbt.theme index 8feaadc1a..4d9ea6962 100644 --- a/hdbt.theme +++ b/hdbt.theme @@ -1503,11 +1503,6 @@ function hdbt_preprocess_paragraph__job_search(array &$variables) { } } - $config = \Drupal::config('elastic_proxy.settings'); - if ($config->get('elastic_proxy_url')) { - $variables['#attached']['drupalSettings']['helfi_rekry_job_search']['elastic_proxy_url'] = $config->get('elastic_proxy_url'); - } - $variables['#attached']['library'][] = 'hdbt/job-search'; } diff --git a/src/js/react/apps/district-and-project-search/containers/ResultsContainer.tsx b/src/js/react/apps/district-and-project-search/containers/ResultsContainer.tsx index 596679e46..b0fcf1179 100644 --- a/src/js/react/apps/district-and-project-search/containers/ResultsContainer.tsx +++ b/src/js/react/apps/district-and-project-search/containers/ResultsContainer.tsx @@ -28,7 +28,7 @@ const ResultsContainer = (): JSX.Element => { const fetcher = () => { const proxyUrl = drupalSettings?.helfi_kymp_district_project_search?.elastic_proxy_url; - const url: string | undefined = proxyUrl || process.env.REACT_APP_ELASTIC_URL; + const url: string | undefined = proxyUrl; return fetch(`${url}/${Settings.INDEX}/_search`, { method: 'POST', diff --git a/src/js/react/apps/job-search/containers/SearchContainer.tsx b/src/js/react/apps/job-search/containers/SearchContainer.tsx index 3c859cf2a..e67d412cf 100644 --- a/src/js/react/apps/job-search/containers/SearchContainer.tsx +++ b/src/js/react/apps/job-search/containers/SearchContainer.tsx @@ -5,13 +5,13 @@ import FormContainer from './FormContainer'; import ResultsContainer from './ResultsContainer'; const SearchContainer = () => ( -
- {/* For async atoms that need to load option values from elastic */} - }> - - {!drupalSettings?.helfi_rekry_job_search?.results_page_path && } - -
- ); +
+ {/* For async atoms that need to load option values from elastic */} + }> + + {!drupalSettings?.helfi_rekry_job_search?.results_page_path && } + +
+); export default SearchContainer; diff --git a/src/js/react/apps/job-search/hooks/useIndexQuery.tsx b/src/js/react/apps/job-search/hooks/useIndexQuery.tsx index d86373119..8703f6c7f 100644 --- a/src/js/react/apps/job-search/hooks/useIndexQuery.tsx +++ b/src/js/react/apps/job-search/hooks/useIndexQuery.tsx @@ -12,8 +12,8 @@ type UseIndexQueryProps = { const useIndexQuery = ({ query, multi, ...rest }: UseIndexQueryProps) => { const fetcher = () => { - const proxyUrl = drupalSettings?.helfi_rekry_job_search?.elastic_proxy_url; - const url: string|undefined = proxyUrl || process.env.REACT_APP_ELASTIC_URL; + const proxyUrl = drupalSettings?.helfi_react_search?.elastic_proxy_url; + const url: string|undefined = proxyUrl; const endpoint = multi ? '_msearch' : '_search'; const contentType = `application/${multi ? 'x-ndjson' : 'json'}`; diff --git a/src/js/react/apps/job-search/store.tsx b/src/js/react/apps/job-search/store.tsx index 5119ef64e..b4ea99885 100644 --- a/src/js/react/apps/job-search/store.tsx +++ b/src/js/react/apps/job-search/store.tsx @@ -103,26 +103,26 @@ type configurations = { }; export const configurationsAtom = atom(async(): Promise => { - const proxyUrl = drupalSettings?.helfi_rekry_job_search?.elastic_proxy_url; - const url: string | undefined = proxyUrl || process.env.REACT_APP_ELASTIC_URL; + const proxyUrl = drupalSettings?.helfi_react_search?.elastic_proxy_url; + const url: string | undefined = proxyUrl; const ndjsonHeader = '{}'; const body = - `${ndjsonHeader - }\n${ - JSON.stringify(AGGREGATIONS) - }\n${ - ndjsonHeader - }\n${ - JSON.stringify(TASK_AREA_OPTIONS) - }\n${ - ndjsonHeader - }\n${ - JSON.stringify(EMPLOYMENT_FILTER_OPTIONS) - }\n${ - ndjsonHeader - }\n${ - JSON.stringify(LANGUAGE_OPTIONS) + `${ndjsonHeader + }\n${ + JSON.stringify(AGGREGATIONS) + }\n${ + ndjsonHeader + }\n${ + JSON.stringify(TASK_AREA_OPTIONS) + }\n${ + ndjsonHeader + }\n${ + JSON.stringify(EMPLOYMENT_FILTER_OPTIONS) + }\n${ + ndjsonHeader + }\n${ + JSON.stringify(LANGUAGE_OPTIONS) }\n${ ndjsonHeader }\n${ diff --git a/src/js/types/drupalSettings.d.ts b/src/js/types/drupalSettings.d.ts index dc936e5ac..2f73a8d34 100644 --- a/src/js/types/drupalSettings.d.ts +++ b/src/js/types/drupalSettings.d.ts @@ -27,13 +27,13 @@ declare namespace drupalSettings { } }; const helfi_react_search: { - elastic_proxy_url: string + elastic_proxy_url: string; + sentry_dsn_react: string; }; const helfi_school_search: { cookie_privacy_url: string; }; const helfi_rekry_job_search: { - elastic_proxy_url: string; results_page_path: string; }; const helfi_kymp_district_project_search: { From 51c0636883f4d4a06826051784e58022974bbcae Mon Sep 17 00:00:00 2001 From: Jussiles Date: Wed, 6 Sep 2023 08:50:01 +0300 Subject: [PATCH 04/18] UHF-8081: UHF-8081: cleaning. --- dist/js/district-and-project-search.min.js | 2 +- dist/js/job-search.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/js/district-and-project-search.min.js b/dist/js/district-and-project-search.min.js index 605e09254..b45ae6de6 100644 --- a/dist/js/district-and-project-search.min.js +++ b/dist/js/district-and-project-search.min.js @@ -1 +1 @@ -!function(){var e={296:function(e){function t(e,t,n){var r,o,i,a,l;function u(){var s=Date.now()-a;s=0?r=setTimeout(u,t-s):(r=null,n||(l=e.apply(i,o),i=o=null))}null==t&&(t=100);var s=function(){i=this,o=arguments,a=Date.now();var s=n&&!r;return r||(r=setTimeout(u,t)),s&&(l=e.apply(i,o),i=o=null),l};return s.clear=function(){r&&(clearTimeout(r),r=null)},s.flush=function(){r&&(l=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},s}t.debounce=t,e.exports=t},9960:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},7915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(9960),a=n(7790);o(n(7790),t);var l=/\s+/g,u={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=function(){function e(e,t,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 t&&(n=t,t=u),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:u,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.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},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,r=new a.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.options.normalizeWhitespace,n=this.lastNode;if(n&&n.type===i.ElementType.Text)t?n.data=(n.data+e).replace(l," "):n.data+=e,this.options.withEndIndices&&(n.endIndex=this.parser.endIndex);else{t&&(e=e.replace(l," "));var r=new a.Text(e);this.addNode(r),this.lastNode=r}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new a.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new a.Text(""),t=new a.NodeWithChildren(i.ElementType.CDATA,[e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new a.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=s,t.default=s},7790:function(e,t,n){"use strict";var r,o=this&&this.__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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?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}(u);t.NodeWithChildren=p;var h=function(e){function t(t){return e.call(this,a.ElementType.Root,t)||this}return o(t,e),t}(p);t.Document=h;var m=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?a.ElementType.Script:"style"===t?a.ElementType.Style:a.ElementType.Tag);var i=e.call(this,o,r)||this;return i.name=t,i.attribs=n,i}return o(t,e),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}(p);function g(e){return(0,a.isTag)(e)}function v(e){return e.type===a.ElementType.CDATA}function b(e){return e.type===a.ElementType.Text}function _(e){return e.type===a.ElementType.Comment}function y(e){return e.type===a.ElementType.Directive}function x(e){return e.type===a.ElementType.Root}function w(e,t){var n;if(void 0===t&&(t=!1),b(e))n=new c(e.data);else if(_(e))n=new d(e.data);else if(g(e)){var r=t?k(e.children):[],o=new m(e.name,i({},e.attribs),r);r.forEach((function(e){return e.parent=o})),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=o}else if(v(e)){r=t?k(e.children):[];var l=new p(a.ElementType.CDATA,r);r.forEach((function(e){return e.parent=l})),n=l}else if(x(e)){r=t?k(e.children):[];var u=new h(r);r.forEach((function(e){return e.parent=u})),e["x-mode"]&&(u["x-mode"]=e["x-mode"]),n=u}else{if(!y(e))throw new Error("Not implemented yet: ".concat(e.type));var s=new f(e.name,e.data);null!=e["x-name"]&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),n=s}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function k(e){for(var t=e.map((function(e){return w(e,!0)})),n=1;n/i,a=//i,l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},u=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},s="object"==typeof window&&window.DOMParser;if("function"==typeof s){var c=new s;l=u=function(e,t){return t&&(e="<"+t+">"+e+""),c.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var d=document.implementation.createHTMLDocument();l=function(e,t){return t?(d.documentElement.querySelector(t).innerHTML=e,d):(d.documentElement.innerHTML=e,d)}}var f,p="object"==typeof document?document.createElement("template"):{};p.content&&(f=function(e){return p.innerHTML=e,p.content.childNodes}),e.exports=function(e){var s,c,d,p,h=e.match(o);switch(h&&h[1]&&(s=h[1].toLowerCase()),s){case t:return c=u(e),i.test(e)||(d=c.querySelector(n))&&d.parentNode.removeChild(d),a.test(e)||(d=c.querySelector(r))&&d.parentNode.removeChild(d),c.querySelectorAll(t);case n:case r:return p=(c=l(e)).querySelectorAll(s),a.test(e)&&i.test(e)?p[0].parentNode.childNodes:p;default:return f?f(e):(d=l(e,r).querySelector(r)).childNodes}}},4152:function(e,t,n){var r=n(8276),o=n(1507).formatDOM,i=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(i);return n&&n[1]&&(t=n[1]),o(r(e),null,t)}},1507:function(e,t,n){for(var r,o=n(7915),i=n(885).CASE_SENSITIVE_TAG_NAMES,a=o.Comment,l=o.Element,u=o.ProcessingInstruction,s=o.Text,c={},d=0,f=i.length;d1&&(c=h(c,{key:c.key||y})),v.push(c);else if("text"!==i.type){switch(d=i.attribs,u(i)?a(d.style,d):d&&(d=o(d,i.name)),f=null,i.type){case"script":case"style":i.children[0]&&(d.dangerouslySetInnerHTML={__html:i.children[0].data});break;case"tag":"textarea"===i.name&&i.children[0]?d.defaultValue=i.children[0].data:i.children&&i.children.length&&(f=e(i.children,n));break;default:continue}x>1&&(d.key=y),v.push(m(i.name,d,f))}else{if((s=!i.data.trim().length)&&i.parent&&!l(i.parent))continue;if(_&&s)continue;v.push(i.data)}return 1===v.length?v[0]:v}},4606:function(e,t,n){var r=n(7294),o=n(1476).default;var i={reactCompat:!0};var a=r.version.split(".")[0]>=16,l=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,o="function"==typeof t,i={},a={};for(n in e)r=e[n],o&&(i=t(n,r))&&2===i.length?a[i[0]]=i[1]:"string"==typeof r&&(a[r]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=o(e,i)}catch(e){t.style={}}},canTextBeChildOfNode:function(e){return!l.has(e.name)},elementsWithNoTextChildren:l}},8139:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,s="";function c(e){return e?e.replace(u,s):s}e.exports=function(e,u){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];u=u||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=u.source}m.prototype.content=e;var g=[];function v(t){var n=new Error(u.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=u.source,n.line=d,n.column=f,n.source=e,!u.silent)throw n;g.push(n)}function b(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function _(){b(r)}function y(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;s!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,s===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function w(){var e=h(),n=b(o);if(n){if(x(),!b(i))return v("property missing ':'");var r=b(a),u=e({type:"declaration",property:c(n[0].replace(t,s)),value:r?c(r[0].replace(t,s)):s});return b(l),u}}return _(),function(){var e,t=[];for(y(t);e=w();)!1!==e&&(t.push(e),y(t));return t}()}},2307:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object Map]",f="[object Number]",p="[object Object]",h="[object Promise]",m="[object RegExp]",g="[object Set]",v="[object String]",b="[object Symbol]",_="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",w=/^\[object .+?Constructor\]$/,k=/^(?:0|[1-9]\d*)$/,E={};E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E[i]=E[a]=E[y]=E[l]=E[x]=E[u]=E[s]=E[c]=E[d]=E[f]=E[p]=E[m]=E[g]=E[v]=E[_]=!1;var S="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,C=S||I||Function("return this")(),T=t&&!t.nodeType&&t,O=T&&e&&!e.nodeType&&e,j=O&&O.exports===T,N=j&&S.process,z=function(){try{return N&&N.binding&&N.binding("util")}catch(e){}}(),L=z&&z.isTypedArray;function P(e,t){for(var n=-1,r=null==e?0:e.length;++nl))return!1;var s=i.get(e);if(s&&i.get(t))return s==t;var c=-1,d=!0,f=2&n?new ye:void 0;for(i.set(e,t),i.set(t,e);++c-1},be.prototype.set=function(e,t){var n=this.__data__,r=ke(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},_e.prototype.clear=function(){this.size=0,this.__data__={hash:new ve,map:new(ie||be),string:new ve}},_e.prototype.delete=function(e){var t=Ne(this,e).delete(e);return this.size-=t?1:0,t},_e.prototype.get=function(e){return Ne(this,e).get(e)},_e.prototype.has=function(e){return Ne(this,e).has(e)},_e.prototype.set=function(e,t){var n=Ne(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ye.prototype.add=ye.prototype.push=function(e){return this.__data__.set(e,r),this},ye.prototype.has=function(e){return this.__data__.has(e)},xe.prototype.clear=function(){this.__data__=new be,this.size=0},xe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xe.prototype.get=function(e){return this.__data__.get(e)},xe.prototype.has=function(e){return this.__data__.has(e)},xe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof be){var r=n.__data__;if(!ie||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _e(r)}return n.set(e,t),this.size=n.size,this};var Le=te?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=o}function $e(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ue(e){return null!=e&&"object"==typeof e}var Ke=L?function(e){return function(t){return e(t)}}(L):function(e){return Ue(e)&&Ve(e.length)&&!!E[Ee(e)]};function We(e){return null!=(t=e)&&Ve(t.length)&&!He(t)?we(e):Te(e);var t}e.exports=function(e,t){return Ie(e,t)}},4461:function(e,t,n){var r="[object Symbol]",o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,i="object"==typeof self&&self&&self.Object===Object&&self,a=o||i||Function("return this")(),l=Object.prototype,u=0,s=l.toString,c=a.Symbol,d=c?c.prototype:void 0,f=d?d.toString:void 0;function p(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&s.call(e)==r}(e))return f?f.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}e.exports=function(e){var t,n=++u;return(null==(t=e)?"":p(t))+n}},7418:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,l,u=o(e),s=1;s1)for(var n=1;n