@makeswift/runtime 0.0.0-e0c0445 → 0.0.0-e76fc43

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 (141) hide show
  1. package/box-model.js +1 -0
  2. package/components.js +1 -0
  3. package/dist/actions.cjs.js +73 -16
  4. package/dist/actions.cjs.js.map +1 -1
  5. package/dist/actions.es.js +67 -16
  6. package/dist/actions.es.js.map +1 -1
  7. package/dist/box-models.cjs.js +25 -15
  8. package/dist/box-models.cjs.js.map +1 -1
  9. package/dist/box-models.es.js +25 -15
  10. package/dist/box-models.es.js.map +1 -1
  11. package/dist/components.cjs.js +2012 -333
  12. package/dist/components.cjs.js.map +1 -1
  13. package/dist/components.es.js +1888 -219
  14. package/dist/components.es.js.map +1 -1
  15. package/dist/deepEqual.cjs.js +40 -0
  16. package/dist/deepEqual.cjs.js.map +1 -0
  17. package/dist/deepEqual.es.js +39 -0
  18. package/dist/deepEqual.es.js.map +1 -0
  19. package/dist/descriptors.cjs.js.map +1 -1
  20. package/dist/descriptors.es.js.map +1 -1
  21. package/dist/immutable.es.cjs.js +4459 -0
  22. package/dist/immutable.es.cjs.js.map +1 -0
  23. package/dist/immutable.es.es.js +4450 -0
  24. package/dist/immutable.es.es.js.map +1 -0
  25. package/dist/instances.cjs.js +89 -0
  26. package/dist/instances.cjs.js.map +1 -0
  27. package/dist/instances.es.js +87 -0
  28. package/dist/instances.es.js.map +1 -0
  29. package/dist/main.cjs.js +1 -0
  30. package/dist/main.cjs.js.map +1 -1
  31. package/dist/main.es.js +1 -1
  32. package/dist/prop-controllers.cjs.js +2 -0
  33. package/dist/prop-controllers.cjs.js.map +1 -1
  34. package/dist/prop-controllers.es.js +1 -0
  35. package/dist/prop-controllers.es.js.map +1 -1
  36. package/dist/react-builder-preview.cjs.js +172 -33
  37. package/dist/react-builder-preview.cjs.js.map +1 -1
  38. package/dist/react-builder-preview.es.js +180 -41
  39. package/dist/react-builder-preview.es.js.map +1 -1
  40. package/dist/react.cjs2.js +50 -14
  41. package/dist/react.cjs2.js.map +1 -1
  42. package/dist/react.es2.js +52 -17
  43. package/dist/react.es2.js.map +1 -1
  44. package/dist/shallowEqual.cjs.js +24 -0
  45. package/dist/shallowEqual.cjs.js.map +1 -0
  46. package/dist/shallowEqual.es.js +23 -0
  47. package/dist/shallowEqual.es.js.map +1 -0
  48. package/dist/types/components/builtin/Text/Text.d.ts +16 -0
  49. package/dist/types/components/builtin/Text/Text.d.ts.map +1 -0
  50. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +24 -0
  51. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -0
  52. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Link/index.d.ts +9 -0
  53. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Link/index.d.ts.map +1 -0
  54. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +25 -0
  55. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +1 -0
  56. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts +13 -0
  57. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts.map +1 -0
  58. package/dist/types/components/builtin/Text/components/RichTextEditor/index.d.ts +5 -0
  59. package/dist/types/components/builtin/Text/components/RichTextEditor/index.d.ts.map +1 -0
  60. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +3 -0
  61. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +1 -0
  62. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +3 -0
  63. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +1 -0
  64. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts +3 -0
  65. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts.map +1 -0
  66. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts +3 -0
  67. package/dist/types/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts.map +1 -0
  68. package/dist/types/components/builtin/Text/hooks/useRichText.d.ts +1 -0
  69. package/dist/types/components/builtin/Text/hooks/useRichText.d.ts.map +1 -0
  70. package/dist/types/components/builtin/Text/index.d.ts +2 -0
  71. package/dist/types/components/builtin/Text/index.d.ts.map +1 -0
  72. package/dist/types/components/builtin/Text/prop-controllers.d.ts +286 -0
  73. package/dist/types/components/builtin/Text/prop-controllers.d.ts.map +1 -0
  74. package/dist/types/components/builtin/index.d.ts +1 -0
  75. package/dist/types/components/builtin/index.d.ts.map +1 -1
  76. package/dist/types/components/hooks/useRichText.d.ts +18 -0
  77. package/dist/types/components/hooks/useRichText.d.ts.map +1 -0
  78. package/dist/types/components/hooks/useTypography.d.ts +24 -0
  79. package/dist/types/components/hooks/useTypography.d.ts.map +1 -0
  80. package/dist/types/components/index.d.ts +1 -0
  81. package/dist/types/components/index.d.ts.map +1 -1
  82. package/dist/types/components/shared/RichTextEditor/components/Block/index.d.ts +24 -0
  83. package/dist/types/components/shared/RichTextEditor/components/Block/index.d.ts.map +1 -0
  84. package/dist/types/components/shared/RichTextEditor/components/Link/index.d.ts +9 -0
  85. package/dist/types/components/shared/RichTextEditor/components/Link/index.d.ts.map +1 -0
  86. package/dist/types/components/shared/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +23 -0
  87. package/dist/types/components/shared/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +1 -0
  88. package/dist/types/components/shared/RichTextEditor/components/Mark/index.d.ts +13 -0
  89. package/dist/types/components/shared/RichTextEditor/components/Mark/index.d.ts.map +1 -0
  90. package/dist/types/components/shared/RichTextEditor/index.d.ts +5 -0
  91. package/dist/types/components/shared/RichTextEditor/index.d.ts.map +1 -0
  92. package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +3 -0
  93. package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +1 -0
  94. package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +3 -0
  95. package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +1 -0
  96. package/dist/types/components/shared/RichTextEditor/plugins/Inlines.d.ts +3 -0
  97. package/dist/types/components/shared/RichTextEditor/plugins/Inlines.d.ts.map +1 -0
  98. package/dist/types/components/shared/RichTextEditor/plugins/Link.d.ts +3 -0
  99. package/dist/types/components/shared/RichTextEditor/plugins/Link.d.ts.map +1 -0
  100. package/dist/types/components/utils/contants.d.ts +5 -0
  101. package/dist/types/components/utils/contants.d.ts.map +1 -0
  102. package/dist/types/components/utils/devices.d.ts +1 -0
  103. package/dist/types/components/utils/devices.d.ts.map +1 -1
  104. package/dist/types/components/utils/intersection.d.ts +4 -0
  105. package/dist/types/components/utils/intersection.d.ts.map +1 -0
  106. package/dist/types/components/utils/keys.d.ts +5 -0
  107. package/dist/types/components/utils/keys.d.ts.map +1 -0
  108. package/dist/types/components/utils/queries.d.ts +6 -4
  109. package/dist/types/components/utils/queries.d.ts.map +1 -1
  110. package/dist/types/index.d.ts +1 -1
  111. package/dist/types/index.d.ts.map +1 -1
  112. package/dist/types/prop-controllers/descriptors.d.ts +1 -1
  113. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  114. package/dist/types/prop-controllers/index.d.ts +2 -0
  115. package/dist/types/prop-controllers/index.d.ts.map +1 -1
  116. package/dist/types/prop-controllers/instances.d.ts +63 -4
  117. package/dist/types/prop-controllers/instances.d.ts.map +1 -1
  118. package/dist/types/runtimes/react.d.ts.map +1 -1
  119. package/dist/types/state/actions.d.ts +88 -13
  120. package/dist/types/state/actions.d.ts.map +1 -1
  121. package/dist/types/state/modules/box-models.d.ts +5 -5
  122. package/dist/types/state/modules/box-models.d.ts.map +1 -1
  123. package/dist/types/state/modules/prop-controller-handles.d.ts +4 -8
  124. package/dist/types/state/modules/prop-controller-handles.d.ts.map +1 -1
  125. package/dist/types/state/react-builder-preview.d.ts +2 -0
  126. package/dist/types/state/react-builder-preview.d.ts.map +1 -1
  127. package/dist/types/state/react-page.d.ts +1 -0
  128. package/dist/types/state/react-page.d.ts.map +1 -1
  129. package/dist/types/utils/coalesce.d.ts +3 -0
  130. package/dist/types/utils/coalesce.d.ts.map +1 -0
  131. package/dist/types/utils/constants.d.ts +6 -0
  132. package/dist/types/utils/constants.d.ts.map +1 -0
  133. package/dist/types/utils/intersection.d.ts +4 -0
  134. package/dist/types/utils/intersection.d.ts.map +1 -0
  135. package/dist/types/utils/keys.d.ts +5 -0
  136. package/dist/types/utils/keys.d.ts.map +1 -0
  137. package/dist/types/utils/shallowMerge.d.ts +2 -0
  138. package/dist/types/utils/shallowMerge.d.ts.map +1 -0
  139. package/package.json +35 -4
  140. package/prop-controllers.js +1 -0
  141. package/react.js +1 -0
@@ -35,9 +35,11 @@ import styled, { css, keyframes as keyframes$2, createGlobalStyle } from "styled
35
35
  import { E as Element$1, b as useElementId, u as useIsInBuilder } from "./react.es2.js";
36
36
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
37
37
  import { gql, useQuery } from "@apollo/client";
38
- import { p as parse$1, c as createBox$1 } from "./box-models.es.js";
38
+ import { p as parse$1, c as createBox$1, g as getBox } from "./box-models.es.js";
39
39
  import NextImage from "next/image";
40
40
  import NextLink from "next/link";
41
+ import { Block as Block$2, Text as Text$1, Value } from "slate";
42
+ import { Editor } from "slate-react";
41
43
  import "./actions.es.js";
42
44
  import "./descriptors.es.js";
43
45
  function getDefaultExportFromCjs(x) {
@@ -170,14 +172,14 @@ var featureDefinitions = {
170
172
  "onViewportLeave"
171
173
  ])
172
174
  };
173
- function loadFeatures(features) {
174
- for (var key in features) {
175
- if (features[key] === null)
175
+ function loadFeatures(features2) {
176
+ for (var key in features2) {
177
+ if (features2[key] === null)
176
178
  continue;
177
179
  if (key === "projectionNodeConstructor") {
178
- featureDefinitions.projectionNodeConstructor = features[key];
180
+ featureDefinitions.projectionNodeConstructor = features2[key];
179
181
  } else {
180
- featureDefinitions[key].Component = features[key];
182
+ featureDefinitions[key].Component = features2[key];
181
183
  }
182
184
  }
183
185
  }
@@ -189,7 +191,7 @@ var LazyContext = createContext({ strict: false });
189
191
  var featureNames = Object.keys(featureDefinitions);
190
192
  var numFeatures = featureNames.length;
191
193
  function useFeatures(props2, visualElement2, preloadedFeatures) {
192
- var features = [];
194
+ var features2 = [];
193
195
  useContext(LazyContext);
194
196
  if (!visualElement2)
195
197
  return null;
@@ -197,10 +199,10 @@ function useFeatures(props2, visualElement2, preloadedFeatures) {
197
199
  var name_1 = featureNames[i];
198
200
  var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component;
199
201
  if (isEnabled(props2) && Component) {
200
- features.push(React.createElement(Component, __assign$1({ key: name_1 }, props2, { visualElement: visualElement2 })));
202
+ features2.push(React.createElement(Component, __assign$1({ key: name_1 }, props2, { visualElement: visualElement2 })));
201
203
  }
202
204
  }
203
- return features;
205
+ return features2;
204
206
  }
205
207
  var MotionConfigContext = createContext({
206
208
  transformPagePoint: function(p) {
@@ -214,8 +216,8 @@ function useVisualElementContext() {
214
216
  return useContext(MotionContext).visualElement;
215
217
  }
216
218
  var PresenceContext = createContext(null);
217
- var isBrowser$1 = typeof window !== "undefined";
218
- var useIsomorphicLayoutEffect = isBrowser$1 ? useLayoutEffect : useEffect;
219
+ var isBrowser$2 = typeof window !== "undefined";
220
+ var useIsomorphicLayoutEffect = isBrowser$2 ? useLayoutEffect : useEffect;
219
221
  var prefersReducedMotion = { current: null };
220
222
  var hasDetected = false;
221
223
  function initPrefersReducedMotion() {
@@ -386,7 +388,7 @@ function createRenderStep(runNextFrame2) {
386
388
  let numToRun = 0;
387
389
  let isProcessing2 = false;
388
390
  let flushNextFrame = false;
389
- const toKeepAlive = new WeakSet();
391
+ const toKeepAlive = /* @__PURE__ */ new WeakSet();
390
392
  const step = {
391
393
  schedule: (callback, keepAlive = false, immediate = false) => {
392
394
  const addToCurrentFrame = immediate && isProcessing2;
@@ -401,9 +403,9 @@ function createRenderStep(runNextFrame2) {
401
403
  return callback;
402
404
  },
403
405
  cancel: (callback) => {
404
- const index = toRunNextFrame.indexOf(callback);
405
- if (index !== -1)
406
- toRunNextFrame.splice(index, 1);
406
+ const index2 = toRunNextFrame.indexOf(callback);
407
+ if (index2 !== -1)
408
+ toRunNextFrame.splice(index2, 1);
407
409
  toKeepAlive.delete(callback);
408
410
  },
409
411
  process: (frameData) => {
@@ -565,8 +567,8 @@ function calcAngularFreq(undampedFreq, dampingRatio) {
565
567
  }
566
568
  const durationKeys = ["duration", "bounce"];
567
569
  const physicsKeys = ["stiffness", "damping", "mass"];
568
- function isSpringType(options, keys) {
569
- return keys.some((key) => options[key] !== void 0);
570
+ function isSpringType(options, keys2) {
571
+ return keys2.some((key) => options[key] !== void 0);
570
572
  }
571
573
  function getSpringOptions(options) {
572
574
  let springOptions = Object.assign({ velocity: 0, stiffness: 100, damping: 10, mass: 1, isResolvedFromDuration: false }, options);
@@ -744,7 +746,7 @@ const color$1 = {
744
746
  };
745
747
  const colorToken = "${c}";
746
748
  const numberToken = "${n}";
747
- function test(v) {
749
+ function test$1(v) {
748
750
  var _a, _b, _c, _d;
749
751
  return isNaN(v) && isString(v) && ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0;
750
752
  }
@@ -786,8 +788,8 @@ function getAnimatableNone$1(v) {
786
788
  const transformer = createTransformer(v);
787
789
  return transformer(parsed.map(convertNumbersToZero));
788
790
  }
789
- const complex = { test, parse, createTransformer, getAnimatableNone: getAnimatableNone$1 };
790
- const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]);
791
+ const complex = { test: test$1, parse, createTransformer, getAnimatableNone: getAnimatableNone$1 };
792
+ const maxDefaults = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
791
793
  function applyDefaultFilter(v) {
792
794
  let [name, value] = v.slice(0, -1).split("(");
793
795
  if (name === "drop-shadow")
@@ -1104,10 +1106,10 @@ function detectAnimationFromOptions(config) {
1104
1106
  } else if (types[config.type]) {
1105
1107
  return types[config.type];
1106
1108
  }
1107
- const keys = new Set(Object.keys(config));
1108
- if (keys.has("ease") || keys.has("duration") && !keys.has("dampingRatio")) {
1109
+ const keys2 = new Set(Object.keys(config));
1110
+ if (keys2.has("ease") || keys2.has("duration") && !keys2.has("dampingRatio")) {
1109
1111
  return keyframes$1;
1110
- } else if (keys.has("dampingRatio") || keys.has("stiffness") || keys.has("mass") || keys.has("damping") || keys.has("restSpeed") || keys.has("restDelta")) {
1112
+ } else if (keys2.has("dampingRatio") || keys2.has("stiffness") || keys2.has("mass") || keys2.has("damping") || keys2.has("restSpeed") || keys2.has("restDelta")) {
1111
1113
  return spring;
1112
1114
  }
1113
1115
  return keyframes$1;
@@ -1346,8 +1348,8 @@ function addUniqueItem(arr, item) {
1346
1348
  arr.indexOf(item) === -1 && arr.push(item);
1347
1349
  }
1348
1350
  function removeItem(arr, item) {
1349
- var index = arr.indexOf(item);
1350
- index > -1 && arr.splice(index, 1);
1351
+ var index2 = arr.indexOf(item);
1352
+ index2 > -1 && arr.splice(index2, 1);
1351
1353
  }
1352
1354
  var SubscriptionManager = function() {
1353
1355
  function SubscriptionManager2() {
@@ -2245,7 +2247,7 @@ var transformPropSet = new Set(transformProps);
2245
2247
  function isTransformProp(key) {
2246
2248
  return transformPropSet.has(key);
2247
2249
  }
2248
- var transformOriginProps = new Set(["originX", "originY", "originZ"]);
2250
+ var transformOriginProps = /* @__PURE__ */ new Set(["originX", "originY", "originZ"]);
2249
2251
  function isTransformOriginProp(key) {
2250
2252
  return transformOriginProps.has(key);
2251
2253
  }
@@ -2292,7 +2294,7 @@ function createProjectionNode(_a) {
2292
2294
  if (parent === void 0) {
2293
2295
  parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent();
2294
2296
  }
2295
- this.children = new Set();
2297
+ this.children = /* @__PURE__ */ new Set();
2296
2298
  this.options = {};
2297
2299
  this.isTreeAnimating = false;
2298
2300
  this.isAnimationBlocked = false;
@@ -2304,8 +2306,8 @@ function createProjectionNode(_a) {
2304
2306
  this.needsReset = false;
2305
2307
  this.shouldResetTransform = false;
2306
2308
  this.treeScale = { x: 1, y: 1 };
2307
- this.eventHandlers = new Map();
2308
- this.potentialNodes = new Map();
2309
+ this.eventHandlers = /* @__PURE__ */ new Map();
2310
+ this.potentialNodes = /* @__PURE__ */ new Map();
2309
2311
  this.checkUpdateFailed = function() {
2310
2312
  if (_this.isUpdating) {
2311
2313
  _this.isUpdating = false;
@@ -2319,7 +2321,7 @@ function createProjectionNode(_a) {
2319
2321
  this.hasProjected = false;
2320
2322
  this.isVisible = true;
2321
2323
  this.animationProgress = 0;
2322
- this.sharedNodes = new Map();
2324
+ this.sharedNodes = /* @__PURE__ */ new Map();
2323
2325
  this.id = id2;
2324
2326
  this.latestValues = latestValues;
2325
2327
  this.root = parent ? parent.root || parent : this;
@@ -3201,16 +3203,16 @@ function createMotionComponent(_a) {
3201
3203
  var layoutId = useLayoutId(props2);
3202
3204
  props2 = __assign$1(__assign$1({}, props2), { layoutId });
3203
3205
  var config = useContext(MotionConfigContext);
3204
- var features = null;
3206
+ var features2 = null;
3205
3207
  var context = useCreateMotionContext(props2);
3206
3208
  var projectionId = config.isStatic ? void 0 : useProjectionId();
3207
3209
  var visualState = useVisualState(props2, config.isStatic);
3208
- if (!config.isStatic && isBrowser$1) {
3210
+ if (!config.isStatic && isBrowser$2) {
3209
3211
  context.visualElement = useVisualElement(Component, visualState, __assign$1(__assign$1({}, config), props2), createVisualElement);
3210
3212
  useProjection(projectionId, props2, context.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor);
3211
- features = useFeatures(props2, context.visualElement);
3213
+ features2 = useFeatures(props2, context.visualElement);
3212
3214
  }
3213
- return React.createElement(VisualElementHandler, { visualElement: context.visualElement, props: __assign$1(__assign$1({}, config), props2) }, features, React.createElement(MotionContext.Provider, { value: context }, useRender(Component, props2, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement)));
3215
+ return React.createElement(VisualElementHandler, { visualElement: context.visualElement, props: __assign$1(__assign$1({}, config), props2) }, features2, React.createElement(MotionContext.Provider, { value: context }, useRender(Component, props2, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement)));
3214
3216
  }
3215
3217
  return forwardRef(MotionComponent);
3216
3218
  }
@@ -3230,7 +3232,7 @@ function createMotionProxy(createConfig) {
3230
3232
  if (typeof Proxy === "undefined") {
3231
3233
  return custom;
3232
3234
  }
3233
- var componentCache = new Map();
3235
+ var componentCache = /* @__PURE__ */ new Map();
3234
3236
  return new Proxy(custom, {
3235
3237
  get: function(_target, key) {
3236
3238
  if (!componentCache.has(key)) {
@@ -3407,7 +3409,7 @@ function useHTMLProps(props2, visualState, isStatic) {
3407
3409
  htmlProps.style = style;
3408
3410
  return htmlProps;
3409
3411
  }
3410
- var validMotionProps = new Set([
3412
+ var validMotionProps = /* @__PURE__ */ new Set([
3411
3413
  "initial",
3412
3414
  "animate",
3413
3415
  "exit",
@@ -3517,11 +3519,11 @@ function buildSVGPath(attrs, length, spacing, offset, useDashCase) {
3517
3519
  useDashCase = true;
3518
3520
  }
3519
3521
  attrs.pathLength = 1;
3520
- var keys = useDashCase ? dashKeys : camelKeys;
3521
- attrs[keys.offset] = px.transform(-offset);
3522
+ var keys2 = useDashCase ? dashKeys : camelKeys;
3523
+ attrs[keys2.offset] = px.transform(-offset);
3522
3524
  var pathLength = px.transform(length);
3523
3525
  var pathSpacing = px.transform(spacing);
3524
- attrs[keys.array] = "".concat(pathLength, " ").concat(pathSpacing);
3526
+ attrs[keys2.array] = "".concat(pathLength, " ").concat(pathSpacing);
3525
3527
  }
3526
3528
  function buildSVGAttrs(state, _a, options, transformTemplate) {
3527
3529
  var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c, latest = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
@@ -3590,7 +3592,7 @@ function renderHTML(element, _a, styleProp, projection) {
3590
3592
  element.style.setProperty(key, vars[key]);
3591
3593
  }
3592
3594
  }
3593
- var camelCaseAttributes = new Set([
3595
+ var camelCaseAttributes = /* @__PURE__ */ new Set([
3594
3596
  "baseFrequency",
3595
3597
  "diffuseConstant",
3596
3598
  "kernelMatrix",
@@ -3691,8 +3693,8 @@ function makeLatestValues(props2, context, presenceContext, scrapeMotionValues)
3691
3693
  for (var key2 in target) {
3692
3694
  var valueTarget = target[key2];
3693
3695
  if (Array.isArray(valueTarget)) {
3694
- var index = initialAnimationIsBlocked ? valueTarget.length - 1 : 0;
3695
- valueTarget = valueTarget[index];
3696
+ var index2 = initialAnimationIsBlocked ? valueTarget.length - 1 : 0;
3697
+ valueTarget = valueTarget[index2];
3696
3698
  }
3697
3699
  if (valueTarget !== null) {
3698
3700
  values[key2] = valueTarget;
@@ -3831,13 +3833,13 @@ var wrapHandler = function(handler, shouldFilterPrimaryPointer) {
3831
3833
  return shouldFilterPrimaryPointer ? filterPrimaryPointer(listener) : listener;
3832
3834
  };
3833
3835
  var supportsPointerEvents$1 = function() {
3834
- return isBrowser$1 && window.onpointerdown === null;
3836
+ return isBrowser$2 && window.onpointerdown === null;
3835
3837
  };
3836
3838
  var supportsTouchEvents$1 = function() {
3837
- return isBrowser$1 && window.ontouchstart === null;
3839
+ return isBrowser$2 && window.ontouchstart === null;
3838
3840
  };
3839
3841
  var supportsMouseEvents = function() {
3840
- return isBrowser$1 && window.onmousedown === null;
3842
+ return isBrowser$2 && window.onmousedown === null;
3841
3843
  };
3842
3844
  var mouseEventNames = {
3843
3845
  pointerdown: "mousedown",
@@ -3986,8 +3988,8 @@ function useTapGesture(_a) {
3986
3988
  usePointerEvent(visualElement2, "pointerdown", hasPressListeners ? onPointerDown : void 0);
3987
3989
  useUnmountEffect(removePointerEndListener);
3988
3990
  }
3989
- var observerCallbacks = new WeakMap();
3990
- var observers = new WeakMap();
3991
+ var observerCallbacks = /* @__PURE__ */ new WeakMap();
3992
+ var observers = /* @__PURE__ */ new WeakMap();
3991
3993
  var fireObserverCallback = function(entry) {
3992
3994
  var _a;
3993
3995
  (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);
@@ -4397,7 +4399,7 @@ function createAnimationState(visualElement2) {
4397
4399
  var props2 = visualElement2.getProps();
4398
4400
  var context = visualElement2.getVariantContext(true) || {};
4399
4401
  var animations2 = [];
4400
- var removedKeys = new Set();
4402
+ var removedKeys = /* @__PURE__ */ new Set();
4401
4403
  var encounteredKeys = {};
4402
4404
  var removedVariantIndex = Infinity;
4403
4405
  var _loop_1 = function(i2) {
@@ -4798,7 +4800,7 @@ function measurePageBox(element, rootProjectionNode2, transformPagePoint) {
4798
4800
  }
4799
4801
  return viewportBox;
4800
4802
  }
4801
- var elementDragControls = new WeakMap();
4803
+ var elementDragControls = /* @__PURE__ */ new WeakMap();
4802
4804
  var VisualElementDragControls = function() {
4803
4805
  function VisualElementDragControls2(visualElement2) {
4804
4806
  this.openGlobalLock = null;
@@ -5234,8 +5236,8 @@ var visualElement = function(_a) {
5234
5236
  var latestValues = visualState.latestValues, renderState = visualState.renderState;
5235
5237
  var instance;
5236
5238
  var lifecycles = createLifecycles();
5237
- var values = new Map();
5238
- var valueSubscriptions = new Map();
5239
+ var values = /* @__PURE__ */ new Map();
5240
+ var valueSubscriptions = /* @__PURE__ */ new Map();
5239
5241
  var prevMotionValues = {};
5240
5242
  var baseTarget = __assign$1({}, latestValues);
5241
5243
  var removeFromVariantTree;
@@ -5276,10 +5278,10 @@ var visualElement = function(_a) {
5276
5278
  current: null,
5277
5279
  depth: parent ? parent.depth + 1 : 0,
5278
5280
  parent,
5279
- children: new Set(),
5281
+ children: /* @__PURE__ */ new Set(),
5280
5282
  presenceId,
5281
5283
  shouldReduceMotion,
5282
- variantChildren: isVariantNode ? new Set() : void 0,
5284
+ variantChildren: isVariantNode ? /* @__PURE__ */ new Set() : void 0,
5283
5285
  isVisible: void 0,
5284
5286
  manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()),
5285
5287
  blockInitialAnimation,
@@ -5520,7 +5522,7 @@ function resolveCSSVariables(visualElement2, _a, transitionEnd) {
5520
5522
  }
5521
5523
  return { target, transitionEnd };
5522
5524
  }
5523
- var positionalKeys = new Set([
5525
+ var positionalKeys = /* @__PURE__ */ new Set([
5524
5526
  "width",
5525
5527
  "height",
5526
5528
  "top",
@@ -5573,7 +5575,7 @@ var getTranslateFromMatrix = function(pos2, pos3) {
5573
5575
  }
5574
5576
  };
5575
5577
  };
5576
- var transformKeys = new Set(["x", "y", "z"]);
5578
+ var transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]);
5577
5579
  var nonTranslationalTransformKeys = transformProps.filter(function(key) {
5578
5580
  return !transformKeys.has(key);
5579
5581
  });
@@ -6026,7 +6028,7 @@ var motion = /* @__PURE__ */ createMotionProxy(function(Component, config) {
6026
6028
  function animationControls() {
6027
6029
  var hasMounted = false;
6028
6030
  var pendingAnimations = [];
6029
- var subscribers = new Set();
6031
+ var subscribers = /* @__PURE__ */ new Set();
6030
6032
  var controls = {
6031
6033
  subscribe: function(visualElement2) {
6032
6034
  subscribers.add(visualElement2);
@@ -6167,6 +6169,43 @@ const PAGE_PATHNAMES_BY_ID = gql`
6167
6169
  }
6168
6170
  }
6169
6171
  `;
6172
+ const TYPOGRAPHY_FRAGMENT = gql`
6173
+ fragment Typography on Typography {
6174
+ id
6175
+ name
6176
+ style {
6177
+ deviceId
6178
+ value {
6179
+ fontFamily
6180
+ fontSize {
6181
+ value
6182
+ unit
6183
+ }
6184
+ color {
6185
+ swatchId
6186
+ alpha
6187
+ }
6188
+ lineHeight
6189
+ letterSpacing
6190
+ fontWeight
6191
+ textAlign
6192
+ uppercase
6193
+ underline
6194
+ strikethrough
6195
+ italic
6196
+ }
6197
+ }
6198
+ }
6199
+ `;
6200
+ const TYPOGRAPHIES_BY_ID = gql`
6201
+ query TypographiesById($ids: [ID!]!) {
6202
+ typographies(ids: $ids) {
6203
+ ...Typography
6204
+ }
6205
+ }
6206
+
6207
+ ${TYPOGRAPHY_FRAGMENT}
6208
+ `;
6170
6209
  function isNonNullable(value) {
6171
6210
  return value != null;
6172
6211
  }
@@ -6359,6 +6398,23 @@ function useFile(fileId) {
6359
6398
  return null;
6360
6399
  return data.file;
6361
6400
  }
6401
+ const keys = (o) => Object.keys(o);
6402
+ const coalesce = (...args) => {
6403
+ let i;
6404
+ for (i = 0; i < args.length - 1; i += 1) {
6405
+ if (args[i] != null)
6406
+ return args[i];
6407
+ }
6408
+ return args[i];
6409
+ };
6410
+ function shallowMerge(a2, b2) {
6411
+ const bKeys = keys(b2);
6412
+ const merged = __spreadValues({}, a2);
6413
+ bKeys.forEach((key) => {
6414
+ merged[key] = coalesce(merged[key], b2[key]);
6415
+ });
6416
+ return merged;
6417
+ }
6362
6418
  const DEVICES = [
6363
6419
  { id: "desktop", minWidth: 769 },
6364
6420
  { id: "tablet", minWidth: 476, maxWidth: 768 },
@@ -6373,6 +6429,12 @@ const getDevice = (deviceId) => {
6373
6429
  function defaultStrategy(value, fallbacks) {
6374
6430
  return value || fallbacks[0];
6375
6431
  }
6432
+ function shallowMergeFallbacks(value, fallbacks) {
6433
+ return [value, ...fallbacks].filter((override) => Boolean(override)).reduce((a2, b2) => ({
6434
+ deviceId: a2.deviceId || b2.deviceId,
6435
+ value: shallowMerge(a2.value, b2.value)
6436
+ }));
6437
+ }
6376
6438
  function findDeviceOverride(values = [], deviceId, strategy = defaultStrategy) {
6377
6439
  const value = values.find(({ deviceId: d }) => d === deviceId);
6378
6440
  const fallbacks = DEVICES.slice(0, DEVICES.findIndex((d) => d.id === deviceId) + 1).reverse().map((d) => values.find((v) => v.deviceId === d.id)).filter((override) => Boolean(override));
@@ -6669,11 +6731,11 @@ const useBoxAnimations = (_e) => {
6669
6731
  }
6670
6732
  };
6671
6733
  };
6672
- const getIndexes = (spans, index) => {
6734
+ const getIndexes = (spans, index2) => {
6673
6735
  const flattened = spans.reduce((a2, s) => a2.concat(s), []);
6674
- if (index < 0 || index > flattened.length)
6736
+ if (index2 < 0 || index2 > flattened.length)
6675
6737
  throw new RangeError();
6676
- let remainder = index;
6738
+ let remainder = index2;
6677
6739
  let rowIndex = 0;
6678
6740
  while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
6679
6741
  remainder -= spans[rowIndex].length;
@@ -7409,20 +7471,20 @@ var _props = props;
7409
7471
  function _interopRequireDefault(obj) {
7410
7472
  return obj && obj.__esModule ? obj : { "default": obj };
7411
7473
  }
7412
- function _typeof(obj) {
7474
+ function _typeof$1(obj) {
7413
7475
  "@babel/helpers - typeof";
7414
7476
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
7415
- _typeof = function _typeof2(obj2) {
7477
+ _typeof$1 = function _typeof2(obj2) {
7416
7478
  return typeof obj2;
7417
7479
  };
7418
7480
  } else {
7419
- _typeof = function _typeof2(obj2) {
7481
+ _typeof$1 = function _typeof2(obj2) {
7420
7482
  return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
7421
7483
  };
7422
7484
  }
7423
- return _typeof(obj);
7485
+ return _typeof$1(obj);
7424
7486
  }
7425
- function _defineProperty(obj, key, value) {
7487
+ function _defineProperty$2(obj, key, value) {
7426
7488
  if (key in obj) {
7427
7489
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
7428
7490
  } else {
@@ -7432,7 +7494,7 @@ function _defineProperty(obj, key, value) {
7432
7494
  }
7433
7495
  function _createForOfIteratorHelper(o) {
7434
7496
  if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
7435
- if (Array.isArray(o) || (o = _unsupportedIterableToArray$1(o))) {
7497
+ if (Array.isArray(o) || (o = _unsupportedIterableToArray$2(o))) {
7436
7498
  var i = 0;
7437
7499
  var F = function F2() {
7438
7500
  };
@@ -7466,26 +7528,26 @@ function _createForOfIteratorHelper(o) {
7466
7528
  }
7467
7529
  } };
7468
7530
  }
7469
- function _slicedToArray(arr, i) {
7470
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
7531
+ function _slicedToArray$1(arr, i) {
7532
+ return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$1();
7471
7533
  }
7472
- function _nonIterableRest() {
7534
+ function _nonIterableRest$1() {
7473
7535
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7474
7536
  }
7475
- function _unsupportedIterableToArray$1(o, minLen) {
7537
+ function _unsupportedIterableToArray$2(o, minLen) {
7476
7538
  if (!o)
7477
7539
  return;
7478
7540
  if (typeof o === "string")
7479
- return _arrayLikeToArray$1(o, minLen);
7541
+ return _arrayLikeToArray$2(o, minLen);
7480
7542
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
7481
7543
  if (n2 === "Object" && o.constructor)
7482
7544
  n2 = o.constructor.name;
7483
7545
  if (n2 === "Map" || n2 === "Set")
7484
7546
  return Array.from(n2);
7485
7547
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
7486
- return _arrayLikeToArray$1(o, minLen);
7548
+ return _arrayLikeToArray$2(o, minLen);
7487
7549
  }
7488
- function _arrayLikeToArray$1(arr, len) {
7550
+ function _arrayLikeToArray$2(arr, len) {
7489
7551
  if (len == null || len > arr.length)
7490
7552
  len = arr.length;
7491
7553
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
@@ -7493,7 +7555,7 @@ function _arrayLikeToArray$1(arr, len) {
7493
7555
  }
7494
7556
  return arr2;
7495
7557
  }
7496
- function _iterableToArrayLimit(arr, i) {
7558
+ function _iterableToArrayLimit$1(arr, i) {
7497
7559
  if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
7498
7560
  return;
7499
7561
  var _arr = [];
@@ -7520,7 +7582,7 @@ function _iterableToArrayLimit(arr, i) {
7520
7582
  }
7521
7583
  return _arr;
7522
7584
  }
7523
- function _arrayWithHoles(arr) {
7585
+ function _arrayWithHoles$1(arr) {
7524
7586
  if (Array.isArray(arr))
7525
7587
  return arr;
7526
7588
  }
@@ -7545,7 +7607,7 @@ function parseTimeString(stamp) {
7545
7607
  var seconds = 0;
7546
7608
  var array2 = MATCH_START_STAMP.exec(stamp);
7547
7609
  while (array2 !== null) {
7548
- var _array = array2, _array2 = _slicedToArray(_array, 3), count = _array2[1], period = _array2[2];
7610
+ var _array = array2, _array2 = _slicedToArray$1(_array, 3), count = _array2[1], period = _array2[2];
7549
7611
  if (period === "h")
7550
7612
  seconds += parseInt(count, 10) * 60 * 60;
7551
7613
  if (period === "m")
@@ -7625,7 +7687,7 @@ function getConfig(props2, defaultProps2, showWarning) {
7625
7687
  var p = _step.value;
7626
7688
  if (props2[p]) {
7627
7689
  var key = p.replace(/Config$/, "");
7628
- config = (0, _deepmerge["default"])(config, _defineProperty({}, key, props2[p]));
7690
+ config = (0, _deepmerge["default"])(config, _defineProperty$2({}, key, props2[p]));
7629
7691
  if (showWarning) {
7630
7692
  var link2 = "https://github.com/CookPete/react-player#config-prop";
7631
7693
  var message = "ReactPlayer: %c".concat(p, " %cis deprecated, please use the config prop instead \u2013 ").concat(link2);
@@ -7647,8 +7709,8 @@ function omit(object2) {
7647
7709
  }
7648
7710
  var omitKeys = (_ref = []).concat.apply(_ref, arrays);
7649
7711
  var output = {};
7650
- var keys = Object.keys(object2);
7651
- for (var _i2 = 0, _keys = keys; _i2 < _keys.length; _i2++) {
7712
+ var keys2 = Object.keys(object2);
7713
+ for (var _i2 = 0, _keys = keys2; _i2 < _keys.length; _i2++) {
7652
7714
  var key = _keys[_i2];
7653
7715
  if (omitKeys.indexOf(key) === -1) {
7654
7716
  output[key] = object2[key];
@@ -7674,7 +7736,7 @@ function callPlayer(method) {
7674
7736
  return (_this$player = this.player)[method].apply(_this$player, args);
7675
7737
  }
7676
7738
  function isObject(val) {
7677
- return val !== null && _typeof(val) === "object";
7739
+ return val !== null && _typeof$1(val) === "object";
7678
7740
  }
7679
7741
  function isEqual(a2, b2) {
7680
7742
  if (typeof a2 === "function" && typeof b2 === "function") {
@@ -7726,7 +7788,7 @@ var Player = {};
7726
7788
  function _getRequireWildcardCache() {
7727
7789
  if (typeof WeakMap !== "function")
7728
7790
  return null;
7729
- var cache = new WeakMap();
7791
+ var cache = /* @__PURE__ */ new WeakMap();
7730
7792
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
7731
7793
  return cache;
7732
7794
  };
@@ -8158,7 +8220,7 @@ var Player = {};
8158
8220
  function _getRequireWildcardCache() {
8159
8221
  if (typeof WeakMap !== "function")
8160
8222
  return null;
8161
- var cache = new WeakMap();
8223
+ var cache = /* @__PURE__ */ new WeakMap();
8162
8224
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
8163
8225
  return cache;
8164
8226
  };
@@ -8220,29 +8282,29 @@ var Player = {};
8220
8282
  };
8221
8283
  return _extends2.apply(this, arguments);
8222
8284
  }
8223
- function ownKeys(object2, enumerableOnly) {
8224
- var keys = Object.keys(object2);
8285
+ function ownKeys2(object2, enumerableOnly) {
8286
+ var keys2 = Object.keys(object2);
8225
8287
  if (Object.getOwnPropertySymbols) {
8226
8288
  var symbols = Object.getOwnPropertySymbols(object2);
8227
8289
  if (enumerableOnly)
8228
8290
  symbols = symbols.filter(function(sym) {
8229
8291
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
8230
8292
  });
8231
- keys.push.apply(keys, symbols);
8293
+ keys2.push.apply(keys2, symbols);
8232
8294
  }
8233
- return keys;
8295
+ return keys2;
8234
8296
  }
8235
- function _objectSpread(target) {
8297
+ function _objectSpread2(target) {
8236
8298
  for (var i = 1; i < arguments.length; i++) {
8237
8299
  var source = arguments[i] != null ? arguments[i] : {};
8238
8300
  if (i % 2) {
8239
- ownKeys(Object(source), true).forEach(function(key) {
8301
+ ownKeys2(Object(source), true).forEach(function(key) {
8240
8302
  _defineProperty2(target, key, source[key]);
8241
8303
  });
8242
8304
  } else if (Object.getOwnPropertyDescriptors) {
8243
8305
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8244
8306
  } else {
8245
- ownKeys(Object(source)).forEach(function(key) {
8307
+ ownKeys2(Object(source)).forEach(function(key) {
8246
8308
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8247
8309
  });
8248
8310
  }
@@ -8405,7 +8467,7 @@ var Player = {};
8405
8467
  var _this$props = this.props, style = _this$props.style, width = _this$props.width, height = _this$props.height, Wrapper2 = _this$props.wrapper;
8406
8468
  var otherProps = (0, _utils.omit)(this.props, SUPPORTED_PROPS, _props2.DEPRECATED_CONFIG_PROPS);
8407
8469
  return /* @__PURE__ */ _react2["default"].createElement(Wrapper2, _extends2({
8408
- style: _objectSpread({}, style, {
8470
+ style: _objectSpread2({}, style, {
8409
8471
  width,
8410
8472
  height
8411
8473
  })
@@ -8434,7 +8496,7 @@ var Player = {};
8434
8496
  function _getRequireWildcardCache() {
8435
8497
  if (typeof WeakMap !== "function")
8436
8498
  return null;
8437
- var cache = new WeakMap();
8499
+ var cache = /* @__PURE__ */ new WeakMap();
8438
8500
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
8439
8501
  return cache;
8440
8502
  };
@@ -8482,29 +8544,29 @@ var Player = {};
8482
8544
  }
8483
8545
  return _typeof2(obj);
8484
8546
  }
8485
- function ownKeys(object2, enumerableOnly) {
8486
- var keys = Object.keys(object2);
8547
+ function ownKeys2(object2, enumerableOnly) {
8548
+ var keys2 = Object.keys(object2);
8487
8549
  if (Object.getOwnPropertySymbols) {
8488
8550
  var symbols = Object.getOwnPropertySymbols(object2);
8489
8551
  if (enumerableOnly)
8490
8552
  symbols = symbols.filter(function(sym) {
8491
8553
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
8492
8554
  });
8493
- keys.push.apply(keys, symbols);
8555
+ keys2.push.apply(keys2, symbols);
8494
8556
  }
8495
- return keys;
8557
+ return keys2;
8496
8558
  }
8497
- function _objectSpread(target) {
8559
+ function _objectSpread2(target) {
8498
8560
  for (var i = 1; i < arguments.length; i++) {
8499
8561
  var source = arguments[i] != null ? arguments[i] : {};
8500
8562
  if (i % 2) {
8501
- ownKeys(Object(source), true).forEach(function(key) {
8563
+ ownKeys2(Object(source), true).forEach(function(key) {
8502
8564
  _defineProperty2(target, key, source[key]);
8503
8565
  });
8504
8566
  } else if (Object.getOwnPropertyDescriptors) {
8505
8567
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8506
8568
  } else {
8507
- ownKeys(Object(source)).forEach(function(key) {
8569
+ ownKeys2(Object(source)).forEach(function(key) {
8508
8570
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8509
8571
  });
8510
8572
  }
@@ -8742,11 +8804,11 @@ var Player = {};
8742
8804
  }).then(function(YT) {
8743
8805
  if (!_this2.container)
8744
8806
  return;
8745
- _this2.player = new YT.Player(_this2.container, _objectSpread({
8807
+ _this2.player = new YT.Player(_this2.container, _objectSpread2({
8746
8808
  width: "100%",
8747
8809
  height: "100%",
8748
8810
  videoId: id2,
8749
- playerVars: _objectSpread({
8811
+ playerVars: _objectSpread2({
8750
8812
  autoplay: playing ? 1 : 0,
8751
8813
  mute: muted ? 1 : 0,
8752
8814
  controls: controls ? 1 : 0,
@@ -8866,7 +8928,7 @@ var SoundCloud = {};
8866
8928
  function _getRequireWildcardCache() {
8867
8929
  if (typeof WeakMap !== "function")
8868
8930
  return null;
8869
- var cache = new WeakMap();
8931
+ var cache = /* @__PURE__ */ new WeakMap();
8870
8932
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
8871
8933
  return cache;
8872
8934
  };
@@ -8914,29 +8976,29 @@ var SoundCloud = {};
8914
8976
  }
8915
8977
  return _typeof2(obj);
8916
8978
  }
8917
- function ownKeys(object2, enumerableOnly) {
8918
- var keys = Object.keys(object2);
8979
+ function ownKeys2(object2, enumerableOnly) {
8980
+ var keys2 = Object.keys(object2);
8919
8981
  if (Object.getOwnPropertySymbols) {
8920
8982
  var symbols = Object.getOwnPropertySymbols(object2);
8921
8983
  if (enumerableOnly)
8922
8984
  symbols = symbols.filter(function(sym) {
8923
8985
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
8924
8986
  });
8925
- keys.push.apply(keys, symbols);
8987
+ keys2.push.apply(keys2, symbols);
8926
8988
  }
8927
- return keys;
8989
+ return keys2;
8928
8990
  }
8929
- function _objectSpread(target) {
8991
+ function _objectSpread2(target) {
8930
8992
  for (var i = 1; i < arguments.length; i++) {
8931
8993
  var source = arguments[i] != null ? arguments[i] : {};
8932
8994
  if (i % 2) {
8933
- ownKeys(Object(source), true).forEach(function(key) {
8995
+ ownKeys2(Object(source), true).forEach(function(key) {
8934
8996
  _defineProperty2(target, key, source[key]);
8935
8997
  });
8936
8998
  } else if (Object.getOwnPropertyDescriptors) {
8937
8999
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8938
9000
  } else {
8939
- ownKeys(Object(source)).forEach(function(key) {
9001
+ ownKeys2(Object(source)).forEach(function(key) {
8940
9002
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8941
9003
  });
8942
9004
  }
@@ -9086,7 +9148,7 @@ var SoundCloud = {};
9086
9148
  return _this2.props.onError(e2);
9087
9149
  });
9088
9150
  }
9089
- _this2.player.load(url, _objectSpread({}, _this2.props.config.soundcloud.options, {
9151
+ _this2.player.load(url, _objectSpread2({}, _this2.props.config.soundcloud.options, {
9090
9152
  callback: function callback() {
9091
9153
  _this2.player.getDuration(function(duration) {
9092
9154
  _this2.duration = duration / 1e3;
@@ -9179,7 +9241,7 @@ var Vimeo = {};
9179
9241
  function _getRequireWildcardCache() {
9180
9242
  if (typeof WeakMap !== "function")
9181
9243
  return null;
9182
- var cache = new WeakMap();
9244
+ var cache = /* @__PURE__ */ new WeakMap();
9183
9245
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
9184
9246
  return cache;
9185
9247
  };
@@ -9227,29 +9289,29 @@ var Vimeo = {};
9227
9289
  }
9228
9290
  return _typeof2(obj);
9229
9291
  }
9230
- function ownKeys(object2, enumerableOnly) {
9231
- var keys = Object.keys(object2);
9292
+ function ownKeys2(object2, enumerableOnly) {
9293
+ var keys2 = Object.keys(object2);
9232
9294
  if (Object.getOwnPropertySymbols) {
9233
9295
  var symbols = Object.getOwnPropertySymbols(object2);
9234
9296
  if (enumerableOnly)
9235
9297
  symbols = symbols.filter(function(sym) {
9236
9298
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
9237
9299
  });
9238
- keys.push.apply(keys, symbols);
9300
+ keys2.push.apply(keys2, symbols);
9239
9301
  }
9240
- return keys;
9302
+ return keys2;
9241
9303
  }
9242
- function _objectSpread(target) {
9304
+ function _objectSpread2(target) {
9243
9305
  for (var i = 1; i < arguments.length; i++) {
9244
9306
  var source = arguments[i] != null ? arguments[i] : {};
9245
9307
  if (i % 2) {
9246
- ownKeys(Object(source), true).forEach(function(key) {
9308
+ ownKeys2(Object(source), true).forEach(function(key) {
9247
9309
  _defineProperty2(target, key, source[key]);
9248
9310
  });
9249
9311
  } else if (Object.getOwnPropertyDescriptors) {
9250
9312
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
9251
9313
  } else {
9252
- ownKeys(Object(source)).forEach(function(key) {
9314
+ ownKeys2(Object(source)).forEach(function(key) {
9253
9315
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
9254
9316
  });
9255
9317
  }
@@ -9385,7 +9447,7 @@ var Vimeo = {};
9385
9447
  (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function(Vimeo4) {
9386
9448
  if (!_this2.container)
9387
9449
  return;
9388
- _this2.player = new Vimeo4.Player(_this2.container, _objectSpread({
9450
+ _this2.player = new Vimeo4.Player(_this2.container, _objectSpread2({
9389
9451
  url,
9390
9452
  autoplay: _this2.props.playing,
9391
9453
  muted: _this2.props.muted,
@@ -9529,7 +9591,7 @@ var Facebook = {};
9529
9591
  function _getRequireWildcardCache() {
9530
9592
  if (typeof WeakMap !== "function")
9531
9593
  return null;
9532
- var cache = new WeakMap();
9594
+ var cache = /* @__PURE__ */ new WeakMap();
9533
9595
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
9534
9596
  return cache;
9535
9597
  };
@@ -9812,7 +9874,7 @@ var Streamable = {};
9812
9874
  function _getRequireWildcardCache() {
9813
9875
  if (typeof WeakMap !== "function")
9814
9876
  return null;
9815
- var cache = new WeakMap();
9877
+ var cache = /* @__PURE__ */ new WeakMap();
9816
9878
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
9817
9879
  return cache;
9818
9880
  };
@@ -10096,7 +10158,7 @@ var Wistia = {};
10096
10158
  function _getRequireWildcardCache() {
10097
10159
  if (typeof WeakMap !== "function")
10098
10160
  return null;
10099
- var cache = new WeakMap();
10161
+ var cache = /* @__PURE__ */ new WeakMap();
10100
10162
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
10101
10163
  return cache;
10102
10164
  };
@@ -10144,29 +10206,29 @@ var Wistia = {};
10144
10206
  }
10145
10207
  return _typeof2(obj);
10146
10208
  }
10147
- function ownKeys(object2, enumerableOnly) {
10148
- var keys = Object.keys(object2);
10209
+ function ownKeys2(object2, enumerableOnly) {
10210
+ var keys2 = Object.keys(object2);
10149
10211
  if (Object.getOwnPropertySymbols) {
10150
10212
  var symbols = Object.getOwnPropertySymbols(object2);
10151
10213
  if (enumerableOnly)
10152
10214
  symbols = symbols.filter(function(sym) {
10153
10215
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
10154
10216
  });
10155
- keys.push.apply(keys, symbols);
10217
+ keys2.push.apply(keys2, symbols);
10156
10218
  }
10157
- return keys;
10219
+ return keys2;
10158
10220
  }
10159
- function _objectSpread(target) {
10221
+ function _objectSpread2(target) {
10160
10222
  for (var i = 1; i < arguments.length; i++) {
10161
10223
  var source = arguments[i] != null ? arguments[i] : {};
10162
10224
  if (i % 2) {
10163
- ownKeys(Object(source), true).forEach(function(key) {
10225
+ ownKeys2(Object(source), true).forEach(function(key) {
10164
10226
  _defineProperty2(target, key, source[key]);
10165
10227
  });
10166
10228
  } else if (Object.getOwnPropertyDescriptors) {
10167
10229
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
10168
10230
  } else {
10169
- ownKeys(Object(source)).forEach(function(key) {
10231
+ ownKeys2(Object(source)).forEach(function(key) {
10170
10232
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
10171
10233
  });
10172
10234
  }
@@ -10315,7 +10377,7 @@ var Wistia = {};
10315
10377
  window._wq = window._wq || [];
10316
10378
  window._wq.push({
10317
10379
  id: _this2.getID(url),
10318
- options: _objectSpread({
10380
+ options: _objectSpread2({
10319
10381
  autoPlay: playing,
10320
10382
  silentAutoPlay: "allow",
10321
10383
  muted,
@@ -10429,7 +10491,7 @@ var Twitch = {};
10429
10491
  function _getRequireWildcardCache() {
10430
10492
  if (typeof WeakMap !== "function")
10431
10493
  return null;
10432
- var cache = new WeakMap();
10494
+ var cache = /* @__PURE__ */ new WeakMap();
10433
10495
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
10434
10496
  return cache;
10435
10497
  };
@@ -10477,29 +10539,29 @@ var Twitch = {};
10477
10539
  }
10478
10540
  return _typeof2(obj);
10479
10541
  }
10480
- function ownKeys(object2, enumerableOnly) {
10481
- var keys = Object.keys(object2);
10542
+ function ownKeys2(object2, enumerableOnly) {
10543
+ var keys2 = Object.keys(object2);
10482
10544
  if (Object.getOwnPropertySymbols) {
10483
10545
  var symbols = Object.getOwnPropertySymbols(object2);
10484
10546
  if (enumerableOnly)
10485
10547
  symbols = symbols.filter(function(sym) {
10486
10548
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
10487
10549
  });
10488
- keys.push.apply(keys, symbols);
10550
+ keys2.push.apply(keys2, symbols);
10489
10551
  }
10490
- return keys;
10552
+ return keys2;
10491
10553
  }
10492
- function _objectSpread(target) {
10554
+ function _objectSpread2(target) {
10493
10555
  for (var i = 1; i < arguments.length; i++) {
10494
10556
  var source = arguments[i] != null ? arguments[i] : {};
10495
10557
  if (i % 2) {
10496
- ownKeys(Object(source), true).forEach(function(key) {
10558
+ ownKeys2(Object(source), true).forEach(function(key) {
10497
10559
  _defineProperty2(target, key, source[key]);
10498
10560
  });
10499
10561
  } else if (Object.getOwnPropertyDescriptors) {
10500
10562
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
10501
10563
  } else {
10502
- ownKeys(Object(source)).forEach(function(key) {
10564
+ ownKeys2(Object(source)).forEach(function(key) {
10503
10565
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
10504
10566
  });
10505
10567
  }
@@ -10637,7 +10699,7 @@ var Twitch = {};
10637
10699
  return;
10638
10700
  }
10639
10701
  (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function(Twitch4) {
10640
- _this2.player = new Twitch4.Player(_this2.playerID, _objectSpread({
10702
+ _this2.player = new Twitch4.Player(_this2.playerID, _objectSpread2({
10641
10703
  video: isChannel ? "" : id2,
10642
10704
  channel: isChannel ? id2 : "",
10643
10705
  height: "100%",
@@ -10735,7 +10797,7 @@ var DailyMotion = {};
10735
10797
  function _getRequireWildcardCache() {
10736
10798
  if (typeof WeakMap !== "function")
10737
10799
  return null;
10738
- var cache = new WeakMap();
10800
+ var cache = /* @__PURE__ */ new WeakMap();
10739
10801
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
10740
10802
  return cache;
10741
10803
  };
@@ -10783,29 +10845,29 @@ var DailyMotion = {};
10783
10845
  }
10784
10846
  return _typeof2(obj);
10785
10847
  }
10786
- function ownKeys(object2, enumerableOnly) {
10787
- var keys = Object.keys(object2);
10848
+ function ownKeys2(object2, enumerableOnly) {
10849
+ var keys2 = Object.keys(object2);
10788
10850
  if (Object.getOwnPropertySymbols) {
10789
10851
  var symbols = Object.getOwnPropertySymbols(object2);
10790
10852
  if (enumerableOnly)
10791
10853
  symbols = symbols.filter(function(sym) {
10792
10854
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
10793
10855
  });
10794
- keys.push.apply(keys, symbols);
10856
+ keys2.push.apply(keys2, symbols);
10795
10857
  }
10796
- return keys;
10858
+ return keys2;
10797
10859
  }
10798
- function _objectSpread(target) {
10860
+ function _objectSpread2(target) {
10799
10861
  for (var i = 1; i < arguments.length; i++) {
10800
10862
  var source = arguments[i] != null ? arguments[i] : {};
10801
10863
  if (i % 2) {
10802
- ownKeys(Object(source), true).forEach(function(key) {
10864
+ ownKeys2(Object(source), true).forEach(function(key) {
10803
10865
  _defineProperty2(target, key, source[key]);
10804
10866
  });
10805
10867
  } else if (Object.getOwnPropertyDescriptors) {
10806
10868
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
10807
10869
  } else {
10808
- ownKeys(Object(source)).forEach(function(key) {
10870
+ ownKeys2(Object(source)).forEach(function(key) {
10809
10871
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
10810
10872
  });
10811
10873
  }
@@ -11013,7 +11075,7 @@ var DailyMotion = {};
11013
11075
  width: "100%",
11014
11076
  height: "100%",
11015
11077
  video: id2,
11016
- params: _objectSpread({
11078
+ params: _objectSpread2({
11017
11079
  controls,
11018
11080
  autoplay: _this2.props.playing,
11019
11081
  mute: _this2.props.muted,
@@ -11118,7 +11180,7 @@ var Mixcloud = {};
11118
11180
  function _getRequireWildcardCache() {
11119
11181
  if (typeof WeakMap !== "function")
11120
11182
  return null;
11121
- var cache = new WeakMap();
11183
+ var cache = /* @__PURE__ */ new WeakMap();
11122
11184
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
11123
11185
  return cache;
11124
11186
  };
@@ -11166,29 +11228,29 @@ var Mixcloud = {};
11166
11228
  }
11167
11229
  return _typeof2(obj);
11168
11230
  }
11169
- function ownKeys(object2, enumerableOnly) {
11170
- var keys = Object.keys(object2);
11231
+ function ownKeys2(object2, enumerableOnly) {
11232
+ var keys2 = Object.keys(object2);
11171
11233
  if (Object.getOwnPropertySymbols) {
11172
11234
  var symbols = Object.getOwnPropertySymbols(object2);
11173
11235
  if (enumerableOnly)
11174
11236
  symbols = symbols.filter(function(sym) {
11175
11237
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
11176
11238
  });
11177
- keys.push.apply(keys, symbols);
11239
+ keys2.push.apply(keys2, symbols);
11178
11240
  }
11179
- return keys;
11241
+ return keys2;
11180
11242
  }
11181
- function _objectSpread(target) {
11243
+ function _objectSpread2(target) {
11182
11244
  for (var i = 1; i < arguments.length; i++) {
11183
11245
  var source = arguments[i] != null ? arguments[i] : {};
11184
11246
  if (i % 2) {
11185
- ownKeys(Object(source), true).forEach(function(key) {
11247
+ ownKeys2(Object(source), true).forEach(function(key) {
11186
11248
  _defineProperty2(target, key, source[key]);
11187
11249
  });
11188
11250
  } else if (Object.getOwnPropertyDescriptors) {
11189
11251
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
11190
11252
  } else {
11191
- ownKeys(Object(source)).forEach(function(key) {
11253
+ ownKeys2(Object(source)).forEach(function(key) {
11192
11254
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
11193
11255
  });
11194
11256
  }
@@ -11377,7 +11439,7 @@ var Mixcloud = {};
11377
11439
  width: "100%",
11378
11440
  height: "100%"
11379
11441
  };
11380
- var query = (0, _utils.queryString)(_objectSpread({}, config.mixcloud.options, {
11442
+ var query = (0, _utils.queryString)(_objectSpread2({}, config.mixcloud.options, {
11381
11443
  feed: "/".concat(id2, "/")
11382
11444
  }));
11383
11445
  return /* @__PURE__ */ _react2["default"].createElement("iframe", {
@@ -11415,7 +11477,7 @@ var FilePlayer = {};
11415
11477
  function _getRequireWildcardCache() {
11416
11478
  if (typeof WeakMap !== "function")
11417
11479
  return null;
11418
- var cache = new WeakMap();
11480
+ var cache = /* @__PURE__ */ new WeakMap();
11419
11481
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
11420
11482
  return cache;
11421
11483
  };
@@ -11735,20 +11797,20 @@ var FilePlayer = {};
11735
11797
  _defineProperty2(_assertThisInitialized2(_this), "unmute", function() {
11736
11798
  _this.player.muted = false;
11737
11799
  });
11738
- _defineProperty2(_assertThisInitialized2(_this), "renderSourceElement", function(source, index) {
11800
+ _defineProperty2(_assertThisInitialized2(_this), "renderSourceElement", function(source, index2) {
11739
11801
  if (typeof source === "string") {
11740
11802
  return /* @__PURE__ */ _react2["default"].createElement("source", {
11741
- key: index,
11803
+ key: index2,
11742
11804
  src: source
11743
11805
  });
11744
11806
  }
11745
11807
  return /* @__PURE__ */ _react2["default"].createElement("source", _extends2({
11746
- key: index
11808
+ key: index2
11747
11809
  }, source));
11748
11810
  });
11749
- _defineProperty2(_assertThisInitialized2(_this), "renderTrack", function(track, index) {
11811
+ _defineProperty2(_assertThisInitialized2(_this), "renderTrack", function(track, index2) {
11750
11812
  return /* @__PURE__ */ _react2["default"].createElement("track", _extends2({
11751
- key: index
11813
+ key: index2
11752
11814
  }, track));
11753
11815
  });
11754
11816
  _defineProperty2(_assertThisInitialized2(_this), "ref", function(player) {
@@ -12033,7 +12095,7 @@ var Preview = {};
12033
12095
  function _getRequireWildcardCache() {
12034
12096
  if (typeof WeakMap !== "function")
12035
12097
  return null;
12036
- var cache = new WeakMap();
12098
+ var cache = /* @__PURE__ */ new WeakMap();
12037
12099
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
12038
12100
  return cache;
12039
12101
  };
@@ -12081,29 +12143,29 @@ var Preview = {};
12081
12143
  }
12082
12144
  return _typeof2(obj);
12083
12145
  }
12084
- function ownKeys(object2, enumerableOnly) {
12085
- var keys = Object.keys(object2);
12146
+ function ownKeys2(object2, enumerableOnly) {
12147
+ var keys2 = Object.keys(object2);
12086
12148
  if (Object.getOwnPropertySymbols) {
12087
12149
  var symbols = Object.getOwnPropertySymbols(object2);
12088
12150
  if (enumerableOnly)
12089
12151
  symbols = symbols.filter(function(sym) {
12090
12152
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
12091
12153
  });
12092
- keys.push.apply(keys, symbols);
12154
+ keys2.push.apply(keys2, symbols);
12093
12155
  }
12094
- return keys;
12156
+ return keys2;
12095
12157
  }
12096
- function _objectSpread(target) {
12158
+ function _objectSpread2(target) {
12097
12159
  for (var i = 1; i < arguments.length; i++) {
12098
12160
  var source = arguments[i] != null ? arguments[i] : {};
12099
12161
  if (i % 2) {
12100
- ownKeys(Object(source), true).forEach(function(key) {
12162
+ ownKeys2(Object(source), true).forEach(function(key) {
12101
12163
  _defineProperty2(target, key, source[key]);
12102
12164
  });
12103
12165
  } else if (Object.getOwnPropertyDescriptors) {
12104
12166
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
12105
12167
  } else {
12106
- ownKeys(Object(source)).forEach(function(key) {
12168
+ ownKeys2(Object(source)).forEach(function(key) {
12107
12169
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12108
12170
  });
12109
12171
  }
@@ -12272,7 +12334,7 @@ var Preview = {};
12272
12334
  justifyContent: "center"
12273
12335
  };
12274
12336
  var styles = {
12275
- preview: _objectSpread({
12337
+ preview: _objectSpread2({
12276
12338
  width: "100%",
12277
12339
  height: "100%",
12278
12340
  backgroundImage: image ? "url(".concat(image, ")") : void 0,
@@ -12280,7 +12342,7 @@ var Preview = {};
12280
12342
  backgroundPosition: "center",
12281
12343
  cursor: "pointer"
12282
12344
  }, flexCenter),
12283
- shadow: _objectSpread({
12345
+ shadow: _objectSpread2({
12284
12346
  background: "radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",
12285
12347
  borderRadius: ICON_SIZE,
12286
12348
  width: ICON_SIZE,
@@ -12514,7 +12576,7 @@ var preload = {};
12514
12576
  function _getRequireWildcardCache() {
12515
12577
  if (typeof WeakMap !== "function")
12516
12578
  return null;
12517
- var cache = new WeakMap();
12579
+ var cache = /* @__PURE__ */ new WeakMap();
12518
12580
  _getRequireWildcardCache = function _getRequireWildcardCache2() {
12519
12581
  return cache;
12520
12582
  };
@@ -12562,29 +12624,29 @@ var preload = {};
12562
12624
  }
12563
12625
  return _typeof2(obj);
12564
12626
  }
12565
- function ownKeys(object2, enumerableOnly) {
12566
- var keys = Object.keys(object2);
12627
+ function ownKeys2(object2, enumerableOnly) {
12628
+ var keys2 = Object.keys(object2);
12567
12629
  if (Object.getOwnPropertySymbols) {
12568
12630
  var symbols = Object.getOwnPropertySymbols(object2);
12569
12631
  if (enumerableOnly)
12570
12632
  symbols = symbols.filter(function(sym) {
12571
12633
  return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
12572
12634
  });
12573
- keys.push.apply(keys, symbols);
12635
+ keys2.push.apply(keys2, symbols);
12574
12636
  }
12575
- return keys;
12637
+ return keys2;
12576
12638
  }
12577
- function _objectSpread(target) {
12639
+ function _objectSpread2(target) {
12578
12640
  for (var i = 1; i < arguments.length; i++) {
12579
12641
  var source = arguments[i] != null ? arguments[i] : {};
12580
12642
  if (i % 2) {
12581
- ownKeys(Object(source), true).forEach(function(key) {
12643
+ ownKeys2(Object(source), true).forEach(function(key) {
12582
12644
  _defineProperty2(target, key, source[key]);
12583
12645
  });
12584
12646
  } else if (Object.getOwnPropertyDescriptors) {
12585
12647
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
12586
12648
  } else {
12587
- ownKeys(Object(source)).forEach(function(key) {
12649
+ ownKeys2(Object(source)).forEach(function(key) {
12588
12650
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12589
12651
  });
12590
12652
  }
@@ -12872,7 +12934,7 @@ var preload = {};
12872
12934
  });
12873
12935
  return /* @__PURE__ */ _react2["default"].createElement(Wrapper2, _extends2({
12874
12936
  ref: this.wrapperRef,
12875
- style: _objectSpread({}, style, {
12937
+ style: _objectSpread2({}, style, {
12876
12938
  width,
12877
12939
  height
12878
12940
  })
@@ -13321,9 +13383,9 @@ var Box = forwardRef(function Box2({
13321
13383
  animate: animate2 == null ? void 0 : animate2.parent,
13322
13384
  initial: initial2 == null ? void 0 : initial2.parent,
13323
13385
  transition: transition == null ? void 0 : transition.parent,
13324
- children: children && children.elements.length > 0 ? children.elements.map((child, index) => /* @__PURE__ */ jsx(GridItem$1, {
13386
+ children: children && children.elements.length > 0 ? children.elements.map((child, index2) => /* @__PURE__ */ jsx(GridItem$1, {
13325
13387
  grid: children.columns,
13326
- index,
13388
+ index: index2,
13327
13389
  columnGap,
13328
13390
  rowGap,
13329
13391
  alignItems: verticalAlign,
@@ -13497,14 +13559,14 @@ var isArrayish$1 = function isArrayish(obj) {
13497
13559
  return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
13498
13560
  };
13499
13561
  var isArrayish2 = isArrayish$1;
13500
- var concat = Array.prototype.concat;
13562
+ var concat$1 = Array.prototype.concat;
13501
13563
  var slice = Array.prototype.slice;
13502
13564
  var swizzle$1 = simpleSwizzle.exports = function swizzle(args) {
13503
13565
  var results = [];
13504
13566
  for (var i = 0, len = args.length; i < len; i++) {
13505
13567
  var arg = args[i];
13506
13568
  if (isArrayish2(arg)) {
13507
- results = concat.call(results, slice.call(arg));
13569
+ results = concat$1.call(results, slice.call(arg));
13508
13570
  } else {
13509
13571
  results.push(arg);
13510
13572
  }
@@ -13520,9 +13582,9 @@ var colorNames = colorName$1;
13520
13582
  var swizzle2 = simpleSwizzle.exports;
13521
13583
  var hasOwnProperty = Object.hasOwnProperty;
13522
13584
  var reverseNames = {};
13523
- for (var name in colorNames) {
13524
- if (hasOwnProperty.call(colorNames, name)) {
13525
- reverseNames[colorNames[name]] = name;
13585
+ for (var name$1 in colorNames) {
13586
+ if (hasOwnProperty.call(colorNames, name$1)) {
13587
+ reverseNames[colorNames[name$1]] = name$1;
13526
13588
  }
13527
13589
  }
13528
13590
  var cs = colorString$1.exports = {
@@ -14722,12 +14784,12 @@ function Color(obj, model) {
14722
14784
  this.valpha = 1;
14723
14785
  } else {
14724
14786
  this.valpha = 1;
14725
- var keys = Object.keys(obj);
14787
+ var keys2 = Object.keys(obj);
14726
14788
  if ("alpha" in obj) {
14727
- keys.splice(keys.indexOf("alpha"), 1);
14789
+ keys2.splice(keys2.indexOf("alpha"), 1);
14728
14790
  this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0;
14729
14791
  }
14730
- var hashedKeys = keys.sort().join("");
14792
+ var hashedKeys = keys2.sort().join("");
14731
14793
  if (!(hashedKeys in hashedModelKeys)) {
14732
14794
  throw new Error("Unable to parse color from object: " + JSON.stringify(obj));
14733
14795
  }
@@ -15582,20 +15644,20 @@ function _assertThisInitialized(self) {
15582
15644
  }
15583
15645
  return self;
15584
15646
  }
15585
- function _unsupportedIterableToArray(o, minLen) {
15647
+ function _unsupportedIterableToArray$1(o, minLen) {
15586
15648
  if (!o)
15587
15649
  return;
15588
15650
  if (typeof o === "string")
15589
- return _arrayLikeToArray(o, minLen);
15651
+ return _arrayLikeToArray$1(o, minLen);
15590
15652
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
15591
15653
  if (n2 === "Object" && o.constructor)
15592
15654
  n2 = o.constructor.name;
15593
15655
  if (n2 === "Map" || n2 === "Set")
15594
15656
  return Array.from(o);
15595
15657
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
15596
- return _arrayLikeToArray(o, minLen);
15658
+ return _arrayLikeToArray$1(o, minLen);
15597
15659
  }
15598
- function _arrayLikeToArray(arr, len) {
15660
+ function _arrayLikeToArray$1(arr, len) {
15599
15661
  if (len == null || len > arr.length)
15600
15662
  len = arr.length;
15601
15663
  for (var i = 0, arr2 = new Array(len); i < len; i++)
@@ -15605,7 +15667,7 @@ function _arrayLikeToArray(arr, len) {
15605
15667
  function _createForOfIteratorHelperLoose(o, allowArrayLike) {
15606
15668
  var it;
15607
15669
  if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
15608
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
15670
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
15609
15671
  if (it)
15610
15672
  o = it;
15611
15673
  var i = 0;
@@ -15853,7 +15915,7 @@ var InternalCoordinatesOptionsNormalizers = /* @__PURE__ */ _extends$s({}, Inter
15853
15915
  return [[left, right], [top, bottom]];
15854
15916
  }
15855
15917
  });
15856
- var isBrowser = typeof window !== "undefined" && window.document && window.document.createElement;
15918
+ var isBrowser$1 = typeof window !== "undefined" && window.document && window.document.createElement;
15857
15919
  var InternalGenericOptionsNormalizers = {
15858
15920
  enabled: function enabled2(value) {
15859
15921
  if (value === void 0) {
@@ -15872,7 +15934,7 @@ var InternalGenericOptionsNormalizers = {
15872
15934
  return window2;
15873
15935
  }(function(value) {
15874
15936
  if (value === void 0) {
15875
- value = isBrowser ? window : void 0;
15937
+ value = isBrowser$1 ? window : void 0;
15876
15938
  }
15877
15939
  return value;
15878
15940
  }),
@@ -15995,7 +16057,7 @@ function buildComplexConfig(config, actions) {
15995
16057
  config = {};
15996
16058
  }
15997
16059
  if (actions === void 0) {
15998
- actions = new Set();
16060
+ actions = /* @__PURE__ */ new Set();
15999
16061
  }
16000
16062
  var _config = config, drag2 = _config.drag, wheel = _config.wheel, move = _config.move, scroll = _config.scroll, pinch = _config.pinch, hover = _config.hover, eventOptions2 = _config.eventOptions, window2 = _config.window, transform = _config.transform, domTarget = _config.domTarget, enabled3 = _config.enabled;
16001
16063
  var mergedConfig = getInternalGenericOptions({
@@ -16307,8 +16369,8 @@ function getStartGestureState(_ref4, values, event, initial2) {
16307
16369
  var Controller = function Controller2(classes) {
16308
16370
  var _this = this;
16309
16371
  this.classes = classes;
16310
- this.pointerIds = new Set();
16311
- this.touchIds = new Set();
16372
+ this.pointerIds = /* @__PURE__ */ new Set();
16373
+ this.touchIds = /* @__PURE__ */ new Set();
16312
16374
  this.supportsTouchEvents = supportsTouchEvents();
16313
16375
  this.supportsGestureEvents = supportsGestureEvents();
16314
16376
  this.bind = function() {
@@ -16489,7 +16551,7 @@ function useRecognizers(handlers, config, nativeHandlers) {
16489
16551
  function deprecationNoticeForDomTarget() {
16490
16552
  }
16491
16553
  function resolveClasses(internalHandlers) {
16492
- var classes = new Set();
16554
+ var classes = /* @__PURE__ */ new Set();
16493
16555
  if (internalHandlers.drag)
16494
16556
  classes.add(RecognizersMap.get("drag"));
16495
16557
  if (internalHandlers.wheel)
@@ -17187,7 +17249,7 @@ var RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;
17187
17249
  function sortHandlers(handlers) {
17188
17250
  var _native = {};
17189
17251
  var handle = {};
17190
- var actions = new Set();
17252
+ var actions = /* @__PURE__ */ new Set();
17191
17253
  for (var key in handlers) {
17192
17254
  if (RE_NOT_NATIVE.test(key)) {
17193
17255
  actions.add(RegExp.lastMatch);
@@ -17746,9 +17808,9 @@ var Carousel = forwardRef(function Carousel2({
17746
17808
  slideBorder,
17747
17809
  slideBorderRadius
17748
17810
  }, ref) {
17749
- const [index, setIndex] = useState(0);
17811
+ const [index2, setIndex] = useState(0);
17750
17812
  const swipe = useRef(0);
17751
- const startIndex = wrap$1(0, images.length, index);
17813
+ const startIndex = wrap$1(0, images.length, index2);
17752
17814
  const pageSize = useMediaQuery(responsivePageSize) || 1;
17753
17815
  const step = useMediaQuery(responsiveStep) || 1;
17754
17816
  const endIndex = startIndex + pageSize;
@@ -17762,8 +17824,8 @@ var Carousel = forwardRef(function Carousel2({
17762
17824
  const direction = pageDistance / Math.abs(pageDistance);
17763
17825
  const remaining = direction > 0 ? images.slice(endIndex) : images.slice(0, startIndex);
17764
17826
  const distance2 = direction * Math.min(remaining.length, step * Math.abs(pageDistance));
17765
- setIndex(index + distance2);
17766
- }, [images, index, startIndex, endIndex, step]);
17827
+ setIndex(index2 + distance2);
17828
+ }, [images, index2, startIndex, endIndex, step]);
17767
17829
  const animation = useAnimation();
17768
17830
  const bindPage = useGesture({
17769
17831
  onDrag: ({
@@ -17897,7 +17959,7 @@ var Carousel = forwardRef(function Carousel2({
17897
17959
  })]
17898
17960
  });
17899
17961
  });
17900
- const Block = styled.div`
17962
+ const Block$1 = styled.div`
17901
17963
  display: block;
17902
17964
  padding: 0.5em;
17903
17965
  font-size: 1em;
@@ -17956,7 +18018,7 @@ const Container$5 = styled.div`
17956
18018
  `)}
17957
18019
  }
17958
18020
 
17959
- ${Block} {
18021
+ ${Block$1} {
17960
18022
  ${(p) => cssMediaRules([p.shape], ([shape2 = "rounded"]) => {
17961
18023
  switch (shape2) {
17962
18024
  case "pill":
@@ -18164,7 +18226,7 @@ var Countdown = forwardRef(function Countdown2({
18164
18226
  blockColor: useColor(blockColor),
18165
18227
  gap,
18166
18228
  children: [/* @__PURE__ */ jsxs(Segment, {
18167
- children: [/* @__PURE__ */ jsx(Block, {
18229
+ children: [/* @__PURE__ */ jsx(Block$1, {
18168
18230
  children: /* @__PURE__ */ jsx("span", {
18169
18231
  children: days
18170
18232
  })
@@ -18172,7 +18234,7 @@ var Countdown = forwardRef(function Countdown2({
18172
18234
  children: daysLabel == null ? "Days" : daysLabel
18173
18235
  })]
18174
18236
  }), /* @__PURE__ */ jsxs(Segment, {
18175
- children: [/* @__PURE__ */ jsx(Block, {
18237
+ children: [/* @__PURE__ */ jsx(Block$1, {
18176
18238
  children: /* @__PURE__ */ jsx("span", {
18177
18239
  children: hours
18178
18240
  })
@@ -18180,7 +18242,7 @@ var Countdown = forwardRef(function Countdown2({
18180
18242
  children: hoursLabel == null ? "Hours" : hoursLabel
18181
18243
  })]
18182
18244
  }), /* @__PURE__ */ jsxs(Segment, {
18183
- children: [/* @__PURE__ */ jsx(Block, {
18245
+ children: [/* @__PURE__ */ jsx(Block$1, {
18184
18246
  children: /* @__PURE__ */ jsx("span", {
18185
18247
  children: minutes
18186
18248
  })
@@ -18188,7 +18250,7 @@ var Countdown = forwardRef(function Countdown2({
18188
18250
  children: minutesLabel == null ? "Minutes" : minutesLabel
18189
18251
  })]
18190
18252
  }), /* @__PURE__ */ jsxs(Segment, {
18191
- children: [/* @__PURE__ */ jsx(Block, {
18253
+ children: [/* @__PURE__ */ jsx(Block$1, {
18192
18254
  children: /* @__PURE__ */ jsx("span", {
18193
18255
  children: seconds
18194
18256
  })
@@ -18686,7 +18748,7 @@ const DropDownMenu = styled.div`
18686
18748
  const ButtonLink$1 = styled(Button)`
18687
18749
  margin: 8px 0;
18688
18750
  `;
18689
- const StyledLink$1 = styled(Link)`
18751
+ const StyledLink$2 = styled(Link)`
18690
18752
  text-decoration: none;
18691
18753
  line-height: 1.4;
18692
18754
  padding: 8px 16px;
@@ -18702,7 +18764,7 @@ function DropDownItem(_s) {
18702
18764
  } = _t, restOfProps = __objRest(_t, [
18703
18765
  "color"
18704
18766
  ]);
18705
- return /* @__PURE__ */ jsx(StyledLink$1, __spreadProps(__spreadValues({}, restOfProps), {
18767
+ return /* @__PURE__ */ jsx(StyledLink$2, __spreadProps(__spreadValues({}, restOfProps), {
18706
18768
  color: useColor(color2)
18707
18769
  }));
18708
18770
  }
@@ -19113,9 +19175,9 @@ var Root = forwardRef(function Page2({
19113
19175
  },
19114
19176
  backgrounds,
19115
19177
  children: /* @__PURE__ */ jsx(Grid, {
19116
- children: children && children.elements.length > 0 ? children.elements.map((child, index) => /* @__PURE__ */ jsx(GridItem, {
19178
+ children: children && children.elements.length > 0 ? children.elements.map((child, index2) => /* @__PURE__ */ jsx(GridItem, {
19117
19179
  grid: children.columns,
19118
- index,
19180
+ index: index2,
19119
19181
  columnGap,
19120
19182
  rowGap,
19121
19183
  children: /* @__PURE__ */ jsx(Element$1, {
@@ -19800,7 +19862,7 @@ const Container = styled.div`
19800
19862
  justify-content: ${alignment};
19801
19863
  `)}
19802
19864
  `;
19803
- const StyledLink = styled(Link)`
19865
+ const StyledLink$1 = styled(Link)`
19804
19866
  display: block;
19805
19867
  color: ${(props2) => props2.brandColor};
19806
19868
  transition: transform, opacity 0.18s;
@@ -19888,7 +19950,7 @@ var SocialLinks = forwardRef(function SocialLinks2({
19888
19950
  gutter,
19889
19951
  first: i === 0,
19890
19952
  last: i === links2.length - 1,
19891
- children: /* @__PURE__ */ jsx(StyledLink, {
19953
+ children: /* @__PURE__ */ jsx(StyledLink$1, {
19892
19954
  backgroundColor: backgroundColorData,
19893
19955
  brandColor: option.brandColor,
19894
19956
  fill: fillData,
@@ -19910,5 +19972,1612 @@ var SocialLinks = forwardRef(function SocialLinks2({
19910
19972
  })
19911
19973
  });
19912
19974
  });
19913
- export { Box, Button, Carousel, Countdown, DEFAULT_BOX_ANIMATE_DELAY, DEFAULT_BOX_ANIMATE_DURATION, DEFAULT_BOX_ANIMATE_TYPE, DEFAULT_ITEM_ANIMATE_DELAY, DEFAULT_ITEM_ANIMATE_DURATION, DEFAULT_ITEM_ANIMATE_TYPE, DEFAULT_ITEM_STAGGER_DURATION, Divider, Embed, Image$1 as Image, Navigation, Root, SocialLinks };
19975
+ var lib$1 = {};
19976
+ Object.defineProperty(lib$1, "__esModule", {
19977
+ value: true
19978
+ });
19979
+ var IS_MAC$1 = typeof window != "undefined" && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
19980
+ var MODIFIERS = {
19981
+ alt: "altKey",
19982
+ control: "ctrlKey",
19983
+ meta: "metaKey",
19984
+ shift: "shiftKey"
19985
+ };
19986
+ var ALIASES = {
19987
+ add: "+",
19988
+ break: "pause",
19989
+ cmd: "meta",
19990
+ command: "meta",
19991
+ ctl: "control",
19992
+ ctrl: "control",
19993
+ del: "delete",
19994
+ down: "arrowdown",
19995
+ esc: "escape",
19996
+ ins: "insert",
19997
+ left: "arrowleft",
19998
+ mod: IS_MAC$1 ? "meta" : "control",
19999
+ opt: "alt",
20000
+ option: "alt",
20001
+ return: "enter",
20002
+ right: "arrowright",
20003
+ space: " ",
20004
+ spacebar: " ",
20005
+ up: "arrowup",
20006
+ win: "meta",
20007
+ windows: "meta"
20008
+ };
20009
+ var CODES = {
20010
+ backspace: 8,
20011
+ tab: 9,
20012
+ enter: 13,
20013
+ shift: 16,
20014
+ control: 17,
20015
+ alt: 18,
20016
+ pause: 19,
20017
+ capslock: 20,
20018
+ escape: 27,
20019
+ " ": 32,
20020
+ pageup: 33,
20021
+ pagedown: 34,
20022
+ end: 35,
20023
+ home: 36,
20024
+ arrowleft: 37,
20025
+ arrowup: 38,
20026
+ arrowright: 39,
20027
+ arrowdown: 40,
20028
+ insert: 45,
20029
+ delete: 46,
20030
+ meta: 91,
20031
+ numlock: 144,
20032
+ scrolllock: 145,
20033
+ ";": 186,
20034
+ "=": 187,
20035
+ ",": 188,
20036
+ "-": 189,
20037
+ ".": 190,
20038
+ "/": 191,
20039
+ "`": 192,
20040
+ "[": 219,
20041
+ "\\": 220,
20042
+ "]": 221,
20043
+ "'": 222
20044
+ };
20045
+ for (var f = 1; f < 20; f++) {
20046
+ CODES["f" + f] = 111 + f;
20047
+ }
20048
+ function isHotkey$1(hotkey, options, event) {
20049
+ if (options && !("byKey" in options)) {
20050
+ event = options;
20051
+ options = null;
20052
+ }
20053
+ if (!Array.isArray(hotkey)) {
20054
+ hotkey = [hotkey];
20055
+ }
20056
+ var array2 = hotkey.map(function(string2) {
20057
+ return parseHotkey(string2, options);
20058
+ });
20059
+ var check = function check2(e2) {
20060
+ return array2.some(function(object2) {
20061
+ return compareHotkey(object2, e2);
20062
+ });
20063
+ };
20064
+ var ret = event == null ? check : check(event);
20065
+ return ret;
20066
+ }
20067
+ function isCodeHotkey(hotkey, event) {
20068
+ return isHotkey$1(hotkey, event);
20069
+ }
20070
+ function isKeyHotkey(hotkey, event) {
20071
+ return isHotkey$1(hotkey, { byKey: true }, event);
20072
+ }
20073
+ function parseHotkey(hotkey, options) {
20074
+ var byKey = options && options.byKey;
20075
+ var ret = {};
20076
+ hotkey = hotkey.replace("++", "+add");
20077
+ var values = hotkey.split("+");
20078
+ var length = values.length;
20079
+ for (var k in MODIFIERS) {
20080
+ ret[MODIFIERS[k]] = false;
20081
+ }
20082
+ var _iteratorNormalCompletion = true;
20083
+ var _didIteratorError = false;
20084
+ var _iteratorError = void 0;
20085
+ try {
20086
+ for (var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
20087
+ var value = _step.value;
20088
+ var optional = value.endsWith("?");
20089
+ if (optional) {
20090
+ value = value.slice(0, -1);
20091
+ }
20092
+ var name = toKeyName(value);
20093
+ var modifier = MODIFIERS[name];
20094
+ if (length === 1 || !modifier) {
20095
+ if (byKey) {
20096
+ ret.key = name;
20097
+ } else {
20098
+ ret.which = toKeyCode(value);
20099
+ }
20100
+ }
20101
+ if (modifier) {
20102
+ ret[modifier] = optional ? null : true;
20103
+ }
20104
+ }
20105
+ } catch (err) {
20106
+ _didIteratorError = true;
20107
+ _iteratorError = err;
20108
+ } finally {
20109
+ try {
20110
+ if (!_iteratorNormalCompletion && _iterator.return) {
20111
+ _iterator.return();
20112
+ }
20113
+ } finally {
20114
+ if (_didIteratorError) {
20115
+ throw _iteratorError;
20116
+ }
20117
+ }
20118
+ }
20119
+ return ret;
20120
+ }
20121
+ function compareHotkey(object2, event) {
20122
+ for (var key in object2) {
20123
+ var expected = object2[key];
20124
+ var actual = void 0;
20125
+ if (expected == null) {
20126
+ continue;
20127
+ }
20128
+ if (key === "key") {
20129
+ actual = event.key.toLowerCase();
20130
+ } else if (key === "which") {
20131
+ actual = expected === 91 && event.which === 93 ? 91 : event.which;
20132
+ } else {
20133
+ actual = event[key];
20134
+ }
20135
+ if (actual == null && expected === false) {
20136
+ continue;
20137
+ }
20138
+ if (actual !== expected) {
20139
+ return false;
20140
+ }
20141
+ }
20142
+ return true;
20143
+ }
20144
+ function toKeyCode(name) {
20145
+ name = toKeyName(name);
20146
+ var code = CODES[name] || name.toUpperCase().charCodeAt(0);
20147
+ return code;
20148
+ }
20149
+ function toKeyName(name) {
20150
+ name = name.toLowerCase();
20151
+ name = ALIASES[name] || name;
20152
+ return name;
20153
+ }
20154
+ lib$1.default = isHotkey$1;
20155
+ lib$1.isHotkey = isHotkey$1;
20156
+ lib$1.isCodeHotkey = isCodeHotkey;
20157
+ var isKeyHotkey_1 = lib$1.isKeyHotkey = isKeyHotkey;
20158
+ lib$1.parseHotkey = parseHotkey;
20159
+ lib$1.compareHotkey = compareHotkey;
20160
+ lib$1.toKeyCode = toKeyCode;
20161
+ lib$1.toKeyName = toKeyName;
20162
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
20163
+ return typeof obj;
20164
+ } : function(obj) {
20165
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
20166
+ };
20167
+ var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === "object" && document.nodeType === 9;
20168
+ var slicedToArray$1 = function() {
20169
+ function sliceIterator(arr, i) {
20170
+ var _arr = [];
20171
+ var _n = true;
20172
+ var _d = false;
20173
+ var _e = void 0;
20174
+ try {
20175
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
20176
+ _arr.push(_s.value);
20177
+ if (i && _arr.length === i)
20178
+ break;
20179
+ }
20180
+ } catch (err) {
20181
+ _d = true;
20182
+ _e = err;
20183
+ } finally {
20184
+ try {
20185
+ if (!_n && _i["return"])
20186
+ _i["return"]();
20187
+ } finally {
20188
+ if (_d)
20189
+ throw _e;
20190
+ }
20191
+ }
20192
+ return _arr;
20193
+ }
20194
+ return function(arr, i) {
20195
+ if (Array.isArray(arr)) {
20196
+ return arr;
20197
+ } else if (Symbol.iterator in Object(arr)) {
20198
+ return sliceIterator(arr, i);
20199
+ } else {
20200
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
20201
+ }
20202
+ };
20203
+ }();
20204
+ var BROWSER_RULES = [["edge", /Edge\/([0-9\._]+)/], ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], ["opera", /OPR\/([0-9\.]+)(:?\s|$)$/], ["ie", /Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/], ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ["ie", /MSIE\s(7\.0)/], ["android", /Android\s([0-9\.]+)/], ["safari", /Version\/([0-9\._]+).*Safari/]];
20205
+ var browser = void 0;
20206
+ if (isBrowser) {
20207
+ var _iteratorNormalCompletion = true;
20208
+ var _didIteratorError = false;
20209
+ var _iteratorError = void 0;
20210
+ try {
20211
+ for (var _iterator = BROWSER_RULES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
20212
+ var _ref = _step.value;
20213
+ var _ref2 = slicedToArray$1(_ref, 2);
20214
+ var name = _ref2[0];
20215
+ var regexp = _ref2[1];
20216
+ if (regexp.test(window.navigator.userAgent)) {
20217
+ browser = name;
20218
+ break;
20219
+ }
20220
+ }
20221
+ } catch (err) {
20222
+ _didIteratorError = true;
20223
+ _iteratorError = err;
20224
+ } finally {
20225
+ try {
20226
+ if (!_iteratorNormalCompletion && _iterator.return) {
20227
+ _iterator.return();
20228
+ }
20229
+ } finally {
20230
+ if (_didIteratorError) {
20231
+ throw _iteratorError;
20232
+ }
20233
+ }
20234
+ }
20235
+ }
20236
+ var OS_RULES = [
20237
+ ["ios", /os ([\.\_\d]+) like mac os/i],
20238
+ ["macos", /mac os x/i],
20239
+ ["android", /android/i],
20240
+ ["firefoxos", /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i],
20241
+ ["windows", /windows\s*(?:nt)?\s*([\.\_\d]+)/i]
20242
+ ];
20243
+ var os = void 0;
20244
+ if (isBrowser) {
20245
+ var _iteratorNormalCompletion2 = true;
20246
+ var _didIteratorError2 = false;
20247
+ var _iteratorError2 = void 0;
20248
+ try {
20249
+ for (var _iterator2 = OS_RULES[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
20250
+ var _ref3 = _step2.value;
20251
+ var _ref4 = slicedToArray$1(_ref3, 2);
20252
+ var _name = _ref4[0];
20253
+ var _regexp = _ref4[1];
20254
+ if (_regexp.test(window.navigator.userAgent)) {
20255
+ os = _name;
20256
+ break;
20257
+ }
20258
+ }
20259
+ } catch (err) {
20260
+ _didIteratorError2 = true;
20261
+ _iteratorError2 = err;
20262
+ } finally {
20263
+ try {
20264
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
20265
+ _iterator2.return();
20266
+ }
20267
+ } finally {
20268
+ if (_didIteratorError2) {
20269
+ throw _iteratorError2;
20270
+ }
20271
+ }
20272
+ }
20273
+ }
20274
+ var FEATURE_RULES = [["inputeventslevel1", function(window2) {
20275
+ var event = window2.InputEvent ? new window2.InputEvent("input") : {};
20276
+ var support = "inputType" in event;
20277
+ return support;
20278
+ }], ["inputeventslevel2", function(window2) {
20279
+ var element = window2.document.createElement("div");
20280
+ element.contentEditable = true;
20281
+ var support = "onbeforeinput" in element;
20282
+ return support;
20283
+ }]];
20284
+ var features = [];
20285
+ if (isBrowser) {
20286
+ var _iteratorNormalCompletion3 = true;
20287
+ var _didIteratorError3 = false;
20288
+ var _iteratorError3 = void 0;
20289
+ try {
20290
+ for (var _iterator3 = FEATURE_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
20291
+ var _ref5 = _step3.value;
20292
+ var _ref6 = slicedToArray$1(_ref5, 2);
20293
+ var _name2 = _ref6[0];
20294
+ var test = _ref6[1];
20295
+ if (test(window)) {
20296
+ features.push(_name2);
20297
+ }
20298
+ }
20299
+ } catch (err) {
20300
+ _didIteratorError3 = true;
20301
+ _iteratorError3 = err;
20302
+ } finally {
20303
+ try {
20304
+ if (!_iteratorNormalCompletion3 && _iterator3.return) {
20305
+ _iterator3.return();
20306
+ }
20307
+ } finally {
20308
+ if (_didIteratorError3) {
20309
+ throw _iteratorError3;
20310
+ }
20311
+ }
20312
+ }
20313
+ }
20314
+ var ANDROID_API_VERSIONS = [[/^9([.]0|)/, 28], [/^8[.]1/, 27], [/^8([.]0|)/, 26], [/^7[.]1/, 25], [/^7([.]0|)/, 24], [/^6([.]0|)/, 23], [/^5[.]1/, 22], [/^5([.]0|)/, 21], [/^4[.]4/, 20]];
20315
+ function getAndroidApiVersion() {
20316
+ if (os !== "android")
20317
+ return null;
20318
+ var userAgent = window.navigator.userAgent;
20319
+ var matchData = userAgent.match(/Android\s([0-9\.]+)/);
20320
+ if (matchData == null)
20321
+ return null;
20322
+ var versionString = matchData[1];
20323
+ var _iteratorNormalCompletion4 = true;
20324
+ var _didIteratorError4 = false;
20325
+ var _iteratorError4 = void 0;
20326
+ try {
20327
+ for (var _iterator4 = ANDROID_API_VERSIONS[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
20328
+ var _ref7 = _step4.value;
20329
+ var _ref8 = slicedToArray$1(_ref7, 2);
20330
+ var regex = _ref8[0];
20331
+ var version = _ref8[1];
20332
+ if (versionString.match(regex))
20333
+ return version;
20334
+ }
20335
+ } catch (err) {
20336
+ _didIteratorError4 = true;
20337
+ _iteratorError4 = err;
20338
+ } finally {
20339
+ try {
20340
+ if (!_iteratorNormalCompletion4 && _iterator4.return) {
20341
+ _iterator4.return();
20342
+ }
20343
+ } finally {
20344
+ if (_didIteratorError4) {
20345
+ throw _iteratorError4;
20346
+ }
20347
+ }
20348
+ }
20349
+ return null;
20350
+ }
20351
+ var IS_IOS = os === "ios";
20352
+ var IS_MAC = os === "macos";
20353
+ getAndroidApiVersion();
20354
+ var HOTKEYS = {
20355
+ bold: "mod+b",
20356
+ compose: ["down", "left", "right", "up", "backspace", "enter"],
20357
+ moveBackward: "left",
20358
+ moveForward: "right",
20359
+ moveWordBackward: "ctrl+left",
20360
+ moveWordForward: "ctrl+right",
20361
+ deleteBackward: "shift?+backspace",
20362
+ deleteForward: "shift?+delete",
20363
+ extendBackward: "shift+left",
20364
+ extendForward: "shift+right",
20365
+ italic: "mod+i",
20366
+ splitBlock: "shift?+enter",
20367
+ undo: "mod+z"
20368
+ };
20369
+ var APPLE_HOTKEYS = {
20370
+ moveLineBackward: "opt+up",
20371
+ moveLineForward: "opt+down",
20372
+ moveWordBackward: "opt+left",
20373
+ moveWordForward: "opt+right",
20374
+ deleteBackward: ["ctrl+backspace", "ctrl+h"],
20375
+ deleteForward: ["ctrl+delete", "ctrl+d"],
20376
+ deleteLineBackward: "cmd+shift?+backspace",
20377
+ deleteLineForward: ["cmd+shift?+delete", "ctrl+k"],
20378
+ deleteWordBackward: "opt+shift?+backspace",
20379
+ deleteWordForward: "opt+shift?+delete",
20380
+ extendLineBackward: "opt+shift+up",
20381
+ extendLineForward: "opt+shift+down",
20382
+ redo: "cmd+shift+z",
20383
+ transposeCharacter: "ctrl+t"
20384
+ };
20385
+ var WINDOWS_HOTKEYS = {
20386
+ deleteWordBackward: "ctrl+shift?+backspace",
20387
+ deleteWordForward: "ctrl+shift?+delete",
20388
+ redo: "ctrl+y"
20389
+ };
20390
+ var Hotkeys = {};
20391
+ var IS_APPLE = IS_IOS || IS_MAC;
20392
+ var IS_WINDOWS = !IS_APPLE;
20393
+ var KEYS = [].concat(Object.keys(HOTKEYS)).concat(Object.keys(APPLE_HOTKEYS)).concat(Object.keys(WINDOWS_HOTKEYS));
20394
+ KEYS.forEach(function(key) {
20395
+ var method = "is" + key[0].toUpperCase() + key.slice(1);
20396
+ if (Hotkeys[method])
20397
+ return;
20398
+ var generic = HOTKEYS[key];
20399
+ var apple = APPLE_HOTKEYS[key];
20400
+ var windows = WINDOWS_HOTKEYS[key];
20401
+ var isGeneric = generic && isKeyHotkey_1(generic);
20402
+ var isApple = apple && isKeyHotkey_1(apple);
20403
+ var isWindows = windows && isKeyHotkey_1(windows);
20404
+ Hotkeys[method] = function(event) {
20405
+ if (isGeneric && isGeneric(event))
20406
+ return true;
20407
+ if (IS_APPLE && isApple && isApple(event))
20408
+ return true;
20409
+ if (IS_WINDOWS && isWindows && isWindows(event))
20410
+ return true;
20411
+ return false;
20412
+ };
20413
+ });
20414
+ function _defineProperty(obj, key, value) {
20415
+ if (key in obj) {
20416
+ Object.defineProperty(obj, key, {
20417
+ value,
20418
+ enumerable: true,
20419
+ configurable: true,
20420
+ writable: true
20421
+ });
20422
+ } else {
20423
+ obj[key] = value;
20424
+ }
20425
+ return obj;
20426
+ }
20427
+ var defineProperty = _defineProperty;
20428
+ function _defineProperty$1(obj, key, value) {
20429
+ if (key in obj) {
20430
+ Object.defineProperty(obj, key, {
20431
+ value,
20432
+ enumerable: true,
20433
+ configurable: true,
20434
+ writable: true
20435
+ });
20436
+ } else {
20437
+ obj[key] = value;
20438
+ }
20439
+ return obj;
20440
+ }
20441
+ function _objectSpread(target) {
20442
+ for (var i = 1; i < arguments.length; i++) {
20443
+ var source = arguments[i] != null ? arguments[i] : {};
20444
+ var ownKeys2 = Object.keys(source);
20445
+ if (typeof Object.getOwnPropertySymbols === "function") {
20446
+ ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20447
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
20448
+ }));
20449
+ }
20450
+ ownKeys2.forEach(function(key) {
20451
+ _defineProperty$1(target, key, source[key]);
20452
+ });
20453
+ }
20454
+ return target;
20455
+ }
20456
+ function unwrapExports(x) {
20457
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
20458
+ }
20459
+ function createCommonjsModule(fn, module) {
20460
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
20461
+ }
20462
+ var lib = createCommonjsModule(function(module, exports) {
20463
+ Object.defineProperty(exports, "__esModule", {
20464
+ value: true
20465
+ });
20466
+ var IS_MAC2 = typeof window != "undefined" && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
20467
+ var MODIFIERS2 = {
20468
+ alt: "altKey",
20469
+ control: "ctrlKey",
20470
+ meta: "metaKey",
20471
+ shift: "shiftKey"
20472
+ };
20473
+ var ALIASES2 = {
20474
+ add: "+",
20475
+ break: "pause",
20476
+ cmd: "meta",
20477
+ command: "meta",
20478
+ ctl: "control",
20479
+ ctrl: "control",
20480
+ del: "delete",
20481
+ down: "arrowdown",
20482
+ esc: "escape",
20483
+ ins: "insert",
20484
+ left: "arrowleft",
20485
+ mod: IS_MAC2 ? "meta" : "control",
20486
+ opt: "alt",
20487
+ option: "alt",
20488
+ return: "enter",
20489
+ right: "arrowright",
20490
+ space: " ",
20491
+ spacebar: " ",
20492
+ up: "arrowup",
20493
+ win: "meta",
20494
+ windows: "meta"
20495
+ };
20496
+ var CODES2 = {
20497
+ backspace: 8,
20498
+ tab: 9,
20499
+ enter: 13,
20500
+ shift: 16,
20501
+ control: 17,
20502
+ alt: 18,
20503
+ pause: 19,
20504
+ capslock: 20,
20505
+ escape: 27,
20506
+ " ": 32,
20507
+ pageup: 33,
20508
+ pagedown: 34,
20509
+ end: 35,
20510
+ home: 36,
20511
+ arrowleft: 37,
20512
+ arrowup: 38,
20513
+ arrowright: 39,
20514
+ arrowdown: 40,
20515
+ insert: 45,
20516
+ delete: 46,
20517
+ meta: 91,
20518
+ numlock: 144,
20519
+ scrolllock: 145,
20520
+ ";": 186,
20521
+ "=": 187,
20522
+ ",": 188,
20523
+ "-": 189,
20524
+ ".": 190,
20525
+ "/": 191,
20526
+ "`": 192,
20527
+ "[": 219,
20528
+ "\\": 220,
20529
+ "]": 221,
20530
+ "'": 222
20531
+ };
20532
+ for (var f = 1; f < 20; f++) {
20533
+ CODES2["f" + f] = 111 + f;
20534
+ }
20535
+ function isHotkey2(hotkey, options, event) {
20536
+ if (options && !("byKey" in options)) {
20537
+ event = options;
20538
+ options = null;
20539
+ }
20540
+ if (!Array.isArray(hotkey)) {
20541
+ hotkey = [hotkey];
20542
+ }
20543
+ var array2 = hotkey.map(function(string2) {
20544
+ return parseHotkey2(string2, options);
20545
+ });
20546
+ var check = function check2(e2) {
20547
+ return array2.some(function(object2) {
20548
+ return compareHotkey2(object2, e2);
20549
+ });
20550
+ };
20551
+ var ret = event == null ? check : check(event);
20552
+ return ret;
20553
+ }
20554
+ function isCodeHotkey2(hotkey, event) {
20555
+ return isHotkey2(hotkey, event);
20556
+ }
20557
+ function isKeyHotkey2(hotkey, event) {
20558
+ return isHotkey2(hotkey, { byKey: true }, event);
20559
+ }
20560
+ function parseHotkey2(hotkey, options) {
20561
+ var byKey = options && options.byKey;
20562
+ var ret = {};
20563
+ hotkey = hotkey.replace("++", "+add");
20564
+ var values = hotkey.split("+");
20565
+ var length = values.length;
20566
+ for (var k in MODIFIERS2) {
20567
+ ret[MODIFIERS2[k]] = false;
20568
+ }
20569
+ var _iteratorNormalCompletion = true;
20570
+ var _didIteratorError = false;
20571
+ var _iteratorError = void 0;
20572
+ try {
20573
+ for (var _iterator = values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
20574
+ var value = _step.value;
20575
+ var optional = value.endsWith("?");
20576
+ if (optional) {
20577
+ value = value.slice(0, -1);
20578
+ }
20579
+ var name = toKeyName2(value);
20580
+ var modifier = MODIFIERS2[name];
20581
+ if (length === 1 || !modifier) {
20582
+ if (byKey) {
20583
+ ret.key = name;
20584
+ } else {
20585
+ ret.which = toKeyCode2(value);
20586
+ }
20587
+ }
20588
+ if (modifier) {
20589
+ ret[modifier] = optional ? null : true;
20590
+ }
20591
+ }
20592
+ } catch (err) {
20593
+ _didIteratorError = true;
20594
+ _iteratorError = err;
20595
+ } finally {
20596
+ try {
20597
+ if (!_iteratorNormalCompletion && _iterator.return) {
20598
+ _iterator.return();
20599
+ }
20600
+ } finally {
20601
+ if (_didIteratorError) {
20602
+ throw _iteratorError;
20603
+ }
20604
+ }
20605
+ }
20606
+ return ret;
20607
+ }
20608
+ function compareHotkey2(object2, event) {
20609
+ for (var key in object2) {
20610
+ var expected = object2[key];
20611
+ var actual = void 0;
20612
+ if (expected == null) {
20613
+ continue;
20614
+ }
20615
+ if (key === "key") {
20616
+ actual = event.key.toLowerCase();
20617
+ } else if (key === "which") {
20618
+ actual = expected === 91 && event.which === 93 ? 91 : event.which;
20619
+ } else {
20620
+ actual = event[key];
20621
+ }
20622
+ if (actual == null && expected === false) {
20623
+ continue;
20624
+ }
20625
+ if (actual !== expected) {
20626
+ return false;
20627
+ }
20628
+ }
20629
+ return true;
20630
+ }
20631
+ function toKeyCode2(name) {
20632
+ name = toKeyName2(name);
20633
+ var code = CODES2[name] || name.toUpperCase().charCodeAt(0);
20634
+ return code;
20635
+ }
20636
+ function toKeyName2(name) {
20637
+ name = name.toLowerCase();
20638
+ name = ALIASES2[name] || name;
20639
+ return name;
20640
+ }
20641
+ exports.default = isHotkey2;
20642
+ exports.isHotkey = isHotkey2;
20643
+ exports.isCodeHotkey = isCodeHotkey2;
20644
+ exports.isKeyHotkey = isKeyHotkey2;
20645
+ exports.parseHotkey = parseHotkey2;
20646
+ exports.compareHotkey = compareHotkey2;
20647
+ exports.toKeyCode = toKeyCode2;
20648
+ exports.toKeyName = toKeyName2;
20649
+ });
20650
+ var isHotkey = unwrapExports(lib);
20651
+ lib.isHotkey;
20652
+ lib.isCodeHotkey;
20653
+ lib.isKeyHotkey;
20654
+ lib.parseHotkey;
20655
+ lib.compareHotkey;
20656
+ lib.toKeyCode;
20657
+ lib.toKeyName;
20658
+ var Keymap = function Keymap2(shortcuts, options) {
20659
+ var config = _objectSpread({
20660
+ if: function _if() {
20661
+ return true;
20662
+ }
20663
+ }, options);
20664
+ var functions = Object.keys(shortcuts).map(function(key) {
20665
+ var isKeyPressed = isHotkey(key);
20666
+ var command = shortcuts[key];
20667
+ var check = function check2(event, editor) {
20668
+ return isKeyPressed(event) && config.if(editor);
20669
+ };
20670
+ var handler = typeof command == "string" ? function(event, editor) {
20671
+ event.preventDefault();
20672
+ editor.command(command);
20673
+ } : command;
20674
+ return {
20675
+ check,
20676
+ handler
20677
+ };
20678
+ });
20679
+ return {
20680
+ onKeyDown: function onKeyDown(event, editor, next) {
20681
+ var shortcut = functions.find(function(shortcut2) {
20682
+ return shortcut2.check(event, editor);
20683
+ });
20684
+ if (shortcut) {
20685
+ return shortcut.handler(event, editor, next);
20686
+ } else {
20687
+ return next();
20688
+ }
20689
+ }
20690
+ };
20691
+ };
20692
+ var isList = function isList2(blocks, block) {
20693
+ return block.type == blocks.unordered_list || block.type == blocks.ordered_list;
20694
+ };
20695
+ var wrapList = function(_ref, editor) {
20696
+ var blocks = _ref.blocks;
20697
+ var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
20698
+ var type = options.type || blocks.unordered_list;
20699
+ var rootBlocks = editor.value.document.getRootBlocksAtRange(editor.value.selection);
20700
+ editor.withoutNormalizing(function() {
20701
+ rootBlocks.forEach(function(block) {
20702
+ if (isList(blocks, block))
20703
+ return;
20704
+ editor.wrapBlockByKey(block.key, type);
20705
+ editor.wrapBlockByKey(block.key, blocks.list_item);
20706
+ editor.setNodeByKey(block.key, blocks.list_item_child);
20707
+ });
20708
+ });
20709
+ };
20710
+ var unwrapListByKey = function(_ref, editor, key) {
20711
+ var blocks = _ref.blocks;
20712
+ var listItem = editor.value.document.getNode(key);
20713
+ editor.withoutNormalizing(function() {
20714
+ editor.unwrapNodeByKey(listItem.key);
20715
+ var parent = editor.value.document.getParent(listItem.key);
20716
+ var itemIndex = parent.nodes.findIndex(function(node2) {
20717
+ return node2.key === listItem.key;
20718
+ });
20719
+ listItem.nodes.forEach(function(itemChild, index2) {
20720
+ editor.moveNodeByKey(itemChild.key, parent.key, index2 + itemIndex);
20721
+ if (itemChild.type == blocks.list_item_child) {
20722
+ editor.setNodeByKey(itemChild.key, {
20723
+ type: blocks["default"]
20724
+ });
20725
+ }
20726
+ });
20727
+ editor.removeNodeByKey(listItem.key);
20728
+ });
20729
+ };
20730
+ var unwrapList = function(_ref, editor) {
20731
+ var blocks = _ref.blocks;
20732
+ var listItemChildren = editor.value.document.getNodesAtRange(editor.value.selection).filter(function(node2) {
20733
+ return node2.type == blocks.list_item_child;
20734
+ });
20735
+ var furthestListItems = listItemChildren.map(function(listItemChild) {
20736
+ return editor.value.document.getFurthest(listItemChild.key, function(node2) {
20737
+ return node2.type == blocks.list_item;
20738
+ });
20739
+ }).filter(function(listItemChild, index2, array2) {
20740
+ return array2.indexOf(listItemChild) == index2;
20741
+ });
20742
+ furthestListItems.forEach(function(listItem) {
20743
+ unwrapListByKey({
20744
+ blocks
20745
+ }, editor, listItem.key);
20746
+ });
20747
+ };
20748
+ var toggleList = function(_ref, editor) {
20749
+ var blocks = _ref.blocks;
20750
+ var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
20751
+ var _editor$value = editor.value, document2 = _editor$value.document, startBlock = _editor$value.startBlock;
20752
+ var type = options.type || blocks.unordered_list;
20753
+ var parent = document2.getParent(startBlock.key);
20754
+ var isList3 = parent.type == blocks.list_item;
20755
+ if (!isList3)
20756
+ return editor.wrapList({
20757
+ type
20758
+ });
20759
+ var list = document2.getParent(parent.key);
20760
+ var sameType3 = list.type == type;
20761
+ if (sameType3) {
20762
+ editor.unwrapList();
20763
+ } else {
20764
+ editor.setNodeByKey(list.key, type);
20765
+ }
20766
+ };
20767
+ var decreaseListItemDepth = function(_ref, editor) {
20768
+ var blocks = _ref.blocks;
20769
+ var _editor$value = editor.value, document2 = _editor$value.document, startBlock = _editor$value.startBlock;
20770
+ var listItem = document2.getParent(startBlock.key);
20771
+ if (listItem.type != blocks.list_item)
20772
+ return;
20773
+ var list = document2.getParent(listItem.key);
20774
+ var parentListItem = document2.getParent(list.key);
20775
+ if (parentListItem.type != blocks.list_item)
20776
+ return;
20777
+ var parentList = document2.getParent(parentListItem.key);
20778
+ var index2 = parentList.nodes.indexOf(parentListItem);
20779
+ var otherItems = list.nodes.skipUntil(function(item) {
20780
+ return item === listItem;
20781
+ }).rest();
20782
+ if (!otherItems.isEmpty()) {
20783
+ var newList = Block$2.create({
20784
+ object: "block",
20785
+ type: list.type
20786
+ });
20787
+ editor.withoutNormalizing(function() {
20788
+ editor.insertNodeByKey(listItem.key, listItem.nodes.size, newList);
20789
+ editor.moveNodeByKey(listItem.key, parentList.key, index2 + 1);
20790
+ otherItems.forEach(function(item, index3) {
20791
+ return editor.moveNodeByKey(item.key, newList.key, newList.nodes.size + index3);
20792
+ });
20793
+ });
20794
+ } else {
20795
+ editor.moveNodeByKey(listItem.key, parentList.key, index2 + 1);
20796
+ }
20797
+ };
20798
+ var increaseListItemDepth = function(_ref, editor) {
20799
+ _ref.blocks;
20800
+ var _editor$value = editor.value, document2 = _editor$value.document, startBlock = _editor$value.startBlock;
20801
+ var listItem = document2.getParent(startBlock.key);
20802
+ var previousListItem = document2.getPreviousSibling(listItem.key);
20803
+ var list = document2.getParent(listItem.key);
20804
+ if (!listItem)
20805
+ return;
20806
+ if (!previousListItem)
20807
+ return;
20808
+ var existingList = previousListItem.nodes.get(1);
20809
+ if (existingList) {
20810
+ editor.withoutNormalizing(function() {
20811
+ editor.moveNodeByKey(listItem.key, existingList.key, existingList.nodes.size);
20812
+ });
20813
+ } else {
20814
+ var newList = Block$2.create({
20815
+ object: "block",
20816
+ type: list.type
20817
+ });
20818
+ editor.withoutNormalizing(function() {
20819
+ editor.insertNodeByKey(previousListItem.key, previousListItem.nodes.size, newList);
20820
+ editor.moveNodeByKey(listItem.key, newList.key, 0);
20821
+ });
20822
+ }
20823
+ };
20824
+ var wrapWithOptions = function wrapWithOptions2(fn, options) {
20825
+ return function() {
20826
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20827
+ args[_key] = arguments[_key];
20828
+ }
20829
+ return fn.apply(void 0, [options].concat(args));
20830
+ };
20831
+ };
20832
+ var createCommands = function(options) {
20833
+ return {
20834
+ wrapList: wrapWithOptions(wrapList, options),
20835
+ unwrapList: wrapWithOptions(unwrapList, options),
20836
+ toggleList: wrapWithOptions(toggleList, options),
20837
+ unwrapListByKey: wrapWithOptions(unwrapListByKey, options),
20838
+ decreaseListItemDepth: wrapWithOptions(decreaseListItemDepth, options),
20839
+ increaseListItemDepth: wrapWithOptions(increaseListItemDepth, options)
20840
+ };
20841
+ };
20842
+ function _arrayWithHoles(arr) {
20843
+ if (Array.isArray(arr))
20844
+ return arr;
20845
+ }
20846
+ var arrayWithHoles = _arrayWithHoles;
20847
+ function _iterableToArrayLimit(arr, i) {
20848
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
20849
+ return;
20850
+ var _arr = [];
20851
+ var _n = true;
20852
+ var _d = false;
20853
+ var _e = void 0;
20854
+ try {
20855
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
20856
+ _arr.push(_s.value);
20857
+ if (i && _arr.length === i)
20858
+ break;
20859
+ }
20860
+ } catch (err) {
20861
+ _d = true;
20862
+ _e = err;
20863
+ } finally {
20864
+ try {
20865
+ if (!_n && _i["return"] != null)
20866
+ _i["return"]();
20867
+ } finally {
20868
+ if (_d)
20869
+ throw _e;
20870
+ }
20871
+ }
20872
+ return _arr;
20873
+ }
20874
+ var iterableToArrayLimit = _iterableToArrayLimit;
20875
+ function _arrayLikeToArray(arr, len) {
20876
+ if (len == null || len > arr.length)
20877
+ len = arr.length;
20878
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
20879
+ arr2[i] = arr[i];
20880
+ }
20881
+ return arr2;
20882
+ }
20883
+ var arrayLikeToArray = _arrayLikeToArray;
20884
+ function _unsupportedIterableToArray(o, minLen) {
20885
+ if (!o)
20886
+ return;
20887
+ if (typeof o === "string")
20888
+ return arrayLikeToArray(o, minLen);
20889
+ var n2 = Object.prototype.toString.call(o).slice(8, -1);
20890
+ if (n2 === "Object" && o.constructor)
20891
+ n2 = o.constructor.name;
20892
+ if (n2 === "Map" || n2 === "Set")
20893
+ return Array.from(n2);
20894
+ if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
20895
+ return arrayLikeToArray(o, minLen);
20896
+ }
20897
+ var unsupportedIterableToArray = _unsupportedIterableToArray;
20898
+ function _nonIterableRest() {
20899
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
20900
+ }
20901
+ var nonIterableRest = _nonIterableRest;
20902
+ function _slicedToArray(arr, i) {
20903
+ return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
20904
+ }
20905
+ var slicedToArray = _slicedToArray;
20906
+ var sameType = function sameType2(node2, other) {
20907
+ return node2.type == other.type;
20908
+ };
20909
+ var createNormalizeNode = function(_ref) {
20910
+ var blocks = _ref.blocks;
20911
+ var isList3 = function isList4(block) {
20912
+ return block && (block.type == blocks.unordered_list || block.type == blocks.ordered_list);
20913
+ };
20914
+ return function(node2, editor, next) {
20915
+ if (node2.object !== "document" && node2.object !== "block")
20916
+ return next();
20917
+ var mergable = node2.nodes.map(function(child, index2) {
20918
+ if (!isList3(child)) {
20919
+ return null;
20920
+ }
20921
+ var adjacent = node2.nodes.get(index2 + 1);
20922
+ if (!adjacent || !isList3(adjacent) || !sameType(child, adjacent)) {
20923
+ return null;
20924
+ }
20925
+ return [child, adjacent];
20926
+ }).filter(function(node3) {
20927
+ return node3;
20928
+ });
20929
+ if (mergable.isEmpty())
20930
+ return next();
20931
+ return function(editor2) {
20932
+ mergable.reverse().forEach(function(_ref2) {
20933
+ var _ref3 = slicedToArray(_ref2, 2), list = _ref3[0], adjacent = _ref3[1];
20934
+ var updatedAdjacent = editor2.value.document.getDescendant(adjacent.key);
20935
+ updatedAdjacent.nodes.forEach(function(child, index2) {
20936
+ editor2.withoutNormalizing(function() {
20937
+ editor2.moveNodeByKey(child.key, list.key, list.nodes.size + index2);
20938
+ });
20939
+ });
20940
+ editor2.withoutNormalizing(function() {
20941
+ editor2.removeNodeByKey(adjacent.key);
20942
+ });
20943
+ });
20944
+ };
20945
+ };
20946
+ };
20947
+ function createCommonjsModule$1(fn, module) {
20948
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
20949
+ }
20950
+ var _extends_1 = createCommonjsModule$1(function(module) {
20951
+ function _extends2() {
20952
+ module.exports = _extends2 = Object.assign || function(target) {
20953
+ for (var i = 1; i < arguments.length; i++) {
20954
+ var source = arguments[i];
20955
+ for (var key in source) {
20956
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
20957
+ target[key] = source[key];
20958
+ }
20959
+ }
20960
+ }
20961
+ return target;
20962
+ };
20963
+ return _extends2.apply(this, arguments);
20964
+ }
20965
+ module.exports = _extends2;
20966
+ });
20967
+ var createRenderBlock = function(_ref) {
20968
+ var blocks = _ref.blocks, classNames = _ref.classNames;
20969
+ return function(props2, editor, next) {
20970
+ var node2 = props2.node;
20971
+ switch (node2.type) {
20972
+ case blocks.unordered_list:
20973
+ return /* @__PURE__ */ React__default.createElement("ul", _extends_1({
20974
+ className: classNames.unordered_list
20975
+ }, props2.attributes, {
20976
+ style: {
20977
+ listStylePosition: "inside"
20978
+ }
20979
+ }), props2.children);
20980
+ case blocks.ordered_list: {
20981
+ return /* @__PURE__ */ React__default.createElement("ol", _extends_1({
20982
+ className: classNames.ordered_list
20983
+ }, props2.attributes, {
20984
+ style: {
20985
+ listStylePosition: "inside"
20986
+ }
20987
+ }), props2.children);
20988
+ }
20989
+ case blocks.list_item: {
20990
+ return /* @__PURE__ */ React__default.createElement("li", _extends_1({
20991
+ className: classNames.list_item
20992
+ }, props2.attributes), props2.children);
20993
+ }
20994
+ case blocks.list_item_child: {
20995
+ return /* @__PURE__ */ React__default.createElement("span", _extends_1({
20996
+ className: classNames.list_item_child
20997
+ }, props2.attributes), props2.children);
20998
+ }
20999
+ default:
21000
+ return next();
21001
+ }
21002
+ };
21003
+ };
21004
+ var createSchema = function(_ref) {
21005
+ var _blocks;
21006
+ var blocks = _ref.blocks;
21007
+ return {
21008
+ blocks: (_blocks = {}, defineProperty(_blocks, blocks.unordered_list, {
21009
+ nodes: [{
21010
+ match: {
21011
+ type: blocks.list_item
21012
+ }
21013
+ }]
21014
+ }), defineProperty(_blocks, blocks.ordered_list, {
21015
+ nodes: [{
21016
+ match: {
21017
+ type: blocks.list_item
21018
+ }
21019
+ }]
21020
+ }), defineProperty(_blocks, blocks.list_item, {
21021
+ parent: [{
21022
+ type: blocks.unordered_list
21023
+ }, {
21024
+ type: blocks.ordered_list
21025
+ }],
21026
+ nodes: [{
21027
+ match: {
21028
+ type: blocks.list_item_child
21029
+ },
21030
+ min: 1,
21031
+ max: 1
21032
+ }, {
21033
+ match: [{
21034
+ type: blocks.unordered_list
21035
+ }, {
21036
+ type: blocks.ordered_list
21037
+ }],
21038
+ min: 0,
21039
+ max: 1
21040
+ }],
21041
+ normalize: function normalize2(editor, error) {
21042
+ switch (error.code) {
21043
+ case "child_min_invalid":
21044
+ editor.insertNodeByKey(error.node.key, 0, Block$2.create({
21045
+ type: blocks.list_item_child,
21046
+ nodes: [Text$1.create()]
21047
+ }));
21048
+ return;
21049
+ case "child_type_invalid":
21050
+ editor.wrapBlockByKey(error.child.key, {
21051
+ type: blocks.list_item_child
21052
+ });
21053
+ return;
21054
+ case "parent_type_invalid":
21055
+ editor.wrapBlockByKey(error.node.key, blocks.unordered_list);
21056
+ return;
21057
+ default:
21058
+ return;
21059
+ }
21060
+ }
21061
+ }), _blocks)
21062
+ };
21063
+ };
21064
+ function ownKeys(object2, enumerableOnly) {
21065
+ var keys2 = Object.keys(object2);
21066
+ if (Object.getOwnPropertySymbols) {
21067
+ var symbols = Object.getOwnPropertySymbols(object2);
21068
+ if (enumerableOnly)
21069
+ symbols = symbols.filter(function(sym) {
21070
+ return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
21071
+ });
21072
+ keys2.push.apply(keys2, symbols);
21073
+ }
21074
+ return keys2;
21075
+ }
21076
+ function _objectSpread$1(target) {
21077
+ for (var i = 1; i < arguments.length; i++) {
21078
+ var source = arguments[i] != null ? arguments[i] : {};
21079
+ if (i % 2) {
21080
+ ownKeys(Object(source), true).forEach(function(key) {
21081
+ defineProperty(target, key, source[key]);
21082
+ });
21083
+ } else if (Object.getOwnPropertyDescriptors) {
21084
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
21085
+ } else {
21086
+ ownKeys(Object(source)).forEach(function(key) {
21087
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
21088
+ });
21089
+ }
21090
+ }
21091
+ return target;
21092
+ }
21093
+ var index = function() {
21094
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
21095
+ var config = _objectSpread$1({}, options);
21096
+ var blocks = _objectSpread$1({
21097
+ unordered_list: "unordered-list",
21098
+ ordered_list: "ordered-list",
21099
+ list_item: "list-item",
21100
+ list_item_child: "list-item-child",
21101
+ "default": "paragraph"
21102
+ }, config.blocks);
21103
+ var classNames = _objectSpread$1({
21104
+ unordered_list: "unordered-list",
21105
+ ordered_list: "ordered-list",
21106
+ list_item: "list-item",
21107
+ list_item_child: "list-item-child"
21108
+ }, config.classNames);
21109
+ var commands = createCommands({
21110
+ blocks
21111
+ });
21112
+ var isListItem = function isListItem2(block) {
21113
+ return block && block.type == blocks.list_item;
21114
+ };
21115
+ var getListItem = function getListItem2(editor, block) {
21116
+ var possibleListItem = editor.value.document.getParent(block.key);
21117
+ return isListItem(possibleListItem) ? possibleListItem : null;
21118
+ };
21119
+ var isList3 = function isList4(block) {
21120
+ return block && (block.type == blocks.unordered_list || block.type == blocks.ordered_list);
21121
+ };
21122
+ var getList = function getList2(editor, block) {
21123
+ var possibleList = editor.value.document.getParent(block.key);
21124
+ return isList3(possibleList) ? possibleList : null;
21125
+ };
21126
+ var onBackspace = function onBackspace2(event, editor, next) {
21127
+ var selection = editor.value.selection;
21128
+ if (selection.isExpanded)
21129
+ return next();
21130
+ if (selection.start.offset !== 0)
21131
+ return next();
21132
+ var listItem = getListItem(editor, editor.value.startBlock);
21133
+ var list = getList(editor, listItem);
21134
+ var parentListItem = getListItem(editor, list);
21135
+ if (parentListItem) {
21136
+ editor.decreaseListItemDepth();
21137
+ return;
21138
+ }
21139
+ editor.unwrapList();
21140
+ };
21141
+ var onEnter = function onEnter2(event, editor, next) {
21142
+ var _editor$value = editor.value, selection = _editor$value.selection, startBlock = _editor$value.startBlock;
21143
+ event.preventDefault();
21144
+ if (selection.isExpanded)
21145
+ editor["delete"]();
21146
+ if (selection.start.offset === 0 && startBlock.getText() === "") {
21147
+ var _listItem = getListItem(editor, editor.value.startBlock);
21148
+ var list = getList(editor, _listItem);
21149
+ var parentListItem = getListItem(editor, list);
21150
+ if (parentListItem) {
21151
+ editor.decreaseListItemDepth();
21152
+ return;
21153
+ }
21154
+ editor.unwrapList();
21155
+ return;
21156
+ }
21157
+ var listItem = getListItem(editor, editor.value.startBlock);
21158
+ editor.splitDescendantsByKey(listItem.key, selection.start.key, selection.start.offset);
21159
+ };
21160
+ var onShiftEnter = function onShiftEnter2(event, editor, next) {
21161
+ event.preventDefault();
21162
+ editor.insertText("\n");
21163
+ };
21164
+ var schema = createSchema({
21165
+ blocks
21166
+ });
21167
+ var normalizeNode = createNormalizeNode({
21168
+ blocks
21169
+ });
21170
+ var renderBlock = createRenderBlock({
21171
+ blocks,
21172
+ classNames
21173
+ });
21174
+ return [{
21175
+ commands: {
21176
+ wrapList: commands.wrapList,
21177
+ unwrapList: commands.unwrapList,
21178
+ toggleList: commands.toggleList,
21179
+ decreaseListItemDepth: commands.decreaseListItemDepth,
21180
+ increaseListItemDepth: commands.increaseListItemDepth
21181
+ },
21182
+ normalizeNode,
21183
+ renderBlock,
21184
+ renderNode: renderBlock,
21185
+ schema
21186
+ }, Keymap({
21187
+ backspace: onBackspace,
21188
+ enter: onEnter,
21189
+ "shift+enter": onShiftEnter,
21190
+ tab: "increaseListItemDepth",
21191
+ "shift+tab": "decreaseListItemDepth"
21192
+ }, {
21193
+ "if": function _if(editor) {
21194
+ return !!getListItem(editor, editor.value.startBlock);
21195
+ }
21196
+ })];
21197
+ };
21198
+ function useTypography(typographyId) {
21199
+ const { error, data } = useQuery(TYPOGRAPHIES_BY_ID, {
21200
+ skip: typographyId == null,
21201
+ variables: { ids: typographyId != null ? [typographyId] : [] }
21202
+ });
21203
+ if (typographyId == null || error != null)
21204
+ return null;
21205
+ return data == null ? void 0 : data.typographies[0];
21206
+ }
21207
+ const concat = (a2, b2) => a2.concat(b2);
21208
+ const getSwatchId = ({ value: { color: color2 } }) => color2 && color2.swatchId;
21209
+ const getDeviceId = ({ deviceId }) => deviceId;
21210
+ const withColor = (swatches) => (_a) => {
21211
+ var _b = _a, { value: _c } = _b, _d = _c, { color: color2 } = _d, restOfValue = __objRest(_d, ["color"]), rest = __objRest(_b, ["value"]);
21212
+ return __spreadProps(__spreadValues({}, rest), {
21213
+ value: __spreadValues(__spreadValues({}, restOfValue), color2 ? {
21214
+ color: {
21215
+ swatch: swatches.find((s) => s && s.id === color2.swatchId),
21216
+ alpha: color2.alpha
21217
+ }
21218
+ } : {})
21219
+ });
21220
+ };
21221
+ const overrideTypographyStyle = (source, override) => {
21222
+ const devices = [...new Set(source.map(getDeviceId).concat(override.map(getDeviceId)))];
21223
+ return devices.map((deviceId) => ({
21224
+ deviceId,
21225
+ value: __spreadValues(__spreadValues({}, (findDeviceOverride(source, deviceId) || { value: {} }).value), (findDeviceOverride(override, deviceId, (v) => v) || { value: {} }).value)
21226
+ }));
21227
+ };
21228
+ function useTypographyMark(value) {
21229
+ const typography = useTypography(value && value.id);
21230
+ const swatchIds = [
21231
+ typography && typography.style.map(getSwatchId) || [],
21232
+ value && value.style.map(getSwatchId) || []
21233
+ ].reduce(concat).filter(Boolean);
21234
+ const { error: colorError, data: colorData = {} } = useQuery(SWATCHES_BY_ID, {
21235
+ skip: swatchIds == null || swatchIds.length === 0,
21236
+ variables: { ids: swatchIds }
21237
+ });
21238
+ const { swatches = [] } = colorData;
21239
+ if (colorError != null)
21240
+ return null;
21241
+ return overrideTypographyStyle(typography && typography.style.map(withColor(swatches)) || [], value && value.style.map(withColor(swatches)) || []);
21242
+ }
21243
+ const Span = styled.span`
21244
+ ${(p) => cssMediaRules([p.typographyStyle], ([{
21245
+ color: color2,
21246
+ fontFamily,
21247
+ fontSize,
21248
+ fontWeight,
21249
+ lineHeight,
21250
+ letterSpacing,
21251
+ uppercase,
21252
+ underline,
21253
+ strikethrough,
21254
+ italic
21255
+ } = {}]) => css`
21256
+ ${color2 == null ? "" : css`
21257
+ color: ${colorToString(color2)};
21258
+ `}
21259
+
21260
+ ${fontFamily == null ? "" : css`
21261
+ font-family: '${fontFamily}';
21262
+ `}
21263
+
21264
+ ${fontSize == null || fontSize.value == null || fontSize.unit == null ? "" : css`
21265
+ font-size: ${`${fontSize.value}${fontSize.unit}`};
21266
+ `}
21267
+
21268
+ ${fontWeight == null ? "" : css`
21269
+ font-weight: ${fontWeight};
21270
+ `}
21271
+
21272
+ ${lineHeight == null ? "" : css`
21273
+ line-height: ${lineHeight};
21274
+ `}
21275
+
21276
+ ${letterSpacing == null ? "" : css`
21277
+ letter-spacing: ${letterSpacing / 10}em;
21278
+ `}
21279
+
21280
+ ${underline == null && strikethrough == null ? "" : css`
21281
+ text-decoration: ${[Boolean(underline) && "underline", Boolean(strikethrough) && "line-through"].filter(Boolean).join(" ")};
21282
+ `}
21283
+
21284
+ ${uppercase == null ? "" : css`
21285
+ text-transform: ${uppercase === true ? "uppercase" : "initial"};
21286
+ `}
21287
+
21288
+ ${italic == null ? "" : css`
21289
+ font-style: ${italic === true ? "italic" : "initial"};
21290
+ `}
21291
+ `, shallowMergeFallbacks)}
21292
+ `;
21293
+ function Mark(_w) {
21294
+ var _x = _w, {
21295
+ value
21296
+ } = _x, restOfProps = __objRest(_x, [
21297
+ "value"
21298
+ ]);
21299
+ const typographyStyle = useTypographyMark(value);
21300
+ return /* @__PURE__ */ jsx(Span, __spreadProps(__spreadValues({}, restOfProps), {
21301
+ typographyStyle
21302
+ }));
21303
+ }
21304
+ const TYPOGRAPHY_TYPE = "typography";
21305
+ function DeviceOverridesMarksPlugin() {
21306
+ return {
21307
+ renderMark({
21308
+ mark,
21309
+ children
21310
+ }, _editor, next) {
21311
+ if (mark.type === TYPOGRAPHY_TYPE) {
21312
+ return /* @__PURE__ */ jsx(Mark, {
21313
+ value: mark.data.get("value"),
21314
+ children
21315
+ });
21316
+ }
21317
+ return next();
21318
+ }
21319
+ };
21320
+ }
21321
+ const StyledBlock = styled.div`
21322
+ margin: 0;
21323
+ ${(p) => cssMediaRules([p.textAlign], ([textAlign]) => textAlign == null ? css`` : css`
21324
+ text-align: ${textAlign};
21325
+ `)}
21326
+
21327
+ ${(p) => p.as === "blockquote" ? css`
21328
+ padding: 0.5em 10px;
21329
+ font-size: 1.25em;
21330
+ font-weight: 300;
21331
+ border-left: 5px solid rgba(0, 0, 0, 0.1);
21332
+ ` : ""}
21333
+ `;
21334
+ var Block = forwardRef(function Block2(_y, ref) {
21335
+ var _z = _y, {
21336
+ textAlign
21337
+ } = _z, restOfProps = __objRest(_z, [
21338
+ "textAlign"
21339
+ ]);
21340
+ return /* @__PURE__ */ jsx(StyledBlock, __spreadProps(__spreadValues({}, restOfProps), {
21341
+ ref,
21342
+ textAlign
21343
+ }));
21344
+ });
21345
+ function DeviceOverridesBlockPlugin() {
21346
+ return {
21347
+ renderBlock(props2, _editor, next) {
21348
+ const {
21349
+ node: node2,
21350
+ attributes,
21351
+ children
21352
+ } = props2;
21353
+ const blockProps = {
21354
+ textAlign: node2.data.get("textAlign")
21355
+ };
21356
+ switch (node2.type) {
21357
+ case "paragraph":
21358
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21359
+ as: "p",
21360
+ children
21361
+ }));
21362
+ case "heading-one":
21363
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21364
+ as: "h1",
21365
+ children
21366
+ }));
21367
+ case "heading-two":
21368
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21369
+ as: "h2",
21370
+ children
21371
+ }));
21372
+ case "heading-three":
21373
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21374
+ as: "h3",
21375
+ children
21376
+ }));
21377
+ case "heading-four":
21378
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21379
+ as: "h4",
21380
+ children
21381
+ }));
21382
+ case "heading-five":
21383
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21384
+ as: "h5",
21385
+ children
21386
+ }));
21387
+ case "heading-six":
21388
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21389
+ as: "h6",
21390
+ children
21391
+ }));
21392
+ case "blockquote":
21393
+ return /* @__PURE__ */ jsx(Block, __spreadProps(__spreadValues(__spreadValues({}, attributes), blockProps), {
21394
+ as: "blockquote",
21395
+ children
21396
+ }));
21397
+ default:
21398
+ return next();
21399
+ }
21400
+ }
21401
+ };
21402
+ }
21403
+ const StyledLink = styled(Link)`
21404
+ text-decoration: none;
21405
+ `;
21406
+ function LinkPlugin() {
21407
+ return {
21408
+ renderInline(props2, _editor, next) {
21409
+ const {
21410
+ attributes,
21411
+ children,
21412
+ node: node2
21413
+ } = props2;
21414
+ switch (node2.type) {
21415
+ case "link": {
21416
+ const {
21417
+ data
21418
+ } = node2;
21419
+ return /* @__PURE__ */ jsx(StyledLink, __spreadProps(__spreadValues({}, attributes), {
21420
+ link: data.toJS(),
21421
+ children
21422
+ }));
21423
+ }
21424
+ default: {
21425
+ return next();
21426
+ }
21427
+ }
21428
+ }
21429
+ };
21430
+ }
21431
+ function Inlines() {
21432
+ return {
21433
+ renderInline(props2, _editor, next) {
21434
+ const {
21435
+ attributes,
21436
+ children,
21437
+ node: node2
21438
+ } = props2;
21439
+ switch (node2.type) {
21440
+ case "code": {
21441
+ return /* @__PURE__ */ jsx("code", __spreadProps(__spreadValues({}, attributes), {
21442
+ children
21443
+ }));
21444
+ }
21445
+ case "superscript": {
21446
+ return /* @__PURE__ */ jsx("sup", __spreadProps(__spreadValues({}, attributes), {
21447
+ children
21448
+ }));
21449
+ }
21450
+ case "subscript": {
21451
+ return /* @__PURE__ */ jsx("sub", __spreadProps(__spreadValues({}, attributes), {
21452
+ children
21453
+ }));
21454
+ }
21455
+ default: {
21456
+ return next();
21457
+ }
21458
+ }
21459
+ }
21460
+ };
21461
+ }
21462
+ const RichTextEditor = styled(forwardRef(function RichTextEditor2(_A, ref) {
21463
+ var _B = _A, {
21464
+ placeholder: placeholder2 = "Write some text..."
21465
+ } = _B, restOfProps = __objRest(_B, [
21466
+ "placeholder"
21467
+ ]);
21468
+ const plugins = useMemo(() => [index(), LinkPlugin(), Inlines(), DeviceOverridesBlockPlugin(), DeviceOverridesMarksPlugin()], []);
21469
+ return /* @__PURE__ */ jsx(Editor, __spreadProps(__spreadValues({}, restOfProps), {
21470
+ ref,
21471
+ autoFocus: false,
21472
+ plugins,
21473
+ placeholder: placeholder2
21474
+ }));
21475
+ }))`
21476
+ ul,
21477
+ ol {
21478
+ margin: 0;
21479
+ }
21480
+ `;
21481
+ const StyledRichTextEditor = styled(RichTextEditor)`
21482
+ ${cssWidth()}
21483
+ ${cssMargin()}
21484
+ `;
21485
+ const defaultText = {
21486
+ document: {
21487
+ nodes: [{
21488
+ object: "block",
21489
+ type: "paragraph",
21490
+ nodes: []
21491
+ }]
21492
+ },
21493
+ data: {}
21494
+ };
21495
+ const COMMIT_DEBOUNCE_DELAY = 500;
21496
+ var Text = forwardRef(function Text2({
21497
+ id: id2,
21498
+ text,
21499
+ width,
21500
+ margin
21501
+ }, ref) {
21502
+ const [editor, setEditor] = useState(null);
21503
+ const [propControllers, setPropControllers] = useState(null);
21504
+ const controller = propControllers == null ? void 0 : propControllers.text;
21505
+ useImperativeHandle(ref, () => ({
21506
+ getBoxModel() {
21507
+ const el = editor == null ? void 0 : editor.findDOMNode([]);
21508
+ return el instanceof Element ? getBox(el) : null;
21509
+ },
21510
+ setPropControllers
21511
+ }), [editor, setPropControllers]);
21512
+ useEffect(() => {
21513
+ if (editor)
21514
+ controller == null ? void 0 : controller.setSlateEditor(editor);
21515
+ }, [controller, editor]);
21516
+ const [value, setValue] = useState(() => {
21517
+ const _a = text != null ? text : defaultText, {
21518
+ selection
21519
+ } = _a, textWithoutSelection = __objRest(_a, [
21520
+ "selection"
21521
+ ]);
21522
+ return Value.fromJSON(textWithoutSelection);
21523
+ });
21524
+ const [shouldCommit, setShouldCommit] = useState(true);
21525
+ useEffect(() => {
21526
+ if (shouldCommit) {
21527
+ const nextValue = Value.fromJSON(text != null ? text : defaultText);
21528
+ setValue((currentValue) => currentValue.selection.isBlurred ? Value.fromJSON(nextValue.toJSON({
21529
+ preserveSelection: false
21530
+ })) : nextValue);
21531
+ }
21532
+ }, [shouldCommit, text]);
21533
+ useEffect(() => {
21534
+ if (shouldCommit)
21535
+ return;
21536
+ const timeoutId = window.setTimeout(() => {
21537
+ setShouldCommit(true);
21538
+ }, COMMIT_DEBOUNCE_DELAY);
21539
+ return () => {
21540
+ window.clearTimeout(timeoutId);
21541
+ };
21542
+ }, [shouldCommit]);
21543
+ function handleChange(change) {
21544
+ setValue(change.value);
21545
+ if (change.value.document !== value.document) {
21546
+ setShouldCommit(false);
21547
+ controller == null ? void 0 : controller.onChange(change);
21548
+ }
21549
+ }
21550
+ const lastController = useRef(controller);
21551
+ if (lastController.current !== controller)
21552
+ lastController.current = controller;
21553
+ const handleFocus = useCallback(() => {
21554
+ var _a;
21555
+ (_a = lastController.current) == null ? void 0 : _a.focus();
21556
+ }, []);
21557
+ const handleKeyDown = useCallback((event, _editor, next) => {
21558
+ var _a, _b;
21559
+ if (Hotkeys.isUndo(event)) {
21560
+ (_a = lastController.current) == null ? void 0 : _a.undo();
21561
+ return true;
21562
+ }
21563
+ if (Hotkeys.isRedo(event)) {
21564
+ (_b = lastController.current) == null ? void 0 : _b.redo();
21565
+ return true;
21566
+ }
21567
+ return next();
21568
+ }, []);
21569
+ const isInBuilder = useIsInBuilder();
21570
+ return /* @__PURE__ */ jsx(StyledRichTextEditor, {
21571
+ id: id2,
21572
+ ref: setEditor,
21573
+ readOnly: !isInBuilder,
21574
+ width,
21575
+ margin,
21576
+ value,
21577
+ onChange: handleChange,
21578
+ onFocus: handleFocus,
21579
+ onKeyDown: handleKeyDown
21580
+ });
21581
+ });
21582
+ export { Box, Button, Carousel, Countdown, DEFAULT_BOX_ANIMATE_DELAY, DEFAULT_BOX_ANIMATE_DURATION, DEFAULT_BOX_ANIMATE_TYPE, DEFAULT_ITEM_ANIMATE_DELAY, DEFAULT_ITEM_ANIMATE_DURATION, DEFAULT_ITEM_ANIMATE_TYPE, DEFAULT_ITEM_STAGGER_DURATION, Divider, Embed, Image$1 as Image, Navigation, Root, SocialLinks, Text, cssBorder, cssBorderRadius, cssBoxShadow, cssGridItem, cssMargin, cssMediaRules, cssPadding, cssTextStyle, cssWidth };
19914
21583
  //# sourceMappingURL=components.es.js.map