@measured/puck-plugin-heading-analyzer 0.14.2-canary.2b2ef32 → 0.14.2-canary.3e5599e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1520 -54
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -35204,6 +35204,26 @@ function getFurthestAway({
35204
35204
  }).sort((a2, b) => b.distance - a2.distance);
35205
35205
  return sorted[0] ? sorted[0].id : null;
35206
35206
  }
35207
+ function normalizeFamilies(pageBorderBox, candidates) {
35208
+ const families = candidates.reduce((acc, candidate) => {
35209
+ var _a3;
35210
+ const familyName = ((_a3 = candidate.parents[0]) == null ? void 0 : _a3.id) || candidate.descriptor.id;
35211
+ const family = acc[familyName] || [];
35212
+ const generation = candidate.parents.length;
35213
+ family[generation] = [...family[generation] || [], candidate];
35214
+ return __spreadProps(__spreadValues({}, acc), {
35215
+ [familyName]: family
35216
+ });
35217
+ }, {});
35218
+ return Object.keys(families).map((familyName) => {
35219
+ const family = families[familyName].flat();
35220
+ const reversedFamily = [...family].reverse();
35221
+ const chosenMember = reversedFamily.find((member) => {
35222
+ return pageBorderBox.center.x < member.page.borderBox.right && pageBorderBox.center.x > member.page.borderBox.left && pageBorderBox.center.y > member.page.borderBox.top && pageBorderBox.center.y < member.page.borderBox.bottom;
35223
+ });
35224
+ return chosenMember || family[0];
35225
+ });
35226
+ }
35207
35227
  function getDroppableOver({
35208
35228
  pageBorderBox,
35209
35229
  draggable: draggable2,
@@ -35244,10 +35264,14 @@ function getDroppableOver({
35244
35264
  if (candidates.length === 1) {
35245
35265
  return candidates[0].descriptor.id;
35246
35266
  }
35267
+ const normalizedCandidates = normalizeFamilies(pageBorderBox, candidates);
35268
+ if (normalizedCandidates.length === 1) {
35269
+ return normalizedCandidates[0].descriptor.id;
35270
+ }
35247
35271
  return getFurthestAway({
35248
35272
  pageBorderBox,
35249
35273
  draggable: draggable2,
35250
- candidates
35274
+ candidates: normalizedCandidates
35251
35275
  });
35252
35276
  }
35253
35277
  function getIsDisplaced({
@@ -35932,20 +35956,22 @@ function offsetPoint(x, y, win) {
35932
35956
  let offsetY = 0;
35933
35957
  if (win.parent !== win.self) {
35934
35958
  const iframe = win.frameElement;
35935
- const rect = iframe.getBoundingClientRect();
35936
- const transform = getTransform(iframe);
35937
- offsetX = rect.left;
35938
- offsetY = rect.top;
35939
- if (transform) {
35940
- const {
35941
- x: transformedX,
35942
- y: transformedY
35943
- } = applyTransformPoint(x, y, transform.matrix, transform.origin);
35944
- const point2 = {
35945
- x: transformedX + offsetX,
35946
- y: transformedY + offsetY
35947
- };
35948
- return point2;
35959
+ if (iframe) {
35960
+ const rect = iframe.getBoundingClientRect();
35961
+ const transform = getTransform(iframe);
35962
+ offsetX = rect.left;
35963
+ offsetY = rect.top;
35964
+ if (transform) {
35965
+ const {
35966
+ x: transformedX,
35967
+ y: transformedY
35968
+ } = applyTransformPoint(x, y, transform.matrix, transform.origin);
35969
+ const point2 = {
35970
+ x: transformedX + offsetX,
35971
+ y: transformedY + offsetY
35972
+ };
35973
+ return point2;
35974
+ }
35949
35975
  }
35950
35976
  }
35951
35977
  const point = {
@@ -37618,7 +37644,7 @@ function getBody() {
37618
37644
  !document.body ? process.env.NODE_ENV !== "production" ? invariant2(false, "document.body is not ready") : invariant2(false) : void 0;
37619
37645
  return document.body;
37620
37646
  }
37621
- var import_react5, import_react_dom2, isProduction$1, spacesAndTabs, lineStartWithSpaces, clean$2, getDevMessage, getFormattedMessage, isDisabledFlag, warning2, error, loaded, isProduction2, prefix$1, RbdInvariant, ErrorBoundary, dragHandleUsageInstructions, position, onDragStart, withLocation, withCombine, onDragUpdate, returnedToStart, onDragEnd, preset, preset$1, origin, add, subtract, isEqual$1, negate, patch, distance2, closest$1, apply, executeClip, offsetByPosition, getCorners, noSpacing2, scroll$1, increase, clip2, getSubject, scrollDroppable, toDroppableMap, toDraggableMap, toDroppableList, toDraggableList, getDraggablesInsideDroppable, removeDraggableFromList, moveToNextCombine, isHomeOf, noDisplacedBy, emptyGroups, noImpact, noImpact$1, isWithin, isPartiallyVisibleThroughFrame, isTotallyVisibleThroughFrame, vertical, horizontal, isTotallyVisibleThroughFrameOnAxis, getDroppableDisplaced, isVisibleInDroppable, isVisibleInViewport, isVisible$1, isPartiallyVisible, isTotallyVisible, isTotallyVisibleOnAxis, getShouldAnimate, fromCombine, fromReorder, moveToNextIndex, getCombinedItemDisplacement, whenCombining, distanceFromStartToBorderBoxCenter, distanceFromEndToBorderBoxCenter, getCrossAxisBorderBoxCenter, goAfter, goBefore, goIntoStart, whenReordering, withDroppableDisplacement, getResultWithoutDroppableDisplacement, getPageBorderBoxCenterFromImpact, scrollViewport, speculativelyIncrease, withViewportDisplacement, getClientFromPageBorderBoxCenter, isTotallyVisibleInNewLocation, moveToNextPlace, getKnownActive, getBestCrossAxisDroppable, getCurrentPageBorderBoxCenter, getCurrentPageBorderBox, getClosestDraggable, getDisplacedBy, getRequiredGrowthForPlaceholder, withMaxScroll, addPlaceholder, removePlaceholder, moveToNewDroppable, moveCrossAxis, whatIsDraggedOver, getDroppableOver$1, moveInDirection, offsetRectByPosition, withDroppableScroll, getReorderImpact, combineThresholdDivisor, getCombineImpact, getDragImpact, patchDroppableMap, clearUnusedPlaceholder, recomputePlaceholders, update, recompute, getClientBorderBoxCenter, refreshSnap, getHomeLocation, getLiftEffect, patchDimensionMap, start, finish, offsetDraggable, getFrame, adjustAdditionsForScrollChanges, timingsKey, publishWhileDraggingInVirtual, isSnapping, postDroppableChange, idle$2, reducer, beforeInitialCapture, lift$1, initialPublish, publishWhileDragging, collectionStarting, updateDroppableScroll, updateDroppableIsEnabled, updateDroppableIsCombineEnabled, move, moveByWindowScroll, updateViewportMaxScroll, moveUp, moveDown, moveRight, moveLeft, flush, animateDrop, completeDrop, drop$1, dropPending, dropAnimationFinished, lift, style, curves, combine, timings, outOfTheWayTiming, transitions, moveTo, transforms, minDropTime, maxDropTime, dropTimeRange, maxDropTimeAtDistance, cancelDropModifier, getDropDuration, getNewHomeClientOffset, getDropImpact, dropMiddleware, drop, getWindowScroll3, shouldEnd, scrollListener, scrollListener$1, getExpiringAnnounce, getAsyncMarshal, areLocationsEqual, isCombineEqual, isCriticalEqual, withTimings, getDragStart, getPublisher, responders, dropAnimationFinishMiddleware, dropAnimationFinish, dropAnimationFlushOnScrollMiddleware, dropAnimationFlushOnScroll, dimensionMarshalStopper, focus, shouldStop, autoScroll, pendingDrop, pendingDrop$1, composeEnhancers, createStore2, clean$1, getMaxScroll, getDocumentElement, getMaxWindowScroll, getViewport, getInitialPublish, createDimensionMarshal, canStartDrag, scrollWindow, getScrollableDroppables, getScrollableDroppableOver, getBestScrollableDroppable, defaultAutoScrollerOptions, getDistanceThresholds, getPercentage, minScroll, getValueFromDistance, dampenValueByTime, getValue, getScrollOnAxis, adjustForSizeLimits, clean, getScroll$1, smallestSigned, getOverlap, canPartiallyScroll, canScrollWindow, getWindowOverlap, canScrollDroppable, getDroppableOverlap, getWindowScrollChange, getDroppableScrollChange, iframeCache, createCol, matrixPattern, getMatrix, getOrigin, findNearestTransform, defaultTransform, getTransform, applyTransformPoint, applyTransformRect, applyTransformSpacing, applyTransformBox, resetToOrigin, getIframeScroll, scroll, createFluidScroller, createJumpScroller, createAutoScroller, prefix2, dragHandle, draggable, droppable, scrollContainer, makeGetSelector, getStyles, noPointerEvents, getStyles$1, useIsomorphicLayoutEffect2, useLayoutEffect2, getHead, createStyleEl, alwaysDataAttr, dynamicDataAttr, getWindowFromEl, dragHandleCache, StoreContext, getBodyElement, visuallyHidden, visuallyHidden$1, getId, count$1, defaults, useUniqueId$1, AppContext, peerDependencies, semver, getVersion, isSatisfied, checkReactVersion, suffix, checkDoctype, tab, enter, escape, space, pageUp, pageDown, end, home, arrowLeft, arrowUp, arrowRight, arrowDown, preventedKeys, preventStandardKeyEvents, supportedEventName, supportedPageVisibilityEventName, primaryButton, sloppyClickThreshold, idle$1, scrollJumpKeys, idle, timeForLongPress, forcePressThreshold, interactiveTagNames, getBorderBoxCenterPosition, supportedMatchesName, defaultSensors, createResponders, createAutoScrollerOptions, count, useUniqueContextId$1, zIndexOptions, getDraggingTransition, getDraggingOpacity, getShouldDraggingAnimate, applyOffsetBox, DroppableContext, Draggable, Draggable$1, isStrictEqual, whatIsDraggedOverFromResult, getCombineWithFromResult, getCombineWithFromImpact, atRest, makeMapStateToProps$1, mapDispatchToProps$1, ConnectedDraggable, ConnectedDraggable$1, getScroll, isEqual2, isScroll, isAuto, isVisible, isEither, isBoth, isElementScrollable, isBodyScrollable, getClosestScrollable, getClosestScrollable$1, getIsFixed, getEnv, getDroppableDimension, getClient, getDimension, immediate, delayed, getListenerOptions, getScrollable, getClosestScrollableFromDrag, empty, getSize, getStyle, Placeholder, Placeholder$1, shared, standard, virtual, AnimateInOut, Droppable, Droppable$1, defaultProps, attachDefaultPropsToOwnProps, isMatchingType, getDraggable, makeMapStateToProps, mapDispatchToProps, ConnectedDroppable, ConnectedDroppable$1;
37647
+ var import_react5, import_react_dom2, isProduction$1, spacesAndTabs, lineStartWithSpaces, clean$2, getDevMessage, getFormattedMessage, isDisabledFlag, warning2, error, loaded, isProduction2, prefix$1, RbdInvariant, ErrorBoundary, dragHandleUsageInstructions, position, onDragStart, withLocation, withCombine, onDragUpdate, returnedToStart, onDragEnd, preset, preset$1, origin, add, subtract, isEqual$1, negate, patch, distance2, closest$1, apply, executeClip, offsetByPosition, getCorners, noSpacing2, scroll$1, increase, clip2, getSubject, scrollDroppable, toDroppableMap, toDraggableMap, toDroppableList, toDraggableList, getDraggablesInsideDroppable, removeDraggableFromList, moveToNextCombine, isHomeOf, noDisplacedBy, emptyGroups, noImpact, noImpact$1, isWithin, isPartiallyVisibleThroughFrame, isTotallyVisibleThroughFrame, vertical, horizontal, isTotallyVisibleThroughFrameOnAxis, getDroppableDisplaced, isVisibleInDroppable, isVisibleInViewport, isVisible$1, isPartiallyVisible, isTotallyVisible, isTotallyVisibleOnAxis, getShouldAnimate, fromCombine, fromReorder, moveToNextIndex, getCombinedItemDisplacement, whenCombining, distanceFromStartToBorderBoxCenter, distanceFromEndToBorderBoxCenter, getCrossAxisBorderBoxCenter, goAfter, goBefore, goIntoStart, whenReordering, withDroppableDisplacement, getResultWithoutDroppableDisplacement, getPageBorderBoxCenterFromImpact, scrollViewport, speculativelyIncrease, withViewportDisplacement, getClientFromPageBorderBoxCenter, isTotallyVisibleInNewLocation, moveToNextPlace, getKnownActive, getBestCrossAxisDroppable, getCurrentPageBorderBoxCenter, getCurrentPageBorderBox, getClosestDraggable, getDisplacedBy, getRequiredGrowthForPlaceholder, withMaxScroll, addPlaceholder, removePlaceholder, moveToNewDroppable, moveCrossAxis, whatIsDraggedOver, getDroppableOver$1, moveInDirection, offsetRectByPosition, withDroppableScroll, getReorderImpact, combineThresholdDivisor, getCombineImpact, getDragImpact, patchDroppableMap, clearUnusedPlaceholder, recomputePlaceholders, update, recompute, getClientBorderBoxCenter, refreshSnap, getHomeLocation, getLiftEffect, patchDimensionMap, start, finish, offsetDraggable, getFrame, adjustAdditionsForScrollChanges, timingsKey, publishWhileDraggingInVirtual, isSnapping, postDroppableChange, idle$2, reducer, beforeInitialCapture, lift$1, initialPublish, publishWhileDragging, collectionStarting, updateDroppableScroll, updateDroppableIsEnabled, updateDroppableIsCombineEnabled, move, moveByWindowScroll, updateViewportMaxScroll, moveUp, moveDown, moveRight, moveLeft, flush, animateDrop, completeDrop, drop$1, dropPending, dropAnimationFinished, lift, style, curves, combine, timings, outOfTheWayTiming, transitions, moveTo, transforms, minDropTime, maxDropTime, dropTimeRange, maxDropTimeAtDistance, cancelDropModifier, getDropDuration, getNewHomeClientOffset, getDropImpact, dropMiddleware, drop, getWindowScroll3, shouldEnd, scrollListener, scrollListener$1, getExpiringAnnounce, getAsyncMarshal, areLocationsEqual, isCombineEqual, isCriticalEqual, withTimings, getDragStart, getPublisher, responders, dropAnimationFinishMiddleware, dropAnimationFinish, dropAnimationFlushOnScrollMiddleware, dropAnimationFlushOnScroll, dimensionMarshalStopper, focus, shouldStop, autoScroll, pendingDrop, pendingDrop$1, composeEnhancers, createStore2, clean$1, getMaxScroll, getDocumentElement, getMaxWindowScroll, getViewport, getInitialPublish, createDimensionMarshal, canStartDrag, scrollWindow, getScrollableDroppables, getScrollableDroppableOver, getBestScrollableDroppable, defaultAutoScrollerOptions, getDistanceThresholds, getPercentage, minScroll, getValueFromDistance, dampenValueByTime, getValue, getScrollOnAxis, adjustForSizeLimits, clean, getScroll$1, smallestSigned, getOverlap, canPartiallyScroll, canScrollWindow, getWindowOverlap, canScrollDroppable, getDroppableOverlap, getWindowScrollChange, getDroppableScrollChange, iframeCache, createCol, matrixPattern, getMatrix, getOrigin, findNearestTransform, defaultTransform, getTransform, applyTransformPoint, applyTransformRect, applyTransformSpacing, applyTransformBox, resetToOrigin, getIframeScroll, scroll, createFluidScroller, createJumpScroller, createAutoScroller, prefix2, dragHandle, draggable, droppable, scrollContainer, makeGetSelector, getStyles, noPointerEvents, getStyles$1, useIsomorphicLayoutEffect2, useLayoutEffect2, getHead, createStyleEl, alwaysDataAttr, dynamicDataAttr, getWindowFromEl, dragHandleCache, StoreContext, getBodyElement, visuallyHidden, visuallyHidden$1, getId, count$1, defaults, useUniqueId$1, AppContext, peerDependencies, semver, getVersion, isSatisfied, checkReactVersion, suffix, checkDoctype, tab, enter, escape, space, pageUp, pageDown, end, home, arrowLeft, arrowUp, arrowRight, arrowDown, preventedKeys, preventStandardKeyEvents, supportedEventName, supportedPageVisibilityEventName, primaryButton, sloppyClickThreshold, idle$1, scrollJumpKeys, idle, timeForLongPress, forcePressThreshold, interactiveTagNames, getBorderBoxCenterPosition, supportedMatchesName, defaultSensors, createResponders, createAutoScrollerOptions, count, useUniqueContextId$1, zIndexOptions, getDraggingTransition, getDraggingOpacity, getShouldDraggingAnimate, applyOffsetBox, DroppableContext, Draggable, Draggable$1, isStrictEqual, whatIsDraggedOverFromResult, getCombineWithFromResult, getCombineWithFromImpact, atRest, makeMapStateToProps$1, mapDispatchToProps$1, ConnectedDraggable, ConnectedDraggable$1, getScroll, isEqual2, isScroll, isAuto, isVisible, isEither, isBoth, isElementScrollable, isBodyScrollable, getClosestScrollable, getClosestScrollable$1, getIsFixed, getEnv, getDroppableDimension, getClient, getParents, getDimension, immediate, delayed, getListenerOptions, getScrollable, getClosestScrollableFromDrag, empty, getSize, getStyle, Placeholder, Placeholder$1, shared, standard, virtual, AnimateInOut, Droppable, Droppable$1, defaultProps, attachDefaultPropsToOwnProps, isMatchingType, getDraggable, makeMapStateToProps, mapDispatchToProps, ConnectedDroppable, ConnectedDroppable$1;
37622
37648
  var init_dnd_esm = __esm({
37623
37649
  "../../node_modules/@measured/dnd/dist/dnd.esm.js"() {
37624
37650
  init_react_import();
@@ -41026,7 +41052,7 @@ var init_dnd_esm = __esm({
41026
41052
  }
41027
41053
  if (!el.parentElement) {
41028
41054
  const refWindow = el.ownerDocument.defaultView;
41029
- if (refWindow && refWindow.self !== refWindow.parent) {
41055
+ if (refWindow && refWindow.self !== refWindow.parent && refWindow.frameElement) {
41030
41056
  const iframe = refWindow.frameElement;
41031
41057
  return findNearestTransform(iframe);
41032
41058
  }
@@ -41148,7 +41174,7 @@ var init_dnd_esm = __esm({
41148
41174
  }) => {
41149
41175
  const el = querySelectorAllIframe(`[data-rfd-draggable-id="${state.critical.draggable.id}"]`)[0];
41150
41176
  const win = (el == null ? void 0 : el.ownerDocument.defaultView) || window;
41151
- const isInIframe = win !== window;
41177
+ const isInIframe = win !== window && win.frameElement;
41152
41178
  if (isInIframe) {
41153
41179
  const iframe = win.frameElement;
41154
41180
  const viewportBox = getBox(iframe);
@@ -41987,7 +42013,8 @@ var init_dnd_esm = __esm({
41987
42013
  client,
41988
42014
  page,
41989
42015
  closest: closest2,
41990
- transform
42016
+ transform,
42017
+ parents
41991
42018
  }) => {
41992
42019
  const frame = (() => {
41993
42020
  if (!closest2) {
@@ -42036,7 +42063,8 @@ var init_dnd_esm = __esm({
42036
42063
  page,
42037
42064
  frame,
42038
42065
  subject,
42039
- transform
42066
+ transform,
42067
+ parents
42040
42068
  };
42041
42069
  return dimension;
42042
42070
  };
@@ -42073,6 +42101,27 @@ var init_dnd_esm = __esm({
42073
42101
  });
42074
42102
  return client;
42075
42103
  };
42104
+ getParents = (ref2) => {
42105
+ var _a3;
42106
+ const contextId = ref2.getAttribute(`${prefix2}-droppable-context-id`);
42107
+ const parentDescriptors = [];
42108
+ if (!contextId)
42109
+ return [];
42110
+ let currentEl = ref2;
42111
+ while (currentEl) {
42112
+ currentEl = (_a3 = currentEl.parentElement) == null ? void 0 : _a3.closest(`[${prefix2}-droppable-context-id="${contextId}"]`);
42113
+ const id = currentEl == null ? void 0 : currentEl.getAttribute(`${prefix2}-droppable-id`);
42114
+ if (id) {
42115
+ parentDescriptors.push({
42116
+ id,
42117
+ mode: "standard",
42118
+ type: "DEFAULT"
42119
+ });
42120
+ }
42121
+ }
42122
+ parentDescriptors.reverse();
42123
+ return parentDescriptors;
42124
+ };
42076
42125
  getDimension = ({
42077
42126
  ref: ref2,
42078
42127
  descriptor,
@@ -42108,6 +42157,7 @@ var init_dnd_esm = __esm({
42108
42157
  shouldClipSubject
42109
42158
  };
42110
42159
  })();
42160
+ const parents = getParents(ref2);
42111
42161
  const dimension = getDroppableDimension({
42112
42162
  descriptor,
42113
42163
  isEnabled: !isDropDisabled,
@@ -42117,7 +42167,8 @@ var init_dnd_esm = __esm({
42117
42167
  client,
42118
42168
  page,
42119
42169
  closest: closest2,
42120
- transform
42170
+ transform,
42171
+ parents
42121
42172
  });
42122
42173
  return dimension;
42123
42174
  };
@@ -42588,6 +42639,1291 @@ var init_dnd_esm = __esm({
42588
42639
  }
42589
42640
  });
42590
42641
 
42642
+ // ../../node_modules/ua-parser-js/src/ua-parser.js
42643
+ var require_ua_parser = __commonJS({
42644
+ "../../node_modules/ua-parser-js/src/ua-parser.js"(exports, module2) {
42645
+ init_react_import();
42646
+ (function(window2, undefined2) {
42647
+ "use strict";
42648
+ var LIBVERSION = "1.0.37", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE2 = "type", VENDOR = "vendor", VERSION = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 500;
42649
+ var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook", CHROMIUM_OS = "Chromium OS", MAC_OS = "Mac OS";
42650
+ var extend = function(regexes2, extensions) {
42651
+ var mergedRegexes = {};
42652
+ for (var i2 in regexes2) {
42653
+ if (extensions[i2] && extensions[i2].length % 2 === 0) {
42654
+ mergedRegexes[i2] = extensions[i2].concat(regexes2[i2]);
42655
+ } else {
42656
+ mergedRegexes[i2] = regexes2[i2];
42657
+ }
42658
+ }
42659
+ return mergedRegexes;
42660
+ }, enumerize = function(arr) {
42661
+ var enums = {};
42662
+ for (var i2 = 0; i2 < arr.length; i2++) {
42663
+ enums[arr[i2].toUpperCase()] = arr[i2];
42664
+ }
42665
+ return enums;
42666
+ }, has = function(str1, str2) {
42667
+ return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;
42668
+ }, lowerize = function(str) {
42669
+ return str.toLowerCase();
42670
+ }, majorize = function(version2) {
42671
+ return typeof version2 === STR_TYPE ? version2.replace(/[^\d\.]/g, EMPTY).split(".")[0] : undefined2;
42672
+ }, trim = function(str, len) {
42673
+ if (typeof str === STR_TYPE) {
42674
+ str = str.replace(/^\s\s*/, EMPTY);
42675
+ return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
42676
+ }
42677
+ };
42678
+ var rgxMapper = function(ua, arrays) {
42679
+ var i2 = 0, j, k, p, q, matches, match;
42680
+ while (i2 < arrays.length && !matches) {
42681
+ var regex = arrays[i2], props = arrays[i2 + 1];
42682
+ j = k = 0;
42683
+ while (j < regex.length && !matches) {
42684
+ if (!regex[j]) {
42685
+ break;
42686
+ }
42687
+ matches = regex[j++].exec(ua);
42688
+ if (!!matches) {
42689
+ for (p = 0; p < props.length; p++) {
42690
+ match = matches[++k];
42691
+ q = props[p];
42692
+ if (typeof q === OBJ_TYPE && q.length > 0) {
42693
+ if (q.length === 2) {
42694
+ if (typeof q[1] == FUNC_TYPE) {
42695
+ this[q[0]] = q[1].call(this, match);
42696
+ } else {
42697
+ this[q[0]] = q[1];
42698
+ }
42699
+ } else if (q.length === 3) {
42700
+ if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
42701
+ this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;
42702
+ } else {
42703
+ this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;
42704
+ }
42705
+ } else if (q.length === 4) {
42706
+ this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;
42707
+ }
42708
+ } else {
42709
+ this[q] = match ? match : undefined2;
42710
+ }
42711
+ }
42712
+ }
42713
+ }
42714
+ i2 += 2;
42715
+ }
42716
+ }, strMapper = function(str, map) {
42717
+ for (var i2 in map) {
42718
+ if (typeof map[i2] === OBJ_TYPE && map[i2].length > 0) {
42719
+ for (var j = 0; j < map[i2].length; j++) {
42720
+ if (has(map[i2][j], str)) {
42721
+ return i2 === UNKNOWN ? undefined2 : i2;
42722
+ }
42723
+ }
42724
+ } else if (has(map[i2], str)) {
42725
+ return i2 === UNKNOWN ? undefined2 : i2;
42726
+ }
42727
+ }
42728
+ return str;
42729
+ };
42730
+ var oldSafariMap = {
42731
+ "1.0": "/8",
42732
+ "1.2": "/1",
42733
+ "1.3": "/3",
42734
+ "2.0": "/412",
42735
+ "2.0.2": "/416",
42736
+ "2.0.3": "/417",
42737
+ "2.0.4": "/419",
42738
+ "?": "/"
42739
+ }, windowsVersionMap = {
42740
+ "ME": "4.90",
42741
+ "NT 3.11": "NT3.51",
42742
+ "NT 4.0": "NT4.0",
42743
+ "2000": "NT 5.0",
42744
+ "XP": ["NT 5.1", "NT 5.2"],
42745
+ "Vista": "NT 6.0",
42746
+ "7": "NT 6.1",
42747
+ "8": "NT 6.2",
42748
+ "8.1": "NT 6.3",
42749
+ "10": ["NT 6.4", "NT 10.0"],
42750
+ "RT": "ARM"
42751
+ };
42752
+ var regexes = {
42753
+ browser: [
42754
+ [
42755
+ /\b(?:crmo|crios)\/([\w\.]+)/i
42756
+ // Chrome for Android/iOS
42757
+ ],
42758
+ [VERSION, [NAME, "Chrome"]],
42759
+ [
42760
+ /edg(?:e|ios|a)?\/([\w\.]+)/i
42761
+ // Microsoft Edge
42762
+ ],
42763
+ [VERSION, [NAME, "Edge"]],
42764
+ [
42765
+ // Presto based
42766
+ /(opera mini)\/([-\w\.]+)/i,
42767
+ // Opera Mini
42768
+ /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
42769
+ // Opera Mobi/Tablet
42770
+ /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
42771
+ // Opera
42772
+ ],
42773
+ [NAME, VERSION],
42774
+ [
42775
+ /opios[\/ ]+([\w\.]+)/i
42776
+ // Opera mini on iphone >= 8.0
42777
+ ],
42778
+ [VERSION, [NAME, OPERA + " Mini"]],
42779
+ [
42780
+ /\bopr\/([\w\.]+)/i
42781
+ // Opera Webkit
42782
+ ],
42783
+ [VERSION, [NAME, OPERA]],
42784
+ [
42785
+ // Mixed
42786
+ /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
42787
+ // Baidu
42788
+ ],
42789
+ [VERSION, [NAME, "Baidu"]],
42790
+ [
42791
+ /(kindle)\/([\w\.]+)/i,
42792
+ // Kindle
42793
+ /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
42794
+ // Lunascape/Maxthon/Netfront/Jasmine/Blazer
42795
+ // Trident based
42796
+ /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,
42797
+ // Avant/IEMobile/SlimBrowser
42798
+ /(?:ms|\()(ie) ([\w\.]+)/i,
42799
+ // Internet Explorer
42800
+ // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
42801
+ /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
42802
+ // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
42803
+ /(heytap|ovi)browser\/([\d\.]+)/i,
42804
+ // Heytap/Ovi
42805
+ /(weibo)__([\d\.]+)/i
42806
+ // Weibo
42807
+ ],
42808
+ [NAME, VERSION],
42809
+ [
42810
+ /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
42811
+ // UCBrowser
42812
+ ],
42813
+ [VERSION, [NAME, "UC" + BROWSER]],
42814
+ [
42815
+ /microm.+\bqbcore\/([\w\.]+)/i,
42816
+ // WeChat Desktop for Windows Built-in Browser
42817
+ /\bqbcore\/([\w\.]+).+microm/i,
42818
+ /micromessenger\/([\w\.]+)/i
42819
+ // WeChat
42820
+ ],
42821
+ [VERSION, [NAME, "WeChat"]],
42822
+ [
42823
+ /konqueror\/([\w\.]+)/i
42824
+ // Konqueror
42825
+ ],
42826
+ [VERSION, [NAME, "Konqueror"]],
42827
+ [
42828
+ /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
42829
+ // IE11
42830
+ ],
42831
+ [VERSION, [NAME, "IE"]],
42832
+ [
42833
+ /ya(?:search)?browser\/([\w\.]+)/i
42834
+ // Yandex
42835
+ ],
42836
+ [VERSION, [NAME, "Yandex"]],
42837
+ [
42838
+ /slbrowser\/([\w\.]+)/i
42839
+ // Smart Lenovo Browser
42840
+ ],
42841
+ [VERSION, [NAME, "Smart Lenovo " + BROWSER]],
42842
+ [
42843
+ /(avast|avg)\/([\w\.]+)/i
42844
+ // Avast/AVG Secure Browser
42845
+ ],
42846
+ [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION],
42847
+ [
42848
+ /\bfocus\/([\w\.]+)/i
42849
+ // Firefox Focus
42850
+ ],
42851
+ [VERSION, [NAME, FIREFOX + " Focus"]],
42852
+ [
42853
+ /\bopt\/([\w\.]+)/i
42854
+ // Opera Touch
42855
+ ],
42856
+ [VERSION, [NAME, OPERA + " Touch"]],
42857
+ [
42858
+ /coc_coc\w+\/([\w\.]+)/i
42859
+ // Coc Coc Browser
42860
+ ],
42861
+ [VERSION, [NAME, "Coc Coc"]],
42862
+ [
42863
+ /dolfin\/([\w\.]+)/i
42864
+ // Dolphin
42865
+ ],
42866
+ [VERSION, [NAME, "Dolphin"]],
42867
+ [
42868
+ /coast\/([\w\.]+)/i
42869
+ // Opera Coast
42870
+ ],
42871
+ [VERSION, [NAME, OPERA + " Coast"]],
42872
+ [
42873
+ /miuibrowser\/([\w\.]+)/i
42874
+ // MIUI Browser
42875
+ ],
42876
+ [VERSION, [NAME, "MIUI " + BROWSER]],
42877
+ [
42878
+ /fxios\/([-\w\.]+)/i
42879
+ // Firefox for iOS
42880
+ ],
42881
+ [VERSION, [NAME, FIREFOX]],
42882
+ [
42883
+ /\bqihu|(qi?ho?o?|360)browser/i
42884
+ // 360
42885
+ ],
42886
+ [[NAME, "360 " + BROWSER]],
42887
+ [
42888
+ /(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i
42889
+ ],
42890
+ [[NAME, /(.+)/, "$1 " + BROWSER], VERSION],
42891
+ [
42892
+ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser
42893
+ /samsungbrowser\/([\w\.]+)/i
42894
+ // Samsung Internet
42895
+ ],
42896
+ [VERSION, [NAME, SAMSUNG + " Internet"]],
42897
+ [
42898
+ /(comodo_dragon)\/([\w\.]+)/i
42899
+ // Comodo Dragon
42900
+ ],
42901
+ [[NAME, /_/g, " "], VERSION],
42902
+ [
42903
+ /metasr[\/ ]?([\d\.]+)/i
42904
+ // Sogou Explorer
42905
+ ],
42906
+ [VERSION, [NAME, "Sogou Explorer"]],
42907
+ [
42908
+ /(sogou)mo\w+\/([\d\.]+)/i
42909
+ // Sogou Mobile
42910
+ ],
42911
+ [[NAME, "Sogou Mobile"], VERSION],
42912
+ [
42913
+ /(electron)\/([\w\.]+) safari/i,
42914
+ // Electron-based App
42915
+ /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
42916
+ // Tesla
42917
+ /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i
42918
+ // QQBrowser/2345 Browser
42919
+ ],
42920
+ [NAME, VERSION],
42921
+ [
42922
+ /(lbbrowser)/i,
42923
+ // LieBao Browser
42924
+ /\[(linkedin)app\]/i
42925
+ // LinkedIn App for iOS & Android
42926
+ ],
42927
+ [NAME],
42928
+ [
42929
+ // WebView
42930
+ /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
42931
+ // Facebook App for iOS & Android
42932
+ ],
42933
+ [[NAME, FACEBOOK], VERSION],
42934
+ [
42935
+ /(Klarna)\/([\w\.]+)/i,
42936
+ // Klarna Shopping Browser for iOS & Android
42937
+ /(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
42938
+ // Kakao App
42939
+ /(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
42940
+ // Naver InApp
42941
+ /safari (line)\/([\w\.]+)/i,
42942
+ // Line App for iOS
42943
+ /\b(line)\/([\w\.]+)\/iab/i,
42944
+ // Line App for Android
42945
+ /(alipay)client\/([\w\.]+)/i,
42946
+ // Alipay
42947
+ /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
42948
+ // Chromium/Instagram/Snapchat
42949
+ ],
42950
+ [NAME, VERSION],
42951
+ [
42952
+ /\bgsa\/([\w\.]+) .*safari\//i
42953
+ // Google Search Appliance on iOS
42954
+ ],
42955
+ [VERSION, [NAME, "GSA"]],
42956
+ [
42957
+ /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i
42958
+ // TikTok
42959
+ ],
42960
+ [VERSION, [NAME, "TikTok"]],
42961
+ [
42962
+ /headlesschrome(?:\/([\w\.]+)| )/i
42963
+ // Chrome Headless
42964
+ ],
42965
+ [VERSION, [NAME, CHROME + " Headless"]],
42966
+ [
42967
+ / wv\).+(chrome)\/([\w\.]+)/i
42968
+ // Chrome WebView
42969
+ ],
42970
+ [[NAME, CHROME + " WebView"], VERSION],
42971
+ [
42972
+ /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
42973
+ // Android Browser
42974
+ ],
42975
+ [VERSION, [NAME, "Android " + BROWSER]],
42976
+ [
42977
+ /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
42978
+ // Chrome/OmniWeb/Arora/Tizen/Nokia
42979
+ ],
42980
+ [NAME, VERSION],
42981
+ [
42982
+ /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i
42983
+ // Mobile Safari
42984
+ ],
42985
+ [VERSION, [NAME, "Mobile Safari"]],
42986
+ [
42987
+ /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i
42988
+ // Safari & Safari Mobile
42989
+ ],
42990
+ [VERSION, NAME],
42991
+ [
42992
+ /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
42993
+ // Safari < 3.0
42994
+ ],
42995
+ [NAME, [VERSION, strMapper, oldSafariMap]],
42996
+ [
42997
+ /(webkit|khtml)\/([\w\.]+)/i
42998
+ ],
42999
+ [NAME, VERSION],
43000
+ [
43001
+ // Gecko based
43002
+ /(navigator|netscape\d?)\/([-\w\.]+)/i
43003
+ // Netscape
43004
+ ],
43005
+ [[NAME, "Netscape"], VERSION],
43006
+ [
43007
+ /mobile vr; rv:([\w\.]+)\).+firefox/i
43008
+ // Firefox Reality
43009
+ ],
43010
+ [VERSION, [NAME, FIREFOX + " Reality"]],
43011
+ [
43012
+ /ekiohf.+(flow)\/([\w\.]+)/i,
43013
+ // Flow
43014
+ /(swiftfox)/i,
43015
+ // Swiftfox
43016
+ /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
43017
+ // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
43018
+ /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
43019
+ // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
43020
+ /(firefox)\/([\w\.]+)/i,
43021
+ // Other Firefox-based
43022
+ /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
43023
+ // Mozilla
43024
+ // Other
43025
+ /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
43026
+ // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
43027
+ /(links) \(([\w\.]+)/i,
43028
+ // Links
43029
+ /panasonic;(viera)/i
43030
+ // Panasonic Viera
43031
+ ],
43032
+ [NAME, VERSION],
43033
+ [
43034
+ /(cobalt)\/([\w\.]+)/i
43035
+ // Cobalt
43036
+ ],
43037
+ [NAME, [VERSION, /master.|lts./, ""]]
43038
+ ],
43039
+ cpu: [
43040
+ [
43041
+ /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i
43042
+ // AMD64 (x64)
43043
+ ],
43044
+ [[ARCHITECTURE, "amd64"]],
43045
+ [
43046
+ /(ia32(?=;))/i
43047
+ // IA32 (quicktime)
43048
+ ],
43049
+ [[ARCHITECTURE, lowerize]],
43050
+ [
43051
+ /((?:i[346]|x)86)[;\)]/i
43052
+ // IA32 (x86)
43053
+ ],
43054
+ [[ARCHITECTURE, "ia32"]],
43055
+ [
43056
+ /\b(aarch64|arm(v?8e?l?|_?64))\b/i
43057
+ // ARM64
43058
+ ],
43059
+ [[ARCHITECTURE, "arm64"]],
43060
+ [
43061
+ /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
43062
+ // ARMHF
43063
+ ],
43064
+ [[ARCHITECTURE, "armhf"]],
43065
+ [
43066
+ // PocketPC mistakenly identified as PowerPC
43067
+ /windows (ce|mobile); ppc;/i
43068
+ ],
43069
+ [[ARCHITECTURE, "arm"]],
43070
+ [
43071
+ /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
43072
+ // PowerPC
43073
+ ],
43074
+ [[ARCHITECTURE, /ower/, EMPTY, lowerize]],
43075
+ [
43076
+ /(sun4\w)[;\)]/i
43077
+ // SPARC
43078
+ ],
43079
+ [[ARCHITECTURE, "sparc"]],
43080
+ [
43081
+ /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
43082
+ // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
43083
+ ],
43084
+ [[ARCHITECTURE, lowerize]]
43085
+ ],
43086
+ device: [
43087
+ [
43088
+ //////////////////////////
43089
+ // MOBILES & TABLETS
43090
+ /////////////////////////
43091
+ // Samsung
43092
+ /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
43093
+ ],
43094
+ [MODEL, [VENDOR, SAMSUNG], [TYPE2, TABLET]],
43095
+ [
43096
+ /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
43097
+ /samsung[- ]([-\w]+)/i,
43098
+ /sec-(sgh\w+)/i
43099
+ ],
43100
+ [MODEL, [VENDOR, SAMSUNG], [TYPE2, MOBILE]],
43101
+ [
43102
+ // Apple
43103
+ /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
43104
+ // iPod/iPhone
43105
+ ],
43106
+ [MODEL, [VENDOR, APPLE], [TYPE2, MOBILE]],
43107
+ [
43108
+ /\((ipad);[-\w\),; ]+apple/i,
43109
+ // iPad
43110
+ /applecoremedia\/[\w\.]+ \((ipad)/i,
43111
+ /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
43112
+ ],
43113
+ [MODEL, [VENDOR, APPLE], [TYPE2, TABLET]],
43114
+ [
43115
+ /(macintosh);/i
43116
+ ],
43117
+ [MODEL, [VENDOR, APPLE]],
43118
+ [
43119
+ // Sharp
43120
+ /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
43121
+ ],
43122
+ [MODEL, [VENDOR, SHARP], [TYPE2, MOBILE]],
43123
+ [
43124
+ // Huawei
43125
+ /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
43126
+ ],
43127
+ [MODEL, [VENDOR, HUAWEI], [TYPE2, TABLET]],
43128
+ [
43129
+ /(?:huawei|honor)([-\w ]+)[;\)]/i,
43130
+ /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
43131
+ ],
43132
+ [MODEL, [VENDOR, HUAWEI], [TYPE2, MOBILE]],
43133
+ [
43134
+ // Xiaomi
43135
+ /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
43136
+ // Xiaomi POCO
43137
+ /\b; (\w+) build\/hm\1/i,
43138
+ // Xiaomi Hongmi 'numeric' models
43139
+ /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
43140
+ // Xiaomi Hongmi
43141
+ /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
43142
+ // Xiaomi Redmi
43143
+ /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,
43144
+ // Xiaomi Redmi 'numeric' models
43145
+ /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
43146
+ // Xiaomi Mi
43147
+ ],
43148
+ [[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE2, MOBILE]],
43149
+ [
43150
+ /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
43151
+ // Redmi Pad
43152
+ /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
43153
+ // Mi Pad tablets
43154
+ ],
43155
+ [[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE2, TABLET]],
43156
+ [
43157
+ // OPPO
43158
+ /; (\w+) bui.+ oppo/i,
43159
+ /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
43160
+ ],
43161
+ [MODEL, [VENDOR, "OPPO"], [TYPE2, MOBILE]],
43162
+ [
43163
+ // Vivo
43164
+ /vivo (\w+)(?: bui|\))/i,
43165
+ /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
43166
+ ],
43167
+ [MODEL, [VENDOR, "Vivo"], [TYPE2, MOBILE]],
43168
+ [
43169
+ // Realme
43170
+ /\b(rmx[1-3]\d{3})(?: bui|;|\))/i
43171
+ ],
43172
+ [MODEL, [VENDOR, "Realme"], [TYPE2, MOBILE]],
43173
+ [
43174
+ // Motorola
43175
+ /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
43176
+ /\bmot(?:orola)?[- ](\w*)/i,
43177
+ /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
43178
+ ],
43179
+ [MODEL, [VENDOR, MOTOROLA], [TYPE2, MOBILE]],
43180
+ [
43181
+ /\b(mz60\d|xoom[2 ]{0,2}) build\//i
43182
+ ],
43183
+ [MODEL, [VENDOR, MOTOROLA], [TYPE2, TABLET]],
43184
+ [
43185
+ // LG
43186
+ /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
43187
+ ],
43188
+ [MODEL, [VENDOR, LG], [TYPE2, TABLET]],
43189
+ [
43190
+ /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
43191
+ /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
43192
+ /\blg-?([\d\w]+) bui/i
43193
+ ],
43194
+ [MODEL, [VENDOR, LG], [TYPE2, MOBILE]],
43195
+ [
43196
+ // Lenovo
43197
+ /(ideatab[-\w ]+)/i,
43198
+ /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
43199
+ ],
43200
+ [MODEL, [VENDOR, "Lenovo"], [TYPE2, TABLET]],
43201
+ [
43202
+ // Nokia
43203
+ /(?:maemo|nokia).*(n900|lumia \d+)/i,
43204
+ /nokia[-_ ]?([-\w\.]*)/i
43205
+ ],
43206
+ [[MODEL, /_/g, " "], [VENDOR, "Nokia"], [TYPE2, MOBILE]],
43207
+ [
43208
+ // Google
43209
+ /(pixel c)\b/i
43210
+ // Google Pixel C
43211
+ ],
43212
+ [MODEL, [VENDOR, GOOGLE], [TYPE2, TABLET]],
43213
+ [
43214
+ /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
43215
+ // Google Pixel
43216
+ ],
43217
+ [MODEL, [VENDOR, GOOGLE], [TYPE2, MOBILE]],
43218
+ [
43219
+ // Sony
43220
+ /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
43221
+ ],
43222
+ [MODEL, [VENDOR, SONY], [TYPE2, MOBILE]],
43223
+ [
43224
+ /sony tablet [ps]/i,
43225
+ /\b(?:sony)?sgp\w+(?: bui|\))/i
43226
+ ],
43227
+ [[MODEL, "Xperia Tablet"], [VENDOR, SONY], [TYPE2, TABLET]],
43228
+ [
43229
+ // OnePlus
43230
+ / (kb2005|in20[12]5|be20[12][59])\b/i,
43231
+ /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
43232
+ ],
43233
+ [MODEL, [VENDOR, "OnePlus"], [TYPE2, MOBILE]],
43234
+ [
43235
+ // Amazon
43236
+ /(alexa)webm/i,
43237
+ /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,
43238
+ // Kindle Fire without Silk / Echo Show
43239
+ /(kf[a-z]+)( bui|\)).+silk\//i
43240
+ // Kindle Fire HD
43241
+ ],
43242
+ [MODEL, [VENDOR, AMAZON], [TYPE2, TABLET]],
43243
+ [
43244
+ /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
43245
+ // Fire Phone
43246
+ ],
43247
+ [[MODEL, /(.+)/g, "Fire Phone $1"], [VENDOR, AMAZON], [TYPE2, MOBILE]],
43248
+ [
43249
+ // BlackBerry
43250
+ /(playbook);[-\w\),; ]+(rim)/i
43251
+ // BlackBerry PlayBook
43252
+ ],
43253
+ [MODEL, VENDOR, [TYPE2, TABLET]],
43254
+ [
43255
+ /\b((?:bb[a-f]|st[hv])100-\d)/i,
43256
+ /\(bb10; (\w+)/i
43257
+ // BlackBerry 10
43258
+ ],
43259
+ [MODEL, [VENDOR, BLACKBERRY], [TYPE2, MOBILE]],
43260
+ [
43261
+ // Asus
43262
+ /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
43263
+ ],
43264
+ [MODEL, [VENDOR, ASUS], [TYPE2, TABLET]],
43265
+ [
43266
+ / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
43267
+ ],
43268
+ [MODEL, [VENDOR, ASUS], [TYPE2, MOBILE]],
43269
+ [
43270
+ // HTC
43271
+ /(nexus 9)/i
43272
+ // HTC Nexus 9
43273
+ ],
43274
+ [MODEL, [VENDOR, "HTC"], [TYPE2, TABLET]],
43275
+ [
43276
+ /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
43277
+ // HTC
43278
+ // ZTE
43279
+ /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
43280
+ /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
43281
+ // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
43282
+ ],
43283
+ [VENDOR, [MODEL, /_/g, " "], [TYPE2, MOBILE]],
43284
+ [
43285
+ // Acer
43286
+ /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
43287
+ ],
43288
+ [MODEL, [VENDOR, "Acer"], [TYPE2, TABLET]],
43289
+ [
43290
+ // Meizu
43291
+ /droid.+; (m[1-5] note) bui/i,
43292
+ /\bmz-([-\w]{2,})/i
43293
+ ],
43294
+ [MODEL, [VENDOR, "Meizu"], [TYPE2, MOBILE]],
43295
+ [
43296
+ // Ulefone
43297
+ /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
43298
+ ],
43299
+ [MODEL, [VENDOR, "Ulefone"], [TYPE2, MOBILE]],
43300
+ [
43301
+ // MIXED
43302
+ /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
43303
+ // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
43304
+ /(hp) ([\w ]+\w)/i,
43305
+ // HP iPAQ
43306
+ /(asus)-?(\w+)/i,
43307
+ // Asus
43308
+ /(microsoft); (lumia[\w ]+)/i,
43309
+ // Microsoft Lumia
43310
+ /(lenovo)[-_ ]?([-\w]+)/i,
43311
+ // Lenovo
43312
+ /(jolla)/i,
43313
+ // Jolla
43314
+ /(oppo) ?([\w ]+) bui/i
43315
+ // OPPO
43316
+ ],
43317
+ [VENDOR, MODEL, [TYPE2, MOBILE]],
43318
+ [
43319
+ /(kobo)\s(ereader|touch)/i,
43320
+ // Kobo
43321
+ /(archos) (gamepad2?)/i,
43322
+ // Archos
43323
+ /(hp).+(touchpad(?!.+tablet)|tablet)/i,
43324
+ // HP TouchPad
43325
+ /(kindle)\/([\w\.]+)/i,
43326
+ // Kindle
43327
+ /(nook)[\w ]+build\/(\w+)/i,
43328
+ // Nook
43329
+ /(dell) (strea[kpr\d ]*[\dko])/i,
43330
+ // Dell Streak
43331
+ /(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
43332
+ // Le Pan Tablets
43333
+ /(trinity)[- ]*(t\d{3}) bui/i,
43334
+ // Trinity Tablets
43335
+ /(gigaset)[- ]+(q\w{1,9}) bui/i,
43336
+ // Gigaset Tablets
43337
+ /(vodafone) ([\w ]+)(?:\)| bui)/i
43338
+ // Vodafone
43339
+ ],
43340
+ [VENDOR, MODEL, [TYPE2, TABLET]],
43341
+ [
43342
+ /(surface duo)/i
43343
+ // Surface Duo
43344
+ ],
43345
+ [MODEL, [VENDOR, MICROSOFT], [TYPE2, TABLET]],
43346
+ [
43347
+ /droid [\d\.]+; (fp\du?)(?: b|\))/i
43348
+ // Fairphone
43349
+ ],
43350
+ [MODEL, [VENDOR, "Fairphone"], [TYPE2, MOBILE]],
43351
+ [
43352
+ /(u304aa)/i
43353
+ // AT&T
43354
+ ],
43355
+ [MODEL, [VENDOR, "AT&T"], [TYPE2, MOBILE]],
43356
+ [
43357
+ /\bsie-(\w*)/i
43358
+ // Siemens
43359
+ ],
43360
+ [MODEL, [VENDOR, "Siemens"], [TYPE2, MOBILE]],
43361
+ [
43362
+ /\b(rct\w+) b/i
43363
+ // RCA Tablets
43364
+ ],
43365
+ [MODEL, [VENDOR, "RCA"], [TYPE2, TABLET]],
43366
+ [
43367
+ /\b(venue[\d ]{2,7}) b/i
43368
+ // Dell Venue Tablets
43369
+ ],
43370
+ [MODEL, [VENDOR, "Dell"], [TYPE2, TABLET]],
43371
+ [
43372
+ /\b(q(?:mv|ta)\w+) b/i
43373
+ // Verizon Tablet
43374
+ ],
43375
+ [MODEL, [VENDOR, "Verizon"], [TYPE2, TABLET]],
43376
+ [
43377
+ /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
43378
+ // Barnes & Noble Tablet
43379
+ ],
43380
+ [MODEL, [VENDOR, "Barnes & Noble"], [TYPE2, TABLET]],
43381
+ [
43382
+ /\b(tm\d{3}\w+) b/i
43383
+ ],
43384
+ [MODEL, [VENDOR, "NuVision"], [TYPE2, TABLET]],
43385
+ [
43386
+ /\b(k88) b/i
43387
+ // ZTE K Series Tablet
43388
+ ],
43389
+ [MODEL, [VENDOR, "ZTE"], [TYPE2, TABLET]],
43390
+ [
43391
+ /\b(nx\d{3}j) b/i
43392
+ // ZTE Nubia
43393
+ ],
43394
+ [MODEL, [VENDOR, "ZTE"], [TYPE2, MOBILE]],
43395
+ [
43396
+ /\b(gen\d{3}) b.+49h/i
43397
+ // Swiss GEN Mobile
43398
+ ],
43399
+ [MODEL, [VENDOR, "Swiss"], [TYPE2, MOBILE]],
43400
+ [
43401
+ /\b(zur\d{3}) b/i
43402
+ // Swiss ZUR Tablet
43403
+ ],
43404
+ [MODEL, [VENDOR, "Swiss"], [TYPE2, TABLET]],
43405
+ [
43406
+ /\b((zeki)?tb.*\b) b/i
43407
+ // Zeki Tablets
43408
+ ],
43409
+ [MODEL, [VENDOR, "Zeki"], [TYPE2, TABLET]],
43410
+ [
43411
+ /\b([yr]\d{2}) b/i,
43412
+ /\b(dragon[- ]+touch |dt)(\w{5}) b/i
43413
+ // Dragon Touch Tablet
43414
+ ],
43415
+ [[VENDOR, "Dragon Touch"], MODEL, [TYPE2, TABLET]],
43416
+ [
43417
+ /\b(ns-?\w{0,9}) b/i
43418
+ // Insignia Tablets
43419
+ ],
43420
+ [MODEL, [VENDOR, "Insignia"], [TYPE2, TABLET]],
43421
+ [
43422
+ /\b((nxa|next)-?\w{0,9}) b/i
43423
+ // NextBook Tablets
43424
+ ],
43425
+ [MODEL, [VENDOR, "NextBook"], [TYPE2, TABLET]],
43426
+ [
43427
+ /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
43428
+ // Voice Xtreme Phones
43429
+ ],
43430
+ [[VENDOR, "Voice"], MODEL, [TYPE2, MOBILE]],
43431
+ [
43432
+ /\b(lvtel\-)?(v1[12]) b/i
43433
+ // LvTel Phones
43434
+ ],
43435
+ [[VENDOR, "LvTel"], MODEL, [TYPE2, MOBILE]],
43436
+ [
43437
+ /\b(ph-1) /i
43438
+ // Essential PH-1
43439
+ ],
43440
+ [MODEL, [VENDOR, "Essential"], [TYPE2, MOBILE]],
43441
+ [
43442
+ /\b(v(100md|700na|7011|917g).*\b) b/i
43443
+ // Envizen Tablets
43444
+ ],
43445
+ [MODEL, [VENDOR, "Envizen"], [TYPE2, TABLET]],
43446
+ [
43447
+ /\b(trio[-\w\. ]+) b/i
43448
+ // MachSpeed Tablets
43449
+ ],
43450
+ [MODEL, [VENDOR, "MachSpeed"], [TYPE2, TABLET]],
43451
+ [
43452
+ /\btu_(1491) b/i
43453
+ // Rotor Tablets
43454
+ ],
43455
+ [MODEL, [VENDOR, "Rotor"], [TYPE2, TABLET]],
43456
+ [
43457
+ /(shield[\w ]+) b/i
43458
+ // Nvidia Shield Tablets
43459
+ ],
43460
+ [MODEL, [VENDOR, "Nvidia"], [TYPE2, TABLET]],
43461
+ [
43462
+ /(sprint) (\w+)/i
43463
+ // Sprint Phones
43464
+ ],
43465
+ [VENDOR, MODEL, [TYPE2, MOBILE]],
43466
+ [
43467
+ /(kin\.[onetw]{3})/i
43468
+ // Microsoft Kin
43469
+ ],
43470
+ [[MODEL, /\./g, " "], [VENDOR, MICROSOFT], [TYPE2, MOBILE]],
43471
+ [
43472
+ /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
43473
+ // Zebra
43474
+ ],
43475
+ [MODEL, [VENDOR, ZEBRA], [TYPE2, TABLET]],
43476
+ [
43477
+ /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
43478
+ ],
43479
+ [MODEL, [VENDOR, ZEBRA], [TYPE2, MOBILE]],
43480
+ [
43481
+ ///////////////////
43482
+ // SMARTTVS
43483
+ ///////////////////
43484
+ /smart-tv.+(samsung)/i
43485
+ // Samsung
43486
+ ],
43487
+ [VENDOR, [TYPE2, SMARTTV]],
43488
+ [
43489
+ /hbbtv.+maple;(\d+)/i
43490
+ ],
43491
+ [[MODEL, /^/, "SmartTV"], [VENDOR, SAMSUNG], [TYPE2, SMARTTV]],
43492
+ [
43493
+ /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
43494
+ // LG SmartTV
43495
+ ],
43496
+ [[VENDOR, LG], [TYPE2, SMARTTV]],
43497
+ [
43498
+ /(apple) ?tv/i
43499
+ // Apple TV
43500
+ ],
43501
+ [VENDOR, [MODEL, APPLE + " TV"], [TYPE2, SMARTTV]],
43502
+ [
43503
+ /crkey/i
43504
+ // Google Chromecast
43505
+ ],
43506
+ [[MODEL, CHROME + "cast"], [VENDOR, GOOGLE], [TYPE2, SMARTTV]],
43507
+ [
43508
+ /droid.+aft(\w+)( bui|\))/i
43509
+ // Fire TV
43510
+ ],
43511
+ [MODEL, [VENDOR, AMAZON], [TYPE2, SMARTTV]],
43512
+ [
43513
+ /\(dtv[\);].+(aquos)/i,
43514
+ /(aquos-tv[\w ]+)\)/i
43515
+ // Sharp
43516
+ ],
43517
+ [MODEL, [VENDOR, SHARP], [TYPE2, SMARTTV]],
43518
+ [
43519
+ /(bravia[\w ]+)( bui|\))/i
43520
+ // Sony
43521
+ ],
43522
+ [MODEL, [VENDOR, SONY], [TYPE2, SMARTTV]],
43523
+ [
43524
+ /(mitv-\w{5}) bui/i
43525
+ // Xiaomi
43526
+ ],
43527
+ [MODEL, [VENDOR, XIAOMI], [TYPE2, SMARTTV]],
43528
+ [
43529
+ /Hbbtv.*(technisat) (.*);/i
43530
+ // TechniSAT
43531
+ ],
43532
+ [VENDOR, MODEL, [TYPE2, SMARTTV]],
43533
+ [
43534
+ /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
43535
+ // Roku
43536
+ /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
43537
+ // HbbTV devices
43538
+ ],
43539
+ [[VENDOR, trim], [MODEL, trim], [TYPE2, SMARTTV]],
43540
+ [
43541
+ /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
43542
+ // SmartTV from Unidentified Vendors
43543
+ ],
43544
+ [[TYPE2, SMARTTV]],
43545
+ [
43546
+ ///////////////////
43547
+ // CONSOLES
43548
+ ///////////////////
43549
+ /(ouya)/i,
43550
+ // Ouya
43551
+ /(nintendo) ([wids3utch]+)/i
43552
+ // Nintendo
43553
+ ],
43554
+ [VENDOR, MODEL, [TYPE2, CONSOLE]],
43555
+ [
43556
+ /droid.+; (shield) bui/i
43557
+ // Nvidia
43558
+ ],
43559
+ [MODEL, [VENDOR, "Nvidia"], [TYPE2, CONSOLE]],
43560
+ [
43561
+ /(playstation [345portablevi]+)/i
43562
+ // Playstation
43563
+ ],
43564
+ [MODEL, [VENDOR, SONY], [TYPE2, CONSOLE]],
43565
+ [
43566
+ /\b(xbox(?: one)?(?!; xbox))[\); ]/i
43567
+ // Microsoft Xbox
43568
+ ],
43569
+ [MODEL, [VENDOR, MICROSOFT], [TYPE2, CONSOLE]],
43570
+ [
43571
+ ///////////////////
43572
+ // WEARABLES
43573
+ ///////////////////
43574
+ /((pebble))app/i
43575
+ // Pebble
43576
+ ],
43577
+ [VENDOR, MODEL, [TYPE2, WEARABLE]],
43578
+ [
43579
+ /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
43580
+ // Apple Watch
43581
+ ],
43582
+ [MODEL, [VENDOR, APPLE], [TYPE2, WEARABLE]],
43583
+ [
43584
+ /droid.+; (glass) \d/i
43585
+ // Google Glass
43586
+ ],
43587
+ [MODEL, [VENDOR, GOOGLE], [TYPE2, WEARABLE]],
43588
+ [
43589
+ /droid.+; (wt63?0{2,3})\)/i
43590
+ ],
43591
+ [MODEL, [VENDOR, ZEBRA], [TYPE2, WEARABLE]],
43592
+ [
43593
+ /(quest( 2| pro)?)/i
43594
+ // Oculus Quest
43595
+ ],
43596
+ [MODEL, [VENDOR, FACEBOOK], [TYPE2, WEARABLE]],
43597
+ [
43598
+ ///////////////////
43599
+ // EMBEDDED
43600
+ ///////////////////
43601
+ /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
43602
+ // Tesla
43603
+ ],
43604
+ [VENDOR, [TYPE2, EMBEDDED]],
43605
+ [
43606
+ /(aeobc)\b/i
43607
+ // Echo Dot
43608
+ ],
43609
+ [MODEL, [VENDOR, AMAZON], [TYPE2, EMBEDDED]],
43610
+ [
43611
+ ////////////////////
43612
+ // MIXED (GENERIC)
43613
+ ///////////////////
43614
+ /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
43615
+ // Android Phones from Unidentified Vendors
43616
+ ],
43617
+ [MODEL, [TYPE2, MOBILE]],
43618
+ [
43619
+ /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
43620
+ // Android Tablets from Unidentified Vendors
43621
+ ],
43622
+ [MODEL, [TYPE2, TABLET]],
43623
+ [
43624
+ /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
43625
+ // Unidentifiable Tablet
43626
+ ],
43627
+ [[TYPE2, TABLET]],
43628
+ [
43629
+ /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
43630
+ // Unidentifiable Mobile
43631
+ ],
43632
+ [[TYPE2, MOBILE]],
43633
+ [
43634
+ /(android[-\w\. ]{0,9});.+buil/i
43635
+ // Generic Android Device
43636
+ ],
43637
+ [MODEL, [VENDOR, "Generic"]]
43638
+ ],
43639
+ engine: [
43640
+ [
43641
+ /windows.+ edge\/([\w\.]+)/i
43642
+ // EdgeHTML
43643
+ ],
43644
+ [VERSION, [NAME, EDGE + "HTML"]],
43645
+ [
43646
+ /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
43647
+ // Blink
43648
+ ],
43649
+ [VERSION, [NAME, "Blink"]],
43650
+ [
43651
+ /(presto)\/([\w\.]+)/i,
43652
+ // Presto
43653
+ /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
43654
+ // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
43655
+ /ekioh(flow)\/([\w\.]+)/i,
43656
+ // Flow
43657
+ /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
43658
+ // KHTML/Tasman/Links
43659
+ /(icab)[\/ ]([23]\.[\d\.]+)/i,
43660
+ // iCab
43661
+ /\b(libweb)/i
43662
+ ],
43663
+ [NAME, VERSION],
43664
+ [
43665
+ /rv\:([\w\.]{1,9})\b.+(gecko)/i
43666
+ // Gecko
43667
+ ],
43668
+ [VERSION, NAME]
43669
+ ],
43670
+ os: [
43671
+ [
43672
+ // Windows
43673
+ /microsoft (windows) (vista|xp)/i
43674
+ // Windows (iTunes)
43675
+ ],
43676
+ [NAME, VERSION],
43677
+ [
43678
+ /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
43679
+ // Windows Phone
43680
+ ],
43681
+ [NAME, [VERSION, strMapper, windowsVersionMap]],
43682
+ [
43683
+ /windows nt 6\.2; (arm)/i,
43684
+ // Windows RT
43685
+ /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
43686
+ /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
43687
+ ],
43688
+ [[VERSION, strMapper, windowsVersionMap], [NAME, "Windows"]],
43689
+ [
43690
+ // iOS/macOS
43691
+ /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
43692
+ // iOS
43693
+ /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
43694
+ /cfnetwork\/.+darwin/i
43695
+ ],
43696
+ [[VERSION, /_/g, "."], [NAME, "iOS"]],
43697
+ [
43698
+ /(mac os x) ?([\w\. ]*)/i,
43699
+ /(macintosh|mac_powerpc\b)(?!.+haiku)/i
43700
+ // Mac OS
43701
+ ],
43702
+ [[NAME, MAC_OS], [VERSION, /_/g, "."]],
43703
+ [
43704
+ // Mobile OSes
43705
+ /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
43706
+ // Android-x86/HarmonyOS
43707
+ ],
43708
+ [VERSION, NAME],
43709
+ [
43710
+ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
43711
+ /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
43712
+ /(blackberry)\w*\/([\w\.]*)/i,
43713
+ // Blackberry
43714
+ /(tizen|kaios)[\/ ]([\w\.]+)/i,
43715
+ // Tizen/KaiOS
43716
+ /\((series40);/i
43717
+ // Series 40
43718
+ ],
43719
+ [NAME, VERSION],
43720
+ [
43721
+ /\(bb(10);/i
43722
+ // BlackBerry 10
43723
+ ],
43724
+ [VERSION, [NAME, BLACKBERRY]],
43725
+ [
43726
+ /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
43727
+ // Symbian
43728
+ ],
43729
+ [VERSION, [NAME, "Symbian"]],
43730
+ [
43731
+ /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
43732
+ // Firefox OS
43733
+ ],
43734
+ [VERSION, [NAME, FIREFOX + " OS"]],
43735
+ [
43736
+ /web0s;.+rt(tv)/i,
43737
+ /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
43738
+ // WebOS
43739
+ ],
43740
+ [VERSION, [NAME, "webOS"]],
43741
+ [
43742
+ /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i
43743
+ // watchOS
43744
+ ],
43745
+ [VERSION, [NAME, "watchOS"]],
43746
+ [
43747
+ // Google Chromecast
43748
+ /crkey\/([\d\.]+)/i
43749
+ // Google Chromecast
43750
+ ],
43751
+ [VERSION, [NAME, CHROME + "cast"]],
43752
+ [
43753
+ /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
43754
+ // Chromium OS
43755
+ ],
43756
+ [[NAME, CHROMIUM_OS], VERSION],
43757
+ [
43758
+ // Smart TVs
43759
+ /panasonic;(viera)/i,
43760
+ // Panasonic Viera
43761
+ /(netrange)mmh/i,
43762
+ // Netrange
43763
+ /(nettv)\/(\d+\.[\w\.]+)/i,
43764
+ // NetTV
43765
+ // Console
43766
+ /(nintendo|playstation) ([wids345portablevuch]+)/i,
43767
+ // Nintendo/Playstation
43768
+ /(xbox); +xbox ([^\);]+)/i,
43769
+ // Microsoft Xbox (360, One, X, S, Series X, Series S)
43770
+ // Other
43771
+ /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
43772
+ // Joli/Palm
43773
+ /(mint)[\/\(\) ]?(\w*)/i,
43774
+ // Mint
43775
+ /(mageia|vectorlinux)[; ]/i,
43776
+ // Mageia/VectorLinux
43777
+ /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
43778
+ // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
43779
+ /(hurd|linux) ?([\w\.]*)/i,
43780
+ // Hurd/Linux
43781
+ /(gnu) ?([\w\.]*)/i,
43782
+ // GNU
43783
+ /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
43784
+ // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly
43785
+ /(haiku) (\w+)/i
43786
+ // Haiku
43787
+ ],
43788
+ [NAME, VERSION],
43789
+ [
43790
+ /(sunos) ?([\w\.\d]*)/i
43791
+ // Solaris
43792
+ ],
43793
+ [[NAME, "Solaris"], VERSION],
43794
+ [
43795
+ /((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
43796
+ // Solaris
43797
+ /(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
43798
+ // AIX
43799
+ /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,
43800
+ // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
43801
+ /(unix) ?([\w\.]*)/i
43802
+ // UNIX
43803
+ ],
43804
+ [NAME, VERSION]
43805
+ ]
43806
+ };
43807
+ var UAParser2 = function(ua, extensions) {
43808
+ if (typeof ua === OBJ_TYPE) {
43809
+ extensions = ua;
43810
+ ua = undefined2;
43811
+ }
43812
+ if (!(this instanceof UAParser2)) {
43813
+ return new UAParser2(ua, extensions).getResult();
43814
+ }
43815
+ var _navigator = typeof window2 !== UNDEF_TYPE && window2.navigator ? window2.navigator : undefined2;
43816
+ var _ua = ua || (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY);
43817
+ var _uach = _navigator && _navigator.userAgentData ? _navigator.userAgentData : undefined2;
43818
+ var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
43819
+ var _isSelfNav = _navigator && _navigator.userAgent == _ua;
43820
+ this.getBrowser = function() {
43821
+ var _browser = {};
43822
+ _browser[NAME] = undefined2;
43823
+ _browser[VERSION] = undefined2;
43824
+ rgxMapper.call(_browser, _ua, _rgxmap.browser);
43825
+ _browser[MAJOR] = majorize(_browser[VERSION]);
43826
+ if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
43827
+ _browser[NAME] = "Brave";
43828
+ }
43829
+ return _browser;
43830
+ };
43831
+ this.getCPU = function() {
43832
+ var _cpu = {};
43833
+ _cpu[ARCHITECTURE] = undefined2;
43834
+ rgxMapper.call(_cpu, _ua, _rgxmap.cpu);
43835
+ return _cpu;
43836
+ };
43837
+ this.getDevice = function() {
43838
+ var _device = {};
43839
+ _device[VENDOR] = undefined2;
43840
+ _device[MODEL] = undefined2;
43841
+ _device[TYPE2] = undefined2;
43842
+ rgxMapper.call(_device, _ua, _rgxmap.device);
43843
+ if (_isSelfNav && !_device[TYPE2] && _uach && _uach.mobile) {
43844
+ _device[TYPE2] = MOBILE;
43845
+ }
43846
+ if (_isSelfNav && _device[MODEL] == "Macintosh" && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
43847
+ _device[MODEL] = "iPad";
43848
+ _device[TYPE2] = TABLET;
43849
+ }
43850
+ return _device;
43851
+ };
43852
+ this.getEngine = function() {
43853
+ var _engine = {};
43854
+ _engine[NAME] = undefined2;
43855
+ _engine[VERSION] = undefined2;
43856
+ rgxMapper.call(_engine, _ua, _rgxmap.engine);
43857
+ return _engine;
43858
+ };
43859
+ this.getOS = function() {
43860
+ var _os = {};
43861
+ _os[NAME] = undefined2;
43862
+ _os[VERSION] = undefined2;
43863
+ rgxMapper.call(_os, _ua, _rgxmap.os);
43864
+ if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != "Unknown") {
43865
+ _os[NAME] = _uach.platform.replace(/chrome os/i, CHROMIUM_OS).replace(/macos/i, MAC_OS);
43866
+ }
43867
+ return _os;
43868
+ };
43869
+ this.getResult = function() {
43870
+ return {
43871
+ ua: this.getUA(),
43872
+ browser: this.getBrowser(),
43873
+ engine: this.getEngine(),
43874
+ os: this.getOS(),
43875
+ device: this.getDevice(),
43876
+ cpu: this.getCPU()
43877
+ };
43878
+ };
43879
+ this.getUA = function() {
43880
+ return _ua;
43881
+ };
43882
+ this.setUA = function(ua2) {
43883
+ _ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;
43884
+ return this;
43885
+ };
43886
+ this.setUA(_ua);
43887
+ return this;
43888
+ };
43889
+ UAParser2.VERSION = LIBVERSION;
43890
+ UAParser2.BROWSER = enumerize([NAME, VERSION, MAJOR]);
43891
+ UAParser2.CPU = enumerize([ARCHITECTURE]);
43892
+ UAParser2.DEVICE = enumerize([MODEL, VENDOR, TYPE2, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);
43893
+ UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION]);
43894
+ if (typeof exports !== UNDEF_TYPE) {
43895
+ if (typeof module2 !== UNDEF_TYPE && module2.exports) {
43896
+ exports = module2.exports = UAParser2;
43897
+ }
43898
+ exports.UAParser = UAParser2;
43899
+ } else {
43900
+ if (typeof define === FUNC_TYPE && define.amd) {
43901
+ define(function() {
43902
+ return UAParser2;
43903
+ });
43904
+ } else if (typeof window2 !== UNDEF_TYPE) {
43905
+ window2.UAParser = UAParser2;
43906
+ }
43907
+ }
43908
+ var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);
43909
+ if ($ && !$.ua) {
43910
+ var parser = new UAParser2();
43911
+ $.ua = parser.getResult();
43912
+ $.ua.get = function() {
43913
+ return parser.getUA();
43914
+ };
43915
+ $.ua.set = function(ua) {
43916
+ parser.setUA(ua);
43917
+ var result = parser.getResult();
43918
+ for (var prop in result) {
43919
+ $.ua[prop] = result[prop];
43920
+ }
43921
+ };
43922
+ }
43923
+ })(typeof window === "object" ? window : exports);
43924
+ }
43925
+ });
43926
+
42591
43927
  // ../../node_modules/use-debounce/dist/index.module.js
42592
43928
  var index_module_exports = {};
42593
43929
  __export(index_module_exports, {
@@ -44532,6 +45868,26 @@ var require_dist = __commonJS({
44532
45868
  mod
44533
45869
  ));
44534
45870
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
45871
+ var __async2 = (__this, __arguments, generator) => {
45872
+ return new Promise((resolve, reject) => {
45873
+ var fulfilled = (value) => {
45874
+ try {
45875
+ step(generator.next(value));
45876
+ } catch (e2) {
45877
+ reject(e2);
45878
+ }
45879
+ };
45880
+ var rejected = (value) => {
45881
+ try {
45882
+ step(generator.throw(value));
45883
+ } catch (e2) {
45884
+ reject(e2);
45885
+ }
45886
+ };
45887
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45888
+ step((generator = generator.apply(__this, __arguments)).next());
45889
+ });
45890
+ };
44535
45891
  var auto_frame_component_exports = {};
44536
45892
  __export2(auto_frame_component_exports, {
44537
45893
  default: () => AutoFrameComponent_default
@@ -44550,21 +45906,70 @@ var require_dist = __commonJS({
44550
45906
  });
44551
45907
  return collected;
44552
45908
  };
45909
+ var getStyleSheet = (el) => {
45910
+ return Array.from(document.styleSheets).find((ss) => {
45911
+ const ownerNode = ss.ownerNode;
45912
+ return ownerNode.href === el.href;
45913
+ });
45914
+ };
45915
+ var getStyles2 = (styleSheet) => {
45916
+ if (styleSheet) {
45917
+ try {
45918
+ return [...styleSheet.cssRules].map((rule) => rule.cssText).join("");
45919
+ } catch (e2) {
45920
+ console.warn(
45921
+ "Access to stylesheet %s is denied. Ignoring\u2026",
45922
+ styleSheet.href
45923
+ );
45924
+ }
45925
+ }
45926
+ return "";
45927
+ };
45928
+ var defer = (fn) => setTimeout(fn, 0);
44553
45929
  var CopyHostStyles = ({
44554
45930
  children,
44555
45931
  debug = false,
44556
45932
  onStylesLoaded = () => null
44557
45933
  }) => {
44558
45934
  const { document: doc, window: win } = (0, import_react_frame_component.useFrame)();
44559
- (0, import_react22.useLayoutEffect)(() => {
45935
+ (0, import_react22.useEffect)(() => {
44560
45936
  if (!win || !doc) {
44561
45937
  return () => {
44562
45938
  };
44563
45939
  }
44564
- const elements = [];
45940
+ let elements = [];
45941
+ const hashes = {};
44565
45942
  const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
45943
+ const mirrorEl = (el, onLoad = () => {
45944
+ }) => __async2(void 0, null, function* () {
45945
+ let mirror;
45946
+ if (el.nodeName === "LINK") {
45947
+ mirror = document.createElement("style");
45948
+ mirror.type = "text/css";
45949
+ let styleSheet = getStyleSheet(el);
45950
+ if (!styleSheet) {
45951
+ yield new Promise((resolve) => el.onload = resolve);
45952
+ styleSheet = getStyleSheet(el);
45953
+ }
45954
+ const styles = getStyles2(styleSheet);
45955
+ if (!styles) {
45956
+ if (debug) {
45957
+ console.warn(
45958
+ `Tried to load styles for link element, but couldn't find them. Skipping...`
45959
+ );
45960
+ }
45961
+ return;
45962
+ }
45963
+ mirror.innerHTML = styles;
45964
+ mirror.setAttribute("data-href", el.getAttribute("href"));
45965
+ } else {
45966
+ mirror = el.cloneNode(true);
45967
+ }
45968
+ mirror.onload = onLoad;
45969
+ return mirror;
45970
+ });
44566
45971
  const addEl = (el, onLoad = () => {
44567
- }) => {
45972
+ }) => __async2(void 0, null, function* () {
44568
45973
  const index = lookupEl(el);
44569
45974
  if (index > -1) {
44570
45975
  if (debug)
@@ -44575,11 +45980,13 @@ var require_dist = __commonJS({
44575
45980
  onLoad();
44576
45981
  return;
44577
45982
  }
44578
- const elHash = (0, import_object_hash.default)(el.outerHTML);
44579
- const existingHashes = collectStyles(doc).map(
44580
- (existingStyle) => (0, import_object_hash.default)(existingStyle.outerHTML)
44581
- );
44582
- if (existingHashes.indexOf(elHash) > -1) {
45983
+ const mirror = yield mirrorEl(el, onLoad);
45984
+ if (!mirror) {
45985
+ onLoad();
45986
+ return;
45987
+ }
45988
+ const elHash = (0, import_object_hash.default)(mirror.outerHTML);
45989
+ if (hashes[elHash]) {
44583
45990
  if (debug)
44584
45991
  console.log(
44585
45992
  `iframe already contains element that is being mirrored. Skipping...`
@@ -44587,14 +45994,15 @@ var require_dist = __commonJS({
44587
45994
  onLoad();
44588
45995
  return;
44589
45996
  }
44590
- const mirror = el.cloneNode(true);
45997
+ hashes[elHash] = true;
44591
45998
  mirror.onload = onLoad;
44592
45999
  doc.head.append(mirror);
44593
46000
  elements.push({ original: el, mirror });
44594
46001
  if (debug)
44595
46002
  console.log(`Added style node ${el.outerHTML}`);
44596
- };
46003
+ });
44597
46004
  const removeEl = (el) => {
46005
+ var _a3, _b;
44598
46006
  const index = lookupEl(el);
44599
46007
  if (index === -1) {
44600
46008
  if (debug)
@@ -44603,7 +46011,9 @@ var require_dist = __commonJS({
44603
46011
  );
44604
46012
  return;
44605
46013
  }
44606
- elements[index].mirror.remove();
46014
+ const elHash = (0, import_object_hash.default)(el.outerHTML);
46015
+ (_b = (_a3 = elements[index]) == null ? void 0 : _a3.mirror) == null ? void 0 : _b.remove();
46016
+ delete hashes[elHash];
44607
46017
  if (debug)
44608
46018
  console.log(`Removed style node ${el.outerHTML}`);
44609
46019
  };
@@ -44614,7 +46024,7 @@ var require_dist = __commonJS({
44614
46024
  if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
44615
46025
  const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
44616
46026
  if (el && el.matches(styleSelector)) {
44617
- addEl(el);
46027
+ defer(() => addEl(el));
44618
46028
  }
44619
46029
  }
44620
46030
  });
@@ -44622,7 +46032,7 @@ var require_dist = __commonJS({
44622
46032
  if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
44623
46033
  const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
44624
46034
  if (el && el.matches(styleSelector)) {
44625
- removeEl(el);
46035
+ defer(() => removeEl(el));
44626
46036
  }
44627
46037
  }
44628
46038
  });
@@ -44631,26 +46041,49 @@ var require_dist = __commonJS({
44631
46041
  });
44632
46042
  const parentDocument = win.parent.document;
44633
46043
  const collectedStyles = collectStyles(parentDocument);
44634
- let mountedCounter = 0;
44635
- collectedStyles.forEach((styleNode) => {
44636
- addEl(styleNode, () => {
44637
- mountedCounter += 1;
44638
- if (mountedCounter === collectedStyles.length) {
44639
- onStylesLoaded();
46044
+ const hrefs = [];
46045
+ Promise.all(
46046
+ collectedStyles.map((styleNode, i2) => __async2(void 0, null, function* () {
46047
+ if (styleNode.nodeName === "LINK") {
46048
+ const linkHref = styleNode.href;
46049
+ if (hrefs.indexOf(linkHref) > -1) {
46050
+ return;
46051
+ }
46052
+ hrefs.push(linkHref);
44640
46053
  }
46054
+ const mirror = yield mirrorEl(styleNode);
46055
+ if (!mirror)
46056
+ return;
46057
+ elements.push({ original: styleNode, mirror });
46058
+ return mirror;
46059
+ }))
46060
+ ).then((mirrorStyles) => {
46061
+ const filtered = mirrorStyles.filter(
46062
+ (el) => typeof el !== "undefined"
46063
+ );
46064
+ doc.head.innerHTML = "";
46065
+ doc.head.append(...filtered);
46066
+ observer.observe(parentDocument.head, { childList: true, subtree: true });
46067
+ filtered.forEach((el) => {
46068
+ const elHash = (0, import_object_hash.default)(el.outerHTML);
46069
+ hashes[elHash] = true;
44641
46070
  });
46071
+ onStylesLoaded();
44642
46072
  });
44643
- observer.observe(parentDocument.head, { childList: true, subtree: true });
44644
46073
  return () => {
44645
46074
  observer.disconnect();
44646
46075
  };
44647
46076
  }, []);
44648
46077
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
44649
46078
  };
44650
- var AutoFrameComponent_default = import_react22.default.forwardRef(function(_a3, ref2) {
44651
- var _b = _a3, { children, debug, onStylesLoaded } = _b, props = __objRest2(_b, ["children", "debug", "onStylesLoaded"]);
44652
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
44653
- });
46079
+ var AutoFrameComponent = import_react22.default.forwardRef(
46080
+ function(_a3, ref2) {
46081
+ var _b = _a3, { children, debug, onStylesLoaded } = _b, props = __objRest2(_b, ["children", "debug", "onStylesLoaded"]);
46082
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
46083
+ }
46084
+ );
46085
+ AutoFrameComponent.displayName = "AutoFrameComponent";
46086
+ var AutoFrameComponent_default = AutoFrameComponent;
44654
46087
  }
44655
46088
  });
44656
46089
 
@@ -74391,6 +75824,7 @@ var require_dist2 = __commonJS({
74391
75824
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
74392
75825
  { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
74393
75826
  ];
75827
+ var import_ua_parser_js2 = require_ua_parser();
74394
75828
  var import_jsx_runtime22 = require("react/jsx-runtime");
74395
75829
  var defaultAppState2 = {
74396
75830
  data: { content: [], root: { props: { title: "" } } },
@@ -74430,7 +75864,8 @@ var require_dist2 = __commonJS({
74430
75864
  setZoomConfig: () => null,
74431
75865
  status: "LOADING",
74432
75866
  setStatus: () => null,
74433
- iframe: {}
75867
+ iframe: {},
75868
+ safariFallbackMode: false
74434
75869
  };
74435
75870
  var appContext2 = (0, import_react32.createContext)(defaultContext2);
74436
75871
  var AppProvider = ({
@@ -74442,10 +75877,34 @@ var require_dist2 = __commonJS({
74442
75877
  (0, import_react32.useEffect)(() => {
74443
75878
  setStatus("MOUNTED");
74444
75879
  }, []);
75880
+ const [safariFallbackMode, setSafariFallbackMode] = (0, import_react32.useState)(false);
75881
+ (0, import_react32.useEffect)(() => {
75882
+ var _a3, _b, _c;
75883
+ const ua = new import_ua_parser_js2.UAParser(navigator.userAgent);
75884
+ const { browser } = ua.getResult();
75885
+ if (browser.name === "Safari" && (((_a3 = browser.version) == null ? void 0 : _a3.indexOf("17.2.")) || ((_b = browser.version) == null ? void 0 : _b.indexOf("17.3.")) || ((_c = browser.version) == null ? void 0 : _c.indexOf("17.4.")))) {
75886
+ if (process.env.NODE_ENV !== "production" && value.iframe.enabled) {
75887
+ console.warn(
75888
+ `Detected Safari ${browser.version}, which contains a bug that prevents Puck DropZones from detecting a mouseover event within an iframe. This affects Safari versions 17.2, 17.3 and 17.4.
75889
+
75890
+ Running in compatibility mode, which may have some DropZone side-effects. Alternatively, consider disabling iframes: https://puckeditor.com/docs/integrating-puck/viewports#opting-out-of-iframes.
75891
+
75892
+ See https://github.com/measuredco/puck/issues/411 for more information. This message will not show in production.`
75893
+ );
75894
+ }
75895
+ setSafariFallbackMode(true);
75896
+ }
75897
+ }, []);
74445
75898
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
74446
75899
  appContext2.Provider,
74447
75900
  {
74448
- value: __spreadProps2(__spreadValues2({}, value), { zoomConfig, setZoomConfig, status, setStatus }),
75901
+ value: __spreadProps2(__spreadValues2({}, value), {
75902
+ zoomConfig,
75903
+ setZoomConfig,
75904
+ status,
75905
+ setStatus,
75906
+ safariFallbackMode
75907
+ }),
74449
75908
  children
74450
75909
  }
74451
75910
  );
@@ -74641,7 +76100,7 @@ var require_dist2 = __commonJS({
74641
76100
  var import_react72 = require("react");
74642
76101
  var import_dnd3 = (init_dnd_esm(), __toCommonJS(dnd_esm_exports));
74643
76102
  init_react_import2();
74644
- var styles_module_default32 = { "DraggableComponent": "_DraggableComponent_1542z_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_1542z_11", "DraggableComponent-contents": "_DraggableComponent-contents_1542z_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_1542z_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1542z_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_1542z_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_1542z_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1542z_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_1542z_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_1542z_97", "DraggableComponent-actions": "_DraggableComponent-actions_1542z_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_1542z_127", "DraggableComponent-action": "_DraggableComponent-action_1542z_97" };
76103
+ var styles_module_default32 = { "DraggableComponent": "_DraggableComponent_59z7f_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_59z7f_11", "DraggableComponent-contents": "_DraggableComponent-contents_59z7f_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_59z7f_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_59z7f_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_59z7f_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_59z7f_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_59z7f_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_59z7f_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_59z7f_97", "DraggableComponent-actions": "_DraggableComponent-actions_59z7f_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_59z7f_127", "DraggableComponent-action": "_DraggableComponent-action_59z7f_97" };
74645
76104
  init_react_import2();
74646
76105
  init_react_import2();
74647
76106
  var import_react52 = require("react");
@@ -74982,7 +76441,7 @@ var require_dist2 = __commonJS({
74982
76441
  );
74983
76442
  };
74984
76443
  init_react_import2();
74985
- var styles_module_default42 = { "DropZone": "_DropZone_w4btq_1", "DropZone-content": "_DropZone-content_w4btq_10", "DropZone--userIsDragging": "_DropZone--userIsDragging_w4btq_15", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_w4btq_19", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_w4btq_20", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_w4btq_26", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_w4btq_27", "DropZone--isDisabled": "_DropZone--isDisabled_w4btq_28", "DropZone--isRootZone": "_DropZone--isRootZone_w4btq_29", "DropZone--hasChildren": "_DropZone--hasChildren_w4btq_30", "DropZone--isDestination": "_DropZone--isDestination_w4btq_40", "DropZone-item": "_DropZone-item_w4btq_52", "DropZone-hitbox": "_DropZone-hitbox_w4btq_56" };
76444
+ var styles_module_default42 = { "DropZone": "_DropZone_djoti_1", "DropZone-content": "_DropZone-content_djoti_10", "DropZone--userIsDragging": "_DropZone--userIsDragging_djoti_15", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_djoti_19", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_djoti_20", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_djoti_26", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_djoti_27", "DropZone--isDisabled": "_DropZone--isDisabled_djoti_28", "DropZone--isRootZone": "_DropZone--isRootZone_djoti_29", "DropZone--hasChildren": "_DropZone--hasChildren_djoti_30", "DropZone--isDestination": "_DropZone--isDestination_djoti_40", "DropZone-item": "_DropZone-item_djoti_52", "DropZone-hitbox": "_DropZone-hitbox_djoti_56" };
74986
76445
  init_react_import2();
74987
76446
  var import_react82 = require("react");
74988
76447
  var import_use_debounce = (init_index_module(), __toCommonJS(index_module_exports));
@@ -75167,7 +76626,11 @@ var require_dist2 = __commonJS({
75167
76626
  let isEnabled = userWillDrag;
75168
76627
  if (userIsDragging) {
75169
76628
  if (draggingNewComponent) {
75170
- isEnabled = hoveringOverArea;
76629
+ if (appContext22.safariFallbackMode) {
76630
+ isEnabled = true;
76631
+ } else {
76632
+ isEnabled = hoveringOverArea;
76633
+ }
75171
76634
  } else {
75172
76635
  isEnabled = draggingOverArea && hoveringOverZone;
75173
76636
  }
@@ -76893,7 +78356,7 @@ var require_dist2 = __commonJS({
76893
78356
  onChange(e2.currentTarget.value);
76894
78357
  },
76895
78358
  disabled: readOnly,
76896
- defaultChecked: value === option.value
78359
+ checked: value === option.value
76897
78360
  }
76898
78361
  ),
76899
78362
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName14("radioInner"), children: option.label || option.value })
@@ -76933,7 +78396,7 @@ var require_dist2 = __commonJS({
76933
78396
  disabled: readOnly,
76934
78397
  onChange: (e2) => {
76935
78398
  if (e2.currentTarget.value === "true" || e2.currentTarget.value === "false") {
76936
- onChange(Boolean(e2.currentTarget.value));
78399
+ onChange(JSON.parse(e2.currentTarget.value));
76937
78400
  return;
76938
78401
  }
76939
78402
  onChange(e2.currentTarget.value);
@@ -77428,7 +78891,7 @@ var require_dist2 = __commonJS({
77428
78891
  var import_react222 = require("react");
77429
78892
  var import_auto_frame_component = __toESM2(require_dist());
77430
78893
  init_react_import2();
77431
- var styles_module_default16 = { "PuckPreview": "_PuckPreview_1mia0_1", "PuckPreview-frame": "_PuckPreview-frame_1mia0_5" };
78894
+ var styles_module_default16 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
77432
78895
  var import_jsx_runtime29 = require("react/jsx-runtime");
77433
78896
  var getClassName21 = get_class_name_factory_default2("PuckPreview", styles_module_default16);
77434
78897
  var Preview = ({ id = "puck-preview" }) => {
@@ -78388,6 +79851,7 @@ var require_dist2 = __commonJS({
78388
79851
  children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
78389
79852
  DragDropContext2,
78390
79853
  {
79854
+ autoScrollerOptions: { disabled: iframe.disableAutoScroll },
78391
79855
  onDragUpdate: (update2) => {
78392
79856
  setDraggedItem(__spreadValues2(__spreadValues2({}, draggedItem), update2));
78393
79857
  onDragStartOrUpdate(update2);
@@ -78948,6 +80412,7 @@ var defaultViewports = [
78948
80412
  ];
78949
80413
 
78950
80414
  // ../core/components/Puck/context.tsx
80415
+ var import_ua_parser_js = __toESM(require_ua_parser());
78951
80416
  var import_jsx_runtime4 = require("react/jsx-runtime");
78952
80417
  var defaultAppState = {
78953
80418
  data: { content: [], root: { props: { title: "" } } },
@@ -78987,7 +80452,8 @@ var defaultContext = {
78987
80452
  setZoomConfig: () => null,
78988
80453
  status: "LOADING",
78989
80454
  setStatus: () => null,
78990
- iframe: {}
80455
+ iframe: {},
80456
+ safariFallbackMode: false
78991
80457
  };
78992
80458
  var appContext = (0, import_react10.createContext)(defaultContext);
78993
80459
  function useAppContext() {