@lana-commerce/core 11.0.0

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 (972) hide show
  1. package/CHANGELOG.md +531 -0
  2. package/cjs/actionLock.js +31 -0
  3. package/cjs/addEmptyListItem.js +7 -0
  4. package/cjs/aggregateOptions.js +178 -0
  5. package/cjs/analytics.js +90 -0
  6. package/cjs/analyticsProductData.js +33 -0
  7. package/cjs/arrayToDict.js +12 -0
  8. package/cjs/asyncModuleWrapper.js +52 -0
  9. package/cjs/averageReviewScore.js +45 -0
  10. package/cjs/buildconfig.js +16 -0
  11. package/cjs/cachedLoader.js +36 -0
  12. package/cjs/canonicalVariantURL.js +2 -0
  13. package/cjs/cartOperation.js +132 -0
  14. package/cjs/categorySEO.js +20 -0
  15. package/cjs/commonTypes.js +2 -0
  16. package/cjs/compact.js +8 -0
  17. package/cjs/configLoader.js +69 -0
  18. package/cjs/controlledQueue.js +46 -0
  19. package/cjs/convertImageURL.js +19 -0
  20. package/cjs/dataLoader.js +185 -0
  21. package/cjs/defaultVariant.js +30 -0
  22. package/cjs/effector/clearOnChangeAfterDelay.js +17 -0
  23. package/cjs/effector/combineEvery.js +8 -0
  24. package/cjs/effector/combineSome.js +8 -0
  25. package/cjs/effector/debounced.js +18 -0
  26. package/cjs/effector/form.js +168 -0
  27. package/cjs/effector/hideOnChangeAfterDelay.js +17 -0
  28. package/cjs/effector/requestResponse.js +30 -0
  29. package/cjs/effector/requestResponseMulti.js +51 -0
  30. package/cjs/effector/restoreNamed.js +8 -0
  31. package/cjs/effector/split.js +29 -0
  32. package/cjs/effector/validator.js +33 -0
  33. package/cjs/effector/wrapSignInRequired.js +13 -0
  34. package/cjs/exceptions.js +6 -0
  35. package/cjs/fetchAllItems.js +56 -0
  36. package/cjs/file.js +83 -0
  37. package/cjs/fileWebsocket.js +83 -0
  38. package/cjs/filterFunc.js +48 -0
  39. package/cjs/filterFuncBrand.js +12 -0
  40. package/cjs/filterFuncCategory.js +12 -0
  41. package/cjs/filterFuncContentBlock.js +19 -0
  42. package/cjs/filterFuncCustomer.js +161 -0
  43. package/cjs/filterFuncDataFeed.js +54 -0
  44. package/cjs/filterFuncOrder.js +334 -0
  45. package/cjs/filterFuncPreprocess.js +14 -0
  46. package/cjs/filterFuncProduct.js +70 -0
  47. package/cjs/filterFuncPurchaseOrder.js +126 -0
  48. package/cjs/filterFuncSupplier.js +36 -0
  49. package/cjs/filterFuncTransfer.js +135 -0
  50. package/cjs/formatAbbrevNumber.js +21 -0
  51. package/cjs/formatCurrency.js +47 -0
  52. package/cjs/formatToJSX.js +123 -0
  53. package/cjs/fulfillmentNumber.js +7 -0
  54. package/cjs/generateRandomToken.js +12 -0
  55. package/cjs/generateUUID.js +10 -0
  56. package/cjs/generated/codes.js +47 -0
  57. package/cjs/genericFile.js +73 -0
  58. package/cjs/getSalesChannelID.js +13 -0
  59. package/cjs/getSessionID.js +13 -0
  60. package/cjs/getTimezone.js +12 -0
  61. package/cjs/graphql/fragments/Branding.js +3 -0
  62. package/cjs/graphql/fragments/BrandingField.js +3 -0
  63. package/cjs/graphql/fragments/CartCustomItem.js +3 -0
  64. package/cjs/graphql/fragments/CartOrder.js +3 -0
  65. package/cjs/graphql/fragments/CartVariant.js +3 -0
  66. package/cjs/graphql/fragments/CartVariantFull.js +3 -0
  67. package/cjs/graphql/fragments/Category.js +3 -0
  68. package/cjs/graphql/fragments/CommonCartVariant.js +3 -0
  69. package/cjs/graphql/fragments/Currency.js +3 -0
  70. package/cjs/graphql/fragments/CurrencyPrice.js +3 -0
  71. package/cjs/graphql/fragments/CustomField.js +3 -0
  72. package/cjs/graphql/fragments/CustomFieldObjects.js +3 -0
  73. package/cjs/graphql/fragments/Customer.js +3 -0
  74. package/cjs/graphql/fragments/CustomerBalance.js +3 -0
  75. package/cjs/graphql/fragments/CustomerBalanceHistory.js +3 -0
  76. package/cjs/graphql/fragments/CustomerFavorite.js +3 -0
  77. package/cjs/graphql/fragments/CustomerFavoriteShort.js +3 -0
  78. package/cjs/graphql/fragments/CustomerOAuthProvider.js +3 -0
  79. package/cjs/graphql/fragments/CustomerOrderBrief.js +3 -0
  80. package/cjs/graphql/fragments/CustomerOrderFulfillment.js +3 -0
  81. package/cjs/graphql/fragments/CustomerOrderFull.js +3 -0
  82. package/cjs/graphql/fragments/CustomerPaymentSource.js +3 -0
  83. package/cjs/graphql/fragments/CustomerReturnBrief.js +3 -0
  84. package/cjs/graphql/fragments/CustomerReturnFull.js +3 -0
  85. package/cjs/graphql/fragments/CustomerReturnPolicy.js +3 -0
  86. package/cjs/graphql/fragments/CustomerSubscriptionBrief.js +3 -0
  87. package/cjs/graphql/fragments/CustomerSubscriptionFull.js +3 -0
  88. package/cjs/graphql/fragments/File.js +3 -0
  89. package/cjs/graphql/fragments/FileForUpload.js +3 -0
  90. package/cjs/graphql/fragments/FileNoFallback.js +3 -0
  91. package/cjs/graphql/fragments/FullAddress.js +3 -0
  92. package/cjs/graphql/fragments/Gateway.js +3 -0
  93. package/cjs/graphql/fragments/GatewayManual.js +3 -0
  94. package/cjs/graphql/fragments/GatewayPaypal.js +3 -0
  95. package/cjs/graphql/fragments/GatewayStripe.js +3 -0
  96. package/cjs/graphql/fragments/GatewayTest.js +3 -0
  97. package/cjs/graphql/fragments/IPAndUAInfo.js +3 -0
  98. package/cjs/graphql/fragments/InfoCountry.js +3 -0
  99. package/cjs/graphql/fragments/InfoCountryDedupField.js +3 -0
  100. package/cjs/graphql/fragments/InfoCurrency.js +3 -0
  101. package/cjs/graphql/fragments/InfoProvince.js +3 -0
  102. package/cjs/graphql/fragments/KeyValue.js +3 -0
  103. package/cjs/graphql/fragments/LineItemField.js +3 -0
  104. package/cjs/graphql/fragments/MediaFile.js +3 -0
  105. package/cjs/graphql/fragments/MinCurrencyPrice.js +3 -0
  106. package/cjs/graphql/fragments/ProductField.js +3 -0
  107. package/cjs/graphql/fragments/ProductFieldSet.js +3 -0
  108. package/cjs/graphql/fragments/ProductFlat.js +3 -0
  109. package/cjs/graphql/fragments/ProductQuestion.js +3 -0
  110. package/cjs/graphql/fragments/ProductQuestionAnswer.js +3 -0
  111. package/cjs/graphql/fragments/ProductQuestionPage.js +3 -0
  112. package/cjs/graphql/fragments/ProductReview.js +3 -0
  113. package/cjs/graphql/fragments/ProductReviewAnswer.js +3 -0
  114. package/cjs/graphql/fragments/ProductReviewAverageScore.js +3 -0
  115. package/cjs/graphql/fragments/ProductReviewPage.js +3 -0
  116. package/cjs/graphql/fragments/ProductReviewScore.js +3 -0
  117. package/cjs/graphql/fragments/ProductReviewSurveyAnswer.js +3 -0
  118. package/cjs/graphql/fragments/ProductSearchOptionAgg.js +3 -0
  119. package/cjs/graphql/fragments/ProductSearchResult.js +3 -0
  120. package/cjs/graphql/fragments/ReturnReason.js +3 -0
  121. package/cjs/graphql/fragments/ReviewDimension.js +3 -0
  122. package/cjs/graphql/fragments/ReviewDimensionSet.js +3 -0
  123. package/cjs/graphql/fragments/ReviewImagePage.js +3 -0
  124. package/cjs/graphql/fragments/ReviewQuestionProduct.js +3 -0
  125. package/cjs/graphql/fragments/ReviewSettings.js +3 -0
  126. package/cjs/graphql/fragments/SearchProduct.js +3 -0
  127. package/cjs/graphql/fragments/Shop.js +3 -0
  128. package/cjs/graphql/fragments/SubscriptionPlan.js +3 -0
  129. package/cjs/graphql/fragments/SurveyQuestion.js +3 -0
  130. package/cjs/graphql/fragments/TieredPricing.js +3 -0
  131. package/cjs/graphql/fragments/TieredPricingTier.js +3 -0
  132. package/cjs/graphql/fragments/VariantOption.js +3 -0
  133. package/cjs/graphql/operations/ApplyGiftCardMutation.js +3 -0
  134. package/cjs/graphql/operations/AuthRequestMutation.js +3 -0
  135. package/cjs/graphql/operations/CancelOrderMutation.js +3 -0
  136. package/cjs/graphql/operations/CancelSubscriptionMutation.js +3 -0
  137. package/cjs/graphql/operations/ConnectOAuth2Mutation.js +3 -0
  138. package/cjs/graphql/operations/CreateCartMutation.js +26 -0
  139. package/cjs/graphql/operations/CreateFavoriteMutation.js +22 -0
  140. package/cjs/graphql/operations/CreateFileMutation.js +6 -0
  141. package/cjs/graphql/operations/CreatePaymentSourceMutation.js +6 -0
  142. package/cjs/graphql/operations/CreateProductQuestionAnswerMutation.js +3 -0
  143. package/cjs/graphql/operations/CreateProductQuestionMutation.js +8 -0
  144. package/cjs/graphql/operations/CreateProductReviewMutation.js +18 -0
  145. package/cjs/graphql/operations/CreateReturnMutation.js +22 -0
  146. package/cjs/graphql/operations/DeleteFavoriteMutation.js +3 -0
  147. package/cjs/graphql/operations/DeletePaymentSourceMutation.js +3 -0
  148. package/cjs/graphql/operations/DeleteProductQuestionAnswerMutation.js +3 -0
  149. package/cjs/graphql/operations/DeleteProductQuestionMutation.js +3 -0
  150. package/cjs/graphql/operations/DeleteProductReviewMutation.js +3 -0
  151. package/cjs/graphql/operations/DisconnectOAuth2Mutation.js +3 -0
  152. package/cjs/graphql/operations/EditSubscriptionMutation.js +3 -0
  153. package/cjs/graphql/operations/FileUploadedMutation.js +6 -0
  154. package/cjs/graphql/operations/FlagQuestionAnswerMutation.js +3 -0
  155. package/cjs/graphql/operations/FlagQuestionMutation.js +3 -0
  156. package/cjs/graphql/operations/FlagReviewAnswerMutation.js +3 -0
  157. package/cjs/graphql/operations/FlagReviewMutation.js +3 -0
  158. package/cjs/graphql/operations/GetBrandingQuery.js +10 -0
  159. package/cjs/graphql/operations/GetCartQuery.js +26 -0
  160. package/cjs/graphql/operations/GetCustomerAddressesPageDataQuery.js +16 -0
  161. package/cjs/graphql/operations/GetCustomerBalanceHistoryPageQuery.js +6 -0
  162. package/cjs/graphql/operations/GetCustomerBalanceQuery.js +8 -0
  163. package/cjs/graphql/operations/GetCustomerInfoQuery.js +10 -0
  164. package/cjs/graphql/operations/GetCustomerQuery.js +8 -0
  165. package/cjs/graphql/operations/GetFavoritesQuery.js +22 -0
  166. package/cjs/graphql/operations/GetFileStatusQuery.js +6 -0
  167. package/cjs/graphql/operations/GetGatewaysQuery.js +14 -0
  168. package/cjs/graphql/operations/GetInfoCurrenciesQuery.js +6 -0
  169. package/cjs/graphql/operations/GetLastCartQuery.js +26 -0
  170. package/cjs/graphql/operations/GetOrderQuery.js +30 -0
  171. package/cjs/graphql/operations/GetOrdersPageQuery.js +24 -0
  172. package/cjs/graphql/operations/GetPaymentMethodsPageDataQuery.js +18 -0
  173. package/cjs/graphql/operations/GetProductQuestionsPageQuery.js +10 -0
  174. package/cjs/graphql/operations/GetProductReviewImagesPageQuery.js +8 -0
  175. package/cjs/graphql/operations/GetProductReviewsPageQuery.js +20 -0
  176. package/cjs/graphql/operations/GetProvincesQuery.js +6 -0
  177. package/cjs/graphql/operations/GetQuestionQuery.js +8 -0
  178. package/cjs/graphql/operations/GetReturnCreationInfoQuery.js +36 -0
  179. package/cjs/graphql/operations/GetReturnQuery.js +28 -0
  180. package/cjs/graphql/operations/GetReturnsPageQuery.js +22 -0
  181. package/cjs/graphql/operations/GetReviewDimensionsQuery.js +6 -0
  182. package/cjs/graphql/operations/GetReviewQuery.js +18 -0
  183. package/cjs/graphql/operations/GetReviewSettingsQuery.js +12 -0
  184. package/cjs/graphql/operations/GetShopCurrenciesQuery.js +6 -0
  185. package/cjs/graphql/operations/GetShopQuery.js +8 -0
  186. package/cjs/graphql/operations/GetSubscriptionQuery.js +36 -0
  187. package/cjs/graphql/operations/GetSubscriptionsPageQuery.js +22 -0
  188. package/cjs/graphql/operations/GetVariantPageQuery.js +20 -0
  189. package/cjs/graphql/operations/LoadProductNoCustomerQuery.js +62 -0
  190. package/cjs/graphql/operations/LoadProductQuery.js +66 -0
  191. package/cjs/graphql/operations/ModifyCartMutation.js +26 -0
  192. package/cjs/graphql/operations/ModifyCustomerMutation.js +8 -0
  193. package/cjs/graphql/operations/ModifyFavoriteMutation.js +22 -0
  194. package/cjs/graphql/operations/ModifyProductQuestionAnswerMutation.js +3 -0
  195. package/cjs/graphql/operations/ModifyProductQuestionMutation.js +8 -0
  196. package/cjs/graphql/operations/ModifyProductReviewMutation.js +18 -0
  197. package/cjs/graphql/operations/NewPasswordMutation.js +3 -0
  198. package/cjs/graphql/operations/PauseSubscriptionMutation.js +3 -0
  199. package/cjs/graphql/operations/ResetPasswordMutation.js +3 -0
  200. package/cjs/graphql/operations/ResumeSubscriptionMutation.js +3 -0
  201. package/cjs/graphql/operations/SearchProductsAdvancedQuery.js +24 -0
  202. package/cjs/graphql/operations/SearchProductsQuery.js +20 -0
  203. package/cjs/graphql/operations/SearchQuestionsQuery.js +8 -0
  204. package/cjs/graphql/operations/SearchReviewsQuery.js +18 -0
  205. package/cjs/graphql/operations/SignInMutation.js +3 -0
  206. package/cjs/graphql/operations/SignInViaEmailCompleteMutation.js +3 -0
  207. package/cjs/graphql/operations/SignInViaEmailInitMutation.js +3 -0
  208. package/cjs/graphql/operations/SignUpMutation.js +3 -0
  209. package/cjs/graphql/operations/SkipNextSubscriptionMutation.js +3 -0
  210. package/cjs/graphql/operations/UploadFileMutation.js +3 -0
  211. package/cjs/graphql/operations/VerifyCodeMutation.js +3 -0
  212. package/cjs/graphql/operations/VoteQuestionAnswerMutation.js +3 -0
  213. package/cjs/graphql/operations/VoteQuestionMutation.js +3 -0
  214. package/cjs/graphql/operations/VoteReviewAnswerMutation.js +3 -0
  215. package/cjs/graphql/operations/VoteReviewMutation.js +3 -0
  216. package/cjs/graphql/types.js +2 -0
  217. package/cjs/hierarchicalSearchOption.js +42 -0
  218. package/cjs/idgen.js +8 -0
  219. package/cjs/ignoreQueue.js +50 -0
  220. package/cjs/imageAltProps.js +13 -0
  221. package/cjs/invoiceFormat.js +59 -0
  222. package/cjs/isShippingRequired.js +20 -0
  223. package/cjs/isoStripTrailingZeros.js +7 -0
  224. package/cjs/json/commerce.js +10 -0
  225. package/cjs/json/commerceFileUpload.js +57 -0
  226. package/cjs/json/commerceTypes.js +2 -0
  227. package/cjs/json/common.js +320 -0
  228. package/cjs/json/fetchAllItems.js +61 -0
  229. package/cjs/json/mutator.js +957 -0
  230. package/cjs/json/storefront.js +10 -0
  231. package/cjs/json/storefrontTypes.js +2 -0
  232. package/cjs/lastValue.js +17 -0
  233. package/cjs/lineItemPrice.js +111 -0
  234. package/cjs/loadJWT.js +25 -0
  235. package/cjs/mapInvalidInput.js +33 -0
  236. package/cjs/mapResponseData.js +16 -0
  237. package/cjs/mapResponseMultiData.js +14 -0
  238. package/cjs/meanBy.js +15 -0
  239. package/cjs/media.js +16 -0
  240. package/cjs/modules/advancedSearch.js +127 -0
  241. package/cjs/modules/cart.js +708 -0
  242. package/cjs/modules/config/defaultAdvancedSearchGraphQLConfig.js +8 -0
  243. package/cjs/modules/config/defaultCartGraphQLConfig.js +14 -0
  244. package/cjs/modules/config/defaultProductGraphQLConfig.js +48 -0
  245. package/cjs/modules/config/defaultSearchGraphQLConfig.js +8 -0
  246. package/cjs/modules/customer.js +2174 -0
  247. package/cjs/modules/helpers/cartInitOption.js +22 -0
  248. package/cjs/modules/helpers/cookieConsent.js +33 -0
  249. package/cjs/modules/helpers/customerOauth2.js +64 -0
  250. package/cjs/modules/helpers/getOAuth2Hook.js +52 -0
  251. package/cjs/modules/helpers/hookUpAnalytics.js +49 -0
  252. package/cjs/modules/helpers/loadJWT.js +23 -0
  253. package/cjs/modules/helpers/misc.js +58 -0
  254. package/cjs/modules/imageDialog.js +78 -0
  255. package/cjs/modules/persist.js +55 -0
  256. package/cjs/modules/popupMessage.js +21 -0
  257. package/cjs/modules/product.js +1261 -0
  258. package/cjs/modules/recentlyVisitedProducts.js +72 -0
  259. package/cjs/modules/search.js +102 -0
  260. package/cjs/multiResponseToResponse.js +22 -0
  261. package/cjs/nonNull.js +10 -0
  262. package/cjs/oauthState.js +40 -0
  263. package/cjs/orderShippingAddress.js +7 -0
  264. package/cjs/package.json +3 -0
  265. package/cjs/pender.js +16 -0
  266. package/cjs/percentageOff.js +7 -0
  267. package/cjs/popupConnectQueue.js +62 -0
  268. package/cjs/preact/components/SixDigitInput.js +167 -0
  269. package/cjs/preact/effector.js +74 -0
  270. package/cjs/preact/transition/CSSTransition.js +55 -0
  271. package/cjs/preact/transition/Transition.js +104 -0
  272. package/cjs/preact/translateLocalStatic.js +31 -0
  273. package/cjs/productFiltering.js +173 -0
  274. package/cjs/productSEO.js +51 -0
  275. package/cjs/productSorting.js +93 -0
  276. package/cjs/promiseAll.js +18 -0
  277. package/cjs/promiseLimit.js +38 -0
  278. package/cjs/rdsToInitialScores.js +32 -0
  279. package/cjs/react/components/Portal.js +7 -0
  280. package/cjs/react/components/RootCloseWrapper.js +41 -0
  281. package/cjs/react/components/SixDigitInput.js +167 -0
  282. package/cjs/react/contains.js +14 -0
  283. package/cjs/react/popperBinder.js +70 -0
  284. package/cjs/react/rootClose.js +112 -0
  285. package/cjs/react/translateLocalStatic.js +32 -0
  286. package/cjs/react/useAsyncCachedValue.js +14 -0
  287. package/cjs/refreshTimeout.js +25 -0
  288. package/cjs/remoteAuth.js +59 -0
  289. package/cjs/request.js +348 -0
  290. package/cjs/requestDetails.js +76 -0
  291. package/cjs/rfc3339Normalize.js +10 -0
  292. package/cjs/script.js +172 -0
  293. package/cjs/seo.js +2 -0
  294. package/cjs/shopDomain.js +8 -0
  295. package/cjs/shopLinks.js +63 -0
  296. package/cjs/slate.js +376 -0
  297. package/cjs/sleep.js +10 -0
  298. package/cjs/splitBy.js +21 -0
  299. package/cjs/splitName.js +28 -0
  300. package/cjs/stripZeros.js +13 -0
  301. package/cjs/stripeError.js +65 -0
  302. package/cjs/tailSplit.js +12 -0
  303. package/cjs/tieredPrice.js +32 -0
  304. package/cjs/timeIt.js +15 -0
  305. package/cjs/toMajor.js +8 -0
  306. package/cjs/toMinor.js +8 -0
  307. package/cjs/trace.js +37 -0
  308. package/cjs/translateLocale.js +12 -0
  309. package/cjs/traverse.js +14 -0
  310. package/cjs/truncate.js +21 -0
  311. package/cjs/typedLocalStorage.js +30 -0
  312. package/cjs/variantImage.js +26 -0
  313. package/cjs/variantImageURL.js +13 -0
  314. package/cjs/variantImages.js +19 -0
  315. package/cjs/variantInventory.js +43 -0
  316. package/cjs/variantOptions.js +21 -0
  317. package/cjs/variantPrice.js +96 -0
  318. package/cjs/variantPriceCommerce.js +29 -0
  319. package/cjs/variantTitle.js +9 -0
  320. package/cjs/variantTitleFull.js +11 -0
  321. package/cjs/variantURL.js +9 -0
  322. package/cjs/vendor/popper/index.d.ts +160 -0
  323. package/cjs/vendor/popper/index.js +2657 -0
  324. package/cjs/vendor/popper/index.js.map +1 -0
  325. package/cjs/vendor/popper/package.json +3 -0
  326. package/cjs/websocket.js +179 -0
  327. package/esm/actionLock.js +24 -0
  328. package/esm/addEmptyListItem.js +3 -0
  329. package/esm/aggregateOptions.js +169 -0
  330. package/esm/analytics.js +91 -0
  331. package/esm/analyticsProductData.js +28 -0
  332. package/esm/arrayToDict.js +8 -0
  333. package/esm/asyncModuleWrapper.js +47 -0
  334. package/esm/averageReviewScore.js +40 -0
  335. package/esm/buildconfig.js +13 -0
  336. package/esm/cachedLoader.js +32 -0
  337. package/esm/canonicalVariantURL.js +1 -0
  338. package/esm/cartOperation.js +126 -0
  339. package/esm/categorySEO.js +16 -0
  340. package/esm/commonTypes.js +1 -0
  341. package/esm/compact.js +4 -0
  342. package/esm/configLoader.js +61 -0
  343. package/esm/controlledQueue.js +38 -0
  344. package/esm/convertImageURL.js +15 -0
  345. package/esm/dataLoader.js +192 -0
  346. package/esm/defaultVariant.js +25 -0
  347. package/esm/effector/clearOnChangeAfterDelay.js +13 -0
  348. package/esm/effector/combineEvery.js +4 -0
  349. package/esm/effector/combineSome.js +4 -0
  350. package/esm/effector/debounced.js +14 -0
  351. package/esm/effector/form.js +166 -0
  352. package/esm/effector/hideOnChangeAfterDelay.js +13 -0
  353. package/esm/effector/requestResponse.js +24 -0
  354. package/esm/effector/requestResponseMulti.js +47 -0
  355. package/esm/effector/restoreNamed.js +4 -0
  356. package/esm/effector/split.js +25 -0
  357. package/esm/effector/validator.js +28 -0
  358. package/esm/effector/wrapSignInRequired.js +9 -0
  359. package/esm/exceptions.js +2 -0
  360. package/esm/fetchAllItems.js +44 -0
  361. package/esm/file.js +67 -0
  362. package/esm/fileWebsocket.js +75 -0
  363. package/esm/filterFunc.js +43 -0
  364. package/esm/filterFuncBrand.js +9 -0
  365. package/esm/filterFuncCategory.js +9 -0
  366. package/esm/filterFuncContentBlock.js +16 -0
  367. package/esm/filterFuncCustomer.js +153 -0
  368. package/esm/filterFuncDataFeed.js +50 -0
  369. package/esm/filterFuncOrder.js +325 -0
  370. package/esm/filterFuncPreprocess.js +9 -0
  371. package/esm/filterFuncProduct.js +66 -0
  372. package/esm/filterFuncPurchaseOrder.js +122 -0
  373. package/esm/filterFuncSupplier.js +31 -0
  374. package/esm/filterFuncTransfer.js +130 -0
  375. package/esm/formatAbbrevNumber.js +16 -0
  376. package/esm/formatCurrency.js +42 -0
  377. package/esm/formatToJSX.js +118 -0
  378. package/esm/fulfillmentNumber.js +3 -0
  379. package/esm/generateRandomToken.js +8 -0
  380. package/esm/generateUUID.js +6 -0
  381. package/esm/generated/codes.js +44 -0
  382. package/esm/genericFile.js +65 -0
  383. package/esm/getSalesChannelID.js +9 -0
  384. package/esm/getSessionID.js +9 -0
  385. package/esm/getTimezone.js +8 -0
  386. package/esm/graphql/fragments/Branding.js +1 -0
  387. package/esm/graphql/fragments/BrandingField.js +1 -0
  388. package/esm/graphql/fragments/CartCustomItem.js +1 -0
  389. package/esm/graphql/fragments/CartOrder.js +1 -0
  390. package/esm/graphql/fragments/CartVariant.js +1 -0
  391. package/esm/graphql/fragments/CartVariantFull.js +1 -0
  392. package/esm/graphql/fragments/Category.js +1 -0
  393. package/esm/graphql/fragments/CommonCartVariant.js +1 -0
  394. package/esm/graphql/fragments/Currency.js +1 -0
  395. package/esm/graphql/fragments/CurrencyPrice.js +1 -0
  396. package/esm/graphql/fragments/CustomField.js +1 -0
  397. package/esm/graphql/fragments/CustomFieldObjects.js +1 -0
  398. package/esm/graphql/fragments/Customer.js +1 -0
  399. package/esm/graphql/fragments/CustomerBalance.js +1 -0
  400. package/esm/graphql/fragments/CustomerBalanceHistory.js +1 -0
  401. package/esm/graphql/fragments/CustomerFavorite.js +1 -0
  402. package/esm/graphql/fragments/CustomerFavoriteShort.js +1 -0
  403. package/esm/graphql/fragments/CustomerOAuthProvider.js +1 -0
  404. package/esm/graphql/fragments/CustomerOrderBrief.js +1 -0
  405. package/esm/graphql/fragments/CustomerOrderFulfillment.js +1 -0
  406. package/esm/graphql/fragments/CustomerOrderFull.js +1 -0
  407. package/esm/graphql/fragments/CustomerPaymentSource.js +1 -0
  408. package/esm/graphql/fragments/CustomerReturnBrief.js +1 -0
  409. package/esm/graphql/fragments/CustomerReturnFull.js +1 -0
  410. package/esm/graphql/fragments/CustomerReturnPolicy.js +1 -0
  411. package/esm/graphql/fragments/CustomerSubscriptionBrief.js +1 -0
  412. package/esm/graphql/fragments/CustomerSubscriptionFull.js +1 -0
  413. package/esm/graphql/fragments/File.js +1 -0
  414. package/esm/graphql/fragments/FileForUpload.js +1 -0
  415. package/esm/graphql/fragments/FileNoFallback.js +1 -0
  416. package/esm/graphql/fragments/FullAddress.js +1 -0
  417. package/esm/graphql/fragments/Gateway.js +1 -0
  418. package/esm/graphql/fragments/GatewayManual.js +1 -0
  419. package/esm/graphql/fragments/GatewayPaypal.js +1 -0
  420. package/esm/graphql/fragments/GatewayStripe.js +1 -0
  421. package/esm/graphql/fragments/GatewayTest.js +1 -0
  422. package/esm/graphql/fragments/IPAndUAInfo.js +1 -0
  423. package/esm/graphql/fragments/InfoCountry.js +1 -0
  424. package/esm/graphql/fragments/InfoCountryDedupField.js +1 -0
  425. package/esm/graphql/fragments/InfoCurrency.js +1 -0
  426. package/esm/graphql/fragments/InfoProvince.js +1 -0
  427. package/esm/graphql/fragments/KeyValue.js +1 -0
  428. package/esm/graphql/fragments/LineItemField.js +1 -0
  429. package/esm/graphql/fragments/MediaFile.js +1 -0
  430. package/esm/graphql/fragments/MinCurrencyPrice.js +1 -0
  431. package/esm/graphql/fragments/ProductField.js +1 -0
  432. package/esm/graphql/fragments/ProductFieldSet.js +1 -0
  433. package/esm/graphql/fragments/ProductFlat.js +1 -0
  434. package/esm/graphql/fragments/ProductQuestion.js +1 -0
  435. package/esm/graphql/fragments/ProductQuestionAnswer.js +1 -0
  436. package/esm/graphql/fragments/ProductQuestionPage.js +1 -0
  437. package/esm/graphql/fragments/ProductReview.js +1 -0
  438. package/esm/graphql/fragments/ProductReviewAnswer.js +1 -0
  439. package/esm/graphql/fragments/ProductReviewAverageScore.js +1 -0
  440. package/esm/graphql/fragments/ProductReviewPage.js +1 -0
  441. package/esm/graphql/fragments/ProductReviewScore.js +1 -0
  442. package/esm/graphql/fragments/ProductReviewSurveyAnswer.js +1 -0
  443. package/esm/graphql/fragments/ProductSearchOptionAgg.js +1 -0
  444. package/esm/graphql/fragments/ProductSearchResult.js +1 -0
  445. package/esm/graphql/fragments/ReturnReason.js +1 -0
  446. package/esm/graphql/fragments/ReviewDimension.js +1 -0
  447. package/esm/graphql/fragments/ReviewDimensionSet.js +1 -0
  448. package/esm/graphql/fragments/ReviewImagePage.js +1 -0
  449. package/esm/graphql/fragments/ReviewQuestionProduct.js +1 -0
  450. package/esm/graphql/fragments/ReviewSettings.js +1 -0
  451. package/esm/graphql/fragments/SearchProduct.js +1 -0
  452. package/esm/graphql/fragments/Shop.js +1 -0
  453. package/esm/graphql/fragments/SubscriptionPlan.js +1 -0
  454. package/esm/graphql/fragments/SurveyQuestion.js +1 -0
  455. package/esm/graphql/fragments/TieredPricing.js +1 -0
  456. package/esm/graphql/fragments/TieredPricingTier.js +1 -0
  457. package/esm/graphql/fragments/VariantOption.js +1 -0
  458. package/esm/graphql/operations/ApplyGiftCardMutation.js +1 -0
  459. package/esm/graphql/operations/AuthRequestMutation.js +1 -0
  460. package/esm/graphql/operations/CancelOrderMutation.js +1 -0
  461. package/esm/graphql/operations/CancelSubscriptionMutation.js +1 -0
  462. package/esm/graphql/operations/ConnectOAuth2Mutation.js +1 -0
  463. package/esm/graphql/operations/CreateCartMutation.js +23 -0
  464. package/esm/graphql/operations/CreateFavoriteMutation.js +19 -0
  465. package/esm/graphql/operations/CreateFileMutation.js +3 -0
  466. package/esm/graphql/operations/CreatePaymentSourceMutation.js +3 -0
  467. package/esm/graphql/operations/CreateProductQuestionAnswerMutation.js +1 -0
  468. package/esm/graphql/operations/CreateProductQuestionMutation.js +5 -0
  469. package/esm/graphql/operations/CreateProductReviewMutation.js +15 -0
  470. package/esm/graphql/operations/CreateReturnMutation.js +19 -0
  471. package/esm/graphql/operations/DeleteFavoriteMutation.js +1 -0
  472. package/esm/graphql/operations/DeletePaymentSourceMutation.js +1 -0
  473. package/esm/graphql/operations/DeleteProductQuestionAnswerMutation.js +1 -0
  474. package/esm/graphql/operations/DeleteProductQuestionMutation.js +1 -0
  475. package/esm/graphql/operations/DeleteProductReviewMutation.js +1 -0
  476. package/esm/graphql/operations/DisconnectOAuth2Mutation.js +1 -0
  477. package/esm/graphql/operations/EditSubscriptionMutation.js +1 -0
  478. package/esm/graphql/operations/FileUploadedMutation.js +3 -0
  479. package/esm/graphql/operations/FlagQuestionAnswerMutation.js +1 -0
  480. package/esm/graphql/operations/FlagQuestionMutation.js +1 -0
  481. package/esm/graphql/operations/FlagReviewAnswerMutation.js +1 -0
  482. package/esm/graphql/operations/FlagReviewMutation.js +1 -0
  483. package/esm/graphql/operations/GetBrandingQuery.js +7 -0
  484. package/esm/graphql/operations/GetCartQuery.js +23 -0
  485. package/esm/graphql/operations/GetCustomerAddressesPageDataQuery.js +13 -0
  486. package/esm/graphql/operations/GetCustomerBalanceHistoryPageQuery.js +3 -0
  487. package/esm/graphql/operations/GetCustomerBalanceQuery.js +5 -0
  488. package/esm/graphql/operations/GetCustomerInfoQuery.js +7 -0
  489. package/esm/graphql/operations/GetCustomerQuery.js +5 -0
  490. package/esm/graphql/operations/GetFavoritesQuery.js +19 -0
  491. package/esm/graphql/operations/GetFileStatusQuery.js +3 -0
  492. package/esm/graphql/operations/GetGatewaysQuery.js +11 -0
  493. package/esm/graphql/operations/GetInfoCurrenciesQuery.js +3 -0
  494. package/esm/graphql/operations/GetLastCartQuery.js +23 -0
  495. package/esm/graphql/operations/GetOrderQuery.js +27 -0
  496. package/esm/graphql/operations/GetOrdersPageQuery.js +21 -0
  497. package/esm/graphql/operations/GetPaymentMethodsPageDataQuery.js +15 -0
  498. package/esm/graphql/operations/GetProductQuestionsPageQuery.js +7 -0
  499. package/esm/graphql/operations/GetProductReviewImagesPageQuery.js +5 -0
  500. package/esm/graphql/operations/GetProductReviewsPageQuery.js +17 -0
  501. package/esm/graphql/operations/GetProvincesQuery.js +3 -0
  502. package/esm/graphql/operations/GetQuestionQuery.js +5 -0
  503. package/esm/graphql/operations/GetReturnCreationInfoQuery.js +33 -0
  504. package/esm/graphql/operations/GetReturnQuery.js +25 -0
  505. package/esm/graphql/operations/GetReturnsPageQuery.js +19 -0
  506. package/esm/graphql/operations/GetReviewDimensionsQuery.js +3 -0
  507. package/esm/graphql/operations/GetReviewQuery.js +15 -0
  508. package/esm/graphql/operations/GetReviewSettingsQuery.js +9 -0
  509. package/esm/graphql/operations/GetShopCurrenciesQuery.js +3 -0
  510. package/esm/graphql/operations/GetShopQuery.js +5 -0
  511. package/esm/graphql/operations/GetSubscriptionQuery.js +33 -0
  512. package/esm/graphql/operations/GetSubscriptionsPageQuery.js +19 -0
  513. package/esm/graphql/operations/GetVariantPageQuery.js +17 -0
  514. package/esm/graphql/operations/LoadProductNoCustomerQuery.js +59 -0
  515. package/esm/graphql/operations/LoadProductQuery.js +63 -0
  516. package/esm/graphql/operations/ModifyCartMutation.js +23 -0
  517. package/esm/graphql/operations/ModifyCustomerMutation.js +5 -0
  518. package/esm/graphql/operations/ModifyFavoriteMutation.js +19 -0
  519. package/esm/graphql/operations/ModifyProductQuestionAnswerMutation.js +1 -0
  520. package/esm/graphql/operations/ModifyProductQuestionMutation.js +5 -0
  521. package/esm/graphql/operations/ModifyProductReviewMutation.js +15 -0
  522. package/esm/graphql/operations/NewPasswordMutation.js +1 -0
  523. package/esm/graphql/operations/PauseSubscriptionMutation.js +1 -0
  524. package/esm/graphql/operations/ResetPasswordMutation.js +1 -0
  525. package/esm/graphql/operations/ResumeSubscriptionMutation.js +1 -0
  526. package/esm/graphql/operations/SearchProductsAdvancedQuery.js +21 -0
  527. package/esm/graphql/operations/SearchProductsQuery.js +17 -0
  528. package/esm/graphql/operations/SearchQuestionsQuery.js +5 -0
  529. package/esm/graphql/operations/SearchReviewsQuery.js +15 -0
  530. package/esm/graphql/operations/SignInMutation.js +1 -0
  531. package/esm/graphql/operations/SignInViaEmailCompleteMutation.js +1 -0
  532. package/esm/graphql/operations/SignInViaEmailInitMutation.js +1 -0
  533. package/esm/graphql/operations/SignUpMutation.js +1 -0
  534. package/esm/graphql/operations/SkipNextSubscriptionMutation.js +1 -0
  535. package/esm/graphql/operations/UploadFileMutation.js +1 -0
  536. package/esm/graphql/operations/VerifyCodeMutation.js +1 -0
  537. package/esm/graphql/operations/VoteQuestionAnswerMutation.js +1 -0
  538. package/esm/graphql/operations/VoteQuestionMutation.js +1 -0
  539. package/esm/graphql/operations/VoteReviewAnswerMutation.js +1 -0
  540. package/esm/graphql/operations/VoteReviewMutation.js +1 -0
  541. package/esm/graphql/types.js +1 -0
  542. package/esm/hierarchicalSearchOption.js +43 -0
  543. package/esm/idgen.js +4 -0
  544. package/esm/ignoreQueue.js +45 -0
  545. package/esm/imageAltProps.js +9 -0
  546. package/esm/invoiceFormat.js +54 -0
  547. package/esm/isShippingRequired.js +16 -0
  548. package/esm/isoStripTrailingZeros.js +3 -0
  549. package/esm/json/commerce.js +3 -0
  550. package/esm/json/commerceFileUpload.js +43 -0
  551. package/esm/json/commerceTypes.js +1 -0
  552. package/esm/json/common.js +309 -0
  553. package/esm/json/fetchAllItems.js +51 -0
  554. package/esm/json/mutator.js +952 -0
  555. package/esm/json/storefront.js +3 -0
  556. package/esm/json/storefrontTypes.js +1 -0
  557. package/esm/lastValue.js +12 -0
  558. package/esm/lineItemPrice.js +106 -0
  559. package/esm/loadJWT.js +20 -0
  560. package/esm/mapInvalidInput.js +27 -0
  561. package/esm/mapResponseData.js +11 -0
  562. package/esm/mapResponseMultiData.js +10 -0
  563. package/esm/meanBy.js +11 -0
  564. package/esm/media.js +12 -0
  565. package/esm/modules/advancedSearch.js +132 -0
  566. package/esm/modules/cart.js +699 -0
  567. package/esm/modules/config/defaultAdvancedSearchGraphQLConfig.js +4 -0
  568. package/esm/modules/config/defaultCartGraphQLConfig.js +10 -0
  569. package/esm/modules/config/defaultProductGraphQLConfig.js +44 -0
  570. package/esm/modules/config/defaultSearchGraphQLConfig.js +4 -0
  571. package/esm/modules/customer.js +2198 -0
  572. package/esm/modules/helpers/cartInitOption.js +18 -0
  573. package/esm/modules/helpers/cookieConsent.js +29 -0
  574. package/esm/modules/helpers/customerOauth2.js +53 -0
  575. package/esm/modules/helpers/getOAuth2Hook.js +48 -0
  576. package/esm/modules/helpers/hookUpAnalytics.js +44 -0
  577. package/esm/modules/helpers/loadJWT.js +18 -0
  578. package/esm/modules/helpers/misc.js +49 -0
  579. package/esm/modules/imageDialog.js +71 -0
  580. package/esm/modules/persist.js +49 -0
  581. package/esm/modules/popupMessage.js +17 -0
  582. package/esm/modules/product.js +1278 -0
  583. package/esm/modules/recentlyVisitedProducts.js +70 -0
  584. package/esm/modules/search.js +103 -0
  585. package/esm/multiResponseToResponse.js +18 -0
  586. package/esm/nonNull.js +6 -0
  587. package/esm/oauthState.js +35 -0
  588. package/esm/orderShippingAddress.js +3 -0
  589. package/esm/package.json +3 -0
  590. package/esm/pender.js +11 -0
  591. package/esm/percentageOff.js +3 -0
  592. package/esm/popupConnectQueue.js +55 -0
  593. package/esm/preact/components/SixDigitInput.js +159 -0
  594. package/esm/preact/effector.js +69 -0
  595. package/esm/preact/transition/CSSTransition.js +47 -0
  596. package/esm/preact/transition/Transition.js +100 -0
  597. package/esm/preact/translateLocalStatic.js +26 -0
  598. package/esm/productFiltering.js +164 -0
  599. package/esm/productSEO.js +46 -0
  600. package/esm/productSorting.js +89 -0
  601. package/esm/promiseAll.js +11 -0
  602. package/esm/promiseLimit.js +32 -0
  603. package/esm/rdsToInitialScores.js +27 -0
  604. package/esm/react/components/Portal.js +2 -0
  605. package/esm/react/components/RootCloseWrapper.js +33 -0
  606. package/esm/react/components/SixDigitInput.js +158 -0
  607. package/esm/react/contains.js +10 -0
  608. package/esm/react/popperBinder.js +71 -0
  609. package/esm/react/rootClose.js +106 -0
  610. package/esm/react/translateLocalStatic.js +26 -0
  611. package/esm/react/useAsyncCachedValue.js +10 -0
  612. package/esm/refreshTimeout.js +21 -0
  613. package/esm/remoteAuth.js +52 -0
  614. package/esm/request.js +323 -0
  615. package/esm/requestDetails.js +69 -0
  616. package/esm/rfc3339Normalize.js +6 -0
  617. package/esm/script.js +157 -0
  618. package/esm/seo.js +1 -0
  619. package/esm/shopDomain.js +4 -0
  620. package/esm/shopLinks.js +47 -0
  621. package/esm/slate.js +364 -0
  622. package/esm/sleep.js +3 -0
  623. package/esm/splitBy.js +17 -0
  624. package/esm/splitName.js +22 -0
  625. package/esm/stripZeros.js +9 -0
  626. package/esm/stripeError.js +53 -0
  627. package/esm/tailSplit.js +8 -0
  628. package/esm/tieredPrice.js +28 -0
  629. package/esm/timeIt.js +8 -0
  630. package/esm/toMajor.js +4 -0
  631. package/esm/toMinor.js +4 -0
  632. package/esm/trace.js +37 -0
  633. package/esm/translateLocale.js +7 -0
  634. package/esm/traverse.js +10 -0
  635. package/esm/truncate.js +17 -0
  636. package/esm/typedLocalStorage.js +24 -0
  637. package/esm/variantImage.js +22 -0
  638. package/esm/variantImageURL.js +9 -0
  639. package/esm/variantImages.js +15 -0
  640. package/esm/variantInventory.js +38 -0
  641. package/esm/variantOptions.js +15 -0
  642. package/esm/variantPrice.js +92 -0
  643. package/esm/variantPriceCommerce.js +25 -0
  644. package/esm/variantTitle.js +5 -0
  645. package/esm/variantTitleFull.js +7 -0
  646. package/esm/variantURL.js +5 -0
  647. package/esm/vendor/popper/index.d.ts +160 -0
  648. package/esm/vendor/popper/index.js +2657 -0
  649. package/esm/vendor/popper/index.js.map +1 -0
  650. package/esm/vendor/popper/package.json +3 -0
  651. package/esm/websocket.js +169 -0
  652. package/package.json +92 -0
  653. package/types/actionLock.d.ts +7 -0
  654. package/types/addEmptyListItem.d.ts +2 -0
  655. package/types/aggregateOptions.d.ts +33 -0
  656. package/types/analytics.d.ts +23 -0
  657. package/types/analyticsProductData.d.ts +38 -0
  658. package/types/arrayToDict.d.ts +2 -0
  659. package/types/asyncModuleWrapper.d.ts +13 -0
  660. package/types/averageReviewScore.d.ts +28 -0
  661. package/types/buildconfig.d.ts +13 -0
  662. package/types/cachedLoader.d.ts +10 -0
  663. package/types/canonicalVariantURL.d.ts +12 -0
  664. package/types/cartOperation.d.ts +28 -0
  665. package/types/categorySEO.d.ts +17 -0
  666. package/types/commonTypes.d.ts +10 -0
  667. package/types/compact.d.ts +1 -0
  668. package/types/configLoader.d.ts +53 -0
  669. package/types/controlledQueue.d.ts +17 -0
  670. package/types/convertImageURL.d.ts +9 -0
  671. package/types/dataLoader.d.ts +301 -0
  672. package/types/defaultVariant.d.ts +9 -0
  673. package/types/effector/clearOnChangeAfterDelay.d.ts +2 -0
  674. package/types/effector/combineEvery.d.ts +2 -0
  675. package/types/effector/combineSome.d.ts +2 -0
  676. package/types/effector/debounced.d.ts +2 -0
  677. package/types/effector/form.d.ts +74 -0
  678. package/types/effector/hideOnChangeAfterDelay.d.ts +6 -0
  679. package/types/effector/requestResponse.d.ts +9 -0
  680. package/types/effector/requestResponseMulti.d.ts +7 -0
  681. package/types/effector/restoreNamed.d.ts +2 -0
  682. package/types/effector/split.d.ts +7 -0
  683. package/types/effector/validator.d.ts +14 -0
  684. package/types/effector/wrapSignInRequired.d.ts +2 -0
  685. package/types/exceptions.d.ts +2 -0
  686. package/types/fetchAllItems.d.ts +25 -0
  687. package/types/file.d.ts +4 -0
  688. package/types/fileWebsocket.d.ts +6 -0
  689. package/types/filterFunc.d.ts +8 -0
  690. package/types/filterFuncBrand.d.ts +3 -0
  691. package/types/filterFuncCategory.d.ts +3 -0
  692. package/types/filterFuncContentBlock.d.ts +3 -0
  693. package/types/filterFuncCustomer.d.ts +3 -0
  694. package/types/filterFuncDataFeed.d.ts +8 -0
  695. package/types/filterFuncOrder.d.ts +3 -0
  696. package/types/filterFuncPreprocess.d.ts +2 -0
  697. package/types/filterFuncProduct.d.ts +3 -0
  698. package/types/filterFuncPurchaseOrder.d.ts +3 -0
  699. package/types/filterFuncSupplier.d.ts +3 -0
  700. package/types/filterFuncTransfer.d.ts +3 -0
  701. package/types/formatAbbrevNumber.d.ts +6 -0
  702. package/types/formatCurrency.d.ts +44 -0
  703. package/types/formatToJSX.d.ts +24 -0
  704. package/types/fulfillmentNumber.d.ts +1 -0
  705. package/types/generateRandomToken.d.ts +1 -0
  706. package/types/generateUUID.d.ts +1 -0
  707. package/types/generated/codes.d.ts +234 -0
  708. package/types/genericFile.d.ts +57 -0
  709. package/types/getSalesChannelID.d.ts +1 -0
  710. package/types/getSessionID.d.ts +1 -0
  711. package/types/getTimezone.d.ts +1 -0
  712. package/types/graphql/fragments/Branding.d.ts +2 -0
  713. package/types/graphql/fragments/BrandingField.d.ts +2 -0
  714. package/types/graphql/fragments/CartCustomItem.d.ts +2 -0
  715. package/types/graphql/fragments/CartOrder.d.ts +2 -0
  716. package/types/graphql/fragments/CartVariant.d.ts +2 -0
  717. package/types/graphql/fragments/CartVariantFull.d.ts +2 -0
  718. package/types/graphql/fragments/Category.d.ts +2 -0
  719. package/types/graphql/fragments/CommonCartVariant.d.ts +2 -0
  720. package/types/graphql/fragments/Currency.d.ts +2 -0
  721. package/types/graphql/fragments/CurrencyPrice.d.ts +2 -0
  722. package/types/graphql/fragments/CustomField.d.ts +2 -0
  723. package/types/graphql/fragments/CustomFieldObjects.d.ts +2 -0
  724. package/types/graphql/fragments/Customer.d.ts +2 -0
  725. package/types/graphql/fragments/CustomerBalance.d.ts +2 -0
  726. package/types/graphql/fragments/CustomerBalanceHistory.d.ts +2 -0
  727. package/types/graphql/fragments/CustomerFavorite.d.ts +2 -0
  728. package/types/graphql/fragments/CustomerFavoriteShort.d.ts +2 -0
  729. package/types/graphql/fragments/CustomerOAuthProvider.d.ts +2 -0
  730. package/types/graphql/fragments/CustomerOrderBrief.d.ts +2 -0
  731. package/types/graphql/fragments/CustomerOrderFulfillment.d.ts +2 -0
  732. package/types/graphql/fragments/CustomerOrderFull.d.ts +2 -0
  733. package/types/graphql/fragments/CustomerPaymentSource.d.ts +2 -0
  734. package/types/graphql/fragments/CustomerReturnBrief.d.ts +2 -0
  735. package/types/graphql/fragments/CustomerReturnFull.d.ts +2 -0
  736. package/types/graphql/fragments/CustomerReturnPolicy.d.ts +2 -0
  737. package/types/graphql/fragments/CustomerSubscriptionBrief.d.ts +2 -0
  738. package/types/graphql/fragments/CustomerSubscriptionFull.d.ts +2 -0
  739. package/types/graphql/fragments/File.d.ts +2 -0
  740. package/types/graphql/fragments/FileForUpload.d.ts +2 -0
  741. package/types/graphql/fragments/FileNoFallback.d.ts +2 -0
  742. package/types/graphql/fragments/FullAddress.d.ts +2 -0
  743. package/types/graphql/fragments/Gateway.d.ts +2 -0
  744. package/types/graphql/fragments/GatewayManual.d.ts +2 -0
  745. package/types/graphql/fragments/GatewayPaypal.d.ts +2 -0
  746. package/types/graphql/fragments/GatewayStripe.d.ts +2 -0
  747. package/types/graphql/fragments/GatewayTest.d.ts +2 -0
  748. package/types/graphql/fragments/IPAndUAInfo.d.ts +2 -0
  749. package/types/graphql/fragments/InfoCountry.d.ts +2 -0
  750. package/types/graphql/fragments/InfoCountryDedupField.d.ts +2 -0
  751. package/types/graphql/fragments/InfoCurrency.d.ts +2 -0
  752. package/types/graphql/fragments/InfoProvince.d.ts +2 -0
  753. package/types/graphql/fragments/KeyValue.d.ts +2 -0
  754. package/types/graphql/fragments/LineItemField.d.ts +2 -0
  755. package/types/graphql/fragments/MediaFile.d.ts +2 -0
  756. package/types/graphql/fragments/MinCurrencyPrice.d.ts +2 -0
  757. package/types/graphql/fragments/ProductField.d.ts +2 -0
  758. package/types/graphql/fragments/ProductFieldSet.d.ts +2 -0
  759. package/types/graphql/fragments/ProductFlat.d.ts +2 -0
  760. package/types/graphql/fragments/ProductQuestion.d.ts +2 -0
  761. package/types/graphql/fragments/ProductQuestionAnswer.d.ts +2 -0
  762. package/types/graphql/fragments/ProductQuestionPage.d.ts +2 -0
  763. package/types/graphql/fragments/ProductReview.d.ts +2 -0
  764. package/types/graphql/fragments/ProductReviewAnswer.d.ts +2 -0
  765. package/types/graphql/fragments/ProductReviewAverageScore.d.ts +2 -0
  766. package/types/graphql/fragments/ProductReviewPage.d.ts +2 -0
  767. package/types/graphql/fragments/ProductReviewScore.d.ts +2 -0
  768. package/types/graphql/fragments/ProductReviewSurveyAnswer.d.ts +2 -0
  769. package/types/graphql/fragments/ProductSearchOptionAgg.d.ts +2 -0
  770. package/types/graphql/fragments/ProductSearchResult.d.ts +2 -0
  771. package/types/graphql/fragments/ReturnReason.d.ts +2 -0
  772. package/types/graphql/fragments/ReviewDimension.d.ts +2 -0
  773. package/types/graphql/fragments/ReviewDimensionSet.d.ts +2 -0
  774. package/types/graphql/fragments/ReviewImagePage.d.ts +2 -0
  775. package/types/graphql/fragments/ReviewQuestionProduct.d.ts +2 -0
  776. package/types/graphql/fragments/ReviewSettings.d.ts +2 -0
  777. package/types/graphql/fragments/SearchProduct.d.ts +2 -0
  778. package/types/graphql/fragments/Shop.d.ts +2 -0
  779. package/types/graphql/fragments/SubscriptionPlan.d.ts +2 -0
  780. package/types/graphql/fragments/SurveyQuestion.d.ts +2 -0
  781. package/types/graphql/fragments/TieredPricing.d.ts +2 -0
  782. package/types/graphql/fragments/TieredPricingTier.d.ts +2 -0
  783. package/types/graphql/fragments/VariantOption.d.ts +2 -0
  784. package/types/graphql/operations/ApplyGiftCardMutation.d.ts +3 -0
  785. package/types/graphql/operations/AuthRequestMutation.d.ts +3 -0
  786. package/types/graphql/operations/CancelOrderMutation.d.ts +3 -0
  787. package/types/graphql/operations/CancelSubscriptionMutation.d.ts +3 -0
  788. package/types/graphql/operations/ConnectOAuth2Mutation.d.ts +3 -0
  789. package/types/graphql/operations/CreateCartMutation.d.ts +3 -0
  790. package/types/graphql/operations/CreateFavoriteMutation.d.ts +3 -0
  791. package/types/graphql/operations/CreateFileMutation.d.ts +3 -0
  792. package/types/graphql/operations/CreatePaymentSourceMutation.d.ts +3 -0
  793. package/types/graphql/operations/CreateProductQuestionAnswerMutation.d.ts +3 -0
  794. package/types/graphql/operations/CreateProductQuestionMutation.d.ts +3 -0
  795. package/types/graphql/operations/CreateProductReviewMutation.d.ts +3 -0
  796. package/types/graphql/operations/CreateReturnMutation.d.ts +3 -0
  797. package/types/graphql/operations/DeleteFavoriteMutation.d.ts +3 -0
  798. package/types/graphql/operations/DeletePaymentSourceMutation.d.ts +3 -0
  799. package/types/graphql/operations/DeleteProductQuestionAnswerMutation.d.ts +3 -0
  800. package/types/graphql/operations/DeleteProductQuestionMutation.d.ts +3 -0
  801. package/types/graphql/operations/DeleteProductReviewMutation.d.ts +3 -0
  802. package/types/graphql/operations/DisconnectOAuth2Mutation.d.ts +3 -0
  803. package/types/graphql/operations/EditSubscriptionMutation.d.ts +3 -0
  804. package/types/graphql/operations/FileUploadedMutation.d.ts +3 -0
  805. package/types/graphql/operations/FlagQuestionAnswerMutation.d.ts +3 -0
  806. package/types/graphql/operations/FlagQuestionMutation.d.ts +3 -0
  807. package/types/graphql/operations/FlagReviewAnswerMutation.d.ts +3 -0
  808. package/types/graphql/operations/FlagReviewMutation.d.ts +3 -0
  809. package/types/graphql/operations/GetBrandingQuery.d.ts +3 -0
  810. package/types/graphql/operations/GetCartQuery.d.ts +3 -0
  811. package/types/graphql/operations/GetCustomerAddressesPageDataQuery.d.ts +3 -0
  812. package/types/graphql/operations/GetCustomerBalanceHistoryPageQuery.d.ts +3 -0
  813. package/types/graphql/operations/GetCustomerBalanceQuery.d.ts +3 -0
  814. package/types/graphql/operations/GetCustomerInfoQuery.d.ts +3 -0
  815. package/types/graphql/operations/GetCustomerQuery.d.ts +3 -0
  816. package/types/graphql/operations/GetFavoritesQuery.d.ts +3 -0
  817. package/types/graphql/operations/GetFileStatusQuery.d.ts +3 -0
  818. package/types/graphql/operations/GetGatewaysQuery.d.ts +3 -0
  819. package/types/graphql/operations/GetInfoCurrenciesQuery.d.ts +3 -0
  820. package/types/graphql/operations/GetLastCartQuery.d.ts +3 -0
  821. package/types/graphql/operations/GetOrderQuery.d.ts +3 -0
  822. package/types/graphql/operations/GetOrdersPageQuery.d.ts +3 -0
  823. package/types/graphql/operations/GetPaymentMethodsPageDataQuery.d.ts +3 -0
  824. package/types/graphql/operations/GetProductQuestionsPageQuery.d.ts +3 -0
  825. package/types/graphql/operations/GetProductReviewImagesPageQuery.d.ts +3 -0
  826. package/types/graphql/operations/GetProductReviewsPageQuery.d.ts +3 -0
  827. package/types/graphql/operations/GetProvincesQuery.d.ts +3 -0
  828. package/types/graphql/operations/GetQuestionQuery.d.ts +3 -0
  829. package/types/graphql/operations/GetReturnCreationInfoQuery.d.ts +3 -0
  830. package/types/graphql/operations/GetReturnQuery.d.ts +3 -0
  831. package/types/graphql/operations/GetReturnsPageQuery.d.ts +3 -0
  832. package/types/graphql/operations/GetReviewDimensionsQuery.d.ts +3 -0
  833. package/types/graphql/operations/GetReviewQuery.d.ts +3 -0
  834. package/types/graphql/operations/GetReviewSettingsQuery.d.ts +3 -0
  835. package/types/graphql/operations/GetShopCurrenciesQuery.d.ts +3 -0
  836. package/types/graphql/operations/GetShopQuery.d.ts +3 -0
  837. package/types/graphql/operations/GetSubscriptionQuery.d.ts +3 -0
  838. package/types/graphql/operations/GetSubscriptionsPageQuery.d.ts +3 -0
  839. package/types/graphql/operations/GetVariantPageQuery.d.ts +3 -0
  840. package/types/graphql/operations/LoadProductNoCustomerQuery.d.ts +3 -0
  841. package/types/graphql/operations/LoadProductQuery.d.ts +3 -0
  842. package/types/graphql/operations/ModifyCartMutation.d.ts +3 -0
  843. package/types/graphql/operations/ModifyCustomerMutation.d.ts +3 -0
  844. package/types/graphql/operations/ModifyFavoriteMutation.d.ts +3 -0
  845. package/types/graphql/operations/ModifyProductQuestionAnswerMutation.d.ts +3 -0
  846. package/types/graphql/operations/ModifyProductQuestionMutation.d.ts +3 -0
  847. package/types/graphql/operations/ModifyProductReviewMutation.d.ts +3 -0
  848. package/types/graphql/operations/NewPasswordMutation.d.ts +3 -0
  849. package/types/graphql/operations/PauseSubscriptionMutation.d.ts +3 -0
  850. package/types/graphql/operations/ResetPasswordMutation.d.ts +3 -0
  851. package/types/graphql/operations/ResumeSubscriptionMutation.d.ts +3 -0
  852. package/types/graphql/operations/SearchProductsAdvancedQuery.d.ts +3 -0
  853. package/types/graphql/operations/SearchProductsQuery.d.ts +3 -0
  854. package/types/graphql/operations/SearchQuestionsQuery.d.ts +3 -0
  855. package/types/graphql/operations/SearchReviewsQuery.d.ts +3 -0
  856. package/types/graphql/operations/SignInMutation.d.ts +3 -0
  857. package/types/graphql/operations/SignInViaEmailCompleteMutation.d.ts +3 -0
  858. package/types/graphql/operations/SignInViaEmailInitMutation.d.ts +3 -0
  859. package/types/graphql/operations/SignUpMutation.d.ts +3 -0
  860. package/types/graphql/operations/SkipNextSubscriptionMutation.d.ts +3 -0
  861. package/types/graphql/operations/UploadFileMutation.d.ts +3 -0
  862. package/types/graphql/operations/VerifyCodeMutation.d.ts +3 -0
  863. package/types/graphql/operations/VoteQuestionAnswerMutation.d.ts +3 -0
  864. package/types/graphql/operations/VoteQuestionMutation.d.ts +3 -0
  865. package/types/graphql/operations/VoteReviewAnswerMutation.d.ts +3 -0
  866. package/types/graphql/operations/VoteReviewMutation.d.ts +3 -0
  867. package/types/graphql/types.d.ts +2471 -0
  868. package/types/hierarchicalSearchOption.d.ts +14 -0
  869. package/types/idgen.d.ts +1 -0
  870. package/types/ignoreQueue.d.ts +10 -0
  871. package/types/imageAltProps.d.ts +11 -0
  872. package/types/invoiceFormat.d.ts +32 -0
  873. package/types/isShippingRequired.d.ts +14 -0
  874. package/types/isoStripTrailingZeros.d.ts +1 -0
  875. package/types/json/commerce.d.ts +3 -0
  876. package/types/json/commerceFileUpload.d.ts +20 -0
  877. package/types/json/commerceTypes.d.ts +15422 -0
  878. package/types/json/common.d.ts +81 -0
  879. package/types/json/fetchAllItems.d.ts +15 -0
  880. package/types/json/mutator.d.ts +238 -0
  881. package/types/json/storefront.d.ts +3 -0
  882. package/types/json/storefrontTypes.d.ts +5059 -0
  883. package/types/lastValue.d.ts +10 -0
  884. package/types/lineItemPrice.d.ts +18 -0
  885. package/types/loadJWT.d.ts +1 -0
  886. package/types/mapInvalidInput.d.ts +15 -0
  887. package/types/mapResponseData.d.ts +3 -0
  888. package/types/mapResponseMultiData.d.ts +2 -0
  889. package/types/meanBy.d.ts +1 -0
  890. package/types/media.d.ts +3 -0
  891. package/types/modules/advancedSearch.d.ts +78 -0
  892. package/types/modules/cart.d.ts +263 -0
  893. package/types/modules/config/defaultAdvancedSearchGraphQLConfig.d.ts +3 -0
  894. package/types/modules/config/defaultCartGraphQLConfig.d.ts +6 -0
  895. package/types/modules/config/defaultProductGraphQLConfig.d.ts +23 -0
  896. package/types/modules/config/defaultSearchGraphQLConfig.d.ts +3 -0
  897. package/types/modules/customer.d.ts +624 -0
  898. package/types/modules/helpers/cartInitOption.d.ts +2 -0
  899. package/types/modules/helpers/cookieConsent.d.ts +4 -0
  900. package/types/modules/helpers/customerOauth2.d.ts +19 -0
  901. package/types/modules/helpers/getOAuth2Hook.d.ts +22 -0
  902. package/types/modules/helpers/hookUpAnalytics.d.ts +21 -0
  903. package/types/modules/helpers/loadJWT.d.ts +1 -0
  904. package/types/modules/helpers/misc.d.ts +14 -0
  905. package/types/modules/imageDialog.d.ts +31 -0
  906. package/types/modules/persist.d.ts +13 -0
  907. package/types/modules/popupMessage.d.ts +9 -0
  908. package/types/modules/product.d.ts +320 -0
  909. package/types/modules/recentlyVisitedProducts.d.ts +25 -0
  910. package/types/modules/search.d.ts +54 -0
  911. package/types/multiResponseToResponse.d.ts +2 -0
  912. package/types/nonNull.d.ts +1 -0
  913. package/types/oauthState.d.ts +3 -0
  914. package/types/orderShippingAddress.d.ts +6 -0
  915. package/types/pender.d.ts +5 -0
  916. package/types/percentageOff.d.ts +1 -0
  917. package/types/popupConnectQueue.d.ts +41 -0
  918. package/types/preact/components/SixDigitInput.d.ts +28 -0
  919. package/types/preact/effector.d.ts +8 -0
  920. package/types/preact/transition/CSSTransition.d.ts +8 -0
  921. package/types/preact/transition/Transition.d.ts +30 -0
  922. package/types/preact/translateLocalStatic.d.ts +4 -0
  923. package/types/productFiltering.d.ts +58 -0
  924. package/types/productSEO.d.ts +59 -0
  925. package/types/productSorting.d.ts +35 -0
  926. package/types/promiseAll.d.ts +5 -0
  927. package/types/promiseLimit.d.ts +13 -0
  928. package/types/rdsToInitialScores.d.ts +26 -0
  929. package/types/react/components/Portal.d.ts +2 -0
  930. package/types/react/components/RootCloseWrapper.d.ts +18 -0
  931. package/types/react/components/SixDigitInput.d.ts +27 -0
  932. package/types/react/contains.d.ts +1 -0
  933. package/types/react/popperBinder.d.ts +23 -0
  934. package/types/react/rootClose.d.ts +18 -0
  935. package/types/react/translateLocalStatic.d.ts +4 -0
  936. package/types/react/useAsyncCachedValue.d.ts +2 -0
  937. package/types/refreshTimeout.d.ts +5 -0
  938. package/types/remoteAuth.d.ts +14 -0
  939. package/types/request.d.ts +104 -0
  940. package/types/requestDetails.d.ts +16 -0
  941. package/types/rfc3339Normalize.d.ts +1 -0
  942. package/types/script.d.ts +36 -0
  943. package/types/seo.d.ts +5 -0
  944. package/types/shopDomain.d.ts +7 -0
  945. package/types/shopLinks.d.ts +14 -0
  946. package/types/slate.d.ts +47 -0
  947. package/types/sleep.d.ts +1 -0
  948. package/types/splitBy.d.ts +1 -0
  949. package/types/splitName.d.ts +2 -0
  950. package/types/stripZeros.d.ts +1 -0
  951. package/types/stripeError.d.ts +14 -0
  952. package/types/tailSplit.d.ts +1 -0
  953. package/types/tieredPrice.d.ts +2 -0
  954. package/types/timeIt.d.ts +1 -0
  955. package/types/toMajor.d.ts +8 -0
  956. package/types/toMinor.d.ts +8 -0
  957. package/types/trace.d.ts +17 -0
  958. package/types/translateLocale.d.ts +2 -0
  959. package/types/traverse.d.ts +1 -0
  960. package/types/truncate.d.ts +7 -0
  961. package/types/typedLocalStorage.d.ts +3 -0
  962. package/types/variantImage.d.ts +16 -0
  963. package/types/variantImageURL.d.ts +25 -0
  964. package/types/variantImages.d.ts +11 -0
  965. package/types/variantInventory.d.ts +14 -0
  966. package/types/variantOptions.d.ts +18 -0
  967. package/types/variantPrice.d.ts +37 -0
  968. package/types/variantPriceCommerce.d.ts +26 -0
  969. package/types/variantTitle.d.ts +7 -0
  970. package/types/variantTitleFull.d.ts +11 -0
  971. package/types/variantURL.d.ts +7 -0
  972. package/types/websocket.d.ts +33 -0
@@ -0,0 +1,2657 @@
1
+ /**!
2
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
3
+ * @version 1.14.3
4
+ * @license
5
+ * Copyright (c) 2016 Federico Zivolo and contributors
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ (function(global, factory) {
26
+ typeof exports === "object" && typeof module !== "undefined"
27
+ ? (module.exports = factory())
28
+ : typeof define === "function" && define.amd
29
+ ? define(factory)
30
+ : (global.Popper = factory());
31
+ })(this, function() {
32
+ "use strict";
33
+
34
+ var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
35
+
36
+ var longerTimeoutBrowsers = ["Edge", "Trident", "Firefox"];
37
+ var timeoutDuration = 0;
38
+ for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
39
+ if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
40
+ timeoutDuration = 1;
41
+ break;
42
+ }
43
+ }
44
+
45
+ function microtaskDebounce(fn) {
46
+ var called = false;
47
+ return function() {
48
+ if (called) {
49
+ return;
50
+ }
51
+ called = true;
52
+ window.Promise.resolve().then(function() {
53
+ called = false;
54
+ fn();
55
+ });
56
+ };
57
+ }
58
+
59
+ function taskDebounce(fn) {
60
+ var scheduled = false;
61
+ return function() {
62
+ if (!scheduled) {
63
+ scheduled = true;
64
+ setTimeout(function() {
65
+ scheduled = false;
66
+ fn();
67
+ }, timeoutDuration);
68
+ }
69
+ };
70
+ }
71
+
72
+ var supportsMicroTasks = isBrowser && window.Promise;
73
+
74
+ /**
75
+ * Create a debounced version of a method, that's asynchronously deferred
76
+ * but called in the minimum time possible.
77
+ *
78
+ * @method
79
+ * @memberof Popper.Utils
80
+ * @argument {Function} fn
81
+ * @returns {Function}
82
+ */
83
+ var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
84
+
85
+ /**
86
+ * Check if the given variable is a function
87
+ * @method
88
+ * @memberof Popper.Utils
89
+ * @argument {Any} functionToCheck - variable to check
90
+ * @returns {Boolean} answer to: is a function?
91
+ */
92
+ function isFunction(functionToCheck) {
93
+ var getType = {};
94
+ return functionToCheck && getType.toString.call(functionToCheck) === "[object Function]";
95
+ }
96
+
97
+ /**
98
+ * Get CSS computed property of the given element
99
+ * @method
100
+ * @memberof Popper.Utils
101
+ * @argument {Eement} element
102
+ * @argument {String} property
103
+ */
104
+ function getStyleComputedProperty(element, property) {
105
+ if (element.nodeType !== 1) {
106
+ return [];
107
+ }
108
+ // NOTE: 1 DOM access here
109
+ var css = getComputedStyle(element, null);
110
+ return property ? css[property] : css;
111
+ }
112
+
113
+ /**
114
+ * Returns the parentNode or the host of the element
115
+ * @method
116
+ * @memberof Popper.Utils
117
+ * @argument {Element} element
118
+ * @returns {Element} parent
119
+ */
120
+ function getParentNode(element) {
121
+ if (element.nodeName === "HTML") {
122
+ return element;
123
+ }
124
+ return element.parentNode || element.host;
125
+ }
126
+
127
+ /**
128
+ * Returns the scrolling parent of the given element
129
+ * @method
130
+ * @memberof Popper.Utils
131
+ * @argument {Element} element
132
+ * @returns {Element} scroll parent
133
+ */
134
+ function getScrollParent(element) {
135
+ // Return body, `getScroll` will take care to get the correct `scrollTop` from it
136
+ if (!element) {
137
+ return document.body;
138
+ }
139
+
140
+ switch (element.nodeName) {
141
+ case "HTML":
142
+ case "BODY":
143
+ return element.ownerDocument.body;
144
+ case "#document":
145
+ return element.body;
146
+ }
147
+
148
+ // Firefox want us to check `-x` and `-y` variations as well
149
+
150
+ var _getStyleComputedProp = getStyleComputedProperty(element),
151
+ overflow = _getStyleComputedProp.overflow,
152
+ overflowX = _getStyleComputedProp.overflowX,
153
+ overflowY = _getStyleComputedProp.overflowY;
154
+
155
+ if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
156
+ return element;
157
+ }
158
+
159
+ return getScrollParent(getParentNode(element));
160
+ }
161
+
162
+ var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
163
+ var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
164
+
165
+ /**
166
+ * Determines if the browser is Internet Explorer
167
+ * @method
168
+ * @memberof Popper.Utils
169
+ * @param {Number} version to check
170
+ * @returns {Boolean} isIE
171
+ */
172
+ function isIE(version) {
173
+ if (version === 11) {
174
+ return isIE11;
175
+ }
176
+ if (version === 10) {
177
+ return isIE10;
178
+ }
179
+ return isIE11 || isIE10;
180
+ }
181
+
182
+ /**
183
+ * Returns the offset parent of the given element
184
+ * @method
185
+ * @memberof Popper.Utils
186
+ * @argument {Element} element
187
+ * @returns {Element} offset parent
188
+ */
189
+ function getOffsetParent(element) {
190
+ if (!element) {
191
+ return document.documentElement;
192
+ }
193
+
194
+ var noOffsetParent = isIE(10) ? document.body : null;
195
+
196
+ // NOTE: 1 DOM access here
197
+ var offsetParent = element.offsetParent;
198
+ // Skip hidden elements which don't have an offsetParent
199
+ while (offsetParent === noOffsetParent && element.nextElementSibling) {
200
+ offsetParent = (element = element.nextElementSibling).offsetParent;
201
+ }
202
+
203
+ var nodeName = offsetParent && offsetParent.nodeName;
204
+
205
+ if (!nodeName || nodeName === "BODY" || nodeName === "HTML") {
206
+ return element ? element.ownerDocument.documentElement : document.documentElement;
207
+ }
208
+
209
+ // .offsetParent will return the closest TD or TABLE in case
210
+ // no offsetParent is present, I hate this job...
211
+ if (
212
+ ["TD", "TABLE"].indexOf(offsetParent.nodeName) !== -1 &&
213
+ getStyleComputedProperty(offsetParent, "position") === "static"
214
+ ) {
215
+ return getOffsetParent(offsetParent);
216
+ }
217
+
218
+ return offsetParent;
219
+ }
220
+
221
+ function isOffsetContainer(element) {
222
+ var nodeName = element.nodeName;
223
+
224
+ if (nodeName === "BODY") {
225
+ return false;
226
+ }
227
+ return nodeName === "HTML" || getOffsetParent(element.firstElementChild) === element;
228
+ }
229
+
230
+ /**
231
+ * Finds the root node (document, shadowDOM root) of the given element
232
+ * @method
233
+ * @memberof Popper.Utils
234
+ * @argument {Element} node
235
+ * @returns {Element} root node
236
+ */
237
+ function getRoot(node) {
238
+ if (node.parentNode !== null) {
239
+ return getRoot(node.parentNode);
240
+ }
241
+
242
+ return node;
243
+ }
244
+
245
+ /**
246
+ * Finds the offset parent common to the two provided nodes
247
+ * @method
248
+ * @memberof Popper.Utils
249
+ * @argument {Element} element1
250
+ * @argument {Element} element2
251
+ * @returns {Element} common offset parent
252
+ */
253
+ function findCommonOffsetParent(element1, element2) {
254
+ // This check is needed to avoid errors in case one of the elements isn't defined for any reason
255
+ if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
256
+ return document.documentElement;
257
+ }
258
+
259
+ // Here we make sure to give as "start" the element that comes first in the DOM
260
+ var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
261
+ var start = order ? element1 : element2;
262
+ var end = order ? element2 : element1;
263
+
264
+ // Get common ancestor container
265
+ var range = document.createRange();
266
+ range.setStart(start, 0);
267
+ range.setEnd(end, 0);
268
+ var commonAncestorContainer = range.commonAncestorContainer;
269
+
270
+ // Both nodes are inside #document
271
+
272
+ if ((element1 !== commonAncestorContainer && element2 !== commonAncestorContainer) || start.contains(end)) {
273
+ if (isOffsetContainer(commonAncestorContainer)) {
274
+ return commonAncestorContainer;
275
+ }
276
+
277
+ return getOffsetParent(commonAncestorContainer);
278
+ }
279
+
280
+ // one of the nodes is inside shadowDOM, find which one
281
+ var element1root = getRoot(element1);
282
+ if (element1root.host) {
283
+ return findCommonOffsetParent(element1root.host, element2);
284
+ } else {
285
+ return findCommonOffsetParent(element1, getRoot(element2).host);
286
+ }
287
+ }
288
+
289
+ /**
290
+ * Gets the scroll value of the given element in the given side (top and left)
291
+ * @method
292
+ * @memberof Popper.Utils
293
+ * @argument {Element} element
294
+ * @argument {String} side `top` or `left`
295
+ * @returns {number} amount of scrolled pixels
296
+ */
297
+ function getScroll(element) {
298
+ var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "top";
299
+
300
+ var upperSide = side === "top" ? "scrollTop" : "scrollLeft";
301
+ var nodeName = element.nodeName;
302
+
303
+ if (nodeName === "BODY" || nodeName === "HTML") {
304
+ var html = element.ownerDocument.documentElement;
305
+ var scrollingElement = element.ownerDocument.scrollingElement || html;
306
+ return scrollingElement[upperSide];
307
+ }
308
+
309
+ return element[upperSide];
310
+ }
311
+
312
+ /*
313
+ * Sum or subtract the element scroll values (left and top) from a given rect object
314
+ * @method
315
+ * @memberof Popper.Utils
316
+ * @param {Object} rect - Rect object you want to change
317
+ * @param {HTMLElement} element - The element from the function reads the scroll values
318
+ * @param {Boolean} subtract - set to true if you want to subtract the scroll values
319
+ * @return {Object} rect - The modifier rect object
320
+ */
321
+ function includeScroll(rect, element) {
322
+ var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
323
+
324
+ var scrollTop = getScroll(element, "top");
325
+ var scrollLeft = getScroll(element, "left");
326
+ var modifier = subtract ? -1 : 1;
327
+ rect.top += scrollTop * modifier;
328
+ rect.bottom += scrollTop * modifier;
329
+ rect.left += scrollLeft * modifier;
330
+ rect.right += scrollLeft * modifier;
331
+ return rect;
332
+ }
333
+
334
+ /*
335
+ * Helper to detect borders of a given element
336
+ * @method
337
+ * @memberof Popper.Utils
338
+ * @param {CSSStyleDeclaration} styles
339
+ * Result of `getStyleComputedProperty` on the given element
340
+ * @param {String} axis - `x` or `y`
341
+ * @return {number} borders - The borders size of the given axis
342
+ */
343
+
344
+ function getBordersSize(styles, axis) {
345
+ var sideA = axis === "x" ? "Left" : "Top";
346
+ var sideB = sideA === "Left" ? "Right" : "Bottom";
347
+
348
+ return parseFloat(styles["border" + sideA + "Width"], 10) + parseFloat(styles["border" + sideB + "Width"], 10);
349
+ }
350
+
351
+ function getSize(axis, body, html, computedStyle) {
352
+ return Math.max(
353
+ body["offset" + axis],
354
+ body["scroll" + axis],
355
+ html["client" + axis],
356
+ html["offset" + axis],
357
+ html["scroll" + axis],
358
+ isIE(10)
359
+ ? html["offset" + axis] +
360
+ computedStyle["margin" + (axis === "Height" ? "Top" : "Left")] +
361
+ computedStyle["margin" + (axis === "Height" ? "Bottom" : "Right")]
362
+ : 0
363
+ );
364
+ }
365
+
366
+ function getWindowSizes() {
367
+ var body = document.body;
368
+ var html = document.documentElement;
369
+ var computedStyle = isIE(10) && getComputedStyle(html);
370
+
371
+ return {
372
+ height: getSize("Height", body, html, computedStyle),
373
+ width: getSize("Width", body, html, computedStyle),
374
+ };
375
+ }
376
+
377
+ var classCallCheck = function(instance, Constructor) {
378
+ if (!(instance instanceof Constructor)) {
379
+ throw new TypeError("Cannot call a class as a function");
380
+ }
381
+ };
382
+
383
+ var createClass = (function() {
384
+ function defineProperties(target, props) {
385
+ for (var i = 0; i < props.length; i++) {
386
+ var descriptor = props[i];
387
+ descriptor.enumerable = descriptor.enumerable || false;
388
+ descriptor.configurable = true;
389
+ if ("value" in descriptor) descriptor.writable = true;
390
+ Object.defineProperty(target, descriptor.key, descriptor);
391
+ }
392
+ }
393
+
394
+ return function(Constructor, protoProps, staticProps) {
395
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
396
+ if (staticProps) defineProperties(Constructor, staticProps);
397
+ return Constructor;
398
+ };
399
+ })();
400
+
401
+ var defineProperty = function(obj, key, value) {
402
+ if (key in obj) {
403
+ Object.defineProperty(obj, key, {
404
+ value: value,
405
+ enumerable: true,
406
+ configurable: true,
407
+ writable: true,
408
+ });
409
+ } else {
410
+ obj[key] = value;
411
+ }
412
+
413
+ return obj;
414
+ };
415
+
416
+ var _extends =
417
+ Object.assign ||
418
+ function(target) {
419
+ for (var i = 1; i < arguments.length; i++) {
420
+ var source = arguments[i];
421
+
422
+ for (var key in source) {
423
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
424
+ target[key] = source[key];
425
+ }
426
+ }
427
+ }
428
+
429
+ return target;
430
+ };
431
+
432
+ /**
433
+ * Given element offsets, generate an output similar to getBoundingClientRect
434
+ * @method
435
+ * @memberof Popper.Utils
436
+ * @argument {Object} offsets
437
+ * @returns {Object} ClientRect like output
438
+ */
439
+ function getClientRect(offsets) {
440
+ return _extends({}, offsets, {
441
+ right: offsets.left + offsets.width,
442
+ bottom: offsets.top + offsets.height,
443
+ });
444
+ }
445
+
446
+ /**
447
+ * Get bounding client rect of given element
448
+ * @method
449
+ * @memberof Popper.Utils
450
+ * @param {HTMLElement} element
451
+ * @return {Object} client rect
452
+ */
453
+ function getBoundingClientRect(element) {
454
+ var rect = {};
455
+
456
+ // IE10 10 FIX: Please, don't ask, the element isn't
457
+ // considered in DOM in some circumstances...
458
+ // This isn't reproducible in IE10 compatibility mode of IE11
459
+ try {
460
+ if (isIE(10)) {
461
+ rect = element.getBoundingClientRect();
462
+ var scrollTop = getScroll(element, "top");
463
+ var scrollLeft = getScroll(element, "left");
464
+ rect.top += scrollTop;
465
+ rect.left += scrollLeft;
466
+ rect.bottom += scrollTop;
467
+ rect.right += scrollLeft;
468
+ } else {
469
+ rect = element.getBoundingClientRect();
470
+ }
471
+ } catch (e) {}
472
+
473
+ var result = {
474
+ left: rect.left,
475
+ top: rect.top,
476
+ width: rect.right - rect.left,
477
+ height: rect.bottom - rect.top,
478
+ };
479
+
480
+ // subtract scrollbar size from sizes
481
+ var sizes = element.nodeName === "HTML" ? getWindowSizes() : {};
482
+ var width = sizes.width || element.clientWidth || result.right - result.left;
483
+ var height = sizes.height || element.clientHeight || result.bottom - result.top;
484
+
485
+ var horizScrollbar = element.offsetWidth - width;
486
+ var vertScrollbar = element.offsetHeight - height;
487
+
488
+ // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
489
+ // we make this check conditional for performance reasons
490
+ if (horizScrollbar || vertScrollbar) {
491
+ var styles = getStyleComputedProperty(element);
492
+ horizScrollbar -= getBordersSize(styles, "x");
493
+ vertScrollbar -= getBordersSize(styles, "y");
494
+
495
+ result.width -= horizScrollbar;
496
+ result.height -= vertScrollbar;
497
+ }
498
+
499
+ return getClientRect(result);
500
+ }
501
+
502
+ function getOffsetRectRelativeToArbitraryNode(children, parent) {
503
+ var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
504
+
505
+ var isIE10 = isIE(10);
506
+ var isHTML = parent.nodeName === "HTML";
507
+ var childrenRect = getBoundingClientRect(children);
508
+ var parentRect = getBoundingClientRect(parent);
509
+ var scrollParent = getScrollParent(children);
510
+
511
+ var styles = getStyleComputedProperty(parent);
512
+ var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
513
+ var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
514
+
515
+ // In cases where the parent is fixed, we must ignore negative scroll in offset calc
516
+ if (fixedPosition && parent.nodeName === "HTML") {
517
+ parentRect.top = Math.max(parentRect.top, 0);
518
+ parentRect.left = Math.max(parentRect.left, 0);
519
+ }
520
+ var offsets = getClientRect({
521
+ top: childrenRect.top - parentRect.top - borderTopWidth,
522
+ left: childrenRect.left - parentRect.left - borderLeftWidth,
523
+ width: childrenRect.width,
524
+ height: childrenRect.height,
525
+ });
526
+ offsets.marginTop = 0;
527
+ offsets.marginLeft = 0;
528
+
529
+ // Subtract margins of documentElement in case it's being used as parent
530
+ // we do this only on HTML because it's the only element that behaves
531
+ // differently when margins are applied to it. The margins are included in
532
+ // the box of the documentElement, in the other cases not.
533
+ if (!isIE10 && isHTML) {
534
+ var marginTop = parseFloat(styles.marginTop, 10);
535
+ var marginLeft = parseFloat(styles.marginLeft, 10);
536
+
537
+ offsets.top -= borderTopWidth - marginTop;
538
+ offsets.bottom -= borderTopWidth - marginTop;
539
+ offsets.left -= borderLeftWidth - marginLeft;
540
+ offsets.right -= borderLeftWidth - marginLeft;
541
+
542
+ // Attach marginTop and marginLeft because in some circumstances we may need them
543
+ offsets.marginTop = marginTop;
544
+ offsets.marginLeft = marginLeft;
545
+ }
546
+
547
+ if (
548
+ isIE10 && !fixedPosition
549
+ ? parent.contains(scrollParent)
550
+ : parent === scrollParent && scrollParent.nodeName !== "BODY"
551
+ ) {
552
+ offsets = includeScroll(offsets, parent);
553
+ }
554
+
555
+ return offsets;
556
+ }
557
+
558
+ function getViewportOffsetRectRelativeToArtbitraryNode(element) {
559
+ var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
560
+
561
+ var html = element.ownerDocument.documentElement;
562
+ var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
563
+ var width = Math.max(html.clientWidth, window.innerWidth || 0);
564
+ var height = Math.max(html.clientHeight, window.innerHeight || 0);
565
+
566
+ var scrollTop = !excludeScroll ? getScroll(html) : 0;
567
+ var scrollLeft = !excludeScroll ? getScroll(html, "left") : 0;
568
+
569
+ var offset = {
570
+ top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
571
+ left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
572
+ width: width,
573
+ height: height,
574
+ };
575
+
576
+ return getClientRect(offset);
577
+ }
578
+
579
+ /**
580
+ * Check if the given element is fixed or is inside a fixed parent
581
+ * @method
582
+ * @memberof Popper.Utils
583
+ * @argument {Element} element
584
+ * @argument {Element} customContainer
585
+ * @returns {Boolean} answer to "isFixed?"
586
+ */
587
+ function isFixed(element) {
588
+ var nodeName = element.nodeName;
589
+ if (nodeName === "BODY" || nodeName === "HTML") {
590
+ return false;
591
+ }
592
+ if (getStyleComputedProperty(element, "position") === "fixed") {
593
+ return true;
594
+ }
595
+ return isFixed(getParentNode(element));
596
+ }
597
+
598
+ /**
599
+ * Finds the first parent of an element that has a transformed property defined
600
+ * @method
601
+ * @memberof Popper.Utils
602
+ * @argument {Element} element
603
+ * @returns {Element} first transformed parent or documentElement
604
+ */
605
+
606
+ function getFixedPositionOffsetParent(element) {
607
+ // This check is needed to avoid errors in case one of the elements isn't defined for any reason
608
+ if (!element || !element.parentElement || isIE()) {
609
+ return document.documentElement;
610
+ }
611
+ var el = element.parentElement;
612
+ while (el && getStyleComputedProperty(el, "transform") === "none") {
613
+ el = el.parentElement;
614
+ }
615
+ return el || document.documentElement;
616
+ }
617
+
618
+ /**
619
+ * Computed the boundaries limits and return them
620
+ * @method
621
+ * @memberof Popper.Utils
622
+ * @param {HTMLElement} popper
623
+ * @param {HTMLElement} reference
624
+ * @param {number} padding
625
+ * @param {HTMLElement} boundariesElement - Element used to define the boundaries
626
+ * @param {Boolean} fixedPosition - Is in fixed position mode
627
+ * @returns {Object} Coordinates of the boundaries
628
+ */
629
+ function getBoundaries(popper, reference, padding, boundariesElement) {
630
+ var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
631
+
632
+ // NOTE: 1 DOM access here
633
+
634
+ var boundaries = { top: 0, left: 0 };
635
+ var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
636
+
637
+ // Handle viewport case
638
+ if (boundariesElement === "viewport") {
639
+ boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
640
+ } else {
641
+ // Handle other cases based on DOM element used as boundaries
642
+ var boundariesNode = void 0;
643
+ if (boundariesElement === "scrollParent") {
644
+ boundariesNode = getScrollParent(getParentNode(reference));
645
+ if (boundariesNode.nodeName === "BODY") {
646
+ boundariesNode = popper.ownerDocument.documentElement;
647
+ }
648
+ } else if (boundariesElement === "window") {
649
+ boundariesNode = popper.ownerDocument.documentElement;
650
+ } else {
651
+ boundariesNode = boundariesElement;
652
+ }
653
+
654
+ var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
655
+
656
+ // In case of HTML, we need a different computation
657
+ if (boundariesNode.nodeName === "HTML" && !isFixed(offsetParent)) {
658
+ var _getWindowSizes = getWindowSizes(),
659
+ height = _getWindowSizes.height,
660
+ width = _getWindowSizes.width;
661
+
662
+ boundaries.top += offsets.top - offsets.marginTop;
663
+ boundaries.bottom = height + offsets.top;
664
+ boundaries.left += offsets.left - offsets.marginLeft;
665
+ boundaries.right = width + offsets.left;
666
+ } else {
667
+ // for all the other DOM elements, this one is good
668
+ boundaries = offsets;
669
+ }
670
+ }
671
+
672
+ // Add paddings
673
+ boundaries.left += padding;
674
+ boundaries.top += padding;
675
+ boundaries.right -= padding;
676
+ boundaries.bottom -= padding;
677
+
678
+ return boundaries;
679
+ }
680
+
681
+ function getArea(_ref) {
682
+ var width = _ref.width,
683
+ height = _ref.height;
684
+
685
+ return width * height;
686
+ }
687
+
688
+ /**
689
+ * Utility used to transform the `auto` placement to the placement with more
690
+ * available space.
691
+ * @method
692
+ * @memberof Popper.Utils
693
+ * @argument {Object} data - The data object generated by update method
694
+ * @argument {Object} options - Modifiers configuration and options
695
+ * @returns {Object} The data object, properly modified
696
+ */
697
+ function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
698
+ var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
699
+
700
+ if (placement.indexOf("auto") === -1) {
701
+ return placement;
702
+ }
703
+
704
+ var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
705
+
706
+ var rects = {
707
+ top: {
708
+ width: boundaries.width,
709
+ height: refRect.top - boundaries.top,
710
+ },
711
+ right: {
712
+ width: boundaries.right - refRect.right,
713
+ height: boundaries.height,
714
+ },
715
+ bottom: {
716
+ width: boundaries.width,
717
+ height: boundaries.bottom - refRect.bottom,
718
+ },
719
+ left: {
720
+ width: refRect.left - boundaries.left,
721
+ height: boundaries.height,
722
+ },
723
+ };
724
+
725
+ var sortedAreas = Object.keys(rects)
726
+ .map(function(key) {
727
+ return _extends(
728
+ {
729
+ key: key,
730
+ },
731
+ rects[key],
732
+ {
733
+ area: getArea(rects[key]),
734
+ }
735
+ );
736
+ })
737
+ .sort(function(a, b) {
738
+ return b.area - a.area;
739
+ });
740
+
741
+ var filteredAreas = sortedAreas.filter(function(_ref2) {
742
+ var width = _ref2.width,
743
+ height = _ref2.height;
744
+ return width >= popper.clientWidth && height >= popper.clientHeight;
745
+ });
746
+
747
+ var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
748
+
749
+ var variation = placement.split("-")[1];
750
+
751
+ return computedPlacement + (variation ? "-" + variation : "");
752
+ }
753
+
754
+ /**
755
+ * Get offsets to the reference element
756
+ * @method
757
+ * @memberof Popper.Utils
758
+ * @param {Object} state
759
+ * @param {Element} popper - the popper element
760
+ * @param {Element} reference - the reference element (the popper will be relative to this)
761
+ * @param {Element} fixedPosition - is in fixed position mode
762
+ * @returns {Object} An object containing the offsets which will be applied to the popper
763
+ */
764
+ function getReferenceOffsets(state, popper, reference) {
765
+ var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
766
+
767
+ var commonOffsetParent = fixedPosition
768
+ ? getFixedPositionOffsetParent(popper)
769
+ : findCommonOffsetParent(popper, reference);
770
+ return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
771
+ }
772
+
773
+ /**
774
+ * Get the outer sizes of the given element (offset size + margins)
775
+ * @method
776
+ * @memberof Popper.Utils
777
+ * @argument {Element} element
778
+ * @returns {Object} object containing width and height properties
779
+ */
780
+ function getOuterSizes(element) {
781
+ var styles = getComputedStyle(element);
782
+ var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
783
+ var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
784
+ var result = {
785
+ width: element.offsetWidth + y,
786
+ height: element.offsetHeight + x,
787
+ };
788
+ return result;
789
+ }
790
+
791
+ /**
792
+ * Get the opposite placement of the given one
793
+ * @method
794
+ * @memberof Popper.Utils
795
+ * @argument {String} placement
796
+ * @returns {String} flipped placement
797
+ */
798
+ function getOppositePlacement(placement) {
799
+ var hash = { left: "right", right: "left", bottom: "top", top: "bottom" };
800
+ return placement.replace(/left|right|bottom|top/g, function(matched) {
801
+ return hash[matched];
802
+ });
803
+ }
804
+
805
+ /**
806
+ * Get offsets to the popper
807
+ * @method
808
+ * @memberof Popper.Utils
809
+ * @param {Object} position - CSS position the Popper will get applied
810
+ * @param {HTMLElement} popper - the popper element
811
+ * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
812
+ * @param {String} placement - one of the valid placement options
813
+ * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
814
+ */
815
+ function getPopperOffsets(popper, referenceOffsets, placement) {
816
+ placement = placement.split("-")[0];
817
+
818
+ // Get popper node sizes
819
+ var popperRect = getOuterSizes(popper);
820
+
821
+ // Add position, width and height to our offsets object
822
+ var popperOffsets = {
823
+ width: popperRect.width,
824
+ height: popperRect.height,
825
+ };
826
+
827
+ // depending by the popper placement we have to compute its offsets slightly differently
828
+ var isHoriz = ["right", "left"].indexOf(placement) !== -1;
829
+ var mainSide = isHoriz ? "top" : "left";
830
+ var secondarySide = isHoriz ? "left" : "top";
831
+ var measurement = isHoriz ? "height" : "width";
832
+ var secondaryMeasurement = !isHoriz ? "height" : "width";
833
+
834
+ popperOffsets[mainSide] =
835
+ referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
836
+ if (placement === secondarySide) {
837
+ popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
838
+ } else {
839
+ popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
840
+ }
841
+
842
+ return popperOffsets;
843
+ }
844
+
845
+ /**
846
+ * Mimics the `find` method of Array
847
+ * @method
848
+ * @memberof Popper.Utils
849
+ * @argument {Array} arr
850
+ * @argument prop
851
+ * @argument value
852
+ * @returns index or -1
853
+ */
854
+ function find(arr, check) {
855
+ // use native find if supported
856
+ if (Array.prototype.find) {
857
+ return arr.find(check);
858
+ }
859
+
860
+ // use `filter` to obtain the same behavior of `find`
861
+ return arr.filter(check)[0];
862
+ }
863
+
864
+ /**
865
+ * Return the index of the matching object
866
+ * @method
867
+ * @memberof Popper.Utils
868
+ * @argument {Array} arr
869
+ * @argument prop
870
+ * @argument value
871
+ * @returns index or -1
872
+ */
873
+ function findIndex(arr, prop, value) {
874
+ // use native findIndex if supported
875
+ if (Array.prototype.findIndex) {
876
+ return arr.findIndex(function(cur) {
877
+ return cur[prop] === value;
878
+ });
879
+ }
880
+
881
+ // use `find` + `indexOf` if `findIndex` isn't supported
882
+ var match = find(arr, function(obj) {
883
+ return obj[prop] === value;
884
+ });
885
+ return arr.indexOf(match);
886
+ }
887
+
888
+ /**
889
+ * Loop trough the list of modifiers and run them in order,
890
+ * each of them will then edit the data object.
891
+ * @method
892
+ * @memberof Popper.Utils
893
+ * @param {dataObject} data
894
+ * @param {Array} modifiers
895
+ * @param {String} ends - Optional modifier name used as stopper
896
+ * @returns {dataObject}
897
+ */
898
+ function runModifiers(modifiers, data, ends) {
899
+ var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, "name", ends));
900
+
901
+ modifiersToRun.forEach(function(modifier) {
902
+ if (modifier["function"]) {
903
+ // eslint-disable-line dot-notation
904
+ console.warn("`modifier.function` is deprecated, use `modifier.fn`!");
905
+ }
906
+ var fn = modifier["function"] || modifier.fn; // eslint-disable-line dot-notation
907
+ if (modifier.enabled && isFunction(fn)) {
908
+ // Add properties to offsets to make them a complete clientRect object
909
+ // we do this before each modifier to make sure the previous one doesn't
910
+ // mess with these values
911
+ data.offsets.popper = getClientRect(data.offsets.popper);
912
+ data.offsets.reference = getClientRect(data.offsets.reference);
913
+
914
+ data = fn(data, modifier);
915
+ }
916
+ });
917
+
918
+ return data;
919
+ }
920
+
921
+ /**
922
+ * Updates the position of the popper, computing the new offsets and applying
923
+ * the new style.<br />
924
+ * Prefer `scheduleUpdate` over `update` because of performance reasons.
925
+ * @method
926
+ * @memberof Popper
927
+ */
928
+ function update() {
929
+ // if popper is destroyed, don't perform any further update
930
+ if (this.state.isDestroyed) {
931
+ return;
932
+ }
933
+
934
+ var data = {
935
+ instance: this,
936
+ styles: {},
937
+ arrowStyles: {},
938
+ attributes: {},
939
+ flipped: false,
940
+ offsets: {},
941
+ };
942
+
943
+ // compute reference element offsets
944
+ data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
945
+
946
+ // compute auto placement, store placement inside the data object,
947
+ // modifiers will be able to edit `placement` if needed
948
+ // and refer to originalPlacement to know the original value
949
+ data.placement = computeAutoPlacement(
950
+ this.options.placement,
951
+ data.offsets.reference,
952
+ this.popper,
953
+ this.reference,
954
+ this.options.modifiers.flip.boundariesElement,
955
+ this.options.modifiers.flip.padding
956
+ );
957
+
958
+ // store the computed placement inside `originalPlacement`
959
+ data.originalPlacement = data.placement;
960
+
961
+ data.positionFixed = this.options.positionFixed;
962
+
963
+ // compute the popper offsets
964
+ data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
965
+
966
+ data.offsets.popper.position = this.options.positionFixed ? "fixed" : "absolute";
967
+
968
+ // run the modifiers
969
+ data = runModifiers(this.modifiers, data);
970
+
971
+ // the first `update` will call `onCreate` callback
972
+ // the other ones will call `onUpdate` callback
973
+ if (!this.state.isCreated) {
974
+ this.state.isCreated = true;
975
+ this.options.onCreate(data);
976
+ } else {
977
+ this.options.onUpdate(data);
978
+ }
979
+ }
980
+
981
+ /**
982
+ * Helper used to know if the given modifier is enabled.
983
+ * @method
984
+ * @memberof Popper.Utils
985
+ * @returns {Boolean}
986
+ */
987
+ function isModifierEnabled(modifiers, modifierName) {
988
+ return modifiers.some(function(_ref) {
989
+ var name = _ref.name,
990
+ enabled = _ref.enabled;
991
+ return enabled && name === modifierName;
992
+ });
993
+ }
994
+
995
+ /**
996
+ * Get the prefixed supported property name
997
+ * @method
998
+ * @memberof Popper.Utils
999
+ * @argument {String} property (camelCase)
1000
+ * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
1001
+ */
1002
+ function getSupportedPropertyName(property) {
1003
+ var prefixes = [false, "ms", "Webkit", "Moz", "O"];
1004
+ var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
1005
+
1006
+ for (var i = 0; i < prefixes.length; i++) {
1007
+ var prefix = prefixes[i];
1008
+ var toCheck = prefix ? "" + prefix + upperProp : property;
1009
+ if (typeof document.body.style[toCheck] !== "undefined") {
1010
+ return toCheck;
1011
+ }
1012
+ }
1013
+ return null;
1014
+ }
1015
+
1016
+ /**
1017
+ * Destroy the popper
1018
+ * @method
1019
+ * @memberof Popper
1020
+ */
1021
+ function destroy() {
1022
+ this.state.isDestroyed = true;
1023
+
1024
+ // touch DOM only if `applyStyle` modifier is enabled
1025
+ if (isModifierEnabled(this.modifiers, "applyStyle")) {
1026
+ this.popper.removeAttribute("x-placement");
1027
+ this.popper.style.position = "";
1028
+ this.popper.style.top = "";
1029
+ this.popper.style.left = "";
1030
+ this.popper.style.right = "";
1031
+ this.popper.style.bottom = "";
1032
+ this.popper.style.willChange = "";
1033
+ this.popper.style[getSupportedPropertyName("transform")] = "";
1034
+ }
1035
+
1036
+ this.disableEventListeners();
1037
+
1038
+ // remove the popper if user explicity asked for the deletion on destroy
1039
+ // do not use `remove` because IE11 doesn't support it
1040
+ if (this.options.removeOnDestroy) {
1041
+ this.popper.parentNode.removeChild(this.popper);
1042
+ }
1043
+ return this;
1044
+ }
1045
+
1046
+ /**
1047
+ * Get the window associated with the element
1048
+ * @argument {Element} element
1049
+ * @returns {Window}
1050
+ */
1051
+ function getWindow(element) {
1052
+ var ownerDocument = element.ownerDocument;
1053
+ return ownerDocument ? ownerDocument.defaultView : window;
1054
+ }
1055
+
1056
+ function attachToScrollParents(scrollParent, event, callback, scrollParents) {
1057
+ var isBody = scrollParent.nodeName === "BODY";
1058
+ var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
1059
+ target.addEventListener(event, callback, { passive: true });
1060
+
1061
+ if (!isBody) {
1062
+ attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
1063
+ }
1064
+ scrollParents.push(target);
1065
+ }
1066
+
1067
+ /**
1068
+ * Setup needed event listeners used to update the popper position
1069
+ * @method
1070
+ * @memberof Popper.Utils
1071
+ * @private
1072
+ */
1073
+ function setupEventListeners(reference, options, state, updateBound) {
1074
+ // Resize event listener on window
1075
+ state.updateBound = updateBound;
1076
+ getWindow(reference).addEventListener("resize", state.updateBound, { passive: true });
1077
+
1078
+ // Scroll event listener on scroll parents
1079
+ var scrollElement = getScrollParent(reference);
1080
+ attachToScrollParents(scrollElement, "scroll", state.updateBound, state.scrollParents);
1081
+ state.scrollElement = scrollElement;
1082
+ state.eventsEnabled = true;
1083
+
1084
+ return state;
1085
+ }
1086
+
1087
+ /**
1088
+ * It will add resize/scroll events and start recalculating
1089
+ * position of the popper element when they are triggered.
1090
+ * @method
1091
+ * @memberof Popper
1092
+ */
1093
+ function enableEventListeners() {
1094
+ if (!this.state.eventsEnabled) {
1095
+ this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
1096
+ }
1097
+ }
1098
+
1099
+ /**
1100
+ * Remove event listeners used to update the popper position
1101
+ * @method
1102
+ * @memberof Popper.Utils
1103
+ * @private
1104
+ */
1105
+ function removeEventListeners(reference, state) {
1106
+ // Remove resize event listener on window
1107
+ getWindow(reference).removeEventListener("resize", state.updateBound);
1108
+
1109
+ // Remove scroll event listener on scroll parents
1110
+ state.scrollParents.forEach(function(target) {
1111
+ target.removeEventListener("scroll", state.updateBound);
1112
+ });
1113
+
1114
+ // Reset state
1115
+ state.updateBound = null;
1116
+ state.scrollParents = [];
1117
+ state.scrollElement = null;
1118
+ state.eventsEnabled = false;
1119
+ return state;
1120
+ }
1121
+
1122
+ /**
1123
+ * It will remove resize/scroll events and won't recalculate popper position
1124
+ * when they are triggered. It also won't trigger onUpdate callback anymore,
1125
+ * unless you call `update` method manually.
1126
+ * @method
1127
+ * @memberof Popper
1128
+ */
1129
+ function disableEventListeners() {
1130
+ if (this.state.eventsEnabled) {
1131
+ cancelAnimationFrame(this.scheduleUpdate);
1132
+ this.state = removeEventListeners(this.reference, this.state);
1133
+ }
1134
+ }
1135
+
1136
+ /**
1137
+ * Tells if a given input is a number
1138
+ * @method
1139
+ * @memberof Popper.Utils
1140
+ * @param {*} input to check
1141
+ * @return {Boolean}
1142
+ */
1143
+ function isNumeric(n) {
1144
+ return n !== "" && !isNaN(parseFloat(n)) && isFinite(n);
1145
+ }
1146
+
1147
+ /**
1148
+ * Set the style to the given popper
1149
+ * @method
1150
+ * @memberof Popper.Utils
1151
+ * @argument {Element} element - Element to apply the style to
1152
+ * @argument {Object} styles
1153
+ * Object with a list of properties and values which will be applied to the element
1154
+ */
1155
+ function setStyles(element, styles) {
1156
+ Object.keys(styles).forEach(function(prop) {
1157
+ var unit = "";
1158
+ // add unit if the value is numeric and is one of the following
1159
+ if (["width", "height", "top", "right", "bottom", "left"].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
1160
+ unit = "px";
1161
+ }
1162
+ element.style[prop] = styles[prop] + unit;
1163
+ });
1164
+ }
1165
+
1166
+ /**
1167
+ * Set the attributes to the given popper
1168
+ * @method
1169
+ * @memberof Popper.Utils
1170
+ * @argument {Element} element - Element to apply the attributes to
1171
+ * @argument {Object} styles
1172
+ * Object with a list of properties and values which will be applied to the element
1173
+ */
1174
+ function setAttributes(element, attributes) {
1175
+ Object.keys(attributes).forEach(function(prop) {
1176
+ var value = attributes[prop];
1177
+ if (value !== false) {
1178
+ element.setAttribute(prop, attributes[prop]);
1179
+ } else {
1180
+ element.removeAttribute(prop);
1181
+ }
1182
+ });
1183
+ }
1184
+
1185
+ /**
1186
+ * @function
1187
+ * @memberof Modifiers
1188
+ * @argument {Object} data - The data object generated by `update` method
1189
+ * @argument {Object} data.styles - List of style properties - values to apply to popper element
1190
+ * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
1191
+ * @argument {Object} options - Modifiers configuration and options
1192
+ * @returns {Object} The same data object
1193
+ */
1194
+ function applyStyle(data) {
1195
+ // any property present in `data.styles` will be applied to the popper,
1196
+ // in this way we can make the 3rd party modifiers add custom styles to it
1197
+ // Be aware, modifiers could override the properties defined in the previous
1198
+ // lines of this modifier!
1199
+ setStyles(data.instance.popper, data.styles);
1200
+
1201
+ // any property present in `data.attributes` will be applied to the popper,
1202
+ // they will be set as HTML attributes of the element
1203
+ setAttributes(data.instance.popper, data.attributes);
1204
+
1205
+ // if arrowElement is defined and arrowStyles has some properties
1206
+ if (data.arrowElement && Object.keys(data.arrowStyles).length) {
1207
+ setStyles(data.arrowElement, data.arrowStyles);
1208
+ }
1209
+
1210
+ return data;
1211
+ }
1212
+
1213
+ /**
1214
+ * Set the x-placement attribute before everything else because it could be used
1215
+ * to add margins to the popper margins needs to be calculated to get the
1216
+ * correct popper offsets.
1217
+ * @method
1218
+ * @memberof Popper.modifiers
1219
+ * @param {HTMLElement} reference - The reference element used to position the popper
1220
+ * @param {HTMLElement} popper - The HTML element used as popper
1221
+ * @param {Object} options - Popper.js options
1222
+ */
1223
+ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
1224
+ // compute reference element offsets
1225
+ var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
1226
+
1227
+ // compute auto placement, store placement inside the data object,
1228
+ // modifiers will be able to edit `placement` if needed
1229
+ // and refer to originalPlacement to know the original value
1230
+ var placement = computeAutoPlacement(
1231
+ options.placement,
1232
+ referenceOffsets,
1233
+ popper,
1234
+ reference,
1235
+ options.modifiers.flip.boundariesElement,
1236
+ options.modifiers.flip.padding
1237
+ );
1238
+
1239
+ popper.setAttribute("x-placement", placement);
1240
+
1241
+ // Apply `position` to popper before anything else because
1242
+ // without the position applied we can't guarantee correct computations
1243
+ setStyles(popper, { position: options.positionFixed ? "fixed" : "absolute" });
1244
+
1245
+ return options;
1246
+ }
1247
+
1248
+ /**
1249
+ * @function
1250
+ * @memberof Modifiers
1251
+ * @argument {Object} data - The data object generated by `update` method
1252
+ * @argument {Object} options - Modifiers configuration and options
1253
+ * @returns {Object} The data object, properly modified
1254
+ */
1255
+ function computeStyle(data, options) {
1256
+ var x = options.x,
1257
+ y = options.y;
1258
+ var popper = data.offsets.popper;
1259
+
1260
+ // Remove this legacy support in Popper.js v2
1261
+
1262
+ var legacyGpuAccelerationOption = find(data.instance.modifiers, function(modifier) {
1263
+ return modifier.name === "applyStyle";
1264
+ }).gpuAcceleration;
1265
+ if (legacyGpuAccelerationOption !== undefined) {
1266
+ console.warn(
1267
+ "WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!"
1268
+ );
1269
+ }
1270
+ var gpuAcceleration =
1271
+ legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
1272
+
1273
+ var offsetParent = getOffsetParent(data.instance.popper);
1274
+ var offsetParentRect = getBoundingClientRect(offsetParent);
1275
+
1276
+ // Styles
1277
+ var styles = {
1278
+ position: popper.position,
1279
+ };
1280
+
1281
+ // Avoid blurry text by using full pixel integers.
1282
+ // For pixel-perfect positioning, top/bottom prefers rounded
1283
+ // values, while left/right prefers floored values.
1284
+ var offsets = {
1285
+ left: Math.floor(popper.left),
1286
+ top: Math.round(popper.top),
1287
+ bottom: Math.round(popper.bottom),
1288
+ right: Math.floor(popper.right),
1289
+ };
1290
+
1291
+ var sideA = x === "bottom" ? "top" : "bottom";
1292
+ var sideB = y === "right" ? "left" : "right";
1293
+
1294
+ // if gpuAcceleration is set to `true` and transform is supported,
1295
+ // we use `translate3d` to apply the position to the popper we
1296
+ // automatically use the supported prefixed version if needed
1297
+ var prefixedProperty = getSupportedPropertyName("transform");
1298
+
1299
+ // now, let's make a step back and look at this code closely (wtf?)
1300
+ // If the content of the popper grows once it's been positioned, it
1301
+ // may happen that the popper gets misplaced because of the new content
1302
+ // overflowing its reference element
1303
+ // To avoid this problem, we provide two options (x and y), which allow
1304
+ // the consumer to define the offset origin.
1305
+ // If we position a popper on top of a reference element, we can set
1306
+ // `x` to `top` to make the popper grow towards its top instead of
1307
+ // its bottom.
1308
+ var left = void 0,
1309
+ top = void 0;
1310
+ if (sideA === "bottom") {
1311
+ top = -offsetParentRect.height + offsets.bottom;
1312
+ } else {
1313
+ top = offsets.top;
1314
+ }
1315
+ if (sideB === "right") {
1316
+ left = -offsetParentRect.width + offsets.right;
1317
+ } else {
1318
+ left = offsets.left;
1319
+ }
1320
+ if (gpuAcceleration && prefixedProperty) {
1321
+ styles[prefixedProperty] = "translate3d(" + left + "px, " + top + "px, 0)";
1322
+ styles[sideA] = 0;
1323
+ styles[sideB] = 0;
1324
+ styles.willChange = "transform";
1325
+ } else {
1326
+ // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
1327
+ var invertTop = sideA === "bottom" ? -1 : 1;
1328
+ var invertLeft = sideB === "right" ? -1 : 1;
1329
+ styles[sideA] = top * invertTop;
1330
+ styles[sideB] = left * invertLeft;
1331
+ styles.willChange = sideA + ", " + sideB;
1332
+ }
1333
+
1334
+ // Attributes
1335
+ var attributes = {
1336
+ "x-placement": data.placement,
1337
+ };
1338
+
1339
+ // Update `data` attributes, styles and arrowStyles
1340
+ data.attributes = _extends({}, attributes, data.attributes);
1341
+ data.styles = _extends({}, styles, data.styles);
1342
+ data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
1343
+
1344
+ return data;
1345
+ }
1346
+
1347
+ /**
1348
+ * Helper used to know if the given modifier depends from another one.<br />
1349
+ * It checks if the needed modifier is listed and enabled.
1350
+ * @method
1351
+ * @memberof Popper.Utils
1352
+ * @param {Array} modifiers - list of modifiers
1353
+ * @param {String} requestingName - name of requesting modifier
1354
+ * @param {String} requestedName - name of requested modifier
1355
+ * @returns {Boolean}
1356
+ */
1357
+ function isModifierRequired(modifiers, requestingName, requestedName) {
1358
+ var requesting = find(modifiers, function(_ref) {
1359
+ var name = _ref.name;
1360
+ return name === requestingName;
1361
+ });
1362
+
1363
+ var isRequired =
1364
+ !!requesting &&
1365
+ modifiers.some(function(modifier) {
1366
+ return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
1367
+ });
1368
+
1369
+ if (!isRequired) {
1370
+ var _requesting = "`" + requestingName + "`";
1371
+ var requested = "`" + requestedName + "`";
1372
+ console.warn(
1373
+ requested +
1374
+ " modifier is required by " +
1375
+ _requesting +
1376
+ " modifier in order to work, be sure to include it before " +
1377
+ _requesting +
1378
+ "!"
1379
+ );
1380
+ }
1381
+ return isRequired;
1382
+ }
1383
+
1384
+ /**
1385
+ * @function
1386
+ * @memberof Modifiers
1387
+ * @argument {Object} data - The data object generated by update method
1388
+ * @argument {Object} options - Modifiers configuration and options
1389
+ * @returns {Object} The data object, properly modified
1390
+ */
1391
+ function arrow(data, options) {
1392
+ var _data$offsets$arrow;
1393
+
1394
+ // arrow depends on keepTogether in order to work
1395
+ if (!isModifierRequired(data.instance.modifiers, "arrow", "keepTogether")) {
1396
+ return data;
1397
+ }
1398
+
1399
+ var arrowElement = options.element;
1400
+
1401
+ // if arrowElement is a string, suppose it's a CSS selector
1402
+ if (typeof arrowElement === "string") {
1403
+ arrowElement = data.instance.popper.querySelector(arrowElement);
1404
+
1405
+ // if arrowElement is not found, don't run the modifier
1406
+ if (!arrowElement) {
1407
+ return data;
1408
+ }
1409
+ } else {
1410
+ // if the arrowElement isn't a query selector we must check that the
1411
+ // provided DOM node is child of its popper node
1412
+ if (!data.instance.popper.contains(arrowElement)) {
1413
+ console.warn("WARNING: `arrow.element` must be child of its popper element!");
1414
+ return data;
1415
+ }
1416
+ }
1417
+
1418
+ var placement = data.placement.split("-")[0];
1419
+ var _data$offsets = data.offsets,
1420
+ popper = _data$offsets.popper,
1421
+ reference = _data$offsets.reference;
1422
+
1423
+ var isVertical = ["left", "right"].indexOf(placement) !== -1;
1424
+
1425
+ var len = isVertical ? "height" : "width";
1426
+ var sideCapitalized = isVertical ? "Top" : "Left";
1427
+ var side = sideCapitalized.toLowerCase();
1428
+ var altSide = isVertical ? "left" : "top";
1429
+ var opSide = isVertical ? "bottom" : "right";
1430
+ var arrowElementSize = getOuterSizes(arrowElement)[len];
1431
+
1432
+ //
1433
+ // extends keepTogether behavior making sure the popper and its
1434
+ // reference have enough pixels in conjuction
1435
+ //
1436
+
1437
+ // top/left side
1438
+ if (reference[opSide] - arrowElementSize < popper[side]) {
1439
+ data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
1440
+ }
1441
+ // bottom/right side
1442
+ if (reference[side] + arrowElementSize > popper[opSide]) {
1443
+ data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
1444
+ }
1445
+ data.offsets.popper = getClientRect(data.offsets.popper);
1446
+
1447
+ // compute center of the popper
1448
+ var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
1449
+
1450
+ // Compute the sideValue using the updated popper offsets
1451
+ // take popper margin in account because we don't have this info available
1452
+ var css = getStyleComputedProperty(data.instance.popper);
1453
+ var popperMarginSide = parseFloat(css["margin" + sideCapitalized], 10);
1454
+ var popperBorderSide = parseFloat(css["border" + sideCapitalized + "Width"], 10);
1455
+ var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
1456
+
1457
+ // prevent arrowElement from being placed not contiguously to its popper
1458
+ sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
1459
+
1460
+ data.arrowElement = arrowElement;
1461
+ data.offsets.arrow = ((_data$offsets$arrow = {}),
1462
+ defineProperty(_data$offsets$arrow, side, Math.round(sideValue)),
1463
+ defineProperty(_data$offsets$arrow, altSide, ""),
1464
+ _data$offsets$arrow);
1465
+
1466
+ return data;
1467
+ }
1468
+
1469
+ /**
1470
+ * Get the opposite placement variation of the given one
1471
+ * @method
1472
+ * @memberof Popper.Utils
1473
+ * @argument {String} placement variation
1474
+ * @returns {String} flipped placement variation
1475
+ */
1476
+ function getOppositeVariation(variation) {
1477
+ if (variation === "end") {
1478
+ return "start";
1479
+ } else if (variation === "start") {
1480
+ return "end";
1481
+ }
1482
+ return variation;
1483
+ }
1484
+
1485
+ /**
1486
+ * List of accepted placements to use as values of the `placement` option.<br />
1487
+ * Valid placements are:
1488
+ * - `auto`
1489
+ * - `top`
1490
+ * - `right`
1491
+ * - `bottom`
1492
+ * - `left`
1493
+ *
1494
+ * Each placement can have a variation from this list:
1495
+ * - `-start`
1496
+ * - `-end`
1497
+ *
1498
+ * Variations are interpreted easily if you think of them as the left to right
1499
+ * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
1500
+ * is right.<br />
1501
+ * Vertically (`left` and `right`), `start` is top and `end` is bottom.
1502
+ *
1503
+ * Some valid examples are:
1504
+ * - `top-end` (on top of reference, right aligned)
1505
+ * - `right-start` (on right of reference, top aligned)
1506
+ * - `bottom` (on bottom, centered)
1507
+ * - `auto-right` (on the side with more space available, alignment depends by placement)
1508
+ *
1509
+ * @static
1510
+ * @type {Array}
1511
+ * @enum {String}
1512
+ * @readonly
1513
+ * @method placements
1514
+ * @memberof Popper
1515
+ */
1516
+ var placements = [
1517
+ "auto-start",
1518
+ "auto",
1519
+ "auto-end",
1520
+ "top-start",
1521
+ "top",
1522
+ "top-end",
1523
+ "right-start",
1524
+ "right",
1525
+ "right-end",
1526
+ "bottom-end",
1527
+ "bottom",
1528
+ "bottom-start",
1529
+ "left-end",
1530
+ "left",
1531
+ "left-start",
1532
+ ];
1533
+
1534
+ // Get rid of `auto` `auto-start` and `auto-end`
1535
+ var validPlacements = placements.slice(3);
1536
+
1537
+ /**
1538
+ * Given an initial placement, returns all the subsequent placements
1539
+ * clockwise (or counter-clockwise).
1540
+ *
1541
+ * @method
1542
+ * @memberof Popper.Utils
1543
+ * @argument {String} placement - A valid placement (it accepts variations)
1544
+ * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
1545
+ * @returns {Array} placements including their variations
1546
+ */
1547
+ function clockwise(placement) {
1548
+ var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1549
+
1550
+ var index = validPlacements.indexOf(placement);
1551
+ var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
1552
+ return counter ? arr.reverse() : arr;
1553
+ }
1554
+
1555
+ var BEHAVIORS = {
1556
+ FLIP: "flip",
1557
+ CLOCKWISE: "clockwise",
1558
+ COUNTERCLOCKWISE: "counterclockwise",
1559
+ };
1560
+
1561
+ /**
1562
+ * @function
1563
+ * @memberof Modifiers
1564
+ * @argument {Object} data - The data object generated by update method
1565
+ * @argument {Object} options - Modifiers configuration and options
1566
+ * @returns {Object} The data object, properly modified
1567
+ */
1568
+ function flip(data, options) {
1569
+ // if `inner` modifier is enabled, we can't use the `flip` modifier
1570
+ if (isModifierEnabled(data.instance.modifiers, "inner")) {
1571
+ return data;
1572
+ }
1573
+
1574
+ if (data.flipped && data.placement === data.originalPlacement) {
1575
+ // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
1576
+ return data;
1577
+ }
1578
+
1579
+ var boundaries = getBoundaries(
1580
+ data.instance.popper,
1581
+ data.instance.reference,
1582
+ options.padding,
1583
+ options.boundariesElement,
1584
+ data.positionFixed
1585
+ );
1586
+
1587
+ var placement = data.placement.split("-")[0];
1588
+ var placementOpposite = getOppositePlacement(placement);
1589
+ var variation = data.placement.split("-")[1] || "";
1590
+
1591
+ var flipOrder = [];
1592
+
1593
+ switch (options.behavior) {
1594
+ case BEHAVIORS.FLIP:
1595
+ flipOrder = [placement, placementOpposite];
1596
+ break;
1597
+ case BEHAVIORS.CLOCKWISE:
1598
+ flipOrder = clockwise(placement);
1599
+ break;
1600
+ case BEHAVIORS.COUNTERCLOCKWISE:
1601
+ flipOrder = clockwise(placement, true);
1602
+ break;
1603
+ default:
1604
+ flipOrder = options.behavior;
1605
+ }
1606
+
1607
+ flipOrder.forEach(function(step, index) {
1608
+ if (placement !== step || flipOrder.length === index + 1) {
1609
+ return data;
1610
+ }
1611
+
1612
+ placement = data.placement.split("-")[0];
1613
+ placementOpposite = getOppositePlacement(placement);
1614
+
1615
+ var popperOffsets = data.offsets.popper;
1616
+ var refOffsets = data.offsets.reference;
1617
+
1618
+ // using floor because the reference offsets may contain decimals we are not going to consider here
1619
+ var floor = Math.floor;
1620
+ var overlapsRef =
1621
+ (placement === "left" && floor(popperOffsets.right) > floor(refOffsets.left)) ||
1622
+ (placement === "right" && floor(popperOffsets.left) < floor(refOffsets.right)) ||
1623
+ (placement === "top" && floor(popperOffsets.bottom) > floor(refOffsets.top)) ||
1624
+ (placement === "bottom" && floor(popperOffsets.top) < floor(refOffsets.bottom));
1625
+
1626
+ var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
1627
+ var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
1628
+ var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
1629
+ var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
1630
+
1631
+ var overflowsBoundaries =
1632
+ (placement === "left" && overflowsLeft) ||
1633
+ (placement === "right" && overflowsRight) ||
1634
+ (placement === "top" && overflowsTop) ||
1635
+ (placement === "bottom" && overflowsBottom);
1636
+
1637
+ // flip the variation if required
1638
+ var isVertical = ["top", "bottom"].indexOf(placement) !== -1;
1639
+ var flippedVariation =
1640
+ !!options.flipVariations &&
1641
+ ((isVertical && variation === "start" && overflowsLeft) ||
1642
+ (isVertical && variation === "end" && overflowsRight) ||
1643
+ (!isVertical && variation === "start" && overflowsTop) ||
1644
+ (!isVertical && variation === "end" && overflowsBottom));
1645
+
1646
+ if (overlapsRef || overflowsBoundaries || flippedVariation) {
1647
+ // this boolean to detect any flip loop
1648
+ data.flipped = true;
1649
+
1650
+ if (overlapsRef || overflowsBoundaries) {
1651
+ placement = flipOrder[index + 1];
1652
+ }
1653
+
1654
+ if (flippedVariation) {
1655
+ variation = getOppositeVariation(variation);
1656
+ }
1657
+
1658
+ data.placement = placement + (variation ? "-" + variation : "");
1659
+
1660
+ // this object contains `position`, we want to preserve it along with
1661
+ // any additional property we may add in the future
1662
+ data.offsets.popper = _extends(
1663
+ {},
1664
+ data.offsets.popper,
1665
+ getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)
1666
+ );
1667
+
1668
+ data = runModifiers(data.instance.modifiers, data, "flip");
1669
+ }
1670
+ });
1671
+ return data;
1672
+ }
1673
+
1674
+ /**
1675
+ * @function
1676
+ * @memberof Modifiers
1677
+ * @argument {Object} data - The data object generated by update method
1678
+ * @argument {Object} options - Modifiers configuration and options
1679
+ * @returns {Object} The data object, properly modified
1680
+ */
1681
+ function keepTogether(data) {
1682
+ var _data$offsets = data.offsets,
1683
+ popper = _data$offsets.popper,
1684
+ reference = _data$offsets.reference;
1685
+
1686
+ var placement = data.placement.split("-")[0];
1687
+ var floor = Math.floor;
1688
+ var isVertical = ["top", "bottom"].indexOf(placement) !== -1;
1689
+ var side = isVertical ? "right" : "bottom";
1690
+ var opSide = isVertical ? "left" : "top";
1691
+ var measurement = isVertical ? "width" : "height";
1692
+
1693
+ if (popper[side] < floor(reference[opSide])) {
1694
+ data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
1695
+ }
1696
+ if (popper[opSide] > floor(reference[side])) {
1697
+ data.offsets.popper[opSide] = floor(reference[side]);
1698
+ }
1699
+
1700
+ return data;
1701
+ }
1702
+
1703
+ /**
1704
+ * Converts a string containing value + unit into a px value number
1705
+ * @function
1706
+ * @memberof {modifiers~offset}
1707
+ * @private
1708
+ * @argument {String} str - Value + unit string
1709
+ * @argument {String} measurement - `height` or `width`
1710
+ * @argument {Object} popperOffsets
1711
+ * @argument {Object} referenceOffsets
1712
+ * @returns {Number|String}
1713
+ * Value in pixels, or original string if no values were extracted
1714
+ */
1715
+ function toValue(str, measurement, popperOffsets, referenceOffsets) {
1716
+ // separate value from unit
1717
+ var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
1718
+ var value = +split[1];
1719
+ var unit = split[2];
1720
+
1721
+ // If it's not a number it's an operator, I guess
1722
+ if (!value) {
1723
+ return str;
1724
+ }
1725
+
1726
+ if (unit.indexOf("%") === 0) {
1727
+ var element = void 0;
1728
+ switch (unit) {
1729
+ case "%p":
1730
+ element = popperOffsets;
1731
+ break;
1732
+ case "%":
1733
+ case "%r":
1734
+ default:
1735
+ element = referenceOffsets;
1736
+ }
1737
+
1738
+ var rect = getClientRect(element);
1739
+ return (rect[measurement] / 100) * value;
1740
+ } else if (unit === "vh" || unit === "vw") {
1741
+ // if is a vh or vw, we calculate the size based on the viewport
1742
+ var size = void 0;
1743
+ if (unit === "vh") {
1744
+ size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
1745
+ } else {
1746
+ size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
1747
+ }
1748
+ return (size / 100) * value;
1749
+ } else {
1750
+ // if is an explicit pixel unit, we get rid of the unit and keep the value
1751
+ // if is an implicit unit, it's px, and we return just the value
1752
+ return value;
1753
+ }
1754
+ }
1755
+
1756
+ /**
1757
+ * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
1758
+ * @function
1759
+ * @memberof {modifiers~offset}
1760
+ * @private
1761
+ * @argument {String} offset
1762
+ * @argument {Object} popperOffsets
1763
+ * @argument {Object} referenceOffsets
1764
+ * @argument {String} basePlacement
1765
+ * @returns {Array} a two cells array with x and y offsets in numbers
1766
+ */
1767
+ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
1768
+ var offsets = [0, 0];
1769
+
1770
+ // Use height if placement is left or right and index is 0 otherwise use width
1771
+ // in this way the first offset will use an axis and the second one
1772
+ // will use the other one
1773
+ var useHeight = ["right", "left"].indexOf(basePlacement) !== -1;
1774
+
1775
+ // Split the offset string to obtain a list of values and operands
1776
+ // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
1777
+ var fragments = offset.split(/(\+|\-)/).map(function(frag) {
1778
+ return frag.trim();
1779
+ });
1780
+
1781
+ // Detect if the offset string contains a pair of values or a single one
1782
+ // they could be separated by comma or space
1783
+ var divider = fragments.indexOf(
1784
+ find(fragments, function(frag) {
1785
+ return frag.search(/,|\s/) !== -1;
1786
+ })
1787
+ );
1788
+
1789
+ if (fragments[divider] && fragments[divider].indexOf(",") === -1) {
1790
+ console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");
1791
+ }
1792
+
1793
+ // If divider is found, we divide the list of values and operands to divide
1794
+ // them by ofset X and Y.
1795
+ var splitRegex = /\s*,\s*|\s+/;
1796
+ var ops =
1797
+ divider !== -1
1798
+ ? [
1799
+ fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]),
1800
+ [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1)),
1801
+ ]
1802
+ : [fragments];
1803
+
1804
+ // Convert the values with units to absolute pixels to allow our computations
1805
+ ops = ops.map(function(op, index) {
1806
+ // Most of the units rely on the orientation of the popper
1807
+ var measurement = (index === 1 ? !useHeight : useHeight) ? "height" : "width";
1808
+ var mergeWithPrevious = false;
1809
+ return (
1810
+ op
1811
+ // This aggregates any `+` or `-` sign that aren't considered operators
1812
+ // e.g.: 10 + +5 => [10, +, +5]
1813
+ .reduce(function(a, b) {
1814
+ if (a[a.length - 1] === "" && ["+", "-"].indexOf(b) !== -1) {
1815
+ a[a.length - 1] = b;
1816
+ mergeWithPrevious = true;
1817
+ return a;
1818
+ } else if (mergeWithPrevious) {
1819
+ a[a.length - 1] += b;
1820
+ mergeWithPrevious = false;
1821
+ return a;
1822
+ } else {
1823
+ return a.concat(b);
1824
+ }
1825
+ }, [])
1826
+ // Here we convert the string values into number values (in px)
1827
+ .map(function(str) {
1828
+ return toValue(str, measurement, popperOffsets, referenceOffsets);
1829
+ })
1830
+ );
1831
+ });
1832
+
1833
+ // Loop trough the offsets arrays and execute the operations
1834
+ ops.forEach(function(op, index) {
1835
+ op.forEach(function(frag, index2) {
1836
+ if (isNumeric(frag)) {
1837
+ offsets[index] += frag * (op[index2 - 1] === "-" ? -1 : 1);
1838
+ }
1839
+ });
1840
+ });
1841
+ return offsets;
1842
+ }
1843
+
1844
+ /**
1845
+ * @function
1846
+ * @memberof Modifiers
1847
+ * @argument {Object} data - The data object generated by update method
1848
+ * @argument {Object} options - Modifiers configuration and options
1849
+ * @argument {Number|String} options.offset=0
1850
+ * The offset value as described in the modifier description
1851
+ * @returns {Object} The data object, properly modified
1852
+ */
1853
+ function offset(data, _ref) {
1854
+ var offset = _ref.offset;
1855
+ var placement = data.placement,
1856
+ _data$offsets = data.offsets,
1857
+ popper = _data$offsets.popper,
1858
+ reference = _data$offsets.reference;
1859
+
1860
+ var basePlacement = placement.split("-")[0];
1861
+
1862
+ var offsets = void 0;
1863
+ if (isNumeric(+offset)) {
1864
+ offsets = [+offset, 0];
1865
+ } else {
1866
+ offsets = parseOffset(offset, popper, reference, basePlacement);
1867
+ }
1868
+
1869
+ if (basePlacement === "left") {
1870
+ popper.top += offsets[0];
1871
+ popper.left -= offsets[1];
1872
+ } else if (basePlacement === "right") {
1873
+ popper.top += offsets[0];
1874
+ popper.left += offsets[1];
1875
+ } else if (basePlacement === "top") {
1876
+ popper.left += offsets[0];
1877
+ popper.top -= offsets[1];
1878
+ } else if (basePlacement === "bottom") {
1879
+ popper.left += offsets[0];
1880
+ popper.top += offsets[1];
1881
+ }
1882
+
1883
+ data.popper = popper;
1884
+ return data;
1885
+ }
1886
+
1887
+ /**
1888
+ * @function
1889
+ * @memberof Modifiers
1890
+ * @argument {Object} data - The data object generated by `update` method
1891
+ * @argument {Object} options - Modifiers configuration and options
1892
+ * @returns {Object} The data object, properly modified
1893
+ */
1894
+ function preventOverflow(data, options) {
1895
+ var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
1896
+
1897
+ // If offsetParent is the reference element, we really want to
1898
+ // go one step up and use the next offsetParent as reference to
1899
+ // avoid to make this modifier completely useless and look like broken
1900
+ if (data.instance.reference === boundariesElement) {
1901
+ boundariesElement = getOffsetParent(boundariesElement);
1902
+ }
1903
+
1904
+ // NOTE: DOM access here
1905
+ // resets the popper's position so that the document size can be calculated excluding
1906
+ // the size of the popper element itself
1907
+ var transformProp = getSupportedPropertyName("transform");
1908
+ var popperStyles = data.instance.popper.style; // assignment to help minification
1909
+ var top = popperStyles.top,
1910
+ left = popperStyles.left,
1911
+ transform = popperStyles[transformProp];
1912
+
1913
+ popperStyles.top = "";
1914
+ popperStyles.left = "";
1915
+ popperStyles[transformProp] = "";
1916
+
1917
+ var boundaries = getBoundaries(
1918
+ data.instance.popper,
1919
+ data.instance.reference,
1920
+ options.padding,
1921
+ boundariesElement,
1922
+ data.positionFixed
1923
+ );
1924
+
1925
+ // NOTE: DOM access here
1926
+ // restores the original style properties after the offsets have been computed
1927
+ popperStyles.top = top;
1928
+ popperStyles.left = left;
1929
+ popperStyles[transformProp] = transform;
1930
+
1931
+ options.boundaries = boundaries;
1932
+
1933
+ var order = options.priority;
1934
+ var popper = data.offsets.popper;
1935
+
1936
+ var check = {
1937
+ primary: function primary(placement) {
1938
+ var value = popper[placement];
1939
+ if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
1940
+ value = Math.max(popper[placement], boundaries[placement]);
1941
+ }
1942
+ return defineProperty({}, placement, value);
1943
+ },
1944
+ secondary: function secondary(placement) {
1945
+ var mainSide = placement === "right" ? "left" : "top";
1946
+ var value = popper[mainSide];
1947
+ if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
1948
+ value = Math.min(
1949
+ popper[mainSide],
1950
+ boundaries[placement] - (placement === "right" ? popper.width : popper.height)
1951
+ );
1952
+ }
1953
+ return defineProperty({}, mainSide, value);
1954
+ },
1955
+ };
1956
+
1957
+ order.forEach(function(placement) {
1958
+ var side = ["left", "top"].indexOf(placement) !== -1 ? "primary" : "secondary";
1959
+ popper = _extends({}, popper, check[side](placement));
1960
+ });
1961
+
1962
+ data.offsets.popper = popper;
1963
+
1964
+ return data;
1965
+ }
1966
+
1967
+ /**
1968
+ * @function
1969
+ * @memberof Modifiers
1970
+ * @argument {Object} data - The data object generated by `update` method
1971
+ * @argument {Object} options - Modifiers configuration and options
1972
+ * @returns {Object} The data object, properly modified
1973
+ */
1974
+ function shift(data) {
1975
+ var placement = data.placement;
1976
+ var basePlacement = placement.split("-")[0];
1977
+ var shiftvariation = placement.split("-")[1];
1978
+
1979
+ // if shift shiftvariation is specified, run the modifier
1980
+ if (shiftvariation) {
1981
+ var _data$offsets = data.offsets,
1982
+ reference = _data$offsets.reference,
1983
+ popper = _data$offsets.popper;
1984
+
1985
+ var isVertical = ["bottom", "top"].indexOf(basePlacement) !== -1;
1986
+ var side = isVertical ? "left" : "top";
1987
+ var measurement = isVertical ? "width" : "height";
1988
+
1989
+ var shiftOffsets = {
1990
+ start: defineProperty({}, side, reference[side]),
1991
+ end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]),
1992
+ };
1993
+
1994
+ data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
1995
+ }
1996
+
1997
+ return data;
1998
+ }
1999
+
2000
+ /**
2001
+ * @function
2002
+ * @memberof Modifiers
2003
+ * @argument {Object} data - The data object generated by update method
2004
+ * @argument {Object} options - Modifiers configuration and options
2005
+ * @returns {Object} The data object, properly modified
2006
+ */
2007
+ function hide(data) {
2008
+ if (!isModifierRequired(data.instance.modifiers, "hide", "preventOverflow")) {
2009
+ return data;
2010
+ }
2011
+
2012
+ var refRect = data.offsets.reference;
2013
+ var bound = find(data.instance.modifiers, function(modifier) {
2014
+ return modifier.name === "preventOverflow";
2015
+ }).boundaries;
2016
+
2017
+ if (
2018
+ refRect.bottom < bound.top ||
2019
+ refRect.left > bound.right ||
2020
+ refRect.top > bound.bottom ||
2021
+ refRect.right < bound.left
2022
+ ) {
2023
+ // Avoid unnecessary DOM access if visibility hasn't changed
2024
+ if (data.hide === true) {
2025
+ return data;
2026
+ }
2027
+
2028
+ data.hide = true;
2029
+ data.attributes["x-out-of-boundaries"] = "";
2030
+ } else {
2031
+ // Avoid unnecessary DOM access if visibility hasn't changed
2032
+ if (data.hide === false) {
2033
+ return data;
2034
+ }
2035
+
2036
+ data.hide = false;
2037
+ data.attributes["x-out-of-boundaries"] = false;
2038
+ }
2039
+
2040
+ return data;
2041
+ }
2042
+
2043
+ /**
2044
+ * @function
2045
+ * @memberof Modifiers
2046
+ * @argument {Object} data - The data object generated by `update` method
2047
+ * @argument {Object} options - Modifiers configuration and options
2048
+ * @returns {Object} The data object, properly modified
2049
+ */
2050
+ function inner(data) {
2051
+ var placement = data.placement;
2052
+ var basePlacement = placement.split("-")[0];
2053
+ var _data$offsets = data.offsets,
2054
+ popper = _data$offsets.popper,
2055
+ reference = _data$offsets.reference;
2056
+
2057
+ var isHoriz = ["left", "right"].indexOf(basePlacement) !== -1;
2058
+
2059
+ var subtractLength = ["top", "left"].indexOf(basePlacement) === -1;
2060
+
2061
+ popper[isHoriz ? "left" : "top"] =
2062
+ reference[basePlacement] - (subtractLength ? popper[isHoriz ? "width" : "height"] : 0);
2063
+
2064
+ data.placement = getOppositePlacement(placement);
2065
+ data.offsets.popper = getClientRect(popper);
2066
+
2067
+ return data;
2068
+ }
2069
+
2070
+ /**
2071
+ * Modifier function, each modifier can have a function of this type assigned
2072
+ * to its `fn` property.<br />
2073
+ * These functions will be called on each update, this means that you must
2074
+ * make sure they are performant enough to avoid performance bottlenecks.
2075
+ *
2076
+ * @function ModifierFn
2077
+ * @argument {dataObject} data - The data object generated by `update` method
2078
+ * @argument {Object} options - Modifiers configuration and options
2079
+ * @returns {dataObject} The data object, properly modified
2080
+ */
2081
+
2082
+ /**
2083
+ * Modifiers are plugins used to alter the behavior of your poppers.<br />
2084
+ * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
2085
+ * needed by the library.
2086
+ *
2087
+ * Usually you don't want to override the `order`, `fn` and `onLoad` props.
2088
+ * All the other properties are configurations that could be tweaked.
2089
+ * @namespace modifiers
2090
+ */
2091
+ var modifiers = {
2092
+ /**
2093
+ * Modifier used to shift the popper on the start or end of its reference
2094
+ * element.<br />
2095
+ * It will read the variation of the `placement` property.<br />
2096
+ * It can be one either `-end` or `-start`.
2097
+ * @memberof modifiers
2098
+ * @inner
2099
+ */
2100
+ shift: {
2101
+ /** @prop {number} order=100 - Index used to define the order of execution */
2102
+ order: 100,
2103
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2104
+ enabled: true,
2105
+ /** @prop {ModifierFn} */
2106
+ fn: shift,
2107
+ },
2108
+
2109
+ /**
2110
+ * The `offset` modifier can shift your popper on both its axis.
2111
+ *
2112
+ * It accepts the following units:
2113
+ * - `px` or unitless, interpreted as pixels
2114
+ * - `%` or `%r`, percentage relative to the length of the reference element
2115
+ * - `%p`, percentage relative to the length of the popper element
2116
+ * - `vw`, CSS viewport width unit
2117
+ * - `vh`, CSS viewport height unit
2118
+ *
2119
+ * For length is intended the main axis relative to the placement of the popper.<br />
2120
+ * This means that if the placement is `top` or `bottom`, the length will be the
2121
+ * `width`. In case of `left` or `right`, it will be the height.
2122
+ *
2123
+ * You can provide a single value (as `Number` or `String`), or a pair of values
2124
+ * as `String` divided by a comma or one (or more) white spaces.<br />
2125
+ * The latter is a deprecated method because it leads to confusion and will be
2126
+ * removed in v2.<br />
2127
+ * Additionally, it accepts additions and subtractions between different units.
2128
+ * Note that multiplications and divisions aren't supported.
2129
+ *
2130
+ * Valid examples are:
2131
+ * ```
2132
+ * 10
2133
+ * '10%'
2134
+ * '10, 10'
2135
+ * '10%, 10'
2136
+ * '10 + 10%'
2137
+ * '10 - 5vh + 3%'
2138
+ * '-10px + 5vh, 5px - 6%'
2139
+ * ```
2140
+ * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
2141
+ * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
2142
+ * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)
2143
+ *
2144
+ * @memberof modifiers
2145
+ * @inner
2146
+ */
2147
+ offset: {
2148
+ /** @prop {number} order=200 - Index used to define the order of execution */
2149
+ order: 200,
2150
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2151
+ enabled: true,
2152
+ /** @prop {ModifierFn} */
2153
+ fn: offset,
2154
+ /** @prop {Number|String} offset=0
2155
+ * The offset value as described in the modifier description
2156
+ */
2157
+ offset: 0,
2158
+ },
2159
+
2160
+ /**
2161
+ * Modifier used to prevent the popper from being positioned outside the boundary.
2162
+ *
2163
+ * An scenario exists where the reference itself is not within the boundaries.<br />
2164
+ * We can say it has "escaped the boundaries" — or just "escaped".<br />
2165
+ * In this case we need to decide whether the popper should either:
2166
+ *
2167
+ * - detach from the reference and remain "trapped" in the boundaries, or
2168
+ * - if it should ignore the boundary and "escape with its reference"
2169
+ *
2170
+ * When `escapeWithReference` is set to`true` and reference is completely
2171
+ * outside its boundaries, the popper will overflow (or completely leave)
2172
+ * the boundaries in order to remain attached to the edge of the reference.
2173
+ *
2174
+ * @memberof modifiers
2175
+ * @inner
2176
+ */
2177
+ preventOverflow: {
2178
+ /** @prop {number} order=300 - Index used to define the order of execution */
2179
+ order: 300,
2180
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2181
+ enabled: true,
2182
+ /** @prop {ModifierFn} */
2183
+ fn: preventOverflow,
2184
+ /**
2185
+ * @prop {Array} [priority=['left','right','top','bottom']]
2186
+ * Popper will try to prevent overflow following these priorities by default,
2187
+ * then, it could overflow on the left and on top of the `boundariesElement`
2188
+ */
2189
+ priority: ["left", "right", "top", "bottom"],
2190
+ /**
2191
+ * @prop {number} padding=5
2192
+ * Amount of pixel used to define a minimum distance between the boundaries
2193
+ * and the popper this makes sure the popper has always a little padding
2194
+ * between the edges of its container
2195
+ */
2196
+ padding: 5,
2197
+ /**
2198
+ * @prop {String|HTMLElement} boundariesElement='scrollParent'
2199
+ * Boundaries used by the modifier, can be `scrollParent`, `window`,
2200
+ * `viewport` or any DOM element.
2201
+ */
2202
+ boundariesElement: "scrollParent",
2203
+ },
2204
+
2205
+ /**
2206
+ * Modifier used to make sure the reference and its popper stay near eachothers
2207
+ * without leaving any gap between the two. Expecially useful when the arrow is
2208
+ * enabled and you want to assure it to point to its reference element.
2209
+ * It cares only about the first axis, you can still have poppers with margin
2210
+ * between the popper and its reference element.
2211
+ * @memberof modifiers
2212
+ * @inner
2213
+ */
2214
+ keepTogether: {
2215
+ /** @prop {number} order=400 - Index used to define the order of execution */
2216
+ order: 400,
2217
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2218
+ enabled: true,
2219
+ /** @prop {ModifierFn} */
2220
+ fn: keepTogether,
2221
+ },
2222
+
2223
+ /**
2224
+ * This modifier is used to move the `arrowElement` of the popper to make
2225
+ * sure it is positioned between the reference element and its popper element.
2226
+ * It will read the outer size of the `arrowElement` node to detect how many
2227
+ * pixels of conjuction are needed.
2228
+ *
2229
+ * It has no effect if no `arrowElement` is provided.
2230
+ * @memberof modifiers
2231
+ * @inner
2232
+ */
2233
+ arrow: {
2234
+ /** @prop {number} order=500 - Index used to define the order of execution */
2235
+ order: 500,
2236
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2237
+ enabled: true,
2238
+ /** @prop {ModifierFn} */
2239
+ fn: arrow,
2240
+ /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
2241
+ element: "[x-arrow]",
2242
+ },
2243
+
2244
+ /**
2245
+ * Modifier used to flip the popper's placement when it starts to overlap its
2246
+ * reference element.
2247
+ *
2248
+ * Requires the `preventOverflow` modifier before it in order to work.
2249
+ *
2250
+ * **NOTE:** this modifier will interrupt the current update cycle and will
2251
+ * restart it if it detects the need to flip the placement.
2252
+ * @memberof modifiers
2253
+ * @inner
2254
+ */
2255
+ flip: {
2256
+ /** @prop {number} order=600 - Index used to define the order of execution */
2257
+ order: 600,
2258
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2259
+ enabled: true,
2260
+ /** @prop {ModifierFn} */
2261
+ fn: flip,
2262
+ /**
2263
+ * @prop {String|Array} behavior='flip'
2264
+ * The behavior used to change the popper's placement. It can be one of
2265
+ * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
2266
+ * placements (with optional variations).
2267
+ */
2268
+ behavior: "flip",
2269
+ /**
2270
+ * @prop {number} padding=5
2271
+ * The popper will flip if it hits the edges of the `boundariesElement`
2272
+ */
2273
+ padding: 5,
2274
+ /**
2275
+ * @prop {String|HTMLElement} boundariesElement='viewport'
2276
+ * The element which will define the boundaries of the popper position,
2277
+ * the popper will never be placed outside of the defined boundaries
2278
+ * (except if keepTogether is enabled)
2279
+ */
2280
+ boundariesElement: "viewport",
2281
+ },
2282
+
2283
+ /**
2284
+ * Modifier used to make the popper flow toward the inner of the reference element.
2285
+ * By default, when this modifier is disabled, the popper will be placed outside
2286
+ * the reference element.
2287
+ * @memberof modifiers
2288
+ * @inner
2289
+ */
2290
+ inner: {
2291
+ /** @prop {number} order=700 - Index used to define the order of execution */
2292
+ order: 700,
2293
+ /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
2294
+ enabled: false,
2295
+ /** @prop {ModifierFn} */
2296
+ fn: inner,
2297
+ },
2298
+
2299
+ /**
2300
+ * Modifier used to hide the popper when its reference element is outside of the
2301
+ * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
2302
+ * be used to hide with a CSS selector the popper when its reference is
2303
+ * out of boundaries.
2304
+ *
2305
+ * Requires the `preventOverflow` modifier before it in order to work.
2306
+ * @memberof modifiers
2307
+ * @inner
2308
+ */
2309
+ hide: {
2310
+ /** @prop {number} order=800 - Index used to define the order of execution */
2311
+ order: 800,
2312
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2313
+ enabled: true,
2314
+ /** @prop {ModifierFn} */
2315
+ fn: hide,
2316
+ },
2317
+
2318
+ /**
2319
+ * Computes the style that will be applied to the popper element to gets
2320
+ * properly positioned.
2321
+ *
2322
+ * Note that this modifier will not touch the DOM, it just prepares the styles
2323
+ * so that `applyStyle` modifier can apply it. This separation is useful
2324
+ * in case you need to replace `applyStyle` with a custom implementation.
2325
+ *
2326
+ * This modifier has `850` as `order` value to maintain backward compatibility
2327
+ * with previous versions of Popper.js. Expect the modifiers ordering method
2328
+ * to change in future major versions of the library.
2329
+ *
2330
+ * @memberof modifiers
2331
+ * @inner
2332
+ */
2333
+ computeStyle: {
2334
+ /** @prop {number} order=850 - Index used to define the order of execution */
2335
+ order: 850,
2336
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2337
+ enabled: true,
2338
+ /** @prop {ModifierFn} */
2339
+ fn: computeStyle,
2340
+ /**
2341
+ * @prop {Boolean} gpuAcceleration=true
2342
+ * If true, it uses the CSS 3d transformation to position the popper.
2343
+ * Otherwise, it will use the `top` and `left` properties.
2344
+ */
2345
+ gpuAcceleration: true,
2346
+ /**
2347
+ * @prop {string} [x='bottom']
2348
+ * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
2349
+ * Change this if your popper should grow in a direction different from `bottom`
2350
+ */
2351
+ x: "bottom",
2352
+ /**
2353
+ * @prop {string} [x='left']
2354
+ * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
2355
+ * Change this if your popper should grow in a direction different from `right`
2356
+ */
2357
+ y: "right",
2358
+ },
2359
+
2360
+ /**
2361
+ * Applies the computed styles to the popper element.
2362
+ *
2363
+ * All the DOM manipulations are limited to this modifier. This is useful in case
2364
+ * you want to integrate Popper.js inside a framework or view library and you
2365
+ * want to delegate all the DOM manipulations to it.
2366
+ *
2367
+ * Note that if you disable this modifier, you must make sure the popper element
2368
+ * has its position set to `absolute` before Popper.js can do its work!
2369
+ *
2370
+ * Just disable this modifier and define you own to achieve the desired effect.
2371
+ *
2372
+ * @memberof modifiers
2373
+ * @inner
2374
+ */
2375
+ applyStyle: {
2376
+ /** @prop {number} order=900 - Index used to define the order of execution */
2377
+ order: 900,
2378
+ /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
2379
+ enabled: true,
2380
+ /** @prop {ModifierFn} */
2381
+ fn: applyStyle,
2382
+ /** @prop {Function} */
2383
+ onLoad: applyStyleOnLoad,
2384
+ /**
2385
+ * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
2386
+ * @prop {Boolean} gpuAcceleration=true
2387
+ * If true, it uses the CSS 3d transformation to position the popper.
2388
+ * Otherwise, it will use the `top` and `left` properties.
2389
+ */
2390
+ gpuAcceleration: undefined,
2391
+ },
2392
+ };
2393
+
2394
+ /**
2395
+ * The `dataObject` is an object containing all the informations used by Popper.js
2396
+ * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
2397
+ * @name dataObject
2398
+ * @property {Object} data.instance The Popper.js instance
2399
+ * @property {String} data.placement Placement applied to popper
2400
+ * @property {String} data.originalPlacement Placement originally defined on init
2401
+ * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
2402
+ * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.
2403
+ * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
2404
+ * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)
2405
+ * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)
2406
+ * @property {Object} data.boundaries Offsets of the popper boundaries
2407
+ * @property {Object} data.offsets The measurements of popper, reference and arrow elements.
2408
+ * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
2409
+ * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
2410
+ * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
2411
+ */
2412
+
2413
+ /**
2414
+ * Default options provided to Popper.js constructor.<br />
2415
+ * These can be overriden using the `options` argument of Popper.js.<br />
2416
+ * To override an option, simply pass as 3rd argument an object with the same
2417
+ * structure of this object, example:
2418
+ * ```
2419
+ * new Popper(ref, pop, {
2420
+ * modifiers: {
2421
+ * preventOverflow: { enabled: false }
2422
+ * }
2423
+ * })
2424
+ * ```
2425
+ * @type {Object}
2426
+ * @static
2427
+ * @memberof Popper
2428
+ */
2429
+ var Defaults = {
2430
+ /**
2431
+ * Popper's placement
2432
+ * @prop {Popper.placements} placement='bottom'
2433
+ */
2434
+ placement: "bottom",
2435
+
2436
+ /**
2437
+ * Set this to true if you want popper to position it self in 'fixed' mode
2438
+ * @prop {Boolean} positionFixed=false
2439
+ */
2440
+ positionFixed: false,
2441
+
2442
+ /**
2443
+ * Whether events (resize, scroll) are initially enabled
2444
+ * @prop {Boolean} eventsEnabled=true
2445
+ */
2446
+ eventsEnabled: true,
2447
+
2448
+ /**
2449
+ * Set to true if you want to automatically remove the popper when
2450
+ * you call the `destroy` method.
2451
+ * @prop {Boolean} removeOnDestroy=false
2452
+ */
2453
+ removeOnDestroy: false,
2454
+
2455
+ /**
2456
+ * Callback called when the popper is created.<br />
2457
+ * By default, is set to no-op.<br />
2458
+ * Access Popper.js instance with `data.instance`.
2459
+ * @prop {onCreate}
2460
+ */
2461
+ onCreate: function onCreate() {},
2462
+
2463
+ /**
2464
+ * Callback called when the popper is updated, this callback is not called
2465
+ * on the initialization/creation of the popper, but only on subsequent
2466
+ * updates.<br />
2467
+ * By default, is set to no-op.<br />
2468
+ * Access Popper.js instance with `data.instance`.
2469
+ * @prop {onUpdate}
2470
+ */
2471
+ onUpdate: function onUpdate() {},
2472
+
2473
+ /**
2474
+ * List of modifiers used to modify the offsets before they are applied to the popper.
2475
+ * They provide most of the functionalities of Popper.js
2476
+ * @prop {modifiers}
2477
+ */
2478
+ modifiers: modifiers,
2479
+ };
2480
+
2481
+ /**
2482
+ * @callback onCreate
2483
+ * @param {dataObject} data
2484
+ */
2485
+
2486
+ /**
2487
+ * @callback onUpdate
2488
+ * @param {dataObject} data
2489
+ */
2490
+
2491
+ // Utils
2492
+ // Methods
2493
+ var Popper = (function() {
2494
+ /**
2495
+ * Create a new Popper.js instance
2496
+ * @class Popper
2497
+ * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
2498
+ * @param {HTMLElement} popper - The HTML element used as popper.
2499
+ * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
2500
+ * @return {Object} instance - The generated Popper.js instance
2501
+ */
2502
+ function Popper(reference, popper) {
2503
+ var _this = this;
2504
+
2505
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2506
+ classCallCheck(this, Popper);
2507
+
2508
+ this.scheduleUpdate = function() {
2509
+ return requestAnimationFrame(_this.update);
2510
+ };
2511
+
2512
+ // make update() debounced, so that it only runs at most once-per-tick
2513
+ this.update = debounce(this.update.bind(this));
2514
+
2515
+ // with {} we create a new object with the options inside it
2516
+ this.options = _extends({}, Popper.Defaults, options);
2517
+
2518
+ // init state
2519
+ this.state = {
2520
+ isDestroyed: false,
2521
+ isCreated: false,
2522
+ scrollParents: [],
2523
+ };
2524
+
2525
+ // get reference and popper elements (allow jQuery wrappers)
2526
+ this.reference = reference && reference.jquery ? reference[0] : reference;
2527
+ this.popper = popper && popper.jquery ? popper[0] : popper;
2528
+
2529
+ // Deep merge modifiers options
2530
+ this.options.modifiers = {};
2531
+ Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function(name) {
2532
+ _this.options.modifiers[name] = _extends(
2533
+ {},
2534
+ Popper.Defaults.modifiers[name] || {},
2535
+ options.modifiers ? options.modifiers[name] : {}
2536
+ );
2537
+ });
2538
+
2539
+ // Refactoring modifiers' list (Object => Array)
2540
+ this.modifiers = Object.keys(this.options.modifiers)
2541
+ .map(function(name) {
2542
+ return _extends(
2543
+ {
2544
+ name: name,
2545
+ },
2546
+ _this.options.modifiers[name]
2547
+ );
2548
+ })
2549
+ // sort the modifiers by order
2550
+ .sort(function(a, b) {
2551
+ return a.order - b.order;
2552
+ });
2553
+
2554
+ // modifiers have the ability to execute arbitrary code when Popper.js get inited
2555
+ // such code is executed in the same order of its modifier
2556
+ // they could add new properties to their options configuration
2557
+ // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
2558
+ this.modifiers.forEach(function(modifierOptions) {
2559
+ if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
2560
+ modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
2561
+ }
2562
+ });
2563
+
2564
+ // fire the first update to position the popper in the right place
2565
+ this.update();
2566
+
2567
+ var eventsEnabled = this.options.eventsEnabled;
2568
+ if (eventsEnabled) {
2569
+ // setup event listeners, they will take care of update the position in specific situations
2570
+ this.enableEventListeners();
2571
+ }
2572
+
2573
+ this.state.eventsEnabled = eventsEnabled;
2574
+ }
2575
+
2576
+ // We can't use class properties because they don't get listed in the
2577
+ // class prototype and break stuff like Sinon stubs
2578
+
2579
+ createClass(Popper, [
2580
+ {
2581
+ key: "update",
2582
+ value: function update$$1() {
2583
+ return update.call(this);
2584
+ },
2585
+ },
2586
+ {
2587
+ key: "destroy",
2588
+ value: function destroy$$1() {
2589
+ return destroy.call(this);
2590
+ },
2591
+ },
2592
+ {
2593
+ key: "enableEventListeners",
2594
+ value: function enableEventListeners$$1() {
2595
+ return enableEventListeners.call(this);
2596
+ },
2597
+ },
2598
+ {
2599
+ key: "disableEventListeners",
2600
+ value: function disableEventListeners$$1() {
2601
+ return disableEventListeners.call(this);
2602
+ },
2603
+
2604
+ /**
2605
+ * Schedule an update, it will run on the next UI update available
2606
+ * @method scheduleUpdate
2607
+ * @memberof Popper
2608
+ */
2609
+
2610
+ /**
2611
+ * Collection of utilities useful when writing custom modifiers.
2612
+ * Starting from version 1.7, this method is available only if you
2613
+ * include `popper-utils.js` before `popper.js`.
2614
+ *
2615
+ * **DEPRECATION**: This way to access PopperUtils is deprecated
2616
+ * and will be removed in v2! Use the PopperUtils module directly instead.
2617
+ * Due to the high instability of the methods contained in Utils, we can't
2618
+ * guarantee them to follow semver. Use them at your own risk!
2619
+ * @static
2620
+ * @private
2621
+ * @type {Object}
2622
+ * @deprecated since version 1.8
2623
+ * @member Utils
2624
+ * @memberof Popper
2625
+ */
2626
+ },
2627
+ ]);
2628
+ return Popper;
2629
+ })();
2630
+
2631
+ /**
2632
+ * The `referenceObject` is an object that provides an interface compatible with Popper.js
2633
+ * and lets you use it as replacement of a real DOM node.<br />
2634
+ * You can use this method to position a popper relatively to a set of coordinates
2635
+ * in case you don't have a DOM node to use as reference.
2636
+ *
2637
+ * ```
2638
+ * new Popper(referenceObject, popperNode);
2639
+ * ```
2640
+ *
2641
+ * NB: This feature isn't supported in Internet Explorer 10
2642
+ * @name referenceObject
2643
+ * @property {Function} data.getBoundingClientRect
2644
+ * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
2645
+ * @property {number} data.clientWidth
2646
+ * An ES6 getter that will return the width of the virtual reference element.
2647
+ * @property {number} data.clientHeight
2648
+ * An ES6 getter that will return the height of the virtual reference element.
2649
+ */
2650
+
2651
+ Popper.Utils = (typeof window !== "undefined" ? window : global).PopperUtils;
2652
+ Popper.placements = placements;
2653
+ Popper.Defaults = Defaults;
2654
+
2655
+ return Popper;
2656
+ });
2657
+ //# sourceMappingURL=popper.js.map