PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.0.31
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.0.31
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.0.31, at build/leadin.js

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