PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.3.65
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.3.65
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / build / leadin.js

leadin.js in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.3.65, at build/leadin.js

6,014 lines 210.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js":
5 /*!*******************************************************************!*\
6 !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***!
7 \*******************************************************************/
8 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (/* binding */ memoize)
14 /* harmony export */ });
15 function memoize(fn) {
16 var cache = Object.create(null);
17 return function (arg) {
18 if (cache[arg] === undefined) cache[arg] = fn(arg);
19 return cache[arg];
20 };
21 }
22
23
24
25
26 /***/ }),
27
28 /***/ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js":
29 /*!***********************************************************************************************************!*\
30 !*** ./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js ***!
31 \***********************************************************************************************************/
32 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
33
34 "use strict";
35 __webpack_require__.r(__webpack_exports__);
36 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
37 /* harmony export */ "default": () => (/* binding */ isPropValid)
38 /* harmony export */ });
39 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js");
40
41
42 // eslint-disable-next-line no-undef
43 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
44
45 var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
46 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
47 /* o */
48 && prop.charCodeAt(1) === 110
49 /* n */
50 && prop.charCodeAt(2) < 91;
51 }
52 /* Z+1 */
53 );
54
55
56
57
58 /***/ }),
59
60 /***/ "./scripts/api/wordpressApiClient.ts":
61 /*!*******************************************!*\
62 !*** ./scripts/api/wordpressApiClient.ts ***!
63 \*******************************************/
64 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
65
66 "use strict";
67 __webpack_require__.r(__webpack_exports__);
68 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
69 /* harmony export */ "disableInternalTracking": () => (/* binding */ disableInternalTracking),
70 /* harmony export */ "fetchAccessToken": () => (/* binding */ fetchAccessToken),
71 /* harmony export */ "fetchDisableInternalTracking": () => (/* binding */ fetchDisableInternalTracking),
72 /* harmony export */ "fetchProxyMappingsEnabled": () => (/* binding */ fetchProxyMappingsEnabled),
73 /* harmony export */ "getBusinessUnitId": () => (/* binding */ getBusinessUnitId),
74 /* harmony export */ "healthcheckRestApi": () => (/* binding */ healthcheckRestApi),
75 /* harmony export */ "refreshProxyMappingsCache": () => (/* binding */ refreshProxyMappingsCache),
76 /* harmony export */ "setBusinessUnitId": () => (/* binding */ setBusinessUnitId),
77 /* harmony export */ "skipReview": () => (/* binding */ skipReview),
78 /* harmony export */ "toggleProxyMappingsEnabled": () => (/* binding */ toggleProxyMappingsEnabled),
79 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
80 /* harmony export */ "updateHublet": () => (/* binding */ updateHublet)
81 /* harmony export */ });
82 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
83 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
84 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
85 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
86 /* harmony import */ var _utils_queryParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/queryParams */ "./scripts/utils/queryParams.ts");
87
88
89
90
91 function makeRequest(method, path) {
92 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
93 var queryParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
94 // eslint-disable-next-line compat/compat
95 var restApiUrl = new URL("".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restUrl, "leadin/v1").concat(path));
96 (0,_utils_queryParams__WEBPACK_IMPORTED_MODULE_3__.addQueryObjectToUrl)(restApiUrl, queryParams);
97 return new Promise(function (resolve, reject) {
98 var payload = {
99 url: restApiUrl.toString(),
100 method: method,
101 contentType: 'application/json',
102 beforeSend: function beforeSend(xhr) {
103 return xhr.setRequestHeader('X-WP-Nonce', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restNonce);
104 },
105 success: resolve,
106 error: function error(response) {
107 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].captureMessage("HTTP Request to ".concat(restApiUrl, " failed with error ").concat(response.status, ": ").concat(response.responseText), {
108 fingerprint: ['{{ default }}', path, response.status, response.responseText]
109 });
110 reject(response);
111 }
112 };
113 if (method !== 'get') {
114 payload.data = JSON.stringify(data);
115 }
116 jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax(payload);
117 });
118 }
119 function healthcheckRestApi() {
120 return makeRequest('get', '/healthcheck');
121 }
122 function disableInternalTracking(value) {
123 return makeRequest('put', '/internal-tracking', value ? '1' : '0');
124 }
125 function fetchDisableInternalTracking() {
126 return makeRequest('get', '/internal-tracking').then(function (message) {
127 return {
128 message: message
129 };
130 });
131 }
132 function updateHublet(hublet) {
133 return makeRequest('put', '/hublet', {
134 hublet: hublet
135 });
136 }
137 function skipReview() {
138 return makeRequest('post', '/skip-review');
139 }
140 function trackConsent(canTrack) {
141 return makeRequest('post', '/track-consent', {
142 canTrack: canTrack
143 }).then(function (message) {
144 return {
145 message: message
146 };
147 });
148 }
149 function setBusinessUnitId(businessUnitId) {
150 return makeRequest('put', '/business-unit', {
151 businessUnitId: businessUnitId
152 });
153 }
154 function getBusinessUnitId() {
155 return makeRequest('get', '/business-unit');
156 }
157 function refreshProxyMappingsCache() {
158 return makeRequest('post', '/wp-mappings-cache-reset');
159 }
160 function fetchProxyMappingsEnabled() {
161 return makeRequest('get', '/wp-mappings-proxy-enabled');
162 }
163 function toggleProxyMappingsEnabled(value) {
164 return makeRequest('put', '/wp-mappings-proxy-enabled', value);
165 }
166 var ACCESS_TOKEN_CACHE_KEY = 'leadin_access_token';
167 var ACCESS_TOKEN_MIN_TTL_SECONDS = 300;
168 var accessTokenRequest = null;
169 function fetchAccessToken() {
170 try {
171 var cached = sessionStorage.getItem(ACCESS_TOKEN_CACHE_KEY);
172 if (cached) {
173 var _JSON$parse = JSON.parse(cached),
174 accessToken = _JSON$parse.accessToken,
175 expiresAt = _JSON$parse.expiresAt;
176 if (accessToken && expiresAt > Math.floor(Date.now() / 1000) + ACCESS_TOKEN_MIN_TTL_SECONDS) {
177 return Promise.resolve({
178 accessToken: accessToken,
179 expiresIn: expiresAt - Math.floor(Date.now() / 1000)
180 });
181 }
182 }
183 } catch (_) {}
184 if (!accessTokenRequest) {
185 accessTokenRequest = makeRequest('get', '/access-token').then(function (response) {
186 try {
187 sessionStorage.setItem(ACCESS_TOKEN_CACHE_KEY, JSON.stringify({
188 accessToken: response.accessToken,
189 expiresAt: Math.floor(Date.now() / 1000) + response.expiresIn
190 }));
191 } catch (_) {}
192 return response;
193 })["finally"](function () {
194 accessTokenRequest = null;
195 });
196 }
197 return accessTokenRequest;
198 }
199
200 /***/ }),
201
202 /***/ "./scripts/constants/leadinConfig.ts":
203 /*!*******************************************!*\
204 !*** ./scripts/constants/leadinConfig.ts ***!
205 \*******************************************/
206 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
207
208 "use strict";
209 __webpack_require__.r(__webpack_exports__);
210 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
211 /* harmony export */ "accountName": () => (/* binding */ accountName),
212 /* harmony export */ "activationTime": () => (/* binding */ activationTime),
213 /* harmony export */ "adminUrl": () => (/* binding */ adminUrl),
214 /* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus),
215 /* harmony export */ "contentEmbed": () => (/* binding */ contentEmbed),
216 /* harmony export */ "decryptError": () => (/* binding */ decryptError),
217 /* harmony export */ "deviceId": () => (/* binding */ deviceId),
218 /* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect),
219 /* harmony export */ "env": () => (/* binding */ env),
220 /* harmony export */ "formsScript": () => (/* binding */ formsScript),
221 /* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload),
222 /* harmony export */ "hublet": () => (/* binding */ hublet),
223 /* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl),
224 /* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce),
225 /* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl),
226 /* harmony export */ "impactLink": () => (/* binding */ impactLink),
227 /* harmony export */ "lastAuthorizeTime": () => (/* binding */ lastAuthorizeTime),
228 /* harmony export */ "lastDeauthorizeTime": () => (/* binding */ lastDeauthorizeTime),
229 /* harmony export */ "lastDisconnectTime": () => (/* binding */ lastDisconnectTime),
230 /* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion),
231 /* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams),
232 /* harmony export */ "locale": () => (/* binding */ locale),
233 /* harmony export */ "loginUrl": () => (/* binding */ loginUrl),
234 /* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript),
235 /* harmony export */ "phpVersion": () => (/* binding */ phpVersion),
236 /* harmony export */ "pluginPath": () => (/* binding */ pluginPath),
237 /* harmony export */ "plugins": () => (/* binding */ plugins),
238 /* harmony export */ "portalDomain": () => (/* binding */ portalDomain),
239 /* harmony export */ "portalEmail": () => (/* binding */ portalEmail),
240 /* harmony export */ "portalId": () => (/* binding */ portalId),
241 /* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce),
242 /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
243 /* harmony export */ "requiresContentEmbedScope": () => (/* binding */ requiresContentEmbedScope),
244 /* harmony export */ "restNonce": () => (/* binding */ restNonce),
245 /* harmony export */ "restUrl": () => (/* binding */ restUrl),
246 /* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate),
247 /* harmony export */ "theme": () => (/* binding */ theme),
248 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
249 /* harmony export */ "wpVersion": () => (/* binding */ wpVersion)
250 /* harmony export */ });
251 var _window$leadinConfig = window.leadinConfig,
252 accountName = _window$leadinConfig.accountName,
253 adminUrl = _window$leadinConfig.adminUrl,
254 activationTime = _window$leadinConfig.activationTime,
255 connectionStatus = _window$leadinConfig.connectionStatus,
256 deviceId = _window$leadinConfig.deviceId,
257 didDisconnect = _window$leadinConfig.didDisconnect,
258 env = _window$leadinConfig.env,
259 formsScript = _window$leadinConfig.formsScript,
260 meetingsScript = _window$leadinConfig.meetingsScript,
261 formsScriptPayload = _window$leadinConfig.formsScriptPayload,
262 hublet = _window$leadinConfig.hublet,
263 hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl,
264 hubspotNonce = _window$leadinConfig.hubspotNonce,
265 iframeUrl = _window$leadinConfig.iframeUrl,
266 impactLink = _window$leadinConfig.impactLink,
267 lastAuthorizeTime = _window$leadinConfig.lastAuthorizeTime,
268 lastDeauthorizeTime = _window$leadinConfig.lastDeauthorizeTime,
269 lastDisconnectTime = _window$leadinConfig.lastDisconnectTime,
270 leadinPluginVersion = _window$leadinConfig.leadinPluginVersion,
271 leadinQueryParams = _window$leadinConfig.leadinQueryParams,
272 locale = _window$leadinConfig.locale,
273 loginUrl = _window$leadinConfig.loginUrl,
274 phpVersion = _window$leadinConfig.phpVersion,
275 pluginPath = _window$leadinConfig.pluginPath,
276 plugins = _window$leadinConfig.plugins,
277 portalDomain = _window$leadinConfig.portalDomain,
278 portalEmail = _window$leadinConfig.portalEmail,
279 portalId = _window$leadinConfig.portalId,
280 redirectNonce = _window$leadinConfig.redirectNonce,
281 restNonce = _window$leadinConfig.restNonce,
282 restUrl = _window$leadinConfig.restUrl,
283 refreshToken = _window$leadinConfig.refreshToken,
284 reviewSkippedDate = _window$leadinConfig.reviewSkippedDate,
285 theme = _window$leadinConfig.theme,
286 trackConsent = _window$leadinConfig.trackConsent,
287 wpVersion = _window$leadinConfig.wpVersion,
288 contentEmbed = _window$leadinConfig.contentEmbed,
289 requiresContentEmbedScope = _window$leadinConfig.requiresContentEmbedScope,
290 decryptError = _window$leadinConfig.decryptError;
291
292
293 /***/ }),
294
295 /***/ "./scripts/constants/selectors.ts":
296 /*!****************************************!*\
297 !*** ./scripts/constants/selectors.ts ***!
298 \****************************************/
299 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
300
301 "use strict";
302 __webpack_require__.r(__webpack_exports__);
303 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
304 /* harmony export */ "domElements": () => (/* binding */ domElements)
305 /* harmony export */ });
306 var domElements = {
307 iframe: '#leadin-iframe',
308 subMenu: '.toplevel_page_leadin > ul',
309 subMenuLinks: '.toplevel_page_leadin > ul a',
310 subMenuButtons: '.toplevel_page_leadin > ul > li',
311 deactivatePluginButton: '[data-slug="leadin"] .deactivate a',
312 deactivateFeedbackForm: 'form.leadin-deactivate-form',
313 deactivateFeedbackSubmit: 'button#leadin-feedback-submit',
314 deactivateFeedbackSkip: 'button#leadin-feedback-skip',
315 thickboxModalClose: '.leadin-modal-close',
316 thickboxModalWindow: 'div#TB_window.thickbox-loading',
317 thickboxModalContent: 'div#TB_ajaxContent.TB_modal',
318 reviewBannerContainer: '#leadin-review-banner',
319 reviewBannerLeaveReviewLink: 'a#leave-review-button',
320 reviewBannerDismissButton: 'a#dismiss-review-banner-button',
321 leadinIframeContainer: 'leadin-iframe-container',
322 leadinIframe: 'leadin-iframe',
323 leadinIframeFallbackContainer: 'leadin-iframe-fallback-container'
324 };
325
326 /***/ }),
327
328 /***/ "./scripts/iframe/IframeErrorPage.tsx":
329 /*!********************************************!*\
330 !*** ./scripts/iframe/IframeErrorPage.tsx ***!
331 \********************************************/
332 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
333
334 "use strict";
335 __webpack_require__.r(__webpack_exports__);
336 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
337 /* harmony export */ "IframeErrorPage": () => (/* binding */ IframeErrorPage)
338 /* harmony export */ });
339 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
340 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
341 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
342 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
343
344
345
346 var IframeErrorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
347 name: "IframeErrorContainer",
348 "class": "i1jit3y0",
349 propsAsIs: false
350 });
351 var ErrorHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('h1')({
352 name: "ErrorHeader",
353 "class": "e12lu7tb",
354 propsAsIs: false
355 });
356 var IframeErrorPage = function IframeErrorPage() {
357 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IframeErrorContainer, {
358 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", {
359 alt: "Cannot find page",
360 width: "175",
361 src: "//static.hsappstatic.net/ui-images/static-1.14/optimized/errors/map.svg"
362 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ErrorHeader, {
363 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The HubSpot for WordPress plugin is not able to load pages', 'leadin')
364 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
365 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Try disabling your browser extensions and ad blockers, then refresh the page', 'leadin')
366 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
367 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Or open the HubSpot for WordPress plugin in a different browser', 'leadin')
368 })]
369 });
370 };
371 __webpack_require__(/*! ./IframeErrorPage.linaria.css!=!../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./IframeErrorPage.tsx */ "./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx");
372
373 /***/ }),
374
375 /***/ "./scripts/iframe/constants.ts":
376 /*!*************************************!*\
377 !*** ./scripts/iframe/constants.ts ***!
378 \*************************************/
379 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
380
381 "use strict";
382 __webpack_require__.r(__webpack_exports__);
383 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
384 /* harmony export */ "App": () => (/* binding */ App),
385 /* harmony export */ "AppIframe": () => (/* binding */ AppIframe)
386 /* harmony export */ });
387 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
388 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
389 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
390 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
391 var App;
392 (function (App) {
393 App[App["Forms"] = 0] = "Forms";
394 App[App["LiveChat"] = 1] = "LiveChat";
395 App[App["Plugin"] = 2] = "Plugin";
396 App[App["PluginSettings"] = 3] = "PluginSettings";
397 App[App["Background"] = 4] = "Background";
398 })(App || (App = {}));
399 var AppIframe = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, App.Forms, 'integrated-form-app'), App.LiveChat, 'integrated-livechat-app'), App.Plugin, 'integrated-plugin-app'), App.PluginSettings, 'integrated-plugin-app'), App.Background, 'integrated-plugin-proxy');
400
401 /***/ }),
402
403 /***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts":
404 /*!****************************************************************!*\
405 !*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***!
406 \****************************************************************/
407 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
408
409 "use strict";
410 __webpack_require__.r(__webpack_exports__);
411 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
412 /* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages)
413 /* harmony export */ });
414 var CoreMessages = {
415 HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED',
416 SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN',
417 ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME',
418 RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME',
419 SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE',
420 SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID',
421 SendIntegratedAppConfig: 'INTEGRATED_APP_EMBEDDER_CONFIG'
422 };
423
424 /***/ }),
425
426 /***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts":
427 /*!******************************************************************!*\
428 !*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***!
429 \******************************************************************/
430 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
431
432 "use strict";
433 __webpack_require__.r(__webpack_exports__);
434 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
435 /* harmony export */ "FormMessages": () => (/* binding */ FormMessages)
436 /* harmony export */ });
437 var FormMessages = {
438 CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION'
439 };
440
441 /***/ }),
442
443 /***/ "./scripts/iframe/integratedMessages/index.ts":
444 /*!****************************************************!*\
445 !*** ./scripts/iframe/integratedMessages/index.ts ***!
446 \****************************************************/
447 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
448
449 "use strict";
450 __webpack_require__.r(__webpack_exports__);
451 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
452 /* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages),
453 /* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages),
454 /* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages),
455 /* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages),
456 /* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages)
457 /* harmony export */ });
458 /* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts");
459 /* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts");
460 /* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts");
461 /* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts");
462 /* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts");
463
464
465
466
467
468
469 /***/ }),
470
471 /***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts":
472 /*!************************************************************************!*\
473 !*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***!
474 \************************************************************************/
475 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
476
477 "use strict";
478 __webpack_require__.r(__webpack_exports__);
479 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
480 /* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages)
481 /* harmony export */ });
482 var LiveChatMessages = {
483 CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION'
484 };
485
486 /***/ }),
487
488 /***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts":
489 /*!********************************************************************!*\
490 !*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***!
491 \********************************************************************/
492 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
493
494 "use strict";
495 __webpack_require__.r(__webpack_exports__);
496 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
497 /* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages)
498 /* harmony export */ });
499 var PluginMessages = {
500 PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION',
501 PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG',
502 TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT',
503 InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST',
504 InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE',
505 InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR',
506 InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST',
507 InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR',
508 BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST',
509 BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE',
510 BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR',
511 BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST',
512 BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR',
513 SkipReviewRequest: 'SKIP_REVIEW_REQUEST',
514 SkipReviewResponse: 'SKIP_REVIEW_RESPONSE',
515 SkipReviewError: 'SKIP_REVIEW_ERROR',
516 RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM',
517 ContentEmbedInstallRequest: 'CONTENT_EMBED_INSTALL_REQUEST',
518 ContentEmbedInstallResponse: 'CONTENT_EMBED_INSTALL_RESPONSE',
519 ContentEmbedInstallError: 'CONTENT_EMBED_INSTALL_ERROR',
520 ContentEmbedActivationRequest: 'CONTENT_EMBED_ACTIVATION_REQUEST',
521 ContentEmbedActivationResponse: 'CONTENT_EMBED_ACTIVATION_RESPONSE',
522 ContentEmbedActivationError: 'CONTENT_EMBED_ACTIVATION_ERROR',
523 ProxyMappingsEnabledRequest: 'PROXY_MAPPINGS_ENABLED_REQUEST',
524 ProxyMappingsEnabledResponse: 'PROXY_MAPPINGS_ENABLED_RESPONSE',
525 ProxyMappingsEnabledError: 'PROXY_MAPPINGS_ENABLED_ERROR',
526 ProxyMappingsEnabledChangeRequest: 'PROXY_MAPPINGS_ENABLED_CHANGE_REQUEST',
527 ProxyMappingsEnabledChangeError: 'PROXY_MAPPINGS_ENABLED_CHANGE_ERROR',
528 RefreshProxyMappingsRequest: 'REFRESH_PROXY_MAPPINGS_REQUEST',
529 RefreshProxyMappingsResponse: 'REFRESH_PROXY_MAPPINGS_RESPONSE',
530 RefreshProxyMappingsError: 'REFRESH_PROXY_MAPPINGS_ERROR'
531 };
532
533 /***/ }),
534
535 /***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts":
536 /*!******************************************************************!*\
537 !*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***!
538 \******************************************************************/
539 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
540
541 "use strict";
542 __webpack_require__.r(__webpack_exports__);
543 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
544 /* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages)
545 /* harmony export */ });
546 var ProxyMessages = {
547 FetchForms: 'FETCH_FORMS',
548 FetchForm: 'FETCH_FORM',
549 CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE',
550 GetTemplateAvailability: 'GET_TEMPLATE_AVAILABILITY',
551 FetchAuth: 'FETCH_AUTH',
552 FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS',
553 FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION',
554 FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER',
555 ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR',
556 TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER',
557 TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE',
558 TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED',
559 TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER',
560 TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE',
561 TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER',
562 TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION',
563 TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED',
564 TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION'
565 };
566
567 /***/ }),
568
569 /***/ "./scripts/iframe/messageMiddleware.ts":
570 /*!*********************************************!*\
571 !*** ./scripts/iframe/messageMiddleware.ts ***!
572 \*********************************************/
573 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
574
575 "use strict";
576 __webpack_require__.r(__webpack_exports__);
577 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
578 /* harmony export */ "messageMiddleware": () => (/* binding */ messageMiddleware)
579 /* harmony export */ });
580 /* harmony import */ var _integratedMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
581 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
582 /* harmony import */ var _utils_queryParams__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/queryParams */ "./scripts/utils/queryParams.ts");
583 /* harmony import */ var _utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/contentEmbedInstaller */ "./scripts/utils/contentEmbedInstaller.ts");
584
585
586
587
588 /*
589 * We cannot postMessage error objects. We will run into serialization errors
590 * Extract some properties we care about from the errors and create an error object from these
591 */
592 function createSafeErrorPayload(error) {
593 var defaultMessage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'An error occurred';
594 var safePayload = {
595 status: error && error.status || 500,
596 statusText: error && error.statusText || 'Error',
597 message: error && error.responseJSON && error.responseJSON.message || error && error.message || defaultMessage,
598 code: error && error.responseJSON && error.responseJSON.code
599 };
600 if (error && error.responseJSON && error.responseJSON.data) {
601 safePayload.data = error.responseJSON.data;
602 }
603 return safePayload;
604 }
605 var messageMapper = new Map([[_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.TrackConsent, function (message) {
606 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.trackConsent)(message.payload);
607 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingChangeRequest, function (message, embedder) {
608 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.disableInternalTracking)(message.payload).then(function () {
609 embedder.postMessage({
610 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchResponse,
611 payload: message.payload
612 });
613 })["catch"](function (error) {
614 // Extract only serializable properties from error. You cannot postMessage raw error obj with prototype methods
615 embedder.postMessage({
616 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingChangeError,
617 payload: createSafeErrorPayload(error)
618 });
619 });
620 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchRequest, function (__message, embedder) {
621 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.fetchDisableInternalTracking)().then(function (_ref) {
622 var payload = _ref.message;
623 embedder.postMessage({
624 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchResponse,
625 payload: payload
626 });
627 })["catch"](function (error) {
628 embedder.postMessage({
629 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchError,
630 payload: createSafeErrorPayload(error, 'Fetch error occurred')
631 });
632 });
633 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchRequest, function (__message, embedder) {
634 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.getBusinessUnitId)().then(function (payload) {
635 embedder.postMessage({
636 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchResponse,
637 payload: payload
638 });
639 })["catch"](function (error) {
640 embedder.postMessage({
641 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchError,
642 payload: createSafeErrorPayload(error, 'Business unit fetch error')
643 });
644 });
645 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitChangeRequest, function (message, embedder) {
646 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.setBusinessUnitId)(message.payload).then(function (payload) {
647 embedder.postMessage({
648 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchResponse,
649 payload: payload
650 });
651 })["catch"](function (error) {
652 embedder.postMessage({
653 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitChangeError,
654 payload: createSafeErrorPayload(error, 'Business unit change error')
655 });
656 });
657 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewRequest, function (__message, embedder) {
658 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.skipReview)().then(function (payload) {
659 embedder.postMessage({
660 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewResponse,
661 payload: payload
662 });
663 })["catch"](function (error) {
664 embedder.postMessage({
665 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewError,
666 payload: createSafeErrorPayload(error, 'Skip review error')
667 });
668 });
669 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.RemoveParentQueryParam, function (message) {
670 (0,_utils_queryParams__WEBPACK_IMPORTED_MODULE_2__.removeQueryParamFromLocation)(message.payload);
671 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallRequest, function (message, embedder) {
672 (0,_utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__.startInstall)(message.payload.nonce).then(function (payload) {
673 embedder.postMessage({
674 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallResponse,
675 payload: payload
676 });
677 })["catch"](function (error) {
678 embedder.postMessage({
679 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallError,
680 payload: createSafeErrorPayload(error, 'Content embed install error')
681 });
682 });
683 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationRequest, function (message, embedder) {
684 (0,_utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__.startActivation)(message.payload.activateAjaxUrl).then(function (payload) {
685 embedder.postMessage({
686 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationResponse,
687 payload: payload
688 });
689 })["catch"](function (error) {
690 embedder.postMessage({
691 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationError,
692 payload: createSafeErrorPayload(error, 'Content embed activation error')
693 });
694 });
695 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.RefreshProxyMappingsRequest, function (__message, embedder) {
696 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.refreshProxyMappingsCache)().then(function () {
697 embedder.postMessage({
698 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.RefreshProxyMappingsResponse,
699 payload: {}
700 });
701 })["catch"](function (error) {
702 embedder.postMessage({
703 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.RefreshProxyMappingsError,
704 payload: createSafeErrorPayload(error, 'Refresh proxy mappings error')
705 });
706 });
707 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ProxyMappingsEnabledRequest, function (__message, embedder) {
708 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.fetchProxyMappingsEnabled)().then(function (payload) {
709 embedder.postMessage({
710 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ProxyMappingsEnabledResponse,
711 payload: payload
712 });
713 })["catch"](function (error) {
714 embedder.postMessage({
715 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ProxyMappingsEnabledError,
716 payload: createSafeErrorPayload(error, 'Proxy mappings enabled fetch error')
717 });
718 });
719 }], [_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ProxyMappingsEnabledChangeRequest, function (_ref2, embedder) {
720 var payload = _ref2.payload;
721 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.toggleProxyMappingsEnabled)(payload).then(function () {
722 embedder.postMessage({
723 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ProxyMappingsEnabledResponse,
724 payload: payload
725 });
726 })["catch"](function (error) {
727 embedder.postMessage({
728 key: _integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ProxyMappingsEnabledChangeError,
729 payload: createSafeErrorPayload(error, 'Proxy mappings enabled change error')
730 });
731 });
732 }]]);
733 var messageMiddleware = function messageMiddleware(embedder) {
734 return function (message) {
735 var next = messageMapper.get(message.key);
736 if (next) {
737 next(message, embedder);
738 }
739 };
740 };
741
742 /***/ }),
743
744 /***/ "./scripts/iframe/renderIframeApp.tsx":
745 /*!********************************************!*\
746 !*** ./scripts/iframe/renderIframeApp.tsx ***!
747 \********************************************/
748 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
749
750 "use strict";
751 __webpack_require__.r(__webpack_exports__);
752 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
753 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
754 /* harmony export */ });
755 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
756 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
757 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
758 /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
759 /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
760 /* harmony import */ var _constants_selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants/selectors */ "./scripts/constants/selectors.ts");
761 /* harmony import */ var _useAppEmbedder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useAppEmbedder */ "./scripts/iframe/useAppEmbedder.ts");
762 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./scripts/iframe/constants.ts");
763 /* harmony import */ var _IframeErrorPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IframeErrorPage */ "./scripts/iframe/IframeErrorPage.tsx");
764
765
766
767
768
769
770
771 var IntegratedIframePortal = function IntegratedIframePortal(props) {
772 var container = document.getElementById(_constants_selectors__WEBPACK_IMPORTED_MODULE_3__.domElements.leadinIframeContainer);
773 var iframeNotRendered = (0,_useAppEmbedder__WEBPACK_IMPORTED_MODULE_4__["default"])(props.app, props.createRoute, container);
774 if (container && !iframeNotRendered) {
775 return /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_2___default().createPortal(props.children, container);
776 }
777 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
778 children: (!container || iframeNotRendered) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_IframeErrorPage__WEBPACK_IMPORTED_MODULE_6__.IframeErrorPage, {})
779 });
780 };
781 var renderIframeApp = function renderIframeApp() {
782 var iframeFallbackContainer = document.getElementById(_constants_selectors__WEBPACK_IMPORTED_MODULE_3__.domElements.leadinIframeContainer);
783 var app;
784 var queryParams = new URLSearchParams(location.search);
785 var page = queryParams.get('page');
786 var createRoute = queryParams.get('leadin_route[0]') === 'create';
787 switch (page) {
788 case 'leadin_forms':
789 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.Forms;
790 break;
791 case 'leadin_chatflows':
792 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.LiveChat;
793 break;
794 case 'leadin_settings':
795 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.PluginSettings;
796 break;
797 case 'leadin_user_guide':
798 default:
799 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.Plugin;
800 break;
801 }
802 react_dom__WEBPACK_IMPORTED_MODULE_2___default().render((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IntegratedIframePortal, {
803 app: app,
804 createRoute: createRoute
805 }), iframeFallbackContainer);
806 };
807 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (renderIframeApp);
808
809 /***/ }),
810
811 /***/ "./scripts/iframe/useAppEmbedder.ts":
812 /*!******************************************!*\
813 !*** ./scripts/iframe/useAppEmbedder.ts ***!
814 \******************************************/
815 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
816
817 "use strict";
818 __webpack_require__.r(__webpack_exports__);
819 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
820 /* harmony export */ "default": () => (/* binding */ useAppEmbedder)
821 /* harmony export */ });
822 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
823 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
824 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
825 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
826 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
827 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./scripts/iframe/constants.ts");
828 /* harmony import */ var _messageMiddleware__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./messageMiddleware */ "./scripts/iframe/messageMiddleware.ts");
829 /* harmony import */ var _utils_iframe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/iframe */ "./scripts/utils/iframe.ts");
830 function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
831 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
832 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
833 function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
834 function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
835 function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
836
837
838
839
840
841
842
843 var getIntegrationConfig = function getIntegrationConfig() {
844 return {
845 adminUrl: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.adminUrl
846 };
847 };
848 var getLeadinConfig = function getLeadinConfig() {
849 var utm_query_params = Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams).filter(function (x) {
850 return /^utm/.test(x);
851 }).reduce(function (p, c) {
852 return _objectSpread(_defineProperty({}, c, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams[c]), p);
853 }, {});
854 return _objectSpread({
855 accountName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.accountName,
856 admin: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.admin,
857 adminUrl: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.adminUrl,
858 company: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.company,
859 connectionStatus: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus,
860 deviceId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.deviceId,
861 email: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.email,
862 firstName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.firstName,
863 irclickid: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.irclickid,
864 justConnected: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.justConnected,
865 lastName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.lastName,
866 lastAuthorizeTime: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.lastAuthorizeTime,
867 lastDeauthorizeTime: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.lastDeauthorizeTime,
868 lastDisconnectTime: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.lastDisconnectTime,
869 leadinPluginVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinPluginVersion,
870 mpid: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.mpid,
871 nonce: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.nonce,
872 phpVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.phpVersion,
873 plugins: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.plugins,
874 portalDomain: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalDomain,
875 portalEmail: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalEmail,
876 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
877 reviewSkippedDate: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.reviewSkippedDate,
878 theme: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.theme,
879 trackConsent: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.trackConsent,
880 websiteName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.websiteName,
881 wpVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.wpVersion,
882 contentEmbed: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.contentEmbed,
883 requiresContentEmbedScope: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.requiresContentEmbedScope,
884 decryptError: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.decryptError
885 }, utm_query_params);
886 };
887 var getAppOptions = function getAppOptions(app) {
888 var createRoute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
889 var _window = window,
890 IntegratedAppOptions = _window.IntegratedAppOptions,
891 FormsAppOptions = _window.FormsAppOptions,
892 LiveChatAppOptions = _window.LiveChatAppOptions,
893 PluginAppOptions = _window.PluginAppOptions;
894 var options;
895 switch (app) {
896 case _constants__WEBPACK_IMPORTED_MODULE_4__.App.Plugin:
897 options = new PluginAppOptions();
898 break;
899 case _constants__WEBPACK_IMPORTED_MODULE_4__.App.PluginSettings:
900 options = new PluginAppOptions().setPluginSettingsInit();
901 break;
902 case _constants__WEBPACK_IMPORTED_MODULE_4__.App.Forms:
903 options = new FormsAppOptions().setIntegratedAppConfig(getIntegrationConfig());
904 if (createRoute) {
905 options = options.setCreateFormAppInit();
906 }
907 break;
908 case _constants__WEBPACK_IMPORTED_MODULE_4__.App.LiveChat:
909 options = new LiveChatAppOptions();
910 if (createRoute) {
911 options = options.setCreateLiveChatAppInit();
912 }
913 break;
914 default:
915 options = new IntegratedAppOptions();
916 }
917 return options;
918 };
919 function useAppEmbedder(app, createRoute, container) {
920 console.info('HubSpot plugin - starting app embedder for:', _constants__WEBPACK_IMPORTED_MODULE_4__.AppIframe[app], container);
921 var iframeNotRendered = (0,_utils_iframe__WEBPACK_IMPORTED_MODULE_6__.useIframeNotRendered)(_constants__WEBPACK_IMPORTED_MODULE_4__.AppIframe[app]);
922 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
923 var _window2 = window,
924 IntegratedAppEmbedder = _window2.IntegratedAppEmbedder;
925 if (!IntegratedAppEmbedder) {
926 return;
927 }
928 var createEmbedder = function createEmbedder() {
929 var accessToken = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
930 var expiresIn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
931 var options = getAppOptions(app, createRoute).setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.deviceId).setAccessToken(accessToken, expiresIn).setLeadinConfig(getLeadinConfig());
932 var embedder = new IntegratedAppEmbedder(_constants__WEBPACK_IMPORTED_MODULE_4__.AppIframe[app], _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.hubspotBaseUrl, _utils_iframe__WEBPACK_IMPORTED_MODULE_6__.resizeWindow, accessToken ? '' : _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.impactLink).setOptions(options);
933 embedder.subscribe(function (message) {
934 (0,_messageMiddleware__WEBPACK_IMPORTED_MODULE_5__.messageMiddleware)(embedder)(message);
935 });
936 embedder.setTokenRenewalCallback(_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_3__.fetchAccessToken);
937 embedder.attachTo(container, true);
938 embedder.postStartAppMessage(); // lets the app know all all data has been passed to it
939 window.embedder = embedder;
940 };
941 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus === 'Connected') {
942 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_3__.fetchAccessToken)().then(function (_ref) {
943 var accessToken = _ref.accessToken,
944 expiresIn = _ref.expiresIn;
945 createEmbedder(accessToken, expiresIn);
946 })["catch"](function () {});
947 } else {
948 createEmbedder();
949 }
950 }, []);
951 if (iframeNotRendered) {
952 console.error('HubSpot plugin Iframe not rendered', {
953 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
954 container: container,
955 appName: _constants__WEBPACK_IMPORTED_MODULE_4__.AppIframe[app],
956 hasIntegratedAppEmbedder: !!window.IntegratedAppEmbedder
957 });
958 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].captureException(new Error('Leadin Iframe not rendered'), {
959 fingerprint: ['USE_APP_EMBEDDER', 'IFRAME_SETUP_ERROR'],
960 extra: {
961 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
962 container: container,
963 app: app,
964 hubspotBaseUrl: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.hubspotBaseUrl,
965 impactLink: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.impactLink,
966 appName: _constants__WEBPACK_IMPORTED_MODULE_4__.AppIframe[app],
967 isConnected: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus === 'Connected'
968 }
969 });
970 }
971 return iframeNotRendered;
972 }
973
974 /***/ }),
975
976 /***/ "./scripts/lib/Raven.ts":
977 /*!******************************!*\
978 !*** ./scripts/lib/Raven.ts ***!
979 \******************************/
980 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
981
982 "use strict";
983 __webpack_require__.r(__webpack_exports__);
984 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
985 /* harmony export */ "configureRaven": () => (/* binding */ configureRaven),
986 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
987 /* harmony export */ });
988 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
989 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__);
990 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
991
992
993 function configureRaven() {
994 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('local') !== -1) {
995 return;
996 }
997 var domain = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.replace(/https?:\/\/app/, '');
998 raven_js__WEBPACK_IMPORTED_MODULE_0___default().config("https://a9f08e536ef66abb0bf90becc905b09e@exceptions".concat(domain, "/v2/1"), {
999 instrument: {
1000 tryCatch: false
1001 },
1002 shouldSendCallback: function shouldSendCallback(data) {
1003 return !!data && !!data.culprit && /plugins\/leadin\//.test(data.culprit);
1004 },
1005 release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion
1006 }).install();
1007 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({
1008 v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion,
1009 php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion,
1010 wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion
1011 });
1012 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({
1013 hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId,
1014 plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) {
1015 return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]);
1016 }).join(',')
1017 });
1018 }
1019 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default()));
1020
1021 /***/ }),
1022
1023 /***/ "./scripts/utils/appUtils.ts":
1024 /*!***********************************!*\
1025 !*** ./scripts/utils/appUtils.ts ***!
1026 \***********************************/
1027 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1028
1029 "use strict";
1030 __webpack_require__.r(__webpack_exports__);
1031 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1032 /* harmony export */ "initApp": () => (/* binding */ initApp),
1033 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
1034 /* harmony export */ });
1035 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
1036 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
1037 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
1038
1039
1040 function initApp(initFn) {
1041 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
1042 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
1043 }
1044 function initAppOnReady(initFn) {
1045 function main() {
1046 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
1047 }
1048 initApp(main);
1049 }
1050
1051 /***/ }),
1052
1053 /***/ "./scripts/utils/contentEmbedInstaller.ts":
1054 /*!************************************************!*\
1055 !*** ./scripts/utils/contentEmbedInstaller.ts ***!
1056 \************************************************/
1057 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1058
1059 "use strict";
1060 __webpack_require__.r(__webpack_exports__);
1061 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1062 /* harmony export */ "startActivation": () => (/* binding */ startActivation),
1063 /* harmony export */ "startInstall": () => (/* binding */ startInstall)
1064 /* harmony export */ });
1065 function startInstall(nonce) {
1066 var formData = new FormData();
1067 var ajaxUrl = window.ajaxurl;
1068 formData.append('_wpnonce', nonce);
1069 formData.append('action', 'content_embed_install');
1070 return fetch(ajaxUrl, {
1071 method: 'POST',
1072 body: formData,
1073 keepalive: true
1074 }).then(function (res) {
1075 return res.json();
1076 });
1077 }
1078 function startActivation(requestUrl) {
1079 return fetch(requestUrl, {
1080 method: 'POST',
1081 keepalive: true
1082 }).then(function (res) {
1083 return res.json();
1084 });
1085 }
1086
1087 /***/ }),
1088
1089 /***/ "./scripts/utils/iframe.ts":
1090 /*!*********************************!*\
1091 !*** ./scripts/utils/iframe.ts ***!
1092 \*********************************/
1093 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1094
1095 "use strict";
1096 __webpack_require__.r(__webpack_exports__);
1097 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1098 /* harmony export */ "resizeWindow": () => (/* binding */ resizeWindow),
1099 /* harmony export */ "useIframeNotRendered": () => (/* binding */ useIframeNotRendered)
1100 /* harmony export */ });
1101 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1102 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1103 function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
1104 function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1105 function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
1106 function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1107 function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
1108 function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1109
1110 var IFRAME_DISPLAY_TIMEOUT = 5000;
1111 function useIframeNotRendered(app) {
1112 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
1113 _useState2 = _slicedToArray(_useState, 2),
1114 iframeNotRendered = _useState2[0],
1115 setIframeNotRendered = _useState2[1];
1116 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1117 var timer = setTimeout(function () {
1118 var iframe = document.getElementById(app);
1119 if (!iframe) {
1120 setIframeNotRendered(true);
1121 }
1122 }, IFRAME_DISPLAY_TIMEOUT);
1123 return function () {
1124 if (timer) {
1125 clearTimeout(timer);
1126 }
1127 };
1128 }, []);
1129 return iframeNotRendered;
1130 }
1131 var resizeWindow = function resizeWindow() {
1132 var adminMenuWrap = document.getElementById('adminmenuwrap');
1133 var sideMenuHeight = adminMenuWrap ? adminMenuWrap.offsetHeight : 0;
1134 var adminBar = document.getElementById('wpadminbar');
1135 var adminBarHeight = adminBar && adminBar.offsetHeight || 0;
1136 var offset = 4;
1137 if (window.innerHeight < sideMenuHeight) {
1138 return sideMenuHeight - offset;
1139 } else {
1140 return window.innerHeight - adminBarHeight - offset;
1141 }
1142 };
1143
1144 /***/ }),
1145
1146 /***/ "./scripts/utils/queryParams.ts":
1147 /*!**************************************!*\
1148 !*** ./scripts/utils/queryParams.ts ***!
1149 \**************************************/
1150 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1151
1152 "use strict";
1153 __webpack_require__.r(__webpack_exports__);
1154 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1155 /* harmony export */ "addQueryObjectToUrl": () => (/* binding */ addQueryObjectToUrl),
1156 /* harmony export */ "removeQueryParamFromLocation": () => (/* binding */ removeQueryParamFromLocation)
1157 /* harmony export */ });
1158 function addQueryObjectToUrl(urlObject, queryParams) {
1159 Object.keys(queryParams).forEach(function (key) {
1160 urlObject.searchParams.append(key, queryParams[key]);
1161 });
1162 }
1163 function removeQueryParamFromLocation(key) {
1164 var location = new URL(window.location.href);
1165 location.searchParams["delete"](key);
1166 window.history.replaceState(null, '', location.href);
1167 }
1168
1169 /***/ }),
1170
1171 /***/ "./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx":
1172 /*!*************************************************************************************************************************************************************************!*\
1173 !*** ./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx ***!
1174 \*************************************************************************************************************************************************************************/
1175 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1176
1177 "use strict";
1178 __webpack_require__.r(__webpack_exports__);
1179 // extracted by mini-css-extract-plugin
1180
1181
1182 /***/ }),
1183
1184 /***/ "./node_modules/raven-js/src/configError.js":
1185 /*!**************************************************!*\
1186 !*** ./node_modules/raven-js/src/configError.js ***!
1187 \**************************************************/
1188 /***/ ((module) => {
1189
1190 function RavenConfigError(message) {
1191 this.name = 'RavenConfigError';
1192 this.message = message;
1193 }
1194 RavenConfigError.prototype = new Error();
1195 RavenConfigError.prototype.constructor = RavenConfigError;
1196
1197 module.exports = RavenConfigError;
1198
1199
1200 /***/ }),
1201
1202 /***/ "./node_modules/raven-js/src/console.js":
1203 /*!**********************************************!*\
1204 !*** ./node_modules/raven-js/src/console.js ***!
1205 \**********************************************/
1206 /***/ ((module) => {
1207
1208 var wrapMethod = function(console, level, callback) {
1209 var originalConsoleLevel = console[level];
1210 var originalConsole = console;
1211
1212 if (!(level in console)) {
1213 return;
1214 }
1215
1216 var sentryLevel = level === 'warn' ? 'warning' : level;
1217
1218 console[level] = function() {
1219 var args = [].slice.call(arguments);
1220
1221 var msg = '' + args.join(' ');
1222 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
1223
1224 if (level === 'assert') {
1225 if (args[0] === false) {
1226 // Default browsers message
1227 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
1228 data.extra.arguments = args.slice(1);
1229 callback && callback(msg, data);
1230 }
1231 } else {
1232 callback && callback(msg, data);
1233 }
1234
1235 // this fails for some browsers. :(
1236 if (originalConsoleLevel) {
1237 // IE9 doesn't allow calling apply on console functions directly
1238 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
1239 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
1240 }
1241 };
1242 };
1243
1244 module.exports = {
1245 wrapMethod: wrapMethod
1246 };
1247
1248
1249 /***/ }),
1250
1251 /***/ "./node_modules/raven-js/src/raven.js":
1252 /*!********************************************!*\
1253 !*** ./node_modules/raven-js/src/raven.js ***!
1254 \********************************************/
1255 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1256
1257 /*global XDomainRequest:false */
1258
1259 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
1260 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
1261 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
1262
1263 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
1264 var isError = utils.isError;
1265 var isObject = utils.isObject;
1266 var isObject = utils.isObject;
1267 var isErrorEvent = utils.isErrorEvent;
1268 var isUndefined = utils.isUndefined;
1269 var isFunction = utils.isFunction;
1270 var isString = utils.isString;
1271 var isEmptyObject = utils.isEmptyObject;
1272 var each = utils.each;
1273 var objectMerge = utils.objectMerge;
1274 var truncate = utils.truncate;
1275 var objectFrozen = utils.objectFrozen;
1276 var hasKey = utils.hasKey;
1277 var joinRegExp = utils.joinRegExp;
1278 var urlencode = utils.urlencode;
1279 var uuid4 = utils.uuid4;
1280 var htmlTreeAsString = utils.htmlTreeAsString;
1281 var isSameException = utils.isSameException;
1282 var isSameStacktrace = utils.isSameStacktrace;
1283 var parseUrl = utils.parseUrl;
1284 var fill = utils.fill;
1285
1286 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
1287
1288 var dsnKeys = 'source protocol user pass host port path'.split(' '),
1289 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
1290
1291 function now() {
1292 return +new Date();
1293 }
1294
1295 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
1296 var _window =
1297 typeof window !== 'undefined'
1298 ? window
1299 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
1300 var _document = _window.document;
1301 var _navigator = _window.navigator;
1302
1303 function keepOriginalCallback(original, callback) {
1304 return isFunction(callback)
1305 ? function(data) {
1306 return callback(data, original);
1307 }
1308 : callback;
1309 }
1310
1311 // First, check for JSON support
1312 // If there is no JSON, we no-op the core features of Raven
1313 // since JSON is required to encode the payload
1314 function Raven() {
1315 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
1316 // Raven can run in contexts where there's no document (react-native)
1317 this._hasDocument = !isUndefined(_document);
1318 this._hasNavigator = !isUndefined(_navigator);
1319 this._lastCapturedException = null;
1320 this._lastData = null;
1321 this._lastEventId = null;
1322 this._globalServer = null;
1323 this._globalKey = null;
1324 this._globalProject = null;
1325 this._globalContext = {};
1326 this._globalOptions = {
1327 logger: 'javascript',
1328 ignoreErrors: [],
1329 ignoreUrls: [],
1330 whitelistUrls: [],
1331 includePaths: [],
1332 collectWindowErrors: true,
1333 maxMessageLength: 0,
1334
1335 // By default, truncates URL values to 250 chars
1336 maxUrlLength: 250,
1337 stackTraceLimit: 50,
1338 autoBreadcrumbs: true,
1339 instrument: true,
1340 sampleRate: 1
1341 };
1342 this._ignoreOnError = 0;
1343 this._isRavenInstalled = false;
1344 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
1345 // capture references to window.console *and* all its methods first
1346 // before the console plugin has a chance to monkey patch
1347 this._originalConsole = _window.console || {};
1348 this._originalConsoleMethods = {};
1349 this._plugins = [];
1350 this._startTime = now();
1351 this._wrappedBuiltIns = [];
1352 this._breadcrumbs = [];
1353 this._lastCapturedEvent = null;
1354 this._keypressTimeout;
1355 this._location = _window.location;
1356 this._lastHref = this._location && this._location.href;
1357 this._resetBackoff();
1358
1359 // eslint-disable-next-line guard-for-in
1360 for (var method in this._originalConsole) {
1361 this._originalConsoleMethods[method] = this._originalConsole[method];
1362 }
1363 }
1364
1365 /*
1366 * The core Raven singleton
1367 *
1368 * @this {Raven}
1369 */
1370
1371 Raven.prototype = {
1372 // Hardcode version string so that raven source can be loaded directly via
1373 // webpack (using a build step causes webpack #1617). Grunt verifies that
1374 // this value matches package.json during build.
1375 // See: https://github.com/getsentry/raven-js/issues/465
1376 VERSION: '3.19.1',
1377
1378 debug: false,
1379
1380 TraceKit: TraceKit, // alias to TraceKit
1381
1382 /*
1383 * Configure Raven with a DSN and extra options
1384 *
1385 * @param {string} dsn The public Sentry DSN
1386 * @param {object} options Set of global options [optional]
1387 * @return {Raven}
1388 */
1389 config: function(dsn, options) {
1390 var self = this;
1391
1392 if (self._globalServer) {
1393 this._logDebug('error', 'Error: Raven has already been configured');
1394 return self;
1395 }
1396 if (!dsn) return self;
1397
1398 var globalOptions = self._globalOptions;
1399
1400 // merge in options
1401 if (options) {
1402 each(options, function(key, value) {
1403 // tags and extra are special and need to be put into context
1404 if (key === 'tags' || key === 'extra' || key === 'user') {
1405 self._globalContext[key] = value;
1406 } else {
1407 globalOptions[key] = value;
1408 }
1409 });
1410 }
1411
1412 self.setDSN(dsn);
1413
1414 // "Script error." is hard coded into browsers for errors that it can't read.
1415 // this is the result of a script being pulled in from an external domain and CORS.
1416 globalOptions.ignoreErrors.push(/^Script error\.?$/);
1417 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
1418
1419 // join regexp rules into one big rule
1420 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
1421 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
1422 ? joinRegExp(globalOptions.ignoreUrls)
1423 : false;
1424 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
1425 ? joinRegExp(globalOptions.whitelistUrls)
1426 : false;
1427 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
1428 globalOptions.maxBreadcrumbs = Math.max(
1429 0,
1430 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
1431 ); // default and hard limit is 100
1432
1433 var autoBreadcrumbDefaults = {
1434 xhr: true,
1435 console: true,
1436 dom: true,
1437 location: true
1438 };
1439
1440 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
1441 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
1442 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
1443 } else if (autoBreadcrumbs !== false) {
1444 autoBreadcrumbs = autoBreadcrumbDefaults;
1445 }
1446 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
1447
1448 var instrumentDefaults = {
1449 tryCatch: true
1450 };
1451
1452 var instrument = globalOptions.instrument;
1453 if ({}.toString.call(instrument) === '[object Object]') {
1454 instrument = objectMerge(instrumentDefaults, instrument);
1455 } else if (instrument !== false) {
1456 instrument = instrumentDefaults;
1457 }
1458 globalOptions.instrument = instrument;
1459
1460 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
1461
1462 // return for chaining
1463 return self;
1464 },
1465
1466 /*
1467 * Installs a global window.onerror error handler
1468 * to capture and report uncaught exceptions.
1469 * At this point, install() is required to be called due
1470 * to the way TraceKit is set up.
1471 *
1472 * @return {Raven}
1473 */
1474 install: function() {
1475 var self = this;
1476 if (self.isSetup() && !self._isRavenInstalled) {
1477 TraceKit.report.subscribe(function() {
1478 self._handleOnErrorStackInfo.apply(self, arguments);
1479 });
1480 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
1481 self._instrumentTryCatch();
1482 }
1483
1484 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
1485
1486 // Install all of the plugins
1487 self._drainPlugins();
1488
1489 self._isRavenInstalled = true;
1490 }
1491
1492 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
1493 return this;
1494 },
1495
1496 /*
1497 * Set the DSN (can be called multiple time unlike config)
1498 *
1499 * @param {string} dsn The public Sentry DSN
1500 */
1501 setDSN: function(dsn) {
1502 var self = this,
1503 uri = self._parseDSN(dsn),
1504 lastSlash = uri.path.lastIndexOf('/'),
1505 path = uri.path.substr(1, lastSlash);
1506
1507 self._dsn = dsn;
1508 self._globalKey = uri.user;
1509 self._globalSecret = uri.pass && uri.pass.substr(1);
1510 self._globalProject = uri.path.substr(lastSlash + 1);
1511
1512 self._globalServer = self._getGlobalServer(uri);
1513
1514 self._globalEndpoint =
1515 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
1516
1517 // Reset backoff state since we may be pointing at a
1518 // new project/server
1519 this._resetBackoff();
1520 },
1521
1522 /*
1523 * Wrap code within a context so Raven can capture errors
1524 * reliably across domains that is executed immediately.
1525 *
1526 * @param {object} options A specific set of options for this context [optional]
1527 * @param {function} func The callback to be immediately executed within the context
1528 * @param {array} args An array of arguments to be called with the callback [optional]
1529 */
1530 context: function(options, func, args) {
1531 if (isFunction(options)) {
1532 args = func || [];
1533 func = options;
1534 options = undefined;
1535 }
1536
1537 return this.wrap(options, func).apply(this, args);
1538 },
1539
1540 /*
1541 * Wrap code within a context and returns back a new function to be executed
1542 *
1543 * @param {object} options A specific set of options for this context [optional]
1544 * @param {function} func The function to be wrapped in a new context
1545 * @param {function} func A function to call before the try/catch wrapper [optional, private]
1546 * @return {function} The newly wrapped functions with a context
1547 */
1548 wrap: function(options, func, _before) {
1549 var self = this;
1550 // 1 argument has been passed, and it's not a function
1551 // so just return it
1552 if (isUndefined(func) && !isFunction(options)) {
1553 return options;
1554 }
1555
1556 // options is optional
1557 if (isFunction(options)) {
1558 func = options;
1559 options = undefined;
1560 }
1561
1562 // At this point, we've passed along 2 arguments, and the second one
1563 // is not a function either, so we'll just return the second argument.
1564 if (!isFunction(func)) {
1565 return func;
1566 }
1567
1568 // We don't wanna wrap it twice!
1569 try {
1570 if (func.__raven__) {
1571 return func;
1572 }
1573
1574 // If this has already been wrapped in the past, return that
1575 if (func.__raven_wrapper__) {
1576 return func.__raven_wrapper__;
1577 }
1578 } catch (e) {
1579 // Just accessing custom props in some Selenium environments
1580 // can cause a "Permission denied" exception (see raven-js#495).
1581 // Bail on wrapping and return the function as-is (defers to window.onerror).
1582 return func;
1583 }
1584
1585 function wrapped() {
1586 var args = [],
1587 i = arguments.length,
1588 deep = !options || (options && options.deep !== false);
1589
1590 if (_before && isFunction(_before)) {
1591 _before.apply(this, arguments);
1592 }
1593
1594 // Recursively wrap all of a function's arguments that are
1595 // functions themselves.
1596 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
1597
1598 try {
1599 // Attempt to invoke user-land function
1600 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
1601 // means Raven caught an error invoking your application code. This is
1602 // expected behavior and NOT indicative of a bug with Raven.js.
1603 return func.apply(this, args);
1604 } catch (e) {
1605 self._ignoreNextOnError();
1606 self.captureException(e, options);
1607 throw e;
1608 }
1609 }
1610
1611 // copy over properties of the old function
1612 for (var property in func) {
1613 if (hasKey(func, property)) {
1614 wrapped[property] = func[property];
1615 }
1616 }
1617 wrapped.prototype = func.prototype;
1618
1619 func.__raven_wrapper__ = wrapped;
1620 // Signal that this function has been wrapped already
1621 // for both debugging and to prevent it to being wrapped twice
1622 wrapped.__raven__ = true;
1623 wrapped.__inner__ = func;
1624
1625 return wrapped;
1626 },
1627
1628 /*
1629 * Uninstalls the global error handler.
1630 *
1631 * @return {Raven}
1632 */
1633 uninstall: function() {
1634 TraceKit.report.uninstall();
1635
1636 this._restoreBuiltIns();
1637
1638 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
1639 this._isRavenInstalled = false;
1640
1641 return this;
1642 },
1643
1644 /*
1645 * Manually capture an exception and send it over to Sentry
1646 *
1647 * @param {error} ex An exception to be logged
1648 * @param {object} options A specific set of options for this error [optional]
1649 * @return {Raven}
1650 */
1651 captureException: function(ex, options) {
1652 // Cases for sending ex as a message, rather than an exception
1653 var isNotError = !isError(ex);
1654 var isNotErrorEvent = !isErrorEvent(ex);
1655 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
1656
1657 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
1658 return this.captureMessage(
1659 ex,
1660 objectMerge(
1661 {
1662 trimHeadFrames: 1,
1663 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
1664 },
1665 options
1666 )
1667 );
1668 }
1669
1670 // Get actual Error from ErrorEvent
1671 if (isErrorEvent(ex)) ex = ex.error;
1672
1673 // Store the raw exception object for potential debugging and introspection
1674 this._lastCapturedException = ex;
1675
1676 // TraceKit.report will re-raise any exception passed to it,
1677 // which means you have to wrap it in try/catch. Instead, we
1678 // can wrap it here and only re-raise if TraceKit.report
1679 // raises an exception different from the one we asked to
1680 // report on.
1681 try {
1682 var stack = TraceKit.computeStackTrace(ex);
1683 this._handleStackInfo(stack, options);
1684 } catch (ex1) {
1685 if (ex !== ex1) {
1686 throw ex1;
1687 }
1688 }
1689
1690 return this;
1691 },
1692
1693 /*
1694 * Manually send a message to Sentry
1695 *
1696 * @param {string} msg A plain message to be captured in Sentry
1697 * @param {object} options A specific set of options for this message [optional]
1698 * @return {Raven}
1699 */
1700 captureMessage: function(msg, options) {
1701 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
1702 // early call; we'll error on the side of logging anything called before configuration since it's
1703 // probably something you should see:
1704 if (
1705 !!this._globalOptions.ignoreErrors.test &&
1706 this._globalOptions.ignoreErrors.test(msg)
1707 ) {
1708 return;
1709 }
1710
1711 options = options || {};
1712
1713 var data = objectMerge(
1714 {
1715 message: msg + '' // Make sure it's actually a string
1716 },
1717 options
1718 );
1719
1720 var ex;
1721 // Generate a "synthetic" stack trace from this point.
1722 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
1723 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
1724 // or if it catches a thrown object without a "stack" property.
1725 try {
1726 throw new Error(msg);
1727 } catch (ex1) {
1728 ex = ex1;
1729 }
1730
1731 // null exception name so `Error` isn't prefixed to msg
1732 ex.name = null;
1733 var stack = TraceKit.computeStackTrace(ex);
1734
1735 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
1736 var initialCall = stack.stack[1];
1737
1738 var fileurl = (initialCall && initialCall.url) || '';
1739
1740 if (
1741 !!this._globalOptions.ignoreUrls.test &&
1742 this._globalOptions.ignoreUrls.test(fileurl)
1743 ) {
1744 return;
1745 }
1746
1747 if (
1748 !!this._globalOptions.whitelistUrls.test &&
1749 !this._globalOptions.whitelistUrls.test(fileurl)
1750 ) {
1751 return;
1752 }
1753
1754 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
1755 options = objectMerge(
1756 {
1757 // fingerprint on msg, not stack trace (legacy behavior, could be
1758 // revisited)
1759 fingerprint: msg,
1760 // since we know this is a synthetic trace, the top N-most frames
1761 // MUST be from Raven.js, so mark them as in_app later by setting
1762 // trimHeadFrames
1763 trimHeadFrames: (options.trimHeadFrames || 0) + 1
1764 },
1765 options
1766 );
1767
1768 var frames = this._prepareFrames(stack, options);
1769 data.stacktrace = {
1770 // Sentry expects frames oldest to newest
1771 frames: frames.reverse()
1772 };
1773 }
1774
1775 // Fire away!
1776 this._send(data);
1777
1778 return this;
1779 },
1780
1781 captureBreadcrumb: function(obj) {
1782 var crumb = objectMerge(
1783 {
1784 timestamp: now() / 1000
1785 },
1786 obj
1787 );
1788
1789 if (isFunction(this._globalOptions.breadcrumbCallback)) {
1790 var result = this._globalOptions.breadcrumbCallback(crumb);
1791
1792 if (isObject(result) && !isEmptyObject(result)) {
1793 crumb = result;
1794 } else if (result === false) {
1795 return this;
1796 }
1797 }
1798
1799 this._breadcrumbs.push(crumb);
1800 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
1801 this._breadcrumbs.shift();
1802 }
1803 return this;
1804 },
1805
1806 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
1807 var pluginArgs = [].slice.call(arguments, 1);
1808
1809 this._plugins.push([plugin, pluginArgs]);
1810 if (this._isRavenInstalled) {
1811 this._drainPlugins();
1812 }
1813
1814 return this;
1815 },
1816
1817 /*
1818 * Set/clear a user to be sent along with the payload.
1819 *
1820 * @param {object} user An object representing user data [optional]
1821 * @return {Raven}
1822 */
1823 setUserContext: function(user) {
1824 // Intentionally do not merge here since that's an unexpected behavior.
1825 this._globalContext.user = user;
1826
1827 return this;
1828 },
1829
1830 /*
1831 * Merge extra attributes to be sent along with the payload.
1832 *
1833 * @param {object} extra An object representing extra data [optional]
1834 * @return {Raven}
1835 */
1836 setExtraContext: function(extra) {
1837 this._mergeContext('extra', extra);
1838
1839 return this;
1840 },
1841
1842 /*
1843 * Merge tags to be sent along with the payload.
1844 *
1845 * @param {object} tags An object representing tags [optional]
1846 * @return {Raven}
1847 */
1848 setTagsContext: function(tags) {
1849 this._mergeContext('tags', tags);
1850
1851 return this;
1852 },
1853
1854 /*
1855 * Clear all of the context.
1856 *
1857 * @return {Raven}
1858 */
1859 clearContext: function() {
1860 this._globalContext = {};
1861
1862 return this;
1863 },
1864
1865 /*
1866 * Get a copy of the current context. This cannot be mutated.
1867 *
1868 * @return {object} copy of context
1869 */
1870 getContext: function() {
1871 // lol javascript
1872 return JSON.parse(stringify(this._globalContext));
1873 },
1874
1875 /*
1876 * Set environment of application
1877 *
1878 * @param {string} environment Typically something like 'production'.
1879 * @return {Raven}
1880 */
1881 setEnvironment: function(environment) {
1882 this._globalOptions.environment = environment;
1883
1884 return this;
1885 },
1886
1887 /*
1888 * Set release version of application
1889 *
1890 * @param {string} release Typically something like a git SHA to identify version
1891 * @return {Raven}
1892 */
1893 setRelease: function(release) {
1894 this._globalOptions.release = release;
1895
1896 return this;
1897 },
1898
1899 /*
1900 * Set the dataCallback option
1901 *
1902 * @param {function} callback The callback to run which allows the
1903 * data blob to be mutated before sending
1904 * @return {Raven}
1905 */
1906 setDataCallback: function(callback) {
1907 var original = this._globalOptions.dataCallback;
1908 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
1909 return this;
1910 },
1911
1912 /*
1913 * Set the breadcrumbCallback option
1914 *
1915 * @param {function} callback The callback to run which allows filtering
1916 * or mutating breadcrumbs
1917 * @return {Raven}
1918 */
1919 setBreadcrumbCallback: function(callback) {
1920 var original = this._globalOptions.breadcrumbCallback;
1921 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
1922 return this;
1923 },
1924
1925 /*
1926 * Set the shouldSendCallback option
1927 *
1928 * @param {function} callback The callback to run which allows
1929 * introspecting the blob before sending
1930 * @return {Raven}
1931 */
1932 setShouldSendCallback: function(callback) {
1933 var original = this._globalOptions.shouldSendCallback;
1934 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
1935 return this;
1936 },
1937
1938 /**
1939 * Override the default HTTP transport mechanism that transmits data
1940 * to the Sentry server.
1941 *
1942 * @param {function} transport Function invoked instead of the default
1943 * `makeRequest` handler.
1944 *
1945 * @return {Raven}
1946 */
1947 setTransport: function(transport) {
1948 this._globalOptions.transport = transport;
1949
1950 return this;
1951 },
1952
1953 /*
1954 * Get the latest raw exception that was captured by Raven.
1955 *
1956 * @return {error}
1957 */
1958 lastException: function() {
1959 return this._lastCapturedException;
1960 },
1961
1962 /*
1963 * Get the last event id
1964 *
1965 * @return {string}
1966 */
1967 lastEventId: function() {
1968 return this._lastEventId;
1969 },
1970
1971 /*
1972 * Determine if Raven is setup and ready to go.
1973 *
1974 * @return {boolean}
1975 */
1976 isSetup: function() {
1977 if (!this._hasJSON) return false; // needs JSON support
1978 if (!this._globalServer) {
1979 if (!this.ravenNotConfiguredError) {
1980 this.ravenNotConfiguredError = true;
1981 this._logDebug('error', 'Error: Raven has not been configured.');
1982 }
1983 return false;
1984 }
1985 return true;
1986 },
1987
1988 afterLoad: function() {
1989 // TODO: remove window dependence?
1990
1991 // Attempt to initialize Raven on load
1992 var RavenConfig = _window.RavenConfig;
1993 if (RavenConfig) {
1994 this.config(RavenConfig.dsn, RavenConfig.config).install();
1995 }
1996 },
1997
1998 showReportDialog: function(options) {
1999 if (
2000 !_document // doesn't work without a document (React native)
2001 )
2002 return;
2003
2004 options = options || {};
2005
2006 var lastEventId = options.eventId || this.lastEventId();
2007 if (!lastEventId) {
2008 throw new RavenConfigError('Missing eventId');
2009 }
2010
2011 var dsn = options.dsn || this._dsn;
2012 if (!dsn) {
2013 throw new RavenConfigError('Missing DSN');
2014 }
2015
2016 var encode = encodeURIComponent;
2017 var qs = '';
2018 qs += '?eventId=' + encode(lastEventId);
2019 qs += '&dsn=' + encode(dsn);
2020
2021 var user = options.user || this._globalContext.user;
2022 if (user) {
2023 if (user.name) qs += '&name=' + encode(user.name);
2024 if (user.email) qs += '&email=' + encode(user.email);
2025 }
2026
2027 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
2028
2029 var script = _document.createElement('script');
2030 script.async = true;
2031 script.src = globalServer + '/api/embed/error-page/' + qs;
2032 (_document.head || _document.body).appendChild(script);
2033 },
2034
2035 /**** Private functions ****/
2036 _ignoreNextOnError: function() {
2037 var self = this;
2038 this._ignoreOnError += 1;
2039 setTimeout(function() {
2040 // onerror should trigger before setTimeout
2041 self._ignoreOnError -= 1;
2042 });
2043 },
2044
2045 _triggerEvent: function(eventType, options) {
2046 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
2047 var evt, key;
2048
2049 if (!this._hasDocument) return;
2050
2051 options = options || {};
2052
2053 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
2054
2055 if (_document.createEvent) {
2056 evt = _document.createEvent('HTMLEvents');
2057 evt.initEvent(eventType, true, true);
2058 } else {
2059 evt = _document.createEventObject();
2060 evt.eventType = eventType;
2061 }
2062
2063 for (key in options)
2064 if (hasKey(options, key)) {
2065 evt[key] = options[key];
2066 }
2067
2068 if (_document.createEvent) {
2069 // IE9 if standards
2070 _document.dispatchEvent(evt);
2071 } else {
2072 // IE8 regardless of Quirks or Standards
2073 // IE9 if quirks
2074 try {
2075 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
2076 } catch (e) {
2077 // Do nothing
2078 }
2079 }
2080 },
2081
2082 /**
2083 * Wraps addEventListener to capture UI breadcrumbs
2084 * @param evtName the event name (e.g. "click")
2085 * @returns {Function}
2086 * @private
2087 */
2088 _breadcrumbEventHandler: function(evtName) {
2089 var self = this;
2090 return function(evt) {
2091 // reset keypress timeout; e.g. triggering a 'click' after
2092 // a 'keypress' will reset the keypress debounce so that a new
2093 // set of keypresses can be recorded
2094 self._keypressTimeout = null;
2095
2096 // It's possible this handler might trigger multiple times for the same
2097 // event (e.g. event propagation through node ancestors). Ignore if we've
2098 // already captured the event.
2099 if (self._lastCapturedEvent === evt) return;
2100
2101 self._lastCapturedEvent = evt;
2102
2103 // try/catch both:
2104 // - accessing evt.target (see getsentry/raven-js#838, #768)
2105 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
2106 // can throw an exception in some circumstances.
2107 var target;
2108 try {
2109 target = htmlTreeAsString(evt.target);
2110 } catch (e) {
2111 target = '<unknown>';
2112 }
2113
2114 self.captureBreadcrumb({
2115 category: 'ui.' + evtName, // e.g. ui.click, ui.input
2116 message: target
2117 });
2118 };
2119 },
2120
2121 /**
2122 * Wraps addEventListener to capture keypress UI events
2123 * @returns {Function}
2124 * @private
2125 */
2126 _keypressEventHandler: function() {
2127 var self = this,
2128 debounceDuration = 1000; // milliseconds
2129
2130 // TODO: if somehow user switches keypress target before
2131 // debounce timeout is triggered, we will only capture
2132 // a single breadcrumb from the FIRST target (acceptable?)
2133 return function(evt) {
2134 var target;
2135 try {
2136 target = evt.target;
2137 } catch (e) {
2138 // just accessing event properties can throw an exception in some rare circumstances
2139 // see: https://github.com/getsentry/raven-js/issues/838
2140 return;
2141 }
2142 var tagName = target && target.tagName;
2143
2144 // only consider keypress events on actual input elements
2145 // this will disregard keypresses targeting body (e.g. tabbing
2146 // through elements, hotkeys, etc)
2147 if (
2148 !tagName ||
2149 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
2150 )
2151 return;
2152
2153 // record first keypress in a series, but ignore subsequent
2154 // keypresses until debounce clears
2155 var timeout = self._keypressTimeout;
2156 if (!timeout) {
2157 self._breadcrumbEventHandler('input')(evt);
2158 }
2159 clearTimeout(timeout);
2160 self._keypressTimeout = setTimeout(function() {
2161 self._keypressTimeout = null;
2162 }, debounceDuration);
2163 };
2164 },
2165
2166 /**
2167 * Captures a breadcrumb of type "navigation", normalizing input URLs
2168 * @param to the originating URL
2169 * @param from the target URL
2170 * @private
2171 */
2172 _captureUrlChange: function(from, to) {
2173 var parsedLoc = parseUrl(this._location.href);
2174 var parsedTo = parseUrl(to);
2175 var parsedFrom = parseUrl(from);
2176
2177 // because onpopstate only tells you the "new" (to) value of location.href, and
2178 // not the previous (from) value, we need to track the value of the current URL
2179 // state ourselves
2180 this._lastHref = to;
2181
2182 // Use only the path component of the URL if the URL matches the current
2183 // document (almost all the time when using pushState)
2184 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
2185 to = parsedTo.relative;
2186 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
2187 from = parsedFrom.relative;
2188
2189 this.captureBreadcrumb({
2190 category: 'navigation',
2191 data: {
2192 to: to,
2193 from: from
2194 }
2195 });
2196 },
2197
2198 /**
2199 * Wrap timer functions and event targets to catch errors and provide
2200 * better metadata.
2201 */
2202 _instrumentTryCatch: function() {
2203 var self = this;
2204
2205 var wrappedBuiltIns = self._wrappedBuiltIns;
2206
2207 function wrapTimeFn(orig) {
2208 return function(fn, t) {
2209 // preserve arity
2210 // Make a copy of the arguments to prevent deoptimization
2211 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
2212 var args = new Array(arguments.length);
2213 for (var i = 0; i < args.length; ++i) {
2214 args[i] = arguments[i];
2215 }
2216 var originalCallback = args[0];
2217 if (isFunction(originalCallback)) {
2218 args[0] = self.wrap(originalCallback);
2219 }
2220
2221 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
2222 // also supports only two arguments and doesn't care what this is, so we
2223 // can just call the original function directly.
2224 if (orig.apply) {
2225 return orig.apply(this, args);
2226 } else {
2227 return orig(args[0], args[1]);
2228 }
2229 };
2230 }
2231
2232 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
2233
2234 function wrapEventTarget(global) {
2235 var proto = _window[global] && _window[global].prototype;
2236 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
2237 fill(
2238 proto,
2239 'addEventListener',
2240 function(orig) {
2241 return function(evtName, fn, capture, secure) {
2242 // preserve arity
2243 try {
2244 if (fn && fn.handleEvent) {
2245 fn.handleEvent = self.wrap(fn.handleEvent);
2246 }
2247 } catch (err) {
2248 // can sometimes get 'Permission denied to access property "handle Event'
2249 }
2250
2251 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
2252 // so that we don't have more than one wrapper function
2253 var before, clickHandler, keypressHandler;
2254
2255 if (
2256 autoBreadcrumbs &&
2257 autoBreadcrumbs.dom &&
2258 (global === 'EventTarget' || global === 'Node')
2259 ) {
2260 // NOTE: generating multiple handlers per addEventListener invocation, should
2261 // revisit and verify we can just use one (almost certainly)
2262 clickHandler = self._breadcrumbEventHandler('click');
2263 keypressHandler = self._keypressEventHandler();
2264 before = function(evt) {
2265 // need to intercept every DOM event in `before` argument, in case that
2266 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
2267 // see #724
2268 if (!evt) return;
2269
2270 var eventType;
2271 try {
2272 eventType = evt.type;
2273 } catch (e) {
2274 // just accessing event properties can throw an exception in some rare circumstances
2275 // see: https://github.com/getsentry/raven-js/issues/838
2276 return;
2277 }
2278 if (eventType === 'click') return clickHandler(evt);
2279 else if (eventType === 'keypress') return keypressHandler(evt);
2280 };
2281 }
2282 return orig.call(
2283 this,
2284 evtName,
2285 self.wrap(fn, undefined, before),
2286 capture,
2287 secure
2288 );
2289 };
2290 },
2291 wrappedBuiltIns
2292 );
2293 fill(
2294 proto,
2295 'removeEventListener',
2296 function(orig) {
2297 return function(evt, fn, capture, secure) {
2298 try {
2299 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
2300 } catch (e) {
2301 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
2302 }
2303 return orig.call(this, evt, fn, capture, secure);
2304 };
2305 },
2306 wrappedBuiltIns
2307 );
2308 }
2309 }
2310
2311 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
2312 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
2313 if (_window.requestAnimationFrame) {
2314 fill(
2315 _window,
2316 'requestAnimationFrame',
2317 function(orig) {
2318 return function(cb) {
2319 return orig(self.wrap(cb));
2320 };
2321 },
2322 wrappedBuiltIns
2323 );
2324 }
2325
2326 // event targets borrowed from bugsnag-js:
2327 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
2328 var eventTargets = [
2329 'EventTarget',
2330 'Window',
2331 'Node',
2332 'ApplicationCache',
2333 'AudioTrackList',
2334 'ChannelMergerNode',
2335 'CryptoOperation',
2336 'EventSource',
2337 'FileReader',
2338 'HTMLUnknownElement',
2339 'IDBDatabase',
2340 'IDBRequest',
2341 'IDBTransaction',
2342 'KeyOperation',
2343 'MediaController',
2344 'MessagePort',
2345 'ModalWindow',
2346 'Notification',
2347 'SVGElementInstance',
2348 'Screen',
2349 'TextTrack',
2350 'TextTrackCue',
2351 'TextTrackList',
2352 'WebSocket',
2353 'WebSocketWorker',
2354 'Worker',
2355 'XMLHttpRequest',
2356 'XMLHttpRequestEventTarget',
2357 'XMLHttpRequestUpload'
2358 ];
2359 for (var i = 0; i < eventTargets.length; i++) {
2360 wrapEventTarget(eventTargets[i]);
2361 }
2362 },
2363
2364 /**
2365 * Instrument browser built-ins w/ breadcrumb capturing
2366 * - XMLHttpRequests
2367 * - DOM interactions (click/typing)
2368 * - window.location changes
2369 * - console
2370 *
2371 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
2372 */
2373 _instrumentBreadcrumbs: function() {
2374 var self = this;
2375 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
2376
2377 var wrappedBuiltIns = self._wrappedBuiltIns;
2378
2379 function wrapProp(prop, xhr) {
2380 if (prop in xhr && isFunction(xhr[prop])) {
2381 fill(xhr, prop, function(orig) {
2382 return self.wrap(orig);
2383 }); // intentionally don't track filled methods on XHR instances
2384 }
2385 }
2386
2387 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
2388 var xhrproto = XMLHttpRequest.prototype;
2389 fill(
2390 xhrproto,
2391 'open',
2392 function(origOpen) {
2393 return function(method, url) {
2394 // preserve arity
2395
2396 // if Sentry key appears in URL, don't capture
2397 if (isString(url) && url.indexOf(self._globalKey) === -1) {
2398 this.__raven_xhr = {
2399 method: method,
2400 url: url,
2401 status_code: null
2402 };
2403 }
2404
2405 return origOpen.apply(this, arguments);
2406 };
2407 },
2408 wrappedBuiltIns
2409 );
2410
2411 fill(
2412 xhrproto,
2413 'send',
2414 function(origSend) {
2415 return function(data) {
2416 // preserve arity
2417 var xhr = this;
2418
2419 function onreadystatechangeHandler() {
2420 if (xhr.__raven_xhr && xhr.readyState === 4) {
2421 try {
2422 // touching statusCode in some platforms throws
2423 // an exception
2424 xhr.__raven_xhr.status_code = xhr.status;
2425 } catch (e) {
2426 /* do nothing */
2427 }
2428
2429 self.captureBreadcrumb({
2430 type: 'http',
2431 category: 'xhr',
2432 data: xhr.__raven_xhr
2433 });
2434 }
2435 }
2436
2437 var props = ['onload', 'onerror', 'onprogress'];
2438 for (var j = 0; j < props.length; j++) {
2439 wrapProp(props[j], xhr);
2440 }
2441
2442 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
2443 fill(
2444 xhr,
2445 'onreadystatechange',
2446 function(orig) {
2447 return self.wrap(orig, undefined, onreadystatechangeHandler);
2448 } /* intentionally don't track this instrumentation */
2449 );
2450 } else {
2451 // if onreadystatechange wasn't actually set by the page on this xhr, we
2452 // are free to set our own and capture the breadcrumb
2453 xhr.onreadystatechange = onreadystatechangeHandler;
2454 }
2455
2456 return origSend.apply(this, arguments);
2457 };
2458 },
2459 wrappedBuiltIns
2460 );
2461 }
2462
2463 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
2464 fill(
2465 _window,
2466 'fetch',
2467 function(origFetch) {
2468 return function(fn, t) {
2469 // preserve arity
2470 // Make a copy of the arguments to prevent deoptimization
2471 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
2472 var args = new Array(arguments.length);
2473 for (var i = 0; i < args.length; ++i) {
2474 args[i] = arguments[i];
2475 }
2476
2477 var fetchInput = args[0];
2478 var method = 'GET';
2479 var url;
2480
2481 if (typeof fetchInput === 'string') {
2482 url = fetchInput;
2483 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
2484 url = fetchInput.url;
2485 if (fetchInput.method) {
2486 method = fetchInput.method;
2487 }
2488 } else {
2489 url = '' + fetchInput;
2490 }
2491
2492 if (args[1] && args[1].method) {
2493 method = args[1].method;
2494 }
2495
2496 var fetchData = {
2497 method: method,
2498 url: url,
2499 status_code: null
2500 };
2501
2502 self.captureBreadcrumb({
2503 type: 'http',
2504 category: 'fetch',
2505 data: fetchData
2506 });
2507
2508 return origFetch.apply(this, args).then(function(response) {
2509 fetchData.status_code = response.status;
2510
2511 return response;
2512 });
2513 };
2514 },
2515 wrappedBuiltIns
2516 );
2517 }
2518
2519 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
2520 // to the document. Do this before we instrument addEventListener.
2521 if (autoBreadcrumbs.dom && this._hasDocument) {
2522 if (_document.addEventListener) {
2523 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
2524 _document.addEventListener('keypress', self._keypressEventHandler(), false);
2525 } else {
2526 // IE8 Compatibility
2527 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
2528 _document.attachEvent('onkeypress', self._keypressEventHandler());
2529 }
2530 }
2531
2532 // record navigation (URL) changes
2533 // NOTE: in Chrome App environment, touching history.pushState, *even inside
2534 // a try/catch block*, will cause Chrome to output an error to console.error
2535 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
2536 var chrome = _window.chrome;
2537 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
2538 var hasPushAndReplaceState =
2539 !isChromePackagedApp &&
2540 _window.history &&
2541 history.pushState &&
2542 history.replaceState;
2543 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
2544 // TODO: remove onpopstate handler on uninstall()
2545 var oldOnPopState = _window.onpopstate;
2546 _window.onpopstate = function() {
2547 var currentHref = self._location.href;
2548 self._captureUrlChange(self._lastHref, currentHref);
2549
2550 if (oldOnPopState) {
2551 return oldOnPopState.apply(this, arguments);
2552 }
2553 };
2554
2555 var historyReplacementFunction = function(origHistFunction) {
2556 // note history.pushState.length is 0; intentionally not declaring
2557 // params to preserve 0 arity
2558 return function(/* state, title, url */) {
2559 var url = arguments.length > 2 ? arguments[2] : undefined;
2560
2561 // url argument is optional
2562 if (url) {
2563 // coerce to string (this is what pushState does)
2564 self._captureUrlChange(self._lastHref, url + '');
2565 }
2566
2567 return origHistFunction.apply(this, arguments);
2568 };
2569 };
2570
2571 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
2572 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
2573 }
2574
2575 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
2576 // console
2577 var consoleMethodCallback = function(msg, data) {
2578 self.captureBreadcrumb({
2579 message: msg,
2580 level: data.level,
2581 category: 'console'
2582 });
2583 };
2584
2585 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
2586 wrapConsoleMethod(console, level, consoleMethodCallback);
2587 });
2588 }
2589 },
2590
2591 _restoreBuiltIns: function() {
2592 // restore any wrapped builtins
2593 var builtin;
2594 while (this._wrappedBuiltIns.length) {
2595 builtin = this._wrappedBuiltIns.shift();
2596
2597 var obj = builtin[0],
2598 name = builtin[1],
2599 orig = builtin[2];
2600
2601 obj[name] = orig;
2602 }
2603 },
2604
2605 _drainPlugins: function() {
2606 var self = this;
2607
2608 // FIX ME TODO
2609 each(this._plugins, function(_, plugin) {
2610 var installer = plugin[0];
2611 var args = plugin[1];
2612 installer.apply(self, [self].concat(args));
2613 });
2614 },
2615
2616 _parseDSN: function(str) {
2617 var m = dsnPattern.exec(str),
2618 dsn = {},
2619 i = 7;
2620
2621 try {
2622 while (i--) dsn[dsnKeys[i]] = m[i] || '';
2623 } catch (e) {
2624 throw new RavenConfigError('Invalid DSN: ' + str);
2625 }
2626
2627 if (dsn.pass && !this._globalOptions.allowSecretKey) {
2628 throw new RavenConfigError(
2629 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
2630 );
2631 }
2632
2633 return dsn;
2634 },
2635
2636 _getGlobalServer: function(uri) {
2637 // assemble the endpoint from the uri pieces
2638 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
2639
2640 if (uri.protocol) {
2641 globalServer = uri.protocol + ':' + globalServer;
2642 }
2643 return globalServer;
2644 },
2645
2646 _handleOnErrorStackInfo: function() {
2647 // if we are intentionally ignoring errors via onerror, bail out
2648 if (!this._ignoreOnError) {
2649 this._handleStackInfo.apply(this, arguments);
2650 }
2651 },
2652
2653 _handleStackInfo: function(stackInfo, options) {
2654 var frames = this._prepareFrames(stackInfo, options);
2655
2656 this._triggerEvent('handle', {
2657 stackInfo: stackInfo,
2658 options: options
2659 });
2660
2661 this._processException(
2662 stackInfo.name,
2663 stackInfo.message,
2664 stackInfo.url,
2665 stackInfo.lineno,
2666 frames,
2667 options
2668 );
2669 },
2670
2671 _prepareFrames: function(stackInfo, options) {
2672 var self = this;
2673 var frames = [];
2674 if (stackInfo.stack && stackInfo.stack.length) {
2675 each(stackInfo.stack, function(i, stack) {
2676 var frame = self._normalizeFrame(stack, stackInfo.url);
2677 if (frame) {
2678 frames.push(frame);
2679 }
2680 });
2681
2682 // e.g. frames captured via captureMessage throw
2683 if (options && options.trimHeadFrames) {
2684 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
2685 frames[j].in_app = false;
2686 }
2687 }
2688 }
2689 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
2690 return frames;
2691 },
2692
2693 _normalizeFrame: function(frame, stackInfoUrl) {
2694 // normalize the frames data
2695 var normalized = {
2696 filename: frame.url,
2697 lineno: frame.line,
2698 colno: frame.column,
2699 function: frame.func || '?'
2700 };
2701
2702 // Case when we don't have any information about the error
2703 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
2704 // Generating synthetic error doesn't add any value here
2705 //
2706 // We should probably somehow let a user know that they should fix their code
2707 if (!frame.url) {
2708 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
2709 }
2710
2711 normalized.in_app = !// determine if an exception came from outside of our app
2712 // first we check the global includePaths list.
2713 (
2714 (!!this._globalOptions.includePaths.test &&
2715 !this._globalOptions.includePaths.test(normalized.filename)) ||
2716 // Now we check for fun, if the function name is Raven or TraceKit
2717 /(Raven|TraceKit)\./.test(normalized['function']) ||
2718 // finally, we do a last ditch effort and check for raven.min.js
2719 /raven\.(min\.)?js$/.test(normalized.filename)
2720 );
2721
2722 return normalized;
2723 },
2724
2725 _processException: function(type, message, fileurl, lineno, frames, options) {
2726 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
2727 if (
2728 !!this._globalOptions.ignoreErrors.test &&
2729 (this._globalOptions.ignoreErrors.test(message) ||
2730 this._globalOptions.ignoreErrors.test(prefixedMessage))
2731 ) {
2732 return;
2733 }
2734
2735 var stacktrace;
2736
2737 if (frames && frames.length) {
2738 fileurl = frames[0].filename || fileurl;
2739 // Sentry expects frames oldest to newest
2740 // and JS sends them as newest to oldest
2741 frames.reverse();
2742 stacktrace = {frames: frames};
2743 } else if (fileurl) {
2744 stacktrace = {
2745 frames: [
2746 {
2747 filename: fileurl,
2748 lineno: lineno,
2749 in_app: true
2750 }
2751 ]
2752 };
2753 }
2754
2755 if (
2756 !!this._globalOptions.ignoreUrls.test &&
2757 this._globalOptions.ignoreUrls.test(fileurl)
2758 ) {
2759 return;
2760 }
2761
2762 if (
2763 !!this._globalOptions.whitelistUrls.test &&
2764 !this._globalOptions.whitelistUrls.test(fileurl)
2765 ) {
2766 return;
2767 }
2768
2769 var data = objectMerge(
2770 {
2771 // sentry.interfaces.Exception
2772 exception: {
2773 values: [
2774 {
2775 type: type,
2776 value: message,
2777 stacktrace: stacktrace
2778 }
2779 ]
2780 },
2781 culprit: fileurl
2782 },
2783 options
2784 );
2785
2786 // Fire away!
2787 this._send(data);
2788 },
2789
2790 _trimPacket: function(data) {
2791 // For now, we only want to truncate the two different messages
2792 // but this could/should be expanded to just trim everything
2793 var max = this._globalOptions.maxMessageLength;
2794 if (data.message) {
2795 data.message = truncate(data.message, max);
2796 }
2797 if (data.exception) {
2798 var exception = data.exception.values[0];
2799 exception.value = truncate(exception.value, max);
2800 }
2801
2802 var request = data.request;
2803 if (request) {
2804 if (request.url) {
2805 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
2806 }
2807 if (request.Referer) {
2808 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
2809 }
2810 }
2811
2812 if (data.breadcrumbs && data.breadcrumbs.values)
2813 this._trimBreadcrumbs(data.breadcrumbs);
2814
2815 return data;
2816 },
2817
2818 /**
2819 * Truncate breadcrumb values (right now just URLs)
2820 */
2821 _trimBreadcrumbs: function(breadcrumbs) {
2822 // known breadcrumb properties with urls
2823 // TODO: also consider arbitrary prop values that start with (https?)?://
2824 var urlProps = ['to', 'from', 'url'],
2825 urlProp,
2826 crumb,
2827 data;
2828
2829 for (var i = 0; i < breadcrumbs.values.length; ++i) {
2830 crumb = breadcrumbs.values[i];
2831 if (
2832 !crumb.hasOwnProperty('data') ||
2833 !isObject(crumb.data) ||
2834 objectFrozen(crumb.data)
2835 )
2836 continue;
2837
2838 data = objectMerge({}, crumb.data);
2839 for (var j = 0; j < urlProps.length; ++j) {
2840 urlProp = urlProps[j];
2841 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
2842 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
2843 }
2844 }
2845 breadcrumbs.values[i].data = data;
2846 }
2847 },
2848
2849 _getHttpData: function() {
2850 if (!this._hasNavigator && !this._hasDocument) return;
2851 var httpData = {};
2852
2853 if (this._hasNavigator && _navigator.userAgent) {
2854 httpData.headers = {
2855 'User-Agent': navigator.userAgent
2856 };
2857 }
2858
2859 if (this._hasDocument) {
2860 if (_document.location && _document.location.href) {
2861 httpData.url = _document.location.href;
2862 }
2863 if (_document.referrer) {
2864 if (!httpData.headers) httpData.headers = {};
2865 httpData.headers.Referer = _document.referrer;
2866 }
2867 }
2868
2869 return httpData;
2870 },
2871
2872 _resetBackoff: function() {
2873 this._backoffDuration = 0;
2874 this._backoffStart = null;
2875 },
2876
2877 _shouldBackoff: function() {
2878 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
2879 },
2880
2881 /**
2882 * Returns true if the in-process data payload matches the signature
2883 * of the previously-sent data
2884 *
2885 * NOTE: This has to be done at this level because TraceKit can generate
2886 * data from window.onerror WITHOUT an exception object (IE8, IE9,
2887 * other old browsers). This can take the form of an "exception"
2888 * data object with a single frame (derived from the onerror args).
2889 */
2890 _isRepeatData: function(current) {
2891 var last = this._lastData;
2892
2893 if (
2894 !last ||
2895 current.message !== last.message || // defined for captureMessage
2896 current.culprit !== last.culprit // defined for captureException/onerror
2897 )
2898 return false;
2899
2900 // Stacktrace interface (i.e. from captureMessage)
2901 if (current.stacktrace || last.stacktrace) {
2902 return isSameStacktrace(current.stacktrace, last.stacktrace);
2903 } else if (current.exception || last.exception) {
2904 // Exception interface (i.e. from captureException/onerror)
2905 return isSameException(current.exception, last.exception);
2906 }
2907
2908 return true;
2909 },
2910
2911 _setBackoffState: function(request) {
2912 // If we are already in a backoff state, don't change anything
2913 if (this._shouldBackoff()) {
2914 return;
2915 }
2916
2917 var status = request.status;
2918
2919 // 400 - project_id doesn't exist or some other fatal
2920 // 401 - invalid/revoked dsn
2921 // 429 - too many requests
2922 if (!(status === 400 || status === 401 || status === 429)) return;
2923
2924 var retry;
2925 try {
2926 // If Retry-After is not in Access-Control-Expose-Headers, most
2927 // browsers will throw an exception trying to access it
2928 retry = request.getResponseHeader('Retry-After');
2929 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
2930 } catch (e) {
2931 /* eslint no-empty:0 */
2932 }
2933
2934 this._backoffDuration = retry
2935 ? // If Sentry server returned a Retry-After value, use it
2936 retry
2937 : // Otherwise, double the last backoff duration (starts at 1 sec)
2938 this._backoffDuration * 2 || 1000;
2939
2940 this._backoffStart = now();
2941 },
2942
2943 _send: function(data) {
2944 var globalOptions = this._globalOptions;
2945
2946 var baseData = {
2947 project: this._globalProject,
2948 logger: globalOptions.logger,
2949 platform: 'javascript'
2950 },
2951 httpData = this._getHttpData();
2952
2953 if (httpData) {
2954 baseData.request = httpData;
2955 }
2956
2957 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
2958 if (data.trimHeadFrames) delete data.trimHeadFrames;
2959
2960 data = objectMerge(baseData, data);
2961
2962 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
2963 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
2964 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
2965
2966 // Send along our own collected metadata with extra
2967 data.extra['session:duration'] = now() - this._startTime;
2968
2969 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
2970 // intentionally make shallow copy so that additions
2971 // to breadcrumbs aren't accidentally sent in this request
2972 data.breadcrumbs = {
2973 values: [].slice.call(this._breadcrumbs, 0)
2974 };
2975 }
2976
2977 // If there are no tags/extra, strip the key from the payload alltogther.
2978 if (isEmptyObject(data.tags)) delete data.tags;
2979
2980 if (this._globalContext.user) {
2981 // sentry.interfaces.User
2982 data.user = this._globalContext.user;
2983 }
2984
2985 // Include the environment if it's defined in globalOptions
2986 if (globalOptions.environment) data.environment = globalOptions.environment;
2987
2988 // Include the release if it's defined in globalOptions
2989 if (globalOptions.release) data.release = globalOptions.release;
2990
2991 // Include server_name if it's defined in globalOptions
2992 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
2993
2994 if (isFunction(globalOptions.dataCallback)) {
2995 data = globalOptions.dataCallback(data) || data;
2996 }
2997
2998 // Why??????????
2999 if (!data || isEmptyObject(data)) {
3000 return;
3001 }
3002
3003 // Check if the request should be filtered or not
3004 if (
3005 isFunction(globalOptions.shouldSendCallback) &&
3006 !globalOptions.shouldSendCallback(data)
3007 ) {
3008 return;
3009 }
3010
3011 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
3012 // so drop requests until "cool-off" period has elapsed.
3013 if (this._shouldBackoff()) {
3014 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
3015 return;
3016 }
3017
3018 if (typeof globalOptions.sampleRate === 'number') {
3019 if (Math.random() < globalOptions.sampleRate) {
3020 this._sendProcessedPayload(data);
3021 }
3022 } else {
3023 this._sendProcessedPayload(data);
3024 }
3025 },
3026
3027 _getUuid: function() {
3028 return uuid4();
3029 },
3030
3031 _sendProcessedPayload: function(data, callback) {
3032 var self = this;
3033 var globalOptions = this._globalOptions;
3034
3035 if (!this.isSetup()) return;
3036
3037 // Try and clean up the packet before sending by truncating long values
3038 data = this._trimPacket(data);
3039
3040 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
3041 // but this would require copying an un-truncated copy of the data packet, which can be
3042 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
3043 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
3044 this._logDebug('warn', 'Raven dropped repeat event: ', data);
3045 return;
3046 }
3047
3048 // Send along an event_id if not explicitly passed.
3049 // This event_id can be used to reference the error within Sentry itself.
3050 // Set lastEventId after we know the error should actually be sent
3051 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
3052
3053 // Store outbound payload after trim
3054 this._lastData = data;
3055
3056 this._logDebug('debug', 'Raven about to send:', data);
3057
3058 var auth = {
3059 sentry_version: '7',
3060 sentry_client: 'raven-js/' + this.VERSION,
3061 sentry_key: this._globalKey
3062 };
3063
3064 if (this._globalSecret) {
3065 auth.sentry_secret = this._globalSecret;
3066 }
3067
3068 var exception = data.exception && data.exception.values[0];
3069 this.captureBreadcrumb({
3070 category: 'sentry',
3071 message: exception
3072 ? (exception.type ? exception.type + ': ' : '') + exception.value
3073 : data.message,
3074 event_id: data.event_id,
3075 level: data.level || 'error' // presume error unless specified
3076 });
3077
3078 var url = this._globalEndpoint;
3079 (globalOptions.transport || this._makeRequest).call(this, {
3080 url: url,
3081 auth: auth,
3082 data: data,
3083 options: globalOptions,
3084 onSuccess: function success() {
3085 self._resetBackoff();
3086
3087 self._triggerEvent('success', {
3088 data: data,
3089 src: url
3090 });
3091 callback && callback();
3092 },
3093 onError: function failure(error) {
3094 self._logDebug('error', 'Raven transport failed to send: ', error);
3095
3096 if (error.request) {
3097 self._setBackoffState(error.request);
3098 }
3099
3100 self._triggerEvent('failure', {
3101 data: data,
3102 src: url
3103 });
3104 error = error || new Error('Raven send failed (no additional details provided)');
3105 callback && callback(error);
3106 }
3107 });
3108 },
3109
3110 _makeRequest: function(opts) {
3111 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
3112 if (!request) return;
3113
3114 // if browser doesn't support CORS (e.g. IE7), we are out of luck
3115 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
3116
3117 if (!hasCORS) return;
3118
3119 var url = opts.url;
3120
3121 if ('withCredentials' in request) {
3122 request.onreadystatechange = function() {
3123 if (request.readyState !== 4) {
3124 return;
3125 } else if (request.status === 200) {
3126 opts.onSuccess && opts.onSuccess();
3127 } else if (opts.onError) {
3128 var err = new Error('Sentry error code: ' + request.status);
3129 err.request = request;
3130 opts.onError(err);
3131 }
3132 };
3133 } else {
3134 request = new XDomainRequest();
3135 // xdomainrequest cannot go http -> https (or vice versa),
3136 // so always use protocol relative
3137 url = url.replace(/^https?:/, '');
3138
3139 // onreadystatechange not supported by XDomainRequest
3140 if (opts.onSuccess) {
3141 request.onload = opts.onSuccess;
3142 }
3143 if (opts.onError) {
3144 request.onerror = function() {
3145 var err = new Error('Sentry error code: XDomainRequest');
3146 err.request = request;
3147 opts.onError(err);
3148 };
3149 }
3150 }
3151
3152 // NOTE: auth is intentionally sent as part of query string (NOT as custom
3153 // HTTP header) so as to avoid preflight CORS requests
3154 request.open('POST', url + '?' + urlencode(opts.auth));
3155 request.send(stringify(opts.data));
3156 },
3157
3158 _logDebug: function(level) {
3159 if (this._originalConsoleMethods[level] && this.debug) {
3160 // In IE<10 console methods do not have their own 'apply' method
3161 Function.prototype.apply.call(
3162 this._originalConsoleMethods[level],
3163 this._originalConsole,
3164 [].slice.call(arguments, 1)
3165 );
3166 }
3167 },
3168
3169 _mergeContext: function(key, context) {
3170 if (isUndefined(context)) {
3171 delete this._globalContext[key];
3172 } else {
3173 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
3174 }
3175 }
3176 };
3177
3178 // Deprecations
3179 Raven.prototype.setUser = Raven.prototype.setUserContext;
3180 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
3181
3182 module.exports = Raven;
3183
3184
3185 /***/ }),
3186
3187 /***/ "./node_modules/raven-js/src/singleton.js":
3188 /*!************************************************!*\
3189 !*** ./node_modules/raven-js/src/singleton.js ***!
3190 \************************************************/
3191 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3192
3193 /**
3194 * Enforces a single instance of the Raven client, and the
3195 * main entry point for Raven. If you are a consumer of the
3196 * Raven library, you SHOULD load this file (vs raven.js).
3197 **/
3198
3199 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
3200
3201 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
3202 var _window =
3203 typeof window !== 'undefined'
3204 ? window
3205 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3206 var _Raven = _window.Raven;
3207
3208 var Raven = new RavenConstructor();
3209
3210 /*
3211 * Allow multiple versions of Raven to be installed.
3212 * Strip Raven from the global context and returns the instance.
3213 *
3214 * @return {Raven}
3215 */
3216 Raven.noConflict = function() {
3217 _window.Raven = _Raven;
3218 return Raven;
3219 };
3220
3221 Raven.afterLoad();
3222
3223 module.exports = Raven;
3224
3225
3226 /***/ }),
3227
3228 /***/ "./node_modules/raven-js/src/utils.js":
3229 /*!********************************************!*\
3230 !*** ./node_modules/raven-js/src/utils.js ***!
3231 \********************************************/
3232 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3233
3234 var _window =
3235 typeof window !== 'undefined'
3236 ? window
3237 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3238
3239 function isObject(what) {
3240 return typeof what === 'object' && what !== null;
3241 }
3242
3243 // Yanked from https://git.io/vS8DV re-used under CC0
3244 // with some tiny modifications
3245 function isError(value) {
3246 switch ({}.toString.call(value)) {
3247 case '[object Error]':
3248 return true;
3249 case '[object Exception]':
3250 return true;
3251 case '[object DOMException]':
3252 return true;
3253 default:
3254 return value instanceof Error;
3255 }
3256 }
3257
3258 function isErrorEvent(value) {
3259 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
3260 }
3261
3262 function isUndefined(what) {
3263 return what === void 0;
3264 }
3265
3266 function isFunction(what) {
3267 return typeof what === 'function';
3268 }
3269
3270 function isString(what) {
3271 return Object.prototype.toString.call(what) === '[object String]';
3272 }
3273
3274 function isEmptyObject(what) {
3275 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
3276 return true;
3277 }
3278
3279 function supportsErrorEvent() {
3280 try {
3281 new ErrorEvent(''); // eslint-disable-line no-new
3282 return true;
3283 } catch (e) {
3284 return false;
3285 }
3286 }
3287
3288 function wrappedCallback(callback) {
3289 function dataCallback(data, original) {
3290 var normalizedData = callback(data) || data;
3291 if (original) {
3292 return original(normalizedData) || normalizedData;
3293 }
3294 return normalizedData;
3295 }
3296
3297 return dataCallback;
3298 }
3299
3300 function each(obj, callback) {
3301 var i, j;
3302
3303 if (isUndefined(obj.length)) {
3304 for (i in obj) {
3305 if (hasKey(obj, i)) {
3306 callback.call(null, i, obj[i]);
3307 }
3308 }
3309 } else {
3310 j = obj.length;
3311 if (j) {
3312 for (i = 0; i < j; i++) {
3313 callback.call(null, i, obj[i]);
3314 }
3315 }
3316 }
3317 }
3318
3319 function objectMerge(obj1, obj2) {
3320 if (!obj2) {
3321 return obj1;
3322 }
3323 each(obj2, function(key, value) {
3324 obj1[key] = value;
3325 });
3326 return obj1;
3327 }
3328
3329 /**
3330 * This function is only used for react-native.
3331 * react-native freezes object that have already been sent over the
3332 * js bridge. We need this function in order to check if the object is frozen.
3333 * So it's ok that objectFrozen returns false if Object.isFrozen is not
3334 * supported because it's not relevant for other "platforms". See related issue:
3335 * https://github.com/getsentry/react-native-sentry/issues/57
3336 */
3337 function objectFrozen(obj) {
3338 if (!Object.isFrozen) {
3339 return false;
3340 }
3341 return Object.isFrozen(obj);
3342 }
3343
3344 function truncate(str, max) {
3345 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
3346 }
3347
3348 /**
3349 * hasKey, a better form of hasOwnProperty
3350 * Example: hasKey(MainHostObject, property) === true/false
3351 *
3352 * @param {Object} host object to check property
3353 * @param {string} key to check
3354 */
3355 function hasKey(object, key) {
3356 return Object.prototype.hasOwnProperty.call(object, key);
3357 }
3358
3359 function joinRegExp(patterns) {
3360 // Combine an array of regular expressions and strings into one large regexp
3361 // Be mad.
3362 var sources = [],
3363 i = 0,
3364 len = patterns.length,
3365 pattern;
3366
3367 for (; i < len; i++) {
3368 pattern = patterns[i];
3369 if (isString(pattern)) {
3370 // If it's a string, we need to escape it
3371 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
3372 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
3373 } else if (pattern && pattern.source) {
3374 // If it's a regexp already, we want to extract the source
3375 sources.push(pattern.source);
3376 }
3377 // Intentionally skip other cases
3378 }
3379 return new RegExp(sources.join('|'), 'i');
3380 }
3381
3382 function urlencode(o) {
3383 var pairs = [];
3384 each(o, function(key, value) {
3385 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
3386 });
3387 return pairs.join('&');
3388 }
3389
3390 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
3391 // intentionally using regex and not <a/> href parsing trick because React Native and other
3392 // environments where DOM might not be available
3393 function parseUrl(url) {
3394 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
3395 if (!match) return {};
3396
3397 // coerce to undefined values to empty string so we don't get 'undefined'
3398 var query = match[6] || '';
3399 var fragment = match[8] || '';
3400 return {
3401 protocol: match[2],
3402 host: match[4],
3403 path: match[5],
3404 relative: match[5] + query + fragment // everything minus origin
3405 };
3406 }
3407 function uuid4() {
3408 var crypto = _window.crypto || _window.msCrypto;
3409
3410 if (!isUndefined(crypto) && crypto.getRandomValues) {
3411 // Use window.crypto API if available
3412 // eslint-disable-next-line no-undef
3413 var arr = new Uint16Array(8);
3414 crypto.getRandomValues(arr);
3415
3416 // set 4 in byte 7
3417 arr[3] = (arr[3] & 0xfff) | 0x4000;
3418 // set 2 most significant bits of byte 9 to '10'
3419 arr[4] = (arr[4] & 0x3fff) | 0x8000;
3420
3421 var pad = function(num) {
3422 var v = num.toString(16);
3423 while (v.length < 4) {
3424 v = '0' + v;
3425 }
3426 return v;
3427 };
3428
3429 return (
3430 pad(arr[0]) +
3431 pad(arr[1]) +
3432 pad(arr[2]) +
3433 pad(arr[3]) +
3434 pad(arr[4]) +
3435 pad(arr[5]) +
3436 pad(arr[6]) +
3437 pad(arr[7])
3438 );
3439 } else {
3440 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
3441 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
3442 var r = (Math.random() * 16) | 0,
3443 v = c === 'x' ? r : (r & 0x3) | 0x8;
3444 return v.toString(16);
3445 });
3446 }
3447 }
3448
3449 /**
3450 * Given a child DOM element, returns a query-selector statement describing that
3451 * and its ancestors
3452 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
3453 * @param elem
3454 * @returns {string}
3455 */
3456 function htmlTreeAsString(elem) {
3457 /* eslint no-extra-parens:0*/
3458 var MAX_TRAVERSE_HEIGHT = 5,
3459 MAX_OUTPUT_LEN = 80,
3460 out = [],
3461 height = 0,
3462 len = 0,
3463 separator = ' > ',
3464 sepLength = separator.length,
3465 nextStr;
3466
3467 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
3468 nextStr = htmlElementAsString(elem);
3469 // bail out if
3470 // - nextStr is the 'html' element
3471 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
3472 // (ignore this limit if we are on the first iteration)
3473 if (
3474 nextStr === 'html' ||
3475 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
3476 ) {
3477 break;
3478 }
3479
3480 out.push(nextStr);
3481
3482 len += nextStr.length;
3483 elem = elem.parentNode;
3484 }
3485
3486 return out.reverse().join(separator);
3487 }
3488
3489 /**
3490 * Returns a simple, query-selector representation of a DOM element
3491 * e.g. [HTMLElement] => input#foo.btn[name=baz]
3492 * @param HTMLElement
3493 * @returns {string}
3494 */
3495 function htmlElementAsString(elem) {
3496 var out = [],
3497 className,
3498 classes,
3499 key,
3500 attr,
3501 i;
3502
3503 if (!elem || !elem.tagName) {
3504 return '';
3505 }
3506
3507 out.push(elem.tagName.toLowerCase());
3508 if (elem.id) {
3509 out.push('#' + elem.id);
3510 }
3511
3512 className = elem.className;
3513 if (className && isString(className)) {
3514 classes = className.split(/\s+/);
3515 for (i = 0; i < classes.length; i++) {
3516 out.push('.' + classes[i]);
3517 }
3518 }
3519 var attrWhitelist = ['type', 'name', 'title', 'alt'];
3520 for (i = 0; i < attrWhitelist.length; i++) {
3521 key = attrWhitelist[i];
3522 attr = elem.getAttribute(key);
3523 if (attr) {
3524 out.push('[' + key + '="' + attr + '"]');
3525 }
3526 }
3527 return out.join('');
3528 }
3529
3530 /**
3531 * Returns true if either a OR b is truthy, but not both
3532 */
3533 function isOnlyOneTruthy(a, b) {
3534 return !!(!!a ^ !!b);
3535 }
3536
3537 /**
3538 * Returns true if the two input exception interfaces have the same content
3539 */
3540 function isSameException(ex1, ex2) {
3541 if (isOnlyOneTruthy(ex1, ex2)) return false;
3542
3543 ex1 = ex1.values[0];
3544 ex2 = ex2.values[0];
3545
3546 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
3547
3548 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
3549 }
3550
3551 /**
3552 * Returns true if the two input stack trace interfaces have the same content
3553 */
3554 function isSameStacktrace(stack1, stack2) {
3555 if (isOnlyOneTruthy(stack1, stack2)) return false;
3556
3557 var frames1 = stack1.frames;
3558 var frames2 = stack2.frames;
3559
3560 // Exit early if frame count differs
3561 if (frames1.length !== frames2.length) return false;
3562
3563 // Iterate through every frame; bail out if anything differs
3564 var a, b;
3565 for (var i = 0; i < frames1.length; i++) {
3566 a = frames1[i];
3567 b = frames2[i];
3568 if (
3569 a.filename !== b.filename ||
3570 a.lineno !== b.lineno ||
3571 a.colno !== b.colno ||
3572 a['function'] !== b['function']
3573 )
3574 return false;
3575 }
3576 return true;
3577 }
3578
3579 /**
3580 * Polyfill a method
3581 * @param obj object e.g. `document`
3582 * @param name method name present on object e.g. `addEventListener`
3583 * @param replacement replacement function
3584 * @param track {optional} record instrumentation to an array
3585 */
3586 function fill(obj, name, replacement, track) {
3587 var orig = obj[name];
3588 obj[name] = replacement(orig);
3589 if (track) {
3590 track.push([obj, name, orig]);
3591 }
3592 }
3593
3594 module.exports = {
3595 isObject: isObject,
3596 isError: isError,
3597 isErrorEvent: isErrorEvent,
3598 isUndefined: isUndefined,
3599 isFunction: isFunction,
3600 isString: isString,
3601 isEmptyObject: isEmptyObject,
3602 supportsErrorEvent: supportsErrorEvent,
3603 wrappedCallback: wrappedCallback,
3604 each: each,
3605 objectMerge: objectMerge,
3606 truncate: truncate,
3607 objectFrozen: objectFrozen,
3608 hasKey: hasKey,
3609 joinRegExp: joinRegExp,
3610 urlencode: urlencode,
3611 uuid4: uuid4,
3612 htmlTreeAsString: htmlTreeAsString,
3613 htmlElementAsString: htmlElementAsString,
3614 isSameException: isSameException,
3615 isSameStacktrace: isSameStacktrace,
3616 parseUrl: parseUrl,
3617 fill: fill
3618 };
3619
3620
3621 /***/ }),
3622
3623 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
3624 /*!***********************************************************!*\
3625 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
3626 \***********************************************************/
3627 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3628
3629 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
3630
3631 /*
3632 TraceKit - Cross brower stack traces
3633
3634 This was originally forked from github.com/occ/TraceKit, but has since been
3635 largely re-written and is now maintained as part of raven-js. Tests for
3636 this are in test/vendor.
3637
3638 MIT license
3639 */
3640
3641 var TraceKit = {
3642 collectWindowErrors: true,
3643 debug: false
3644 };
3645
3646 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
3647 var _window =
3648 typeof window !== 'undefined'
3649 ? window
3650 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3651
3652 // global reference to slice
3653 var _slice = [].slice;
3654 var UNKNOWN_FUNCTION = '?';
3655
3656 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
3657 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
3658
3659 function getLocationHref() {
3660 if (typeof document === 'undefined' || document.location == null) return '';
3661
3662 return document.location.href;
3663 }
3664
3665 /**
3666 * TraceKit.report: cross-browser processing of unhandled exceptions
3667 *
3668 * Syntax:
3669 * TraceKit.report.subscribe(function(stackInfo) { ... })
3670 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
3671 * TraceKit.report(exception)
3672 * try { ...code... } catch(ex) { TraceKit.report(ex); }
3673 *
3674 * Supports:
3675 * - Firefox: full stack trace with line numbers, plus column number
3676 * on top frame; column number is not guaranteed
3677 * - Opera: full stack trace with line and column numbers
3678 * - Chrome: full stack trace with line and column numbers
3679 * - Safari: line and column number for the top frame only; some frames
3680 * may be missing, and column number is not guaranteed
3681 * - IE: line and column number for the top frame only; some frames
3682 * may be missing, and column number is not guaranteed
3683 *
3684 * In theory, TraceKit should work on all of the following versions:
3685 * - IE5.5+ (only 8.0 tested)
3686 * - Firefox 0.9+ (only 3.5+ tested)
3687 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
3688 * Exceptions Have Stacktrace to be enabled in opera:config)
3689 * - Safari 3+ (only 4+ tested)
3690 * - Chrome 1+ (only 5+ tested)
3691 * - Konqueror 3.5+ (untested)
3692 *
3693 * Requires TraceKit.computeStackTrace.
3694 *
3695 * Tries to catch all unhandled exceptions and report them to the
3696 * subscribed handlers. Please note that TraceKit.report will rethrow the
3697 * exception. This is REQUIRED in order to get a useful stack trace in IE.
3698 * If the exception does not reach the top of the browser, you will only
3699 * get a stack trace from the point where TraceKit.report was called.
3700 *
3701 * Handlers receive a stackInfo object as described in the
3702 * TraceKit.computeStackTrace docs.
3703 */
3704 TraceKit.report = (function reportModuleWrapper() {
3705 var handlers = [],
3706 lastArgs = null,
3707 lastException = null,
3708 lastExceptionStack = null;
3709
3710 /**
3711 * Add a crash handler.
3712 * @param {Function} handler
3713 */
3714 function subscribe(handler) {
3715 installGlobalHandler();
3716 handlers.push(handler);
3717 }
3718
3719 /**
3720 * Remove a crash handler.
3721 * @param {Function} handler
3722 */
3723 function unsubscribe(handler) {
3724 for (var i = handlers.length - 1; i >= 0; --i) {
3725 if (handlers[i] === handler) {
3726 handlers.splice(i, 1);
3727 }
3728 }
3729 }
3730
3731 /**
3732 * Remove all crash handlers.
3733 */
3734 function unsubscribeAll() {
3735 uninstallGlobalHandler();
3736 handlers = [];
3737 }
3738
3739 /**
3740 * Dispatch stack information to all handlers.
3741 * @param {Object.<string, *>} stack
3742 */
3743 function notifyHandlers(stack, isWindowError) {
3744 var exception = null;
3745 if (isWindowError && !TraceKit.collectWindowErrors) {
3746 return;
3747 }
3748 for (var i in handlers) {
3749 if (handlers.hasOwnProperty(i)) {
3750 try {
3751 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
3752 } catch (inner) {
3753 exception = inner;
3754 }
3755 }
3756 }
3757
3758 if (exception) {
3759 throw exception;
3760 }
3761 }
3762
3763 var _oldOnerrorHandler, _onErrorHandlerInstalled;
3764
3765 /**
3766 * Ensures all global unhandled exceptions are recorded.
3767 * Supported by Gecko and IE.
3768 * @param {string} message Error message.
3769 * @param {string} url URL of script that generated the exception.
3770 * @param {(number|string)} lineNo The line number at which the error
3771 * occurred.
3772 * @param {?(number|string)} colNo The column number at which the error
3773 * occurred.
3774 * @param {?Error} ex The actual Error object.
3775 */
3776 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
3777 var stack = null;
3778
3779 if (lastExceptionStack) {
3780 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
3781 lastExceptionStack,
3782 url,
3783 lineNo,
3784 message
3785 );
3786 processLastException();
3787 } else if (ex && utils.isError(ex)) {
3788 // non-string `ex` arg; attempt to extract stack trace
3789
3790 // New chrome and blink send along a real error object
3791 // Let's just report that like a normal error.
3792 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
3793 stack = TraceKit.computeStackTrace(ex);
3794 notifyHandlers(stack, true);
3795 } else {
3796 var location = {
3797 url: url,
3798 line: lineNo,
3799 column: colNo
3800 };
3801
3802 var name = undefined;
3803 var msg = message; // must be new var or will modify original `arguments`
3804 var groups;
3805 if ({}.toString.call(message) === '[object String]') {
3806 var groups = message.match(ERROR_TYPES_RE);
3807 if (groups) {
3808 name = groups[1];
3809 msg = groups[2];
3810 }
3811 }
3812
3813 location.func = UNKNOWN_FUNCTION;
3814
3815 stack = {
3816 name: name,
3817 message: msg,
3818 url: getLocationHref(),
3819 stack: [location]
3820 };
3821 notifyHandlers(stack, true);
3822 }
3823
3824 if (_oldOnerrorHandler) {
3825 return _oldOnerrorHandler.apply(this, arguments);
3826 }
3827
3828 return false;
3829 }
3830
3831 function installGlobalHandler() {
3832 if (_onErrorHandlerInstalled) {
3833 return;
3834 }
3835 _oldOnerrorHandler = _window.onerror;
3836 _window.onerror = traceKitWindowOnError;
3837 _onErrorHandlerInstalled = true;
3838 }
3839
3840 function uninstallGlobalHandler() {
3841 if (!_onErrorHandlerInstalled) {
3842 return;
3843 }
3844 _window.onerror = _oldOnerrorHandler;
3845 _onErrorHandlerInstalled = false;
3846 _oldOnerrorHandler = undefined;
3847 }
3848
3849 function processLastException() {
3850 var _lastExceptionStack = lastExceptionStack,
3851 _lastArgs = lastArgs;
3852 lastArgs = null;
3853 lastExceptionStack = null;
3854 lastException = null;
3855 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
3856 }
3857
3858 /**
3859 * Reports an unhandled Error to TraceKit.
3860 * @param {Error} ex
3861 * @param {?boolean} rethrow If false, do not re-throw the exception.
3862 * Only used for window.onerror to not cause an infinite loop of
3863 * rethrowing.
3864 */
3865 function report(ex, rethrow) {
3866 var args = _slice.call(arguments, 1);
3867 if (lastExceptionStack) {
3868 if (lastException === ex) {
3869 return; // already caught by an inner catch block, ignore
3870 } else {
3871 processLastException();
3872 }
3873 }
3874
3875 var stack = TraceKit.computeStackTrace(ex);
3876 lastExceptionStack = stack;
3877 lastException = ex;
3878 lastArgs = args;
3879
3880 // If the stack trace is incomplete, wait for 2 seconds for
3881 // slow slow IE to see if onerror occurs or not before reporting
3882 // this exception; otherwise, we will end up with an incomplete
3883 // stack trace
3884 setTimeout(function() {
3885 if (lastException === ex) {
3886 processLastException();
3887 }
3888 }, stack.incomplete ? 2000 : 0);
3889
3890 if (rethrow !== false) {
3891 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
3892 }
3893 }
3894
3895 report.subscribe = subscribe;
3896 report.unsubscribe = unsubscribe;
3897 report.uninstall = unsubscribeAll;
3898 return report;
3899 })();
3900
3901 /**
3902 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
3903 *
3904 * Syntax:
3905 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
3906 * Returns:
3907 * s.name - exception name
3908 * s.message - exception message
3909 * s.stack[i].url - JavaScript or HTML file URL
3910 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
3911 * s.stack[i].args - arguments passed to the function, if known
3912 * s.stack[i].line - line number, if known
3913 * s.stack[i].column - column number, if known
3914 *
3915 * Supports:
3916 * - Firefox: full stack trace with line numbers and unreliable column
3917 * number on top frame
3918 * - Opera 10: full stack trace with line and column numbers
3919 * - Opera 9-: full stack trace with line numbers
3920 * - Chrome: full stack trace with line and column numbers
3921 * - Safari: line and column number for the topmost stacktrace element
3922 * only
3923 * - IE: no line numbers whatsoever
3924 *
3925 * Tries to guess names of anonymous functions by looking for assignments
3926 * in the source code. In IE and Safari, we have to guess source file names
3927 * by searching for function bodies inside all page scripts. This will not
3928 * work for scripts that are loaded cross-domain.
3929 * Here be dragons: some function names may be guessed incorrectly, and
3930 * duplicate functions may be mismatched.
3931 *
3932 * TraceKit.computeStackTrace should only be used for tracing purposes.
3933 * Logging of unhandled exceptions should be done with TraceKit.report,
3934 * which builds on top of TraceKit.computeStackTrace and provides better
3935 * IE support by utilizing the window.onerror event to retrieve information
3936 * about the top of the stack.
3937 *
3938 * Note: In IE and Safari, no stack trace is recorded on the Error object,
3939 * so computeStackTrace instead walks its *own* chain of callers.
3940 * This means that:
3941 * * in Safari, some methods may be missing from the stack trace;
3942 * * in IE, the topmost function in the stack trace will always be the
3943 * caller of computeStackTrace.
3944 *
3945 * This is okay for tracing (because you are likely to be calling
3946 * computeStackTrace from the function you want to be the topmost element
3947 * of the stack trace anyway), but not okay for logging unhandled
3948 * exceptions (because your catch block will likely be far away from the
3949 * inner function that actually caused the exception).
3950 *
3951 */
3952 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
3953 // Contents of Exception in various browsers.
3954 //
3955 // SAFARI:
3956 // ex.message = Can't find variable: qq
3957 // ex.line = 59
3958 // ex.sourceId = 580238192
3959 // ex.sourceURL = http://...
3960 // ex.expressionBeginOffset = 96
3961 // ex.expressionCaretOffset = 98
3962 // ex.expressionEndOffset = 98
3963 // ex.name = ReferenceError
3964 //
3965 // FIREFOX:
3966 // ex.message = qq is not defined
3967 // ex.fileName = http://...
3968 // ex.lineNumber = 59
3969 // ex.columnNumber = 69
3970 // ex.stack = ...stack trace... (see the example below)
3971 // ex.name = ReferenceError
3972 //
3973 // CHROME:
3974 // ex.message = qq is not defined
3975 // ex.name = ReferenceError
3976 // ex.type = not_defined
3977 // ex.arguments = ['aa']
3978 // ex.stack = ...stack trace...
3979 //
3980 // INTERNET EXPLORER:
3981 // ex.message = ...
3982 // ex.name = ReferenceError
3983 //
3984 // OPERA:
3985 // ex.message = ...message... (see the example below)
3986 // ex.name = ReferenceError
3987 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
3988 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
3989
3990 /**
3991 * Computes stack trace information from the stack property.
3992 * Chrome and Gecko use this property.
3993 * @param {Error} ex
3994 * @return {?Object.<string, *>} Stack trace information.
3995 */
3996 function computeStackTraceFromStackProp(ex) {
3997 if (typeof ex.stack === 'undefined' || !ex.stack) return;
3998
3999 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
4000 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
4001 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
4002 // Used to additionally parse URL/line/column from eval frames
4003 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
4004 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
4005 lines = ex.stack.split('\n'),
4006 stack = [],
4007 submatch,
4008 parts,
4009 element,
4010 reference = /^(.*) is undefined$/.exec(ex.message);
4011
4012 for (var i = 0, j = lines.length; i < j; ++i) {
4013 if ((parts = chrome.exec(lines[i]))) {
4014 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
4015 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
4016 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
4017 // throw out eval line/column and use top-most line/column number
4018 parts[2] = submatch[1]; // url
4019 parts[3] = submatch[2]; // line
4020 parts[4] = submatch[3]; // column
4021 }
4022 element = {
4023 url: !isNative ? parts[2] : null,
4024 func: parts[1] || UNKNOWN_FUNCTION,
4025 args: isNative ? [parts[2]] : [],
4026 line: parts[3] ? +parts[3] : null,
4027 column: parts[4] ? +parts[4] : null
4028 };
4029 } else if ((parts = winjs.exec(lines[i]))) {
4030 element = {
4031 url: parts[2],
4032 func: parts[1] || UNKNOWN_FUNCTION,
4033 args: [],
4034 line: +parts[3],
4035 column: parts[4] ? +parts[4] : null
4036 };
4037 } else if ((parts = gecko.exec(lines[i]))) {
4038 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
4039 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
4040 // throw out eval line/column and use top-most line number
4041 parts[3] = submatch[1];
4042 parts[4] = submatch[2];
4043 parts[5] = null; // no column when eval
4044 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
4045 // FireFox uses this awesome columnNumber property for its top frame
4046 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
4047 // so adding 1
4048 // NOTE: this hack doesn't work if top-most frame is eval
4049 stack[0].column = ex.columnNumber + 1;
4050 }
4051 element = {
4052 url: parts[3],
4053 func: parts[1] || UNKNOWN_FUNCTION,
4054 args: parts[2] ? parts[2].split(',') : [],
4055 line: parts[4] ? +parts[4] : null,
4056 column: parts[5] ? +parts[5] : null
4057 };
4058 } else {
4059 continue;
4060 }
4061
4062 if (!element.func && element.line) {
4063 element.func = UNKNOWN_FUNCTION;
4064 }
4065
4066 stack.push(element);
4067 }
4068
4069 if (!stack.length) {
4070 return null;
4071 }
4072
4073 return {
4074 name: ex.name,
4075 message: ex.message,
4076 url: getLocationHref(),
4077 stack: stack
4078 };
4079 }
4080
4081 /**
4082 * Adds information about the first frame to incomplete stack traces.
4083 * Safari and IE require this to get complete data on the first frame.
4084 * @param {Object.<string, *>} stackInfo Stack trace information from
4085 * one of the compute* methods.
4086 * @param {string} url The URL of the script that caused an error.
4087 * @param {(number|string)} lineNo The line number of the script that
4088 * caused an error.
4089 * @param {string=} message The error generated by the browser, which
4090 * hopefully contains the name of the object that caused the error.
4091 * @return {boolean} Whether or not the stack information was
4092 * augmented.
4093 */
4094 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
4095 var initial = {
4096 url: url,
4097 line: lineNo
4098 };
4099
4100 if (initial.url && initial.line) {
4101 stackInfo.incomplete = false;
4102
4103 if (!initial.func) {
4104 initial.func = UNKNOWN_FUNCTION;
4105 }
4106
4107 if (stackInfo.stack.length > 0) {
4108 if (stackInfo.stack[0].url === initial.url) {
4109 if (stackInfo.stack[0].line === initial.line) {
4110 return false; // already in stack trace
4111 } else if (
4112 !stackInfo.stack[0].line &&
4113 stackInfo.stack[0].func === initial.func
4114 ) {
4115 stackInfo.stack[0].line = initial.line;
4116 return false;
4117 }
4118 }
4119 }
4120
4121 stackInfo.stack.unshift(initial);
4122 stackInfo.partial = true;
4123 return true;
4124 } else {
4125 stackInfo.incomplete = true;
4126 }
4127
4128 return false;
4129 }
4130
4131 /**
4132 * Computes stack trace information by walking the arguments.caller
4133 * chain at the time the exception occurred. This will cause earlier
4134 * frames to be missed but is the only way to get any stack trace in
4135 * Safari and IE. The top frame is restored by
4136 * {@link augmentStackTraceWithInitialElement}.
4137 * @param {Error} ex
4138 * @return {?Object.<string, *>} Stack trace information.
4139 */
4140 function computeStackTraceByWalkingCallerChain(ex, depth) {
4141 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
4142 stack = [],
4143 funcs = {},
4144 recursion = false,
4145 parts,
4146 item,
4147 source;
4148
4149 for (
4150 var curr = computeStackTraceByWalkingCallerChain.caller;
4151 curr && !recursion;
4152 curr = curr.caller
4153 ) {
4154 if (curr === computeStackTrace || curr === TraceKit.report) {
4155 // console.log('skipping internal function');
4156 continue;
4157 }
4158
4159 item = {
4160 url: null,
4161 func: UNKNOWN_FUNCTION,
4162 line: null,
4163 column: null
4164 };
4165
4166 if (curr.name) {
4167 item.func = curr.name;
4168 } else if ((parts = functionName.exec(curr.toString()))) {
4169 item.func = parts[1];
4170 }
4171
4172 if (typeof item.func === 'undefined') {
4173 try {
4174 item.func = parts.input.substring(0, parts.input.indexOf('{'));
4175 } catch (e) {}
4176 }
4177
4178 if (funcs['' + curr]) {
4179 recursion = true;
4180 } else {
4181 funcs['' + curr] = true;
4182 }
4183
4184 stack.push(item);
4185 }
4186
4187 if (depth) {
4188 // console.log('depth is ' + depth);
4189 // console.log('stack is ' + stack.length);
4190 stack.splice(0, depth);
4191 }
4192
4193 var result = {
4194 name: ex.name,
4195 message: ex.message,
4196 url: getLocationHref(),
4197 stack: stack
4198 };
4199 augmentStackTraceWithInitialElement(
4200 result,
4201 ex.sourceURL || ex.fileName,
4202 ex.line || ex.lineNumber,
4203 ex.message || ex.description
4204 );
4205 return result;
4206 }
4207
4208 /**
4209 * Computes a stack trace for an exception.
4210 * @param {Error} ex
4211 * @param {(string|number)=} depth
4212 */
4213 function computeStackTrace(ex, depth) {
4214 var stack = null;
4215 depth = depth == null ? 0 : +depth;
4216
4217 try {
4218 stack = computeStackTraceFromStackProp(ex);
4219 if (stack) {
4220 return stack;
4221 }
4222 } catch (e) {
4223 if (TraceKit.debug) {
4224 throw e;
4225 }
4226 }
4227
4228 try {
4229 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
4230 if (stack) {
4231 return stack;
4232 }
4233 } catch (e) {
4234 if (TraceKit.debug) {
4235 throw e;
4236 }
4237 }
4238 return {
4239 name: ex.name,
4240 message: ex.message,
4241 url: getLocationHref()
4242 };
4243 }
4244
4245 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
4246 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
4247
4248 return computeStackTrace;
4249 })();
4250
4251 module.exports = TraceKit;
4252
4253
4254 /***/ }),
4255
4256 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
4257 /*!***********************************************************************!*\
4258 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
4259 \***********************************************************************/
4260 /***/ ((module, exports) => {
4261
4262 /*
4263 json-stringify-safe
4264 Like JSON.stringify, but doesn't throw on circular references.
4265
4266 Originally forked from https://github.com/isaacs/json-stringify-safe
4267 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
4268 and IE8 compatibility. Tests for this are in test/vendor.
4269
4270 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
4271 */
4272
4273 exports = module.exports = stringify;
4274 exports.getSerialize = serializer;
4275
4276 function indexOf(haystack, needle) {
4277 for (var i = 0; i < haystack.length; ++i) {
4278 if (haystack[i] === needle) return i;
4279 }
4280 return -1;
4281 }
4282
4283 function stringify(obj, replacer, spaces, cycleReplacer) {
4284 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
4285 }
4286
4287 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
4288 function stringifyError(value) {
4289 var err = {
4290 // These properties are implemented as magical getters and don't show up in for in
4291 stack: value.stack,
4292 message: value.message,
4293 name: value.name
4294 };
4295
4296 for (var i in value) {
4297 if (Object.prototype.hasOwnProperty.call(value, i)) {
4298 err[i] = value[i];
4299 }
4300 }
4301
4302 return err;
4303 }
4304
4305 function serializer(replacer, cycleReplacer) {
4306 var stack = [];
4307 var keys = [];
4308
4309 if (cycleReplacer == null) {
4310 cycleReplacer = function(key, value) {
4311 if (stack[0] === value) {
4312 return '[Circular ~]';
4313 }
4314 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
4315 };
4316 }
4317
4318 return function(key, value) {
4319 if (stack.length > 0) {
4320 var thisPos = indexOf(stack, this);
4321 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
4322 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
4323
4324 if (~indexOf(stack, value)) {
4325 value = cycleReplacer.call(this, key, value);
4326 }
4327 } else {
4328 stack.push(value);
4329 }
4330
4331 return replacer == null
4332 ? value instanceof Error ? stringifyError(value) : value
4333 : replacer.call(this, key, value);
4334 };
4335 }
4336
4337
4338 /***/ }),
4339
4340 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
4341 /*!*****************************************************************!*\
4342 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
4343 \*****************************************************************/
4344 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4345
4346 "use strict";
4347 /**
4348 * @license React
4349 * react-jsx-runtime.development.js
4350 *
4351 * Copyright (c) Facebook, Inc. and its affiliates.
4352 *
4353 * This source code is licensed under the MIT license found in the
4354 * LICENSE file in the root directory of this source tree.
4355 */
4356
4357
4358
4359 if (true) {
4360 (function() {
4361 'use strict';
4362
4363 var React = __webpack_require__(/*! react */ "react");
4364
4365 // ATTENTION
4366 // When adding new symbols to this file,
4367 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
4368 // The Symbol used to tag the ReactElement-like types.
4369 var REACT_ELEMENT_TYPE = Symbol.for('react.element');
4370 var REACT_PORTAL_TYPE = Symbol.for('react.portal');
4371 var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
4372 var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
4373 var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
4374 var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
4375 var REACT_CONTEXT_TYPE = Symbol.for('react.context');
4376 var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
4377 var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
4378 var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
4379 var REACT_MEMO_TYPE = Symbol.for('react.memo');
4380 var REACT_LAZY_TYPE = Symbol.for('react.lazy');
4381 var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
4382 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
4383 var FAUX_ITERATOR_SYMBOL = '@@iterator';
4384 function getIteratorFn(maybeIterable) {
4385 if (maybeIterable === null || typeof maybeIterable !== 'object') {
4386 return null;
4387 }
4388
4389 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
4390
4391 if (typeof maybeIterator === 'function') {
4392 return maybeIterator;
4393 }
4394
4395 return null;
4396 }
4397
4398 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4399
4400 function error(format) {
4401 {
4402 {
4403 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
4404 args[_key2 - 1] = arguments[_key2];
4405 }
4406
4407 printWarning('error', format, args);
4408 }
4409 }
4410 }
4411
4412 function printWarning(level, format, args) {
4413 // When changing this logic, you might want to also
4414 // update consoleWithStackDev.www.js as well.
4415 {
4416 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
4417 var stack = ReactDebugCurrentFrame.getStackAddendum();
4418
4419 if (stack !== '') {
4420 format += '%s';
4421 args = args.concat([stack]);
4422 } // eslint-disable-next-line react-internal/safe-string-coercion
4423
4424
4425 var argsWithFormat = args.map(function (item) {
4426 return String(item);
4427 }); // Careful: RN currently depends on this prefix
4428
4429 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
4430 // breaks IE9: https://github.com/facebook/react/issues/13610
4431 // eslint-disable-next-line react-internal/no-production-logging
4432
4433 Function.prototype.apply.call(console[level], console, argsWithFormat);
4434 }
4435 }
4436
4437 // -----------------------------------------------------------------------------
4438
4439 var enableScopeAPI = false; // Experimental Create Event Handle API.
4440 var enableCacheElement = false;
4441 var enableTransitionTracing = false; // No known bugs, but needs performance testing
4442
4443 var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
4444 // stuff. Intended to enable React core members to more easily debug scheduling
4445 // issues in DEV builds.
4446
4447 var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
4448
4449 var REACT_MODULE_REFERENCE;
4450
4451 {
4452 REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
4453 }
4454
4455 function isValidElementType(type) {
4456 if (typeof type === 'string' || typeof type === 'function') {
4457 return true;
4458 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
4459
4460
4461 if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
4462 return true;
4463 }
4464
4465 if (typeof type === 'object' && type !== null) {
4466 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
4467 // types supported by any Flight configuration anywhere since
4468 // we don't know which Flight build this will end up being used
4469 // with.
4470 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
4471 return true;
4472 }
4473 }
4474
4475 return false;
4476 }
4477
4478 function getWrappedName(outerType, innerType, wrapperName) {
4479 var displayName = outerType.displayName;
4480
4481 if (displayName) {
4482 return displayName;
4483 }
4484
4485 var functionName = innerType.displayName || innerType.name || '';
4486 return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
4487 } // Keep in sync with react-reconciler/getComponentNameFromFiber
4488
4489
4490 function getContextName(type) {
4491 return type.displayName || 'Context';
4492 } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
4493
4494
4495 function getComponentNameFromType(type) {
4496 if (type == null) {
4497 // Host root, text node or just invalid type.
4498 return null;
4499 }
4500
4501 {
4502 if (typeof type.tag === 'number') {
4503 error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
4504 }
4505 }
4506
4507 if (typeof type === 'function') {
4508 return type.displayName || type.name || null;
4509 }
4510
4511 if (typeof type === 'string') {
4512 return type;
4513 }
4514
4515 switch (type) {
4516 case REACT_FRAGMENT_TYPE:
4517 return 'Fragment';
4518
4519 case REACT_PORTAL_TYPE:
4520 return 'Portal';
4521
4522 case REACT_PROFILER_TYPE:
4523 return 'Profiler';
4524
4525 case REACT_STRICT_MODE_TYPE:
4526 return 'StrictMode';
4527
4528 case REACT_SUSPENSE_TYPE:
4529 return 'Suspense';
4530
4531 case REACT_SUSPENSE_LIST_TYPE:
4532 return 'SuspenseList';
4533
4534 }
4535
4536 if (typeof type === 'object') {
4537 switch (type.$$typeof) {
4538 case REACT_CONTEXT_TYPE:
4539 var context = type;
4540 return getContextName(context) + '.Consumer';
4541
4542 case REACT_PROVIDER_TYPE:
4543 var provider = type;
4544 return getContextName(provider._context) + '.Provider';
4545
4546 case REACT_FORWARD_REF_TYPE:
4547 return getWrappedName(type, type.render, 'ForwardRef');
4548
4549 case REACT_MEMO_TYPE:
4550 var outerName = type.displayName || null;
4551
4552 if (outerName !== null) {
4553 return outerName;
4554 }
4555
4556 return getComponentNameFromType(type.type) || 'Memo';
4557
4558 case REACT_LAZY_TYPE:
4559 {
4560 var lazyComponent = type;
4561 var payload = lazyComponent._payload;
4562 var init = lazyComponent._init;
4563
4564 try {
4565 return getComponentNameFromType(init(payload));
4566 } catch (x) {
4567 return null;
4568 }
4569 }
4570
4571 // eslint-disable-next-line no-fallthrough
4572 }
4573 }
4574
4575 return null;
4576 }
4577
4578 var assign = Object.assign;
4579
4580 // Helpers to patch console.logs to avoid logging during side-effect free
4581 // replaying on render function. This currently only patches the object
4582 // lazily which won't cover if the log function was extracted eagerly.
4583 // We could also eagerly patch the method.
4584 var disabledDepth = 0;
4585 var prevLog;
4586 var prevInfo;
4587 var prevWarn;
4588 var prevError;
4589 var prevGroup;
4590 var prevGroupCollapsed;
4591 var prevGroupEnd;
4592
4593 function disabledLog() {}
4594
4595 disabledLog.__reactDisabledLog = true;
4596 function disableLogs() {
4597 {
4598 if (disabledDepth === 0) {
4599 /* eslint-disable react-internal/no-production-logging */
4600 prevLog = console.log;
4601 prevInfo = console.info;
4602 prevWarn = console.warn;
4603 prevError = console.error;
4604 prevGroup = console.group;
4605 prevGroupCollapsed = console.groupCollapsed;
4606 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
4607
4608 var props = {
4609 configurable: true,
4610 enumerable: true,
4611 value: disabledLog,
4612 writable: true
4613 }; // $FlowFixMe Flow thinks console is immutable.
4614
4615 Object.defineProperties(console, {
4616 info: props,
4617 log: props,
4618 warn: props,
4619 error: props,
4620 group: props,
4621 groupCollapsed: props,
4622 groupEnd: props
4623 });
4624 /* eslint-enable react-internal/no-production-logging */
4625 }
4626
4627 disabledDepth++;
4628 }
4629 }
4630 function reenableLogs() {
4631 {
4632 disabledDepth--;
4633
4634 if (disabledDepth === 0) {
4635 /* eslint-disable react-internal/no-production-logging */
4636 var props = {
4637 configurable: true,
4638 enumerable: true,
4639 writable: true
4640 }; // $FlowFixMe Flow thinks console is immutable.
4641
4642 Object.defineProperties(console, {
4643 log: assign({}, props, {
4644 value: prevLog
4645 }),
4646 info: assign({}, props, {
4647 value: prevInfo
4648 }),
4649 warn: assign({}, props, {
4650 value: prevWarn
4651 }),
4652 error: assign({}, props, {
4653 value: prevError
4654 }),
4655 group: assign({}, props, {
4656 value: prevGroup
4657 }),
4658 groupCollapsed: assign({}, props, {
4659 value: prevGroupCollapsed
4660 }),
4661 groupEnd: assign({}, props, {
4662 value: prevGroupEnd
4663 })
4664 });
4665 /* eslint-enable react-internal/no-production-logging */
4666 }
4667
4668 if (disabledDepth < 0) {
4669 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
4670 }
4671 }
4672 }
4673
4674 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
4675 var prefix;
4676 function describeBuiltInComponentFrame(name, source, ownerFn) {
4677 {
4678 if (prefix === undefined) {
4679 // Extract the VM specific prefix used by each line.
4680 try {
4681 throw Error();
4682 } catch (x) {
4683 var match = x.stack.trim().match(/\n( *(at )?)/);
4684 prefix = match && match[1] || '';
4685 }
4686 } // We use the prefix to ensure our stacks line up with native stack frames.
4687
4688
4689 return '\n' + prefix + name;
4690 }
4691 }
4692 var reentry = false;
4693 var componentFrameCache;
4694
4695 {
4696 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
4697 componentFrameCache = new PossiblyWeakMap();
4698 }
4699
4700 function describeNativeComponentFrame(fn, construct) {
4701 // If something asked for a stack inside a fake render, it should get ignored.
4702 if ( !fn || reentry) {
4703 return '';
4704 }
4705
4706 {
4707 var frame = componentFrameCache.get(fn);
4708
4709 if (frame !== undefined) {
4710 return frame;
4711 }
4712 }
4713
4714 var control;
4715 reentry = true;
4716 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
4717
4718 Error.prepareStackTrace = undefined;
4719 var previousDispatcher;
4720
4721 {
4722 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
4723 // for warnings.
4724
4725 ReactCurrentDispatcher.current = null;
4726 disableLogs();
4727 }
4728
4729 try {
4730 // This should throw.
4731 if (construct) {
4732 // Something should be setting the props in the constructor.
4733 var Fake = function () {
4734 throw Error();
4735 }; // $FlowFixMe
4736
4737
4738 Object.defineProperty(Fake.prototype, 'props', {
4739 set: function () {
4740 // We use a throwing setter instead of frozen or non-writable props
4741 // because that won't throw in a non-strict mode function.
4742 throw Error();
4743 }
4744 });
4745
4746 if (typeof Reflect === 'object' && Reflect.construct) {
4747 // We construct a different control for this case to include any extra
4748 // frames added by the construct call.
4749 try {
4750 Reflect.construct(Fake, []);
4751 } catch (x) {
4752 control = x;
4753 }
4754
4755 Reflect.construct(fn, [], Fake);
4756 } else {
4757 try {
4758 Fake.call();
4759 } catch (x) {
4760 control = x;
4761 }
4762
4763 fn.call(Fake.prototype);
4764 }
4765 } else {
4766 try {
4767 throw Error();
4768 } catch (x) {
4769 control = x;
4770 }
4771
4772 fn();
4773 }
4774 } catch (sample) {
4775 // This is inlined manually because closure doesn't do it for us.
4776 if (sample && control && typeof sample.stack === 'string') {
4777 // This extracts the first frame from the sample that isn't also in the control.
4778 // Skipping one frame that we assume is the frame that calls the two.
4779 var sampleLines = sample.stack.split('\n');
4780 var controlLines = control.stack.split('\n');
4781 var s = sampleLines.length - 1;
4782 var c = controlLines.length - 1;
4783
4784 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
4785 // We expect at least one stack frame to be shared.
4786 // Typically this will be the root most one. However, stack frames may be
4787 // cut off due to maximum stack limits. In this case, one maybe cut off
4788 // earlier than the other. We assume that the sample is longer or the same
4789 // and there for cut off earlier. So we should find the root most frame in
4790 // the sample somewhere in the control.
4791 c--;
4792 }
4793
4794 for (; s >= 1 && c >= 0; s--, c--) {
4795 // Next we find the first one that isn't the same which should be the
4796 // frame that called our sample function and the control.
4797 if (sampleLines[s] !== controlLines[c]) {
4798 // In V8, the first line is describing the message but other VMs don't.
4799 // If we're about to return the first line, and the control is also on the same
4800 // line, that's a pretty good indicator that our sample threw at same line as
4801 // the control. I.e. before we entered the sample frame. So we ignore this result.
4802 // This can happen if you passed a class to function component, or non-function.
4803 if (s !== 1 || c !== 1) {
4804 do {
4805 s--;
4806 c--; // We may still have similar intermediate frames from the construct call.
4807 // The next one that isn't the same should be our match though.
4808
4809 if (c < 0 || sampleLines[s] !== controlLines[c]) {
4810 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
4811 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
4812 // but we have a user-provided "displayName"
4813 // splice it in to make the stack more readable.
4814
4815
4816 if (fn.displayName && _frame.includes('<anonymous>')) {
4817 _frame = _frame.replace('<anonymous>', fn.displayName);
4818 }
4819
4820 {
4821 if (typeof fn === 'function') {
4822 componentFrameCache.set(fn, _frame);
4823 }
4824 } // Return the line we found.
4825
4826
4827 return _frame;
4828 }
4829 } while (s >= 1 && c >= 0);
4830 }
4831
4832 break;
4833 }
4834 }
4835 }
4836 } finally {
4837 reentry = false;
4838
4839 {
4840 ReactCurrentDispatcher.current = previousDispatcher;
4841 reenableLogs();
4842 }
4843
4844 Error.prepareStackTrace = previousPrepareStackTrace;
4845 } // Fallback to just using the name if we couldn't make it throw.
4846
4847
4848 var name = fn ? fn.displayName || fn.name : '';
4849 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
4850
4851 {
4852 if (typeof fn === 'function') {
4853 componentFrameCache.set(fn, syntheticFrame);
4854 }
4855 }
4856
4857 return syntheticFrame;
4858 }
4859 function describeFunctionComponentFrame(fn, source, ownerFn) {
4860 {
4861 return describeNativeComponentFrame(fn, false);
4862 }
4863 }
4864
4865 function shouldConstruct(Component) {
4866 var prototype = Component.prototype;
4867 return !!(prototype && prototype.isReactComponent);
4868 }
4869
4870 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
4871
4872 if (type == null) {
4873 return '';
4874 }
4875
4876 if (typeof type === 'function') {
4877 {
4878 return describeNativeComponentFrame(type, shouldConstruct(type));
4879 }
4880 }
4881
4882 if (typeof type === 'string') {
4883 return describeBuiltInComponentFrame(type);
4884 }
4885
4886 switch (type) {
4887 case REACT_SUSPENSE_TYPE:
4888 return describeBuiltInComponentFrame('Suspense');
4889
4890 case REACT_SUSPENSE_LIST_TYPE:
4891 return describeBuiltInComponentFrame('SuspenseList');
4892 }
4893
4894 if (typeof type === 'object') {
4895 switch (type.$$typeof) {
4896 case REACT_FORWARD_REF_TYPE:
4897 return describeFunctionComponentFrame(type.render);
4898
4899 case REACT_MEMO_TYPE:
4900 // Memo may contain any component type so we recursively resolve it.
4901 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
4902
4903 case REACT_LAZY_TYPE:
4904 {
4905 var lazyComponent = type;
4906 var payload = lazyComponent._payload;
4907 var init = lazyComponent._init;
4908
4909 try {
4910 // Lazy may contain any component type so we recursively resolve it.
4911 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
4912 } catch (x) {}
4913 }
4914 }
4915 }
4916
4917 return '';
4918 }
4919
4920 var hasOwnProperty = Object.prototype.hasOwnProperty;
4921
4922 var loggedTypeFailures = {};
4923 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
4924
4925 function setCurrentlyValidatingElement(element) {
4926 {
4927 if (element) {
4928 var owner = element._owner;
4929 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
4930 ReactDebugCurrentFrame.setExtraStackFrame(stack);
4931 } else {
4932 ReactDebugCurrentFrame.setExtraStackFrame(null);
4933 }
4934 }
4935 }
4936
4937 function checkPropTypes(typeSpecs, values, location, componentName, element) {
4938 {
4939 // $FlowFixMe This is okay but Flow doesn't know it.
4940 var has = Function.call.bind(hasOwnProperty);
4941
4942 for (var typeSpecName in typeSpecs) {
4943 if (has(typeSpecs, typeSpecName)) {
4944 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
4945 // fail the render phase where it didn't fail before. So we log it.
4946 // After these have been cleaned up, we'll let them throw.
4947
4948 try {
4949 // This is intentionally an invariant that gets caught. It's the same
4950 // behavior as without this statement except with a better message.
4951 if (typeof typeSpecs[typeSpecName] !== 'function') {
4952 // eslint-disable-next-line react-internal/prod-error-codes
4953 var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
4954 err.name = 'Invariant Violation';
4955 throw err;
4956 }
4957
4958 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
4959 } catch (ex) {
4960 error$1 = ex;
4961 }
4962
4963 if (error$1 && !(error$1 instanceof Error)) {
4964 setCurrentlyValidatingElement(element);
4965
4966 error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
4967
4968 setCurrentlyValidatingElement(null);
4969 }
4970
4971 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
4972 // Only monitor this failure once because there tends to be a lot of the
4973 // same error.
4974 loggedTypeFailures[error$1.message] = true;
4975 setCurrentlyValidatingElement(element);
4976
4977 error('Failed %s type: %s', location, error$1.message);
4978
4979 setCurrentlyValidatingElement(null);
4980 }
4981 }
4982 }
4983 }
4984 }
4985
4986 var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
4987
4988 function isArray(a) {
4989 return isArrayImpl(a);
4990 }
4991
4992 /*
4993 * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
4994 * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
4995 *
4996 * The functions in this module will throw an easier-to-understand,
4997 * easier-to-debug exception with a clear errors message message explaining the
4998 * problem. (Instead of a confusing exception thrown inside the implementation
4999 * of the `value` object).
5000 */
5001 // $FlowFixMe only called in DEV, so void return is not possible.
5002 function typeName(value) {
5003 {
5004 // toStringTag is needed for namespaced types like Temporal.Instant
5005 var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
5006 var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
5007 return type;
5008 }
5009 } // $FlowFixMe only called in DEV, so void return is not possible.
5010
5011
5012 function willCoercionThrow(value) {
5013 {
5014 try {
5015 testStringCoercion(value);
5016 return false;
5017 } catch (e) {
5018 return true;
5019 }
5020 }
5021 }
5022
5023 function testStringCoercion(value) {
5024 // If you ended up here by following an exception call stack, here's what's
5025 // happened: you supplied an object or symbol value to React (as a prop, key,
5026 // DOM attribute, CSS property, string ref, etc.) and when React tried to
5027 // coerce it to a string using `'' + value`, an exception was thrown.
5028 //
5029 // The most common types that will cause this exception are `Symbol` instances
5030 // and Temporal objects like `Temporal.Instant`. But any object that has a
5031 // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
5032 // exception. (Library authors do this to prevent users from using built-in
5033 // numeric operators like `+` or comparison operators like `>=` because custom
5034 // methods are needed to perform accurate arithmetic or comparison.)
5035 //
5036 // To fix the problem, coerce this object or symbol value to a string before
5037 // passing it to React. The most reliable way is usually `String(value)`.
5038 //
5039 // To find which value is throwing, check the browser or debugger console.
5040 // Before this exception was thrown, there should be `console.error` output
5041 // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
5042 // problem and how that type was used: key, atrribute, input value prop, etc.
5043 // In most cases, this console output also shows the component and its
5044 // ancestor components where the exception happened.
5045 //
5046 // eslint-disable-next-line react-internal/safe-string-coercion
5047 return '' + value;
5048 }
5049 function checkKeyStringCoercion(value) {
5050 {
5051 if (willCoercionThrow(value)) {
5052 error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
5053
5054 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
5055 }
5056 }
5057 }
5058
5059 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
5060 var RESERVED_PROPS = {
5061 key: true,
5062 ref: true,
5063 __self: true,
5064 __source: true
5065 };
5066 var specialPropKeyWarningShown;
5067 var specialPropRefWarningShown;
5068 var didWarnAboutStringRefs;
5069
5070 {
5071 didWarnAboutStringRefs = {};
5072 }
5073
5074 function hasValidRef(config) {
5075 {
5076 if (hasOwnProperty.call(config, 'ref')) {
5077 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
5078
5079 if (getter && getter.isReactWarning) {
5080 return false;
5081 }
5082 }
5083 }
5084
5085 return config.ref !== undefined;
5086 }
5087
5088 function hasValidKey(config) {
5089 {
5090 if (hasOwnProperty.call(config, 'key')) {
5091 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
5092
5093 if (getter && getter.isReactWarning) {
5094 return false;
5095 }
5096 }
5097 }
5098
5099 return config.key !== undefined;
5100 }
5101
5102 function warnIfStringRefCannotBeAutoConverted(config, self) {
5103 {
5104 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
5105 var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
5106
5107 if (!didWarnAboutStringRefs[componentName]) {
5108 error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
5109
5110 didWarnAboutStringRefs[componentName] = true;
5111 }
5112 }
5113 }
5114 }
5115
5116 function defineKeyPropWarningGetter(props, displayName) {
5117 {
5118 var warnAboutAccessingKey = function () {
5119 if (!specialPropKeyWarningShown) {
5120 specialPropKeyWarningShown = true;
5121
5122 error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
5123 }
5124 };
5125
5126 warnAboutAccessingKey.isReactWarning = true;
5127 Object.defineProperty(props, 'key', {
5128 get: warnAboutAccessingKey,
5129 configurable: true
5130 });
5131 }
5132 }
5133
5134 function defineRefPropWarningGetter(props, displayName) {
5135 {
5136 var warnAboutAccessingRef = function () {
5137 if (!specialPropRefWarningShown) {
5138 specialPropRefWarningShown = true;
5139
5140 error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
5141 }
5142 };
5143
5144 warnAboutAccessingRef.isReactWarning = true;
5145 Object.defineProperty(props, 'ref', {
5146 get: warnAboutAccessingRef,
5147 configurable: true
5148 });
5149 }
5150 }
5151 /**
5152 * Factory method to create a new React element. This no longer adheres to
5153 * the class pattern, so do not use new to call it. Also, instanceof check
5154 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
5155 * if something is a React Element.
5156 *
5157 * @param {*} type
5158 * @param {*} props
5159 * @param {*} key
5160 * @param {string|object} ref
5161 * @param {*} owner
5162 * @param {*} self A *temporary* helper to detect places where `this` is
5163 * different from the `owner` when React.createElement is called, so that we
5164 * can warn. We want to get rid of owner and replace string `ref`s with arrow
5165 * functions, and as long as `this` and owner are the same, there will be no
5166 * change in behavior.
5167 * @param {*} source An annotation object (added by a transpiler or otherwise)
5168 * indicating filename, line number, and/or other information.
5169 * @internal
5170 */
5171
5172
5173 var ReactElement = function (type, key, ref, self, source, owner, props) {
5174 var element = {
5175 // This tag allows us to uniquely identify this as a React Element
5176 $$typeof: REACT_ELEMENT_TYPE,
5177 // Built-in properties that belong on the element
5178 type: type,
5179 key: key,
5180 ref: ref,
5181 props: props,
5182 // Record the component responsible for creating this element.
5183 _owner: owner
5184 };
5185
5186 {
5187 // The validation flag is currently mutative. We put it on
5188 // an external backing store so that we can freeze the whole object.
5189 // This can be replaced with a WeakMap once they are implemented in
5190 // commonly used development environments.
5191 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
5192 // the validation flag non-enumerable (where possible, which should
5193 // include every environment we run tests in), so the test framework
5194 // ignores it.
5195
5196 Object.defineProperty(element._store, 'validated', {
5197 configurable: false,
5198 enumerable: false,
5199 writable: true,
5200 value: false
5201 }); // self and source are DEV only properties.
5202
5203 Object.defineProperty(element, '_self', {
5204 configurable: false,
5205 enumerable: false,
5206 writable: false,
5207 value: self
5208 }); // Two elements created in two different places should be considered
5209 // equal for testing purposes and therefore we hide it from enumeration.
5210
5211 Object.defineProperty(element, '_source', {
5212 configurable: false,
5213 enumerable: false,
5214 writable: false,
5215 value: source
5216 });
5217
5218 if (Object.freeze) {
5219 Object.freeze(element.props);
5220 Object.freeze(element);
5221 }
5222 }
5223
5224 return element;
5225 };
5226 /**
5227 * https://github.com/reactjs/rfcs/pull/107
5228 * @param {*} type
5229 * @param {object} props
5230 * @param {string} key
5231 */
5232
5233 function jsxDEV(type, config, maybeKey, source, self) {
5234 {
5235 var propName; // Reserved names are extracted
5236
5237 var props = {};
5238 var key = null;
5239 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
5240 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
5241 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
5242 // but as an intermediary step, we will use jsxDEV for everything except
5243 // <div {...props} key="Hi" />, because we aren't currently able to tell if
5244 // key is explicitly declared to be undefined or not.
5245
5246 if (maybeKey !== undefined) {
5247 {
5248 checkKeyStringCoercion(maybeKey);
5249 }
5250
5251 key = '' + maybeKey;
5252 }
5253
5254 if (hasValidKey(config)) {
5255 {
5256 checkKeyStringCoercion(config.key);
5257 }
5258
5259 key = '' + config.key;
5260 }
5261
5262 if (hasValidRef(config)) {
5263 ref = config.ref;
5264 warnIfStringRefCannotBeAutoConverted(config, self);
5265 } // Remaining properties are added to a new props object
5266
5267
5268 for (propName in config) {
5269 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
5270 props[propName] = config[propName];
5271 }
5272 } // Resolve default props
5273
5274
5275 if (type && type.defaultProps) {
5276 var defaultProps = type.defaultProps;
5277
5278 for (propName in defaultProps) {
5279 if (props[propName] === undefined) {
5280 props[propName] = defaultProps[propName];
5281 }
5282 }
5283 }
5284
5285 if (key || ref) {
5286 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
5287
5288 if (key) {
5289 defineKeyPropWarningGetter(props, displayName);
5290 }
5291
5292 if (ref) {
5293 defineRefPropWarningGetter(props, displayName);
5294 }
5295 }
5296
5297 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
5298 }
5299 }
5300
5301 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
5302 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
5303
5304 function setCurrentlyValidatingElement$1(element) {
5305 {
5306 if (element) {
5307 var owner = element._owner;
5308 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
5309 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
5310 } else {
5311 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
5312 }
5313 }
5314 }
5315
5316 var propTypesMisspellWarningShown;
5317
5318 {
5319 propTypesMisspellWarningShown = false;
5320 }
5321 /**
5322 * Verifies the object is a ReactElement.
5323 * See https://reactjs.org/docs/react-api.html#isvalidelement
5324 * @param {?object} object
5325 * @return {boolean} True if `object` is a ReactElement.
5326 * @final
5327 */
5328
5329
5330 function isValidElement(object) {
5331 {
5332 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
5333 }
5334 }
5335
5336 function getDeclarationErrorAddendum() {
5337 {
5338 if (ReactCurrentOwner$1.current) {
5339 var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
5340
5341 if (name) {
5342 return '\n\nCheck the render method of `' + name + '`.';
5343 }
5344 }
5345
5346 return '';
5347 }
5348 }
5349
5350 function getSourceInfoErrorAddendum(source) {
5351 {
5352 if (source !== undefined) {
5353 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
5354 var lineNumber = source.lineNumber;
5355 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
5356 }
5357
5358 return '';
5359 }
5360 }
5361 /**
5362 * Warn if there's no key explicitly set on dynamic arrays of children or
5363 * object keys are not valid. This allows us to keep track of children between
5364 * updates.
5365 */
5366
5367
5368 var ownerHasKeyUseWarning = {};
5369
5370 function getCurrentComponentErrorInfo(parentType) {
5371 {
5372 var info = getDeclarationErrorAddendum();
5373
5374 if (!info) {
5375 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
5376
5377 if (parentName) {
5378 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
5379 }
5380 }
5381
5382 return info;
5383 }
5384 }
5385 /**
5386 * Warn if the element doesn't have an explicit key assigned to it.
5387 * This element is in an array. The array could grow and shrink or be
5388 * reordered. All children that haven't already been validated are required to
5389 * have a "key" property assigned to it. Error statuses are cached so a warning
5390 * will only be shown once.
5391 *
5392 * @internal
5393 * @param {ReactElement} element Element that requires a key.
5394 * @param {*} parentType element's parent's type.
5395 */
5396
5397
5398 function validateExplicitKey(element, parentType) {
5399 {
5400 if (!element._store || element._store.validated || element.key != null) {
5401 return;
5402 }
5403
5404 element._store.validated = true;
5405 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
5406
5407 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
5408 return;
5409 }
5410
5411 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
5412 // property, it may be the creator of the child that's responsible for
5413 // assigning it a key.
5414
5415 var childOwner = '';
5416
5417 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
5418 // Give the component that originally created this child.
5419 childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
5420 }
5421
5422 setCurrentlyValidatingElement$1(element);
5423
5424 error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
5425
5426 setCurrentlyValidatingElement$1(null);
5427 }
5428 }
5429 /**
5430 * Ensure that every element either is passed in a static location, in an
5431 * array with an explicit keys property defined, or in an object literal
5432 * with valid key property.
5433 *
5434 * @internal
5435 * @param {ReactNode} node Statically passed child of any type.
5436 * @param {*} parentType node's parent's type.
5437 */
5438
5439
5440 function validateChildKeys(node, parentType) {
5441 {
5442 if (typeof node !== 'object') {
5443 return;
5444 }
5445
5446 if (isArray(node)) {
5447 for (var i = 0; i < node.length; i++) {
5448 var child = node[i];
5449
5450 if (isValidElement(child)) {
5451 validateExplicitKey(child, parentType);
5452 }
5453 }
5454 } else if (isValidElement(node)) {
5455 // This element was passed in a valid location.
5456 if (node._store) {
5457 node._store.validated = true;
5458 }
5459 } else if (node) {
5460 var iteratorFn = getIteratorFn(node);
5461
5462 if (typeof iteratorFn === 'function') {
5463 // Entry iterators used to provide implicit keys,
5464 // but now we print a separate warning for them later.
5465 if (iteratorFn !== node.entries) {
5466 var iterator = iteratorFn.call(node);
5467 var step;
5468
5469 while (!(step = iterator.next()).done) {
5470 if (isValidElement(step.value)) {
5471 validateExplicitKey(step.value, parentType);
5472 }
5473 }
5474 }
5475 }
5476 }
5477 }
5478 }
5479 /**
5480 * Given an element, validate that its props follow the propTypes definition,
5481 * provided by the type.
5482 *
5483 * @param {ReactElement} element
5484 */
5485
5486
5487 function validatePropTypes(element) {
5488 {
5489 var type = element.type;
5490
5491 if (type === null || type === undefined || typeof type === 'string') {
5492 return;
5493 }
5494
5495 var propTypes;
5496
5497 if (typeof type === 'function') {
5498 propTypes = type.propTypes;
5499 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
5500 // Inner props are checked in the reconciler.
5501 type.$$typeof === REACT_MEMO_TYPE)) {
5502 propTypes = type.propTypes;
5503 } else {
5504 return;
5505 }
5506
5507 if (propTypes) {
5508 // Intentionally inside to avoid triggering lazy initializers:
5509 var name = getComponentNameFromType(type);
5510 checkPropTypes(propTypes, element.props, 'prop', name, element);
5511 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
5512 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
5513
5514 var _name = getComponentNameFromType(type);
5515
5516 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
5517 }
5518
5519 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
5520 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
5521 }
5522 }
5523 }
5524 /**
5525 * Given a fragment, validate that it can only be provided with fragment props
5526 * @param {ReactElement} fragment
5527 */
5528
5529
5530 function validateFragmentProps(fragment) {
5531 {
5532 var keys = Object.keys(fragment.props);
5533
5534 for (var i = 0; i < keys.length; i++) {
5535 var key = keys[i];
5536
5537 if (key !== 'children' && key !== 'key') {
5538 setCurrentlyValidatingElement$1(fragment);
5539
5540 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
5541
5542 setCurrentlyValidatingElement$1(null);
5543 break;
5544 }
5545 }
5546
5547 if (fragment.ref !== null) {
5548 setCurrentlyValidatingElement$1(fragment);
5549
5550 error('Invalid attribute `ref` supplied to `React.Fragment`.');
5551
5552 setCurrentlyValidatingElement$1(null);
5553 }
5554 }
5555 }
5556
5557 var didWarnAboutKeySpread = {};
5558 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
5559 {
5560 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
5561 // succeed and there will likely be errors in render.
5562
5563 if (!validType) {
5564 var info = '';
5565
5566 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
5567 info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
5568 }
5569
5570 var sourceInfo = getSourceInfoErrorAddendum(source);
5571
5572 if (sourceInfo) {
5573 info += sourceInfo;
5574 } else {
5575 info += getDeclarationErrorAddendum();
5576 }
5577
5578 var typeString;
5579
5580 if (type === null) {
5581 typeString = 'null';
5582 } else if (isArray(type)) {
5583 typeString = 'array';
5584 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
5585 typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
5586 info = ' Did you accidentally export a JSX literal instead of a component?';
5587 } else {
5588 typeString = typeof type;
5589 }
5590
5591 error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
5592 }
5593
5594 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
5595 // TODO: Drop this when these are no longer allowed as the type argument.
5596
5597 if (element == null) {
5598 return element;
5599 } // Skip key warning if the type isn't valid since our key validation logic
5600 // doesn't expect a non-string/function type and can throw confusing errors.
5601 // We don't want exception behavior to differ between dev and prod.
5602 // (Rendering will throw with a helpful message and as soon as the type is
5603 // fixed, the key warnings will appear.)
5604
5605
5606 if (validType) {
5607 var children = props.children;
5608
5609 if (children !== undefined) {
5610 if (isStaticChildren) {
5611 if (isArray(children)) {
5612 for (var i = 0; i < children.length; i++) {
5613 validateChildKeys(children[i], type);
5614 }
5615
5616 if (Object.freeze) {
5617 Object.freeze(children);
5618 }
5619 } else {
5620 error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
5621 }
5622 } else {
5623 validateChildKeys(children, type);
5624 }
5625 }
5626 }
5627
5628 {
5629 if (hasOwnProperty.call(props, 'key')) {
5630 var componentName = getComponentNameFromType(type);
5631 var keys = Object.keys(props).filter(function (k) {
5632 return k !== 'key';
5633 });
5634 var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
5635
5636 if (!didWarnAboutKeySpread[componentName + beforeExample]) {
5637 var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
5638
5639 error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
5640
5641 didWarnAboutKeySpread[componentName + beforeExample] = true;
5642 }
5643 }
5644 }
5645
5646 if (type === REACT_FRAGMENT_TYPE) {
5647 validateFragmentProps(element);
5648 } else {
5649 validatePropTypes(element);
5650 }
5651
5652 return element;
5653 }
5654 } // These two functions exist to still get child warnings in dev
5655 // even with the prod transform. This means that jsxDEV is purely
5656 // opt-in behavior for better messages but that we won't stop
5657 // giving you warnings if you use production apis.
5658
5659 function jsxWithValidationStatic(type, props, key) {
5660 {
5661 return jsxWithValidation(type, props, key, true);
5662 }
5663 }
5664 function jsxWithValidationDynamic(type, props, key) {
5665 {
5666 return jsxWithValidation(type, props, key, false);
5667 }
5668 }
5669
5670 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
5671 // for now we can ship identical prod functions
5672
5673 var jsxs = jsxWithValidationStatic ;
5674
5675 exports.Fragment = REACT_FRAGMENT_TYPE;
5676 exports.jsx = jsx;
5677 exports.jsxs = jsxs;
5678 })();
5679 }
5680
5681
5682 /***/ }),
5683
5684 /***/ "./node_modules/react/jsx-runtime.js":
5685 /*!*******************************************!*\
5686 !*** ./node_modules/react/jsx-runtime.js ***!
5687 \*******************************************/
5688 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5689
5690 "use strict";
5691
5692
5693 if (false) {} else {
5694 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
5695 }
5696
5697
5698 /***/ }),
5699
5700 /***/ "react":
5701 /*!************************!*\
5702 !*** external "React" ***!
5703 \************************/
5704 /***/ ((module) => {
5705
5706 "use strict";
5707 module.exports = window["React"];
5708
5709 /***/ }),
5710
5711 /***/ "react-dom":
5712 /*!***************************!*\
5713 !*** external "ReactDOM" ***!
5714 \***************************/
5715 /***/ ((module) => {
5716
5717 "use strict";
5718 module.exports = window["ReactDOM"];
5719
5720 /***/ }),
5721
5722 /***/ "jquery":
5723 /*!*************************!*\
5724 !*** external "jQuery" ***!
5725 \*************************/
5726 /***/ ((module) => {
5727
5728 "use strict";
5729 module.exports = window["jQuery"];
5730
5731 /***/ }),
5732
5733 /***/ "@wordpress/i18n":
5734 /*!******************************!*\
5735 !*** external ["wp","i18n"] ***!
5736 \******************************/
5737 /***/ ((module) => {
5738
5739 "use strict";
5740 module.exports = window["wp"]["i18n"];
5741
5742 /***/ }),
5743
5744 /***/ "./node_modules/@linaria/react/dist/index.mjs":
5745 /*!****************************************************!*\
5746 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
5747 \****************************************************/
5748 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5749
5750 "use strict";
5751 __webpack_require__.r(__webpack_exports__);
5752 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5753 /* harmony export */ "styled": () => (/* binding */ styled_default)
5754 /* harmony export */ });
5755 /* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/is-prop-valid */ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js");
5756 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
5757 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
5758 // src/styled.ts
5759
5760
5761
5762 var isCapital = (ch) => ch.toUpperCase() === ch;
5763 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
5764 var omit = (obj, keys) => {
5765 const res = {};
5766 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
5767 res[key] = obj[key];
5768 });
5769 return res;
5770 };
5771 function filterProps(asIs, props, omitKeys) {
5772 const filteredProps = omit(props, omitKeys);
5773 if (!asIs) {
5774 const interopValidAttr = typeof _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"] === "function" ? { default: _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"] } : _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"];
5775 Object.keys(filteredProps).forEach((key) => {
5776 if (!interopValidAttr.default(key)) {
5777 delete filteredProps[key];
5778 }
5779 });
5780 }
5781 return filteredProps;
5782 }
5783 var warnIfInvalid = (value, componentName) => {
5784 if (true) {
5785 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
5786 return;
5787 }
5788 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
5789 console.warn(
5790 `An interpolation evaluated to '${stringified}' in the component '${componentName}', which is probably a mistake. You should explicitly cast or transform the value to a string.`
5791 );
5792 }
5793 };
5794 var idx = 0;
5795 function styled(tag) {
5796 var _a;
5797 let mockedClass = "";
5798 if (false) {}
5799 return (options) => {
5800 if (true) {
5801 if (Array.isArray(options)) {
5802 throw new Error(
5803 'Using the "styled" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly. See https://github.com/callstack/linaria#setup'
5804 );
5805 }
5806 }
5807 const render = (props, ref) => {
5808 const { as: component = tag, class: className = mockedClass } = props;
5809 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
5810 const filteredProps = filterProps(shouldKeepProps, props, [
5811 "as",
5812 "class"
5813 ]);
5814 filteredProps.ref = ref;
5815 filteredProps.className = options.atomic ? (0,_linaria_core__WEBPACK_IMPORTED_MODULE_2__.cx)(options.class, filteredProps.className || className) : (0,_linaria_core__WEBPACK_IMPORTED_MODULE_2__.cx)(filteredProps.className || className, options.class);
5816 const { vars } = options;
5817 if (vars) {
5818 const style = {};
5819 for (const name in vars) {
5820 const variable = vars[name];
5821 const result = variable[0];
5822 const unit = variable[1] || "";
5823 const value = typeof result === "function" ? result(props) : result;
5824 warnIfInvalid(value, options.name);
5825 style[`--${name}`] = `${value}${unit}`;
5826 }
5827 const ownStyle = filteredProps.style || {};
5828 const keys = Object.keys(ownStyle);
5829 if (keys.length > 0) {
5830 keys.forEach((key) => {
5831 style[key] = ownStyle[key];
5832 });
5833 }
5834 filteredProps.style = style;
5835 }
5836 if (tag.__linaria && tag !== component) {
5837 filteredProps.as = component;
5838 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
5839 }
5840 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
5841 };
5842 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
5843 const rest = omit(props, ["innerRef"]);
5844 return render(rest, props.innerRef);
5845 };
5846 Result.displayName = options.name;
5847 Result.__linaria = {
5848 className: options.class || mockedClass,
5849 extends: tag
5850 };
5851 return Result;
5852 };
5853 }
5854 var styled_default = true ? new Proxy(styled, {
5855 get(o, prop) {
5856 return o(prop);
5857 }
5858 }) : 0;
5859
5860 //# sourceMappingURL=index.mjs.map
5861
5862 /***/ }),
5863
5864 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
5865 /*!*******************************************************************************!*\
5866 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
5867 \*******************************************************************************/
5868 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5869
5870 "use strict";
5871 __webpack_require__.r(__webpack_exports__);
5872 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5873 /* harmony export */ "css": () => (/* binding */ css_default),
5874 /* harmony export */ "cx": () => (/* binding */ cx_default)
5875 /* harmony export */ });
5876 // src/css.ts
5877 var idx = 0;
5878 var css = () => {
5879 if (false) {}
5880 throw new Error(
5881 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
5882 );
5883 };
5884 var css_default = css;
5885
5886 // src/cx.ts
5887 var cx = function cx2() {
5888 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
5889 const atomicClasses = {};
5890 const nonAtomicClasses = [];
5891 presentClassNames.forEach((arg) => {
5892 const individualClassNames = arg ? arg.split(" ") : [];
5893 individualClassNames.forEach((className) => {
5894 if (className.startsWith("atm_")) {
5895 const [, keyHash] = className.split("_");
5896 atomicClasses[keyHash] = className;
5897 } else {
5898 nonAtomicClasses.push(className);
5899 }
5900 });
5901 });
5902 const result = [];
5903 for (const keyHash in atomicClasses) {
5904 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
5905 result.push(atomicClasses[keyHash]);
5906 }
5907 }
5908 result.push(...nonAtomicClasses);
5909 return result.join(" ");
5910 };
5911 var cx_default = cx;
5912
5913 //# sourceMappingURL=index.mjs.map
5914
5915 /***/ })
5916
5917 /******/ });
5918 /************************************************************************/
5919 /******/ // The module cache
5920 /******/ var __webpack_module_cache__ = {};
5921 /******/
5922 /******/ // The require function
5923 /******/ function __webpack_require__(moduleId) {
5924 /******/ // Check if module is in cache
5925 /******/ var cachedModule = __webpack_module_cache__[moduleId];
5926 /******/ if (cachedModule !== undefined) {
5927 /******/ return cachedModule.exports;
5928 /******/ }
5929 /******/ // Create a new module (and put it into the cache)
5930 /******/ var module = __webpack_module_cache__[moduleId] = {
5931 /******/ // no module.id needed
5932 /******/ // no module.loaded needed
5933 /******/ exports: {}
5934 /******/ };
5935 /******/
5936 /******/ // Execute the module function
5937 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
5938 /******/
5939 /******/ // Return the exports of the module
5940 /******/ return module.exports;
5941 /******/ }
5942 /******/
5943 /************************************************************************/
5944 /******/ /* webpack/runtime/compat get default export */
5945 /******/ (() => {
5946 /******/ // getDefaultExport function for compatibility with non-harmony modules
5947 /******/ __webpack_require__.n = (module) => {
5948 /******/ var getter = module && module.__esModule ?
5949 /******/ () => (module['default']) :
5950 /******/ () => (module);
5951 /******/ __webpack_require__.d(getter, { a: getter });
5952 /******/ return getter;
5953 /******/ };
5954 /******/ })();
5955 /******/
5956 /******/ /* webpack/runtime/define property getters */
5957 /******/ (() => {
5958 /******/ // define getter functions for harmony exports
5959 /******/ __webpack_require__.d = (exports, definition) => {
5960 /******/ for(var key in definition) {
5961 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
5962 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
5963 /******/ }
5964 /******/ }
5965 /******/ };
5966 /******/ })();
5967 /******/
5968 /******/ /* webpack/runtime/global */
5969 /******/ (() => {
5970 /******/ __webpack_require__.g = (function() {
5971 /******/ if (typeof globalThis === 'object') return globalThis;
5972 /******/ try {
5973 /******/ return this || new Function('return this')();
5974 /******/ } catch (e) {
5975 /******/ if (typeof window === 'object') return window;
5976 /******/ }
5977 /******/ })();
5978 /******/ })();
5979 /******/
5980 /******/ /* webpack/runtime/hasOwnProperty shorthand */
5981 /******/ (() => {
5982 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
5983 /******/ })();
5984 /******/
5985 /******/ /* webpack/runtime/make namespace object */
5986 /******/ (() => {
5987 /******/ // define __esModule on exports
5988 /******/ __webpack_require__.r = (exports) => {
5989 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
5990 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5991 /******/ }
5992 /******/ Object.defineProperty(exports, '__esModule', { value: true });
5993 /******/ };
5994 /******/ })();
5995 /******/
5996 /************************************************************************/
5997 var __webpack_exports__ = {};
5998 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
5999 (() => {
6000 "use strict";
6001 /*!********************************!*\
6002 !*** ./scripts/entries/app.ts ***!
6003 \********************************/
6004 __webpack_require__.r(__webpack_exports__);
6005 /* harmony import */ var _utils_appUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/appUtils */ "./scripts/utils/appUtils.ts");
6006 /* harmony import */ var _iframe_renderIframeApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../iframe/renderIframeApp */ "./scripts/iframe/renderIframeApp.tsx");
6007
6008
6009 (0,_utils_appUtils__WEBPACK_IMPORTED_MODULE_0__.initAppOnReady)(_iframe_renderIframeApp__WEBPACK_IMPORTED_MODULE_1__["default"]);
6010 })();
6011
6012 /******/ })()
6013 ;
6014 //# sourceMappingURL=leadin.js.map