@artisan-commerce/analytics-web 0.1.0-canary.8 → 0.1.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 (414) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/build/main.bundle.js +11 -11
  3. package/build/report.json +1 -1
  4. package/build/src/index.d.ts +3 -0
  5. package/build/src/lib/events/auth/changePasswordAttempt/changePasswordAttempt.types.d.ts +2 -1
  6. package/build/src/lib/events/auth/changePasswordFail/changePasswordFail.types.d.ts +2 -1
  7. package/build/src/lib/events/auth/changePasswordSuccess/changePasswordSuccess.types.d.ts +2 -1
  8. package/build/src/lib/events/auth/signIn/signIn.types.d.ts +2 -1
  9. package/build/src/lib/events/auth/signOut/signOut.types.d.ts +2 -1
  10. package/build/src/lib/events/auth/signUp/signUp.types.d.ts +2 -1
  11. package/build/src/lib/events/auth/signUpAttempt/signUpAttempt.types.d.ts +2 -1
  12. package/build/src/lib/events/banner/bannerImpression/bannerImpression.types.d.ts +2 -1
  13. package/build/src/lib/events/banner/selectBanner/selectBanner.types.d.ts +2 -1
  14. package/build/src/lib/events/billing/addBillingInfo/addBillingInfo.types.d.ts +2 -1
  15. package/build/src/lib/events/billing/selectBillingInfo/selectBillingInfo.types.d.ts +2 -1
  16. package/build/src/lib/events/billing/updateBillingInfo/updateBillingInfo.types.d.ts +2 -1
  17. package/build/src/lib/events/booking/bookAppointment/bookAppointment.types.d.ts +2 -1
  18. package/build/src/lib/events/category/categoryImpression/categoryImpression.types.d.ts +2 -1
  19. package/build/src/lib/events/category/searchCategoryAttempt/searchCategoryAttempt.types.d.ts +2 -1
  20. package/build/src/lib/events/category/selectCategory/selectCategory.types.d.ts +2 -1
  21. package/build/src/lib/events/category/viewCategory/viewCategory.types.d.ts +2 -1
  22. package/build/src/lib/events/checkout/checkoutAction/checkoutAction.types.d.ts +2 -1
  23. package/build/src/lib/events/checkout/initiateCheckout/initiateCheckout.types.d.ts +2 -1
  24. package/build/src/lib/events/coupon/applyBenefit/applyBenefit.types.d.ts +2 -1
  25. package/build/src/lib/events/coupon/couponCodeError/couponCodeError.types.d.ts +2 -1
  26. package/build/src/lib/events/coupon/redeemCouponCode/redeemCouponCode.types.d.ts +2 -1
  27. package/build/src/lib/events/coupon/removeBenefit/removeBenefit.types.d.ts +2 -1
  28. package/build/src/lib/events/coupon/viewBenefitDetails/viewBenefitDetails.types.d.ts +2 -1
  29. package/build/src/lib/events/coupon/viewBenefitsWallet/viewBenefitsWallet.types.d.ts +2 -1
  30. package/build/src/lib/events/coupon/viewQRStoreCoupon/viewQRStoreCoupon.types.d.ts +2 -1
  31. package/build/src/lib/events/credit/addCredits/addCredits.types.d.ts +2 -1
  32. package/build/src/lib/events/credit/spendCredits/spendCredits.types.d.ts +2 -1
  33. package/build/src/lib/events/credit/viewCredits/viewCredits.types.d.ts +2 -1
  34. package/build/src/lib/events/customEvent/customEvent.types.d.ts +3 -2
  35. package/build/src/lib/events/events.d.ts +5 -5
  36. package/build/src/lib/events/fulfillment/viewFulfillmentStep/viewFulfillmentStep.types.d.ts +2 -1
  37. package/build/src/lib/events/fulfillment/viewTracking/viewTracking.types.d.ts +2 -1
  38. package/build/src/lib/events/geo/changeLocation/changeLocation.d.ts +1 -1
  39. package/build/src/lib/events/geo/changeLocation/changeLocation.types.d.ts +6 -5
  40. package/build/src/lib/events/geo/findLocation/findLocation.d.ts +1 -1
  41. package/build/src/lib/events/geo/findLocation/findLocation.types.d.ts +2 -1
  42. package/build/src/lib/events/geo/index.d.ts +4 -4
  43. package/build/src/lib/events/geo/outOfCoverage/outOfCoverage.d.ts +1 -1
  44. package/build/src/lib/events/geo/outOfCoverage/outOfCoverage.types.d.ts +4 -3
  45. package/build/src/lib/events/geo/setLocation/setLocation.d.ts +1 -1
  46. package/build/src/lib/events/geo/setLocation/setLocation.types.d.ts +4 -3
  47. package/build/src/lib/events/help/requestAssistance/requestAssistance.types.d.ts +2 -1
  48. package/build/src/lib/events/loyalty/earnPoints/earnPoints.types.d.ts +2 -1
  49. package/build/src/lib/events/loyalty/sharePoints/sharePoints.types.d.ts +2 -1
  50. package/build/src/lib/events/loyalty/spendPoints/spendPoints.types.d.ts +2 -1
  51. package/build/src/lib/events/loyalty/viewLoyaltyLevel/viewLoyaltyLevel.types.d.ts +2 -1
  52. package/build/src/lib/events/order/cancelOrder/cancelOrder.types.d.ts +2 -1
  53. package/build/src/lib/events/order/rateOrder/rateOrder.types.d.ts +2 -1
  54. package/build/src/lib/events/order/requestRefund/requestRefund.types.d.ts +2 -1
  55. package/build/src/lib/events/other/generateLead/generateLead.types.d.ts +2 -1
  56. package/build/src/lib/events/other/index.d.ts +1 -1
  57. package/build/src/lib/events/other/pageView/pageView.d.ts +1 -1
  58. package/build/src/lib/events/other/pageView/pageView.types.d.ts +2 -1
  59. package/build/src/lib/events/other/searchPageContent/searchPageContent.types.d.ts +2 -1
  60. package/build/src/lib/events/payment/changePaymentType/changePaymentType.types.d.ts +2 -1
  61. package/build/src/lib/events/payment/selectPaymentType/selectPaymentType.types.d.ts +2 -1
  62. package/build/src/lib/events/payment/setPaymentInfo/setPaymentInfo.types.d.ts +2 -1
  63. package/build/src/lib/events/product/customizeProduct/customizeProduct.types.d.ts +2 -1
  64. package/build/src/lib/events/product/filterProducts/filterProducts.types.d.ts +2 -1
  65. package/build/src/lib/events/product/productImpression/productImpression.types.d.ts +2 -1
  66. package/build/src/lib/events/product/searchProductAttempt/searchProductAttempt.types.d.ts +2 -1
  67. package/build/src/lib/events/product/searchProductNotFound/searchProductNotFound.types.d.ts +2 -1
  68. package/build/src/lib/events/product/searchProductSuccess/searchProductSuccess.types.d.ts +2 -1
  69. package/build/src/lib/events/product/selectProduct/selectProduct.types.d.ts +2 -1
  70. package/build/src/lib/events/product/sortProducts/sortProducts.types.d.ts +2 -1
  71. package/build/src/lib/events/product/viewProductDetails/viewProductDetails.types.d.ts +2 -1
  72. package/build/src/lib/events/purchase/purchaseAttempt/purchaseAttempt.types.d.ts +2 -1
  73. package/build/src/lib/events/purchase/purchaseFail/purchaseFail.types.d.ts +2 -1
  74. package/build/src/lib/events/purchase/purchaseSuccess/purchaseSuccess.types.d.ts +2 -1
  75. package/build/src/lib/events/settings/viewSettings/viewSettings.types.d.ts +2 -1
  76. package/build/src/lib/events/shipping/addShippingAddress/addShippingAddress.types.d.ts +4 -3
  77. package/build/src/lib/events/shipping/selectShippingAddress/selectShippingAddress.types.d.ts +4 -3
  78. package/build/src/lib/events/shipping/updateShippingAddress/updateShippingAddress.types.d.ts +2 -1
  79. package/build/src/lib/events/shoppingCart/addProductToCart/addProductToCart.types.d.ts +2 -1
  80. package/build/src/lib/events/shoppingCart/addProductToWishlist/addProductToWishlist.types.d.ts +2 -1
  81. package/build/src/lib/events/shoppingCart/clearCart/clearCart.types.d.ts +2 -1
  82. package/build/src/lib/events/shoppingCart/removeProductFromCart/removeProductFromCart.types.d.ts +2 -1
  83. package/build/src/lib/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.types.d.ts +2 -1
  84. package/build/src/lib/events/shoppingCart/updateProductInCart/updateProductInCart.types.d.ts +2 -1
  85. package/build/src/lib/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.types.d.ts +2 -1
  86. package/build/src/lib/events/shoppingCart/viewCart/viewCart.types.d.ts +2 -1
  87. package/build/src/lib/events/social/share/share.types.d.ts +2 -1
  88. package/build/src/lib/events/store/changeStore/changeStore.types.d.ts +2 -1
  89. package/build/src/lib/events/store/setStore/setStore.types.d.ts +2 -1
  90. package/build/src/lib/events/user/setUserInfo/setUserInfo.types.d.ts +2 -1
  91. package/build/src/lib/events/user/updateUserInfo/updateUserInfo.types.d.ts +2 -1
  92. package/build/src/lib/events/vendor/changeVendor/changeVendor.types.d.ts +2 -1
  93. package/build/src/lib/events/vendor/setVendor/setVendor.types.d.ts +2 -1
  94. package/build/src/lib/events/workflow/selectWorkflow/selectWorkflow.types.d.ts +2 -1
  95. package/build/src/lib/events/workflow/updateWorkflow/updateWorkflow.types.d.ts +2 -1
  96. package/build/src/lib/initAnalytics/initAnalytics.types.d.ts +27 -1
  97. package/build/src/lib/providers/AnalyticsProvider/AnalyticsProvider.d.ts +1 -1
  98. package/build/src/lib/providers/AnalyticsProvider/AnalyticsProvider.types.d.ts +2 -2
  99. package/build/src/lib/providers/FacebookPixel/FacebookPixel.types.d.ts +1 -1
  100. package/build/src/lib/providers/FacebookPixel/events/category/searchCategoryAttempt/searchCategoryAttempt.types.d.ts +2 -0
  101. package/build/src/lib/providers/FacebookPixel/events/loyalty/spendPoints/spendPoints.types.d.ts +2 -0
  102. package/build/src/lib/providers/FacebookPixel/events/other/searchPageContent/searchPageContent.types.d.ts +2 -0
  103. package/build/src/lib/providers/GlobalProvider/GlobalProvider.d.ts +1 -1
  104. package/build/src/lib/providers/Segment/Segment.d.ts +33 -0
  105. package/build/src/lib/providers/Segment/Segment.test.d.ts +1 -0
  106. package/build/src/lib/providers/Segment/Segment.types.d.ts +229 -0
  107. package/build/src/lib/providers/Segment/events/auth/changePasswordAttempt/changePasswordAttempt.d.ts +11 -0
  108. package/build/src/lib/providers/Segment/events/auth/changePasswordAttempt/changePasswordAttempt.test.d.ts +1 -0
  109. package/build/src/lib/providers/Segment/events/auth/changePasswordAttempt/changePasswordAttempt.types.d.ts +14 -0
  110. package/build/src/lib/providers/Segment/events/auth/changePasswordFail/changePasswordFail.d.ts +11 -0
  111. package/build/src/lib/providers/Segment/events/auth/changePasswordFail/changePasswordFail.test.d.ts +1 -0
  112. package/build/src/lib/providers/Segment/events/auth/changePasswordFail/changePasswordFail.types.d.ts +14 -0
  113. package/build/src/lib/providers/Segment/events/auth/changePasswordSuccess/changePasswordSuccess.d.ts +11 -0
  114. package/build/src/lib/providers/Segment/events/auth/changePasswordSuccess/changePasswordSuccess.test.d.ts +1 -0
  115. package/build/src/lib/providers/Segment/events/auth/changePasswordSuccess/changePasswordSuccess.types.d.ts +14 -0
  116. package/build/src/lib/providers/Segment/events/auth/index.d.ts +10 -0
  117. package/build/src/lib/providers/Segment/events/auth/index.test.d.ts +1 -0
  118. package/build/src/lib/providers/Segment/events/auth/signIn/signIn.d.ts +11 -0
  119. package/build/src/lib/providers/Segment/events/auth/signIn/signIn.test.d.ts +1 -0
  120. package/build/src/lib/providers/Segment/events/auth/signIn/signIn.types.d.ts +18 -0
  121. package/build/src/lib/providers/Segment/events/auth/signOut/signOut.d.ts +11 -0
  122. package/build/src/lib/providers/Segment/events/auth/signOut/signOut.test.d.ts +1 -0
  123. package/build/src/lib/providers/Segment/events/auth/signOut/signOut.types.d.ts +16 -0
  124. package/build/src/lib/providers/Segment/events/auth/signUp/signUp.d.ts +11 -0
  125. package/build/src/lib/providers/Segment/events/auth/signUp/signUp.test.d.ts +1 -0
  126. package/build/src/lib/providers/Segment/events/auth/signUp/signUp.types.d.ts +20 -0
  127. package/build/src/lib/providers/Segment/events/auth/signUpAttempt/signUpAttempt.d.ts +11 -0
  128. package/build/src/lib/providers/Segment/events/auth/signUpAttempt/signUpAttempt.test.d.ts +1 -0
  129. package/build/src/lib/providers/Segment/events/auth/signUpAttempt/signUpAttempt.types.d.ts +14 -0
  130. package/build/src/lib/providers/Segment/events/banner/bannerImpression/bannerImpression.d.ts +11 -0
  131. package/build/src/lib/providers/Segment/events/banner/bannerImpression/bannerImpression.test.d.ts +1 -0
  132. package/build/src/lib/providers/Segment/events/banner/bannerImpression/bannerImpression.types.d.ts +14 -0
  133. package/build/src/lib/providers/Segment/events/banner/index.d.ts +5 -0
  134. package/build/src/lib/providers/Segment/events/banner/index.test.d.ts +1 -0
  135. package/build/src/lib/providers/Segment/events/banner/selectBanner/selectBanner.d.ts +11 -0
  136. package/build/src/lib/providers/Segment/events/banner/selectBanner/selectBanner.test.d.ts +1 -0
  137. package/build/src/lib/providers/Segment/events/banner/selectBanner/selectBanner.types.d.ts +14 -0
  138. package/build/src/lib/providers/Segment/events/billing/addBillingInfo/addBillingInfo.d.ts +11 -0
  139. package/build/src/lib/providers/Segment/events/billing/addBillingInfo/addBillingInfo.test.d.ts +1 -0
  140. package/build/src/lib/providers/Segment/events/billing/addBillingInfo/addBillingInfo.types.d.ts +14 -0
  141. package/build/src/lib/providers/Segment/events/billing/index.d.ts +6 -0
  142. package/build/src/lib/providers/Segment/events/billing/index.test.d.ts +1 -0
  143. package/build/src/lib/providers/Segment/events/billing/selectBillingInfo/selectBillingInfo.d.ts +11 -0
  144. package/build/src/lib/providers/Segment/events/billing/selectBillingInfo/selectBillingInfo.test.d.ts +1 -0
  145. package/build/src/lib/providers/Segment/events/billing/selectBillingInfo/selectBillingInfo.types.d.ts +14 -0
  146. package/build/src/lib/providers/Segment/events/billing/updateBillingInfo/updateBillingInfo.d.ts +11 -0
  147. package/build/src/lib/providers/Segment/events/billing/updateBillingInfo/updateBillingInfo.test.d.ts +1 -0
  148. package/build/src/lib/providers/Segment/events/billing/updateBillingInfo/updateBillingInfo.types.d.ts +14 -0
  149. package/build/src/lib/providers/Segment/events/booking/bookAppointment/bookAppointment.d.ts +11 -0
  150. package/build/src/lib/providers/Segment/events/booking/bookAppointment/bookAppointment.test.d.ts +1 -0
  151. package/build/src/lib/providers/Segment/events/booking/bookAppointment/bookAppointment.types.d.ts +14 -0
  152. package/build/src/lib/providers/Segment/events/booking/index.d.ts +4 -0
  153. package/build/src/lib/providers/Segment/events/booking/index.test.d.ts +1 -0
  154. package/build/src/lib/providers/Segment/events/category/categoryImpression/categoryImpression.d.ts +11 -0
  155. package/build/src/lib/providers/Segment/events/category/categoryImpression/categoryImpression.test.d.ts +1 -0
  156. package/build/src/lib/providers/Segment/events/category/categoryImpression/categoryImpression.types.d.ts +14 -0
  157. package/build/src/lib/providers/Segment/events/category/index.d.ts +7 -0
  158. package/build/src/lib/providers/Segment/events/category/index.test.d.ts +1 -0
  159. package/build/src/lib/providers/Segment/events/category/searchCategoryAttempt/searchCategoryAttempt.d.ts +11 -0
  160. package/build/src/lib/providers/Segment/events/category/searchCategoryAttempt/searchCategoryAttempt.test.d.ts +1 -0
  161. package/build/src/lib/providers/Segment/events/category/searchCategoryAttempt/searchCategoryAttempt.types.d.ts +14 -0
  162. package/build/src/lib/providers/Segment/events/category/selectCategory/selectCategory.d.ts +11 -0
  163. package/build/src/lib/providers/Segment/events/category/selectCategory/selectCategory.test.d.ts +1 -0
  164. package/build/src/lib/providers/Segment/events/category/selectCategory/selectCategory.types.d.ts +14 -0
  165. package/build/src/lib/providers/Segment/events/category/viewCategory/viewCategory.d.ts +11 -0
  166. package/build/src/lib/providers/Segment/events/category/viewCategory/viewCategory.test.d.ts +1 -0
  167. package/build/src/lib/providers/Segment/events/category/viewCategory/viewCategory.types.d.ts +17 -0
  168. package/build/src/lib/providers/Segment/events/checkout/checkoutAction/checkoutAction.d.ts +11 -0
  169. package/build/src/lib/providers/Segment/events/checkout/checkoutAction/checkoutAction.test.d.ts +1 -0
  170. package/build/src/lib/providers/Segment/events/checkout/checkoutAction/checkoutAction.types.d.ts +14 -0
  171. package/build/src/lib/providers/Segment/events/checkout/index.d.ts +5 -0
  172. package/build/src/lib/providers/Segment/events/checkout/index.test.d.ts +1 -0
  173. package/build/src/lib/providers/Segment/events/checkout/initiateCheckout/initiateCheckout.d.ts +11 -0
  174. package/build/src/lib/providers/Segment/events/checkout/initiateCheckout/initiateCheckout.test.d.ts +1 -0
  175. package/build/src/lib/providers/Segment/events/checkout/initiateCheckout/initiateCheckout.types.d.ts +14 -0
  176. package/build/src/lib/providers/Segment/events/coupon/applyBenefit/applyBenefit.d.ts +11 -0
  177. package/build/src/lib/providers/Segment/events/coupon/applyBenefit/applyBenefit.test.d.ts +1 -0
  178. package/build/src/lib/providers/Segment/events/coupon/applyBenefit/applyBenefit.types.d.ts +14 -0
  179. package/build/src/lib/providers/Segment/events/coupon/couponCodeError/couponCodeError.d.ts +11 -0
  180. package/build/src/lib/providers/Segment/events/coupon/couponCodeError/couponCodeError.test.d.ts +1 -0
  181. package/build/src/lib/providers/Segment/events/coupon/couponCodeError/couponCodeError.types.d.ts +14 -0
  182. package/build/src/lib/providers/Segment/events/coupon/index.d.ts +10 -0
  183. package/build/src/lib/providers/Segment/events/coupon/index.test.d.ts +1 -0
  184. package/build/src/lib/providers/Segment/events/coupon/redeemCouponCode/redeemCouponCode.d.ts +11 -0
  185. package/build/src/lib/providers/Segment/events/coupon/redeemCouponCode/redeemCouponCode.test.d.ts +1 -0
  186. package/build/src/lib/providers/Segment/events/coupon/redeemCouponCode/redeemCouponCode.types.d.ts +14 -0
  187. package/build/src/lib/providers/Segment/events/coupon/removeBenefit/removeBenefit.d.ts +11 -0
  188. package/build/src/lib/providers/Segment/events/coupon/removeBenefit/removeBenefit.test.d.ts +1 -0
  189. package/build/src/lib/providers/Segment/events/coupon/removeBenefit/removeBenefit.types.d.ts +14 -0
  190. package/build/src/lib/providers/Segment/events/coupon/viewBenefitDetails/viewBenefitDetails.d.ts +11 -0
  191. package/build/src/lib/providers/Segment/events/coupon/viewBenefitDetails/viewBenefitDetails.test.d.ts +1 -0
  192. package/build/src/lib/providers/Segment/events/coupon/viewBenefitDetails/viewBenefitDetails.types.d.ts +14 -0
  193. package/build/src/lib/providers/Segment/events/coupon/viewBenefitsWallet/viewBenefitsWallet.d.ts +11 -0
  194. package/build/src/lib/providers/Segment/events/coupon/viewBenefitsWallet/viewBenefitsWallet.test.d.ts +1 -0
  195. package/build/src/lib/providers/Segment/events/coupon/viewBenefitsWallet/viewBenefitsWallet.types.d.ts +14 -0
  196. package/build/src/lib/providers/Segment/events/coupon/viewQRStoreCoupon/viewQRStoreCoupon.d.ts +11 -0
  197. package/build/src/lib/providers/Segment/events/coupon/viewQRStoreCoupon/viewQRStoreCoupon.test.d.ts +1 -0
  198. package/build/src/lib/providers/Segment/events/coupon/viewQRStoreCoupon/viewQRStoreCoupon.types.d.ts +14 -0
  199. package/build/src/lib/providers/Segment/events/credit/addCredits/addCredits.d.ts +11 -0
  200. package/build/src/lib/providers/Segment/events/credit/addCredits/addCredits.test.d.ts +1 -0
  201. package/build/src/lib/providers/Segment/events/credit/addCredits/addCredits.types.d.ts +14 -0
  202. package/build/src/lib/providers/Segment/events/credit/index.d.ts +6 -0
  203. package/build/src/lib/providers/Segment/events/credit/index.test.d.ts +1 -0
  204. package/build/src/lib/providers/Segment/events/credit/spendCredits/spendCredits.d.ts +11 -0
  205. package/build/src/lib/providers/Segment/events/credit/spendCredits/spendCredits.test.d.ts +1 -0
  206. package/build/src/lib/providers/Segment/events/credit/spendCredits/spendCredits.types.d.ts +14 -0
  207. package/build/src/lib/providers/Segment/events/credit/viewCredits/viewCredits.d.ts +11 -0
  208. package/build/src/lib/providers/Segment/events/credit/viewCredits/viewCredits.test.d.ts +1 -0
  209. package/build/src/lib/providers/Segment/events/credit/viewCredits/viewCredits.types.d.ts +14 -0
  210. package/build/src/lib/providers/Segment/events/customEvent/customEvent.d.ts +11 -0
  211. package/build/src/lib/providers/Segment/events/customEvent/customEvent.test.d.ts +1 -0
  212. package/build/src/lib/providers/Segment/events/customEvent/customEvent.types.d.ts +14 -0
  213. package/build/src/lib/providers/Segment/events/events.d.ts +26 -0
  214. package/build/src/lib/providers/Segment/events/events.test.d.ts +1 -0
  215. package/build/src/lib/providers/Segment/events/fulfillment/index.d.ts +5 -0
  216. package/build/src/lib/providers/Segment/events/fulfillment/index.test.d.ts +1 -0
  217. package/build/src/lib/providers/Segment/events/fulfillment/viewFulfillmentStep/viewFulfillmentStep.d.ts +11 -0
  218. package/build/src/lib/providers/Segment/events/fulfillment/viewFulfillmentStep/viewFulfillmentStep.test.d.ts +1 -0
  219. package/build/src/lib/providers/Segment/events/fulfillment/viewFulfillmentStep/viewFulfillmentStep.types.d.ts +14 -0
  220. package/build/src/lib/providers/Segment/events/fulfillment/viewTracking/viewTracking.d.ts +11 -0
  221. package/build/src/lib/providers/Segment/events/fulfillment/viewTracking/viewTracking.test.d.ts +1 -0
  222. package/build/src/lib/providers/Segment/events/fulfillment/viewTracking/viewTracking.types.d.ts +14 -0
  223. package/build/src/lib/providers/Segment/events/geo/changeLocation/changeLocation.d.ts +11 -0
  224. package/build/src/lib/providers/Segment/events/geo/changeLocation/changeLocation.test.d.ts +1 -0
  225. package/build/src/lib/providers/Segment/events/geo/changeLocation/changeLocation.types.d.ts +14 -0
  226. package/build/src/lib/providers/Segment/events/geo/findLocation/findLocation.d.ts +11 -0
  227. package/build/src/lib/providers/Segment/events/geo/findLocation/findLocation.test.d.ts +1 -0
  228. package/build/src/lib/providers/Segment/events/geo/findLocation/findLocation.types.d.ts +14 -0
  229. package/build/src/lib/providers/Segment/events/geo/index.d.ts +7 -0
  230. package/build/src/lib/providers/Segment/events/geo/index.test.d.ts +1 -0
  231. package/build/src/lib/providers/Segment/events/geo/outOfCoverage/outOfCoverage.d.ts +11 -0
  232. package/build/src/lib/providers/Segment/events/geo/outOfCoverage/outOfCoverage.test.d.ts +1 -0
  233. package/build/src/lib/providers/Segment/events/geo/outOfCoverage/outOfCoverage.types.d.ts +14 -0
  234. package/build/src/lib/providers/Segment/events/geo/setLocation/setLocation.d.ts +11 -0
  235. package/build/src/lib/providers/Segment/events/geo/setLocation/setLocation.test.d.ts +1 -0
  236. package/build/src/lib/providers/Segment/events/geo/setLocation/setLocation.types.d.ts +14 -0
  237. package/build/src/lib/providers/Segment/events/help/index.d.ts +4 -0
  238. package/build/src/lib/providers/Segment/events/help/index.test.d.ts +1 -0
  239. package/build/src/lib/providers/Segment/events/help/requestAssistance/requestAssistance.d.ts +11 -0
  240. package/build/src/lib/providers/Segment/events/help/requestAssistance/requestAssistance.test.d.ts +1 -0
  241. package/build/src/lib/providers/Segment/events/help/requestAssistance/requestAssistance.types.d.ts +14 -0
  242. package/build/src/lib/providers/Segment/events/loyalty/earnPoints/earnPoints.d.ts +11 -0
  243. package/build/src/lib/providers/Segment/events/loyalty/earnPoints/earnPoints.test.d.ts +1 -0
  244. package/build/src/lib/providers/Segment/events/loyalty/earnPoints/earnPoints.types.d.ts +14 -0
  245. package/build/src/lib/providers/Segment/events/loyalty/index.d.ts +7 -0
  246. package/build/src/lib/providers/Segment/events/loyalty/index.test.d.ts +1 -0
  247. package/build/src/lib/providers/Segment/events/loyalty/sharePoints/sharePoints.d.ts +11 -0
  248. package/build/src/lib/providers/Segment/events/loyalty/sharePoints/sharePoints.test.d.ts +1 -0
  249. package/build/src/lib/providers/Segment/events/loyalty/sharePoints/sharePoints.types.d.ts +14 -0
  250. package/build/src/lib/providers/Segment/events/loyalty/spendPoints/spendPoints.d.ts +11 -0
  251. package/build/src/lib/providers/Segment/events/loyalty/spendPoints/spendPoints.test.d.ts +1 -0
  252. package/build/src/lib/providers/Segment/events/loyalty/spendPoints/spendPoints.types.d.ts +14 -0
  253. package/build/src/lib/providers/Segment/events/loyalty/viewLoyaltyLevel/viewLoyaltyLevel.d.ts +11 -0
  254. package/build/src/lib/providers/Segment/events/loyalty/viewLoyaltyLevel/viewLoyaltyLevel.test.d.ts +1 -0
  255. package/build/src/lib/providers/Segment/events/loyalty/viewLoyaltyLevel/viewLoyaltyLevel.types.d.ts +14 -0
  256. package/build/src/lib/providers/Segment/events/order/cancelOrder/cancelOrder.d.ts +11 -0
  257. package/build/src/lib/providers/Segment/events/order/cancelOrder/cancelOrder.test.d.ts +1 -0
  258. package/build/src/lib/providers/Segment/events/order/cancelOrder/cancelOrder.types.d.ts +19 -0
  259. package/build/src/lib/providers/Segment/events/order/index.d.ts +6 -0
  260. package/build/src/lib/providers/Segment/events/order/index.test.d.ts +1 -0
  261. package/build/src/lib/providers/Segment/events/order/rateOrder/rateOrder.d.ts +11 -0
  262. package/build/src/lib/providers/Segment/events/order/rateOrder/rateOrder.test.d.ts +1 -0
  263. package/build/src/lib/providers/Segment/events/order/rateOrder/rateOrder.types.d.ts +14 -0
  264. package/build/src/lib/providers/Segment/events/order/requestRefund/requestRefund.d.ts +11 -0
  265. package/build/src/lib/providers/Segment/events/order/requestRefund/requestRefund.test.d.ts +1 -0
  266. package/build/src/lib/providers/Segment/events/order/requestRefund/requestRefund.types.d.ts +17 -0
  267. package/build/src/lib/providers/Segment/events/other/generateLead/generateLead.d.ts +11 -0
  268. package/build/src/lib/providers/Segment/events/other/generateLead/generateLead.test.d.ts +1 -0
  269. package/build/src/lib/providers/Segment/events/other/generateLead/generateLead.types.d.ts +14 -0
  270. package/build/src/lib/providers/Segment/events/other/index.d.ts +6 -0
  271. package/build/src/lib/providers/Segment/events/other/index.test.d.ts +1 -0
  272. package/build/src/lib/providers/Segment/events/other/pageView/pageView.d.ts +11 -0
  273. package/build/src/lib/providers/Segment/events/other/pageView/pageView.test.d.ts +1 -0
  274. package/build/src/lib/providers/Segment/events/other/pageView/pageView.types.d.ts +14 -0
  275. package/build/src/lib/providers/Segment/events/other/searchPageContent/searchPageContent.d.ts +11 -0
  276. package/build/src/lib/providers/Segment/events/other/searchPageContent/searchPageContent.test.d.ts +1 -0
  277. package/build/src/lib/providers/Segment/events/other/searchPageContent/searchPageContent.types.d.ts +14 -0
  278. package/build/src/lib/providers/Segment/events/payment/changePaymentType/changePaymentType.d.ts +11 -0
  279. package/build/src/lib/providers/Segment/events/payment/changePaymentType/changePaymentType.test.d.ts +1 -0
  280. package/build/src/lib/providers/Segment/events/payment/changePaymentType/changePaymentType.types.d.ts +14 -0
  281. package/build/src/lib/providers/Segment/events/payment/index.d.ts +6 -0
  282. package/build/src/lib/providers/Segment/events/payment/index.test.d.ts +1 -0
  283. package/build/src/lib/providers/Segment/events/payment/selectPaymentType/selectPaymentType.d.ts +11 -0
  284. package/build/src/lib/providers/Segment/events/payment/selectPaymentType/selectPaymentType.test.d.ts +1 -0
  285. package/build/src/lib/providers/Segment/events/payment/selectPaymentType/selectPaymentType.types.d.ts +14 -0
  286. package/build/src/lib/providers/Segment/events/payment/setPaymentInfo/setPaymentInfo.d.ts +11 -0
  287. package/build/src/lib/providers/Segment/events/payment/setPaymentInfo/setPaymentInfo.test.d.ts +1 -0
  288. package/build/src/lib/providers/Segment/events/payment/setPaymentInfo/setPaymentInfo.types.d.ts +14 -0
  289. package/build/src/lib/providers/Segment/events/product/customizeProduct/customizeProduct.d.ts +11 -0
  290. package/build/src/lib/providers/Segment/events/product/customizeProduct/customizeProduct.test.d.ts +1 -0
  291. package/build/src/lib/providers/Segment/events/product/customizeProduct/customizeProduct.types.d.ts +13 -0
  292. package/build/src/lib/providers/Segment/events/product/filterProducts/filterProducts.d.ts +11 -0
  293. package/build/src/lib/providers/Segment/events/product/filterProducts/filterProducts.test.d.ts +1 -0
  294. package/build/src/lib/providers/Segment/events/product/filterProducts/filterProducts.types.d.ts +14 -0
  295. package/build/src/lib/providers/Segment/events/product/index.d.ts +12 -0
  296. package/build/src/lib/providers/Segment/events/product/index.test.d.ts +1 -0
  297. package/build/src/lib/providers/Segment/events/product/productImpression/productImpression.d.ts +11 -0
  298. package/build/src/lib/providers/Segment/events/product/productImpression/productImpression.test.d.ts +1 -0
  299. package/build/src/lib/providers/Segment/events/product/productImpression/productImpression.types.d.ts +13 -0
  300. package/build/src/lib/providers/Segment/events/product/searchProductAttempt/searchProductAttempt.d.ts +11 -0
  301. package/build/src/lib/providers/Segment/events/product/searchProductAttempt/searchProductAttempt.test.d.ts +1 -0
  302. package/build/src/lib/providers/Segment/events/product/searchProductAttempt/searchProductAttempt.types.d.ts +14 -0
  303. package/build/src/lib/providers/Segment/events/product/searchProductNotFound/searchProductNotFound.d.ts +11 -0
  304. package/build/src/lib/providers/Segment/events/product/searchProductNotFound/searchProductNotFound.test.d.ts +1 -0
  305. package/build/src/lib/providers/Segment/events/product/searchProductNotFound/searchProductNotFound.types.d.ts +14 -0
  306. package/build/src/lib/providers/Segment/events/product/searchProductSuccess/searchProductSuccess.d.ts +11 -0
  307. package/build/src/lib/providers/Segment/events/product/searchProductSuccess/searchProductSuccess.test.d.ts +1 -0
  308. package/build/src/lib/providers/Segment/events/product/searchProductSuccess/searchProductSuccess.types.d.ts +14 -0
  309. package/build/src/lib/providers/Segment/events/product/selectProduct/selectProduct.d.ts +11 -0
  310. package/build/src/lib/providers/Segment/events/product/selectProduct/selectProduct.test.d.ts +1 -0
  311. package/build/src/lib/providers/Segment/events/product/selectProduct/selectProduct.types.d.ts +13 -0
  312. package/build/src/lib/providers/Segment/events/product/sortProducts/sortProducts.d.ts +11 -0
  313. package/build/src/lib/providers/Segment/events/product/sortProducts/sortProducts.test.d.ts +1 -0
  314. package/build/src/lib/providers/Segment/events/product/sortProducts/sortProducts.types.d.ts +14 -0
  315. package/build/src/lib/providers/Segment/events/product/viewProductDetails/viewProductDetails.d.ts +11 -0
  316. package/build/src/lib/providers/Segment/events/product/viewProductDetails/viewProductDetails.test.d.ts +1 -0
  317. package/build/src/lib/providers/Segment/events/product/viewProductDetails/viewProductDetails.types.d.ts +13 -0
  318. package/build/src/lib/providers/Segment/events/purchase/index.d.ts +6 -0
  319. package/build/src/lib/providers/Segment/events/purchase/index.test.d.ts +1 -0
  320. package/build/src/lib/providers/Segment/events/purchase/purchaseAttempt/purchaseAttempt.d.ts +11 -0
  321. package/build/src/lib/providers/Segment/events/purchase/purchaseAttempt/purchaseAttempt.test.d.ts +1 -0
  322. package/build/src/lib/providers/Segment/events/purchase/purchaseAttempt/purchaseAttempt.types.d.ts +14 -0
  323. package/build/src/lib/providers/Segment/events/purchase/purchaseFail/purchaseFail.d.ts +11 -0
  324. package/build/src/lib/providers/Segment/events/purchase/purchaseFail/purchaseFail.test.d.ts +1 -0
  325. package/build/src/lib/providers/Segment/events/purchase/purchaseFail/purchaseFail.types.d.ts +14 -0
  326. package/build/src/lib/providers/Segment/events/purchase/purchaseSuccess/purchaseSuccess.d.ts +11 -0
  327. package/build/src/lib/providers/Segment/events/purchase/purchaseSuccess/purchaseSuccess.test.d.ts +1 -0
  328. package/build/src/lib/providers/Segment/events/purchase/purchaseSuccess/purchaseSuccess.types.d.ts +14 -0
  329. package/build/src/lib/providers/Segment/events/settings/index.d.ts +4 -0
  330. package/build/src/lib/providers/Segment/events/settings/index.test.d.ts +1 -0
  331. package/build/src/lib/providers/Segment/events/settings/viewSettings/viewSettings.d.ts +11 -0
  332. package/build/src/lib/providers/Segment/events/settings/viewSettings/viewSettings.test.d.ts +1 -0
  333. package/build/src/lib/providers/Segment/events/settings/viewSettings/viewSettings.types.d.ts +14 -0
  334. package/build/src/lib/providers/Segment/events/shipping/addShippingAddress/addShippingAddress.d.ts +11 -0
  335. package/build/src/lib/providers/Segment/events/shipping/addShippingAddress/addShippingAddress.test.d.ts +1 -0
  336. package/build/src/lib/providers/Segment/events/shipping/addShippingAddress/addShippingAddress.types.d.ts +16 -0
  337. package/build/src/lib/providers/Segment/events/shipping/index.d.ts +6 -0
  338. package/build/src/lib/providers/Segment/events/shipping/index.test.d.ts +1 -0
  339. package/build/src/lib/providers/Segment/events/shipping/selectShippingAddress/selectShippingAddress.d.ts +11 -0
  340. package/build/src/lib/providers/Segment/events/shipping/selectShippingAddress/selectShippingAddress.test.d.ts +1 -0
  341. package/build/src/lib/providers/Segment/events/shipping/selectShippingAddress/selectShippingAddress.types.d.ts +16 -0
  342. package/build/src/lib/providers/Segment/events/shipping/updateShippingAddress/updateShippingAddress.d.ts +11 -0
  343. package/build/src/lib/providers/Segment/events/shipping/updateShippingAddress/updateShippingAddress.test.d.ts +1 -0
  344. package/build/src/lib/providers/Segment/events/shipping/updateShippingAddress/updateShippingAddress.types.d.ts +16 -0
  345. package/build/src/lib/providers/Segment/events/shoppingCart/addProductToCart/addProductToCart.d.ts +11 -0
  346. package/build/src/lib/providers/Segment/events/shoppingCart/addProductToCart/addProductToCart.test.d.ts +1 -0
  347. package/build/src/lib/providers/Segment/events/shoppingCart/addProductToCart/addProductToCart.types.d.ts +14 -0
  348. package/build/src/lib/providers/Segment/events/shoppingCart/addProductToWishlist/addProductToWishlist.d.ts +11 -0
  349. package/build/src/lib/providers/Segment/events/shoppingCart/addProductToWishlist/addProductToWishlist.test.d.ts +1 -0
  350. package/build/src/lib/providers/Segment/events/shoppingCart/addProductToWishlist/addProductToWishlist.types.d.ts +14 -0
  351. package/build/src/lib/providers/Segment/events/shoppingCart/clearCart/clearCart.d.ts +11 -0
  352. package/build/src/lib/providers/Segment/events/shoppingCart/clearCart/clearCart.test.d.ts +1 -0
  353. package/build/src/lib/providers/Segment/events/shoppingCart/clearCart/clearCart.types.d.ts +14 -0
  354. package/build/src/lib/providers/Segment/events/shoppingCart/index.d.ts +11 -0
  355. package/build/src/lib/providers/Segment/events/shoppingCart/index.test.d.ts +1 -0
  356. package/build/src/lib/providers/Segment/events/shoppingCart/removeProductFromCart/removeProductFromCart.d.ts +11 -0
  357. package/build/src/lib/providers/Segment/events/shoppingCart/removeProductFromCart/removeProductFromCart.test.d.ts +1 -0
  358. package/build/src/lib/providers/Segment/events/shoppingCart/removeProductFromCart/removeProductFromCart.types.d.ts +14 -0
  359. package/build/src/lib/providers/Segment/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.d.ts +11 -0
  360. package/build/src/lib/providers/Segment/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.test.d.ts +1 -0
  361. package/build/src/lib/providers/Segment/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.types.d.ts +14 -0
  362. package/build/src/lib/providers/Segment/events/shoppingCart/updateProductInCart/updateProductInCart.d.ts +11 -0
  363. package/build/src/lib/providers/Segment/events/shoppingCart/updateProductInCart/updateProductInCart.test.d.ts +1 -0
  364. package/build/src/lib/providers/Segment/events/shoppingCart/updateProductInCart/updateProductInCart.types.d.ts +14 -0
  365. package/build/src/lib/providers/Segment/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.d.ts +11 -0
  366. package/build/src/lib/providers/Segment/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.test.d.ts +1 -0
  367. package/build/src/lib/providers/Segment/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.types.d.ts +14 -0
  368. package/build/src/lib/providers/Segment/events/shoppingCart/viewCart/viewCart.d.ts +11 -0
  369. package/build/src/lib/providers/Segment/events/shoppingCart/viewCart/viewCart.test.d.ts +1 -0
  370. package/build/src/lib/providers/Segment/events/shoppingCart/viewCart/viewCart.types.d.ts +17 -0
  371. package/build/src/lib/providers/Segment/events/social/index.d.ts +4 -0
  372. package/build/src/lib/providers/Segment/events/social/index.test.d.ts +1 -0
  373. package/build/src/lib/providers/Segment/events/social/share/share.d.ts +11 -0
  374. package/build/src/lib/providers/Segment/events/social/share/share.test.d.ts +1 -0
  375. package/build/src/lib/providers/Segment/events/social/share/share.types.d.ts +14 -0
  376. package/build/src/lib/providers/Segment/events/store/changeStore/changeStore.d.ts +11 -0
  377. package/build/src/lib/providers/Segment/events/store/changeStore/changeStore.test.d.ts +1 -0
  378. package/build/src/lib/providers/Segment/events/store/changeStore/changeStore.types.d.ts +14 -0
  379. package/build/src/lib/providers/Segment/events/store/index.d.ts +5 -0
  380. package/build/src/lib/providers/Segment/events/store/index.test.d.ts +1 -0
  381. package/build/src/lib/providers/Segment/events/store/setStore/setStore.d.ts +11 -0
  382. package/build/src/lib/providers/Segment/events/store/setStore/setStore.test.d.ts +1 -0
  383. package/build/src/lib/providers/Segment/events/store/setStore/setStore.types.d.ts +14 -0
  384. package/build/src/lib/providers/Segment/events/user/index.d.ts +5 -0
  385. package/build/src/lib/providers/Segment/events/user/index.test.d.ts +1 -0
  386. package/build/src/lib/providers/Segment/events/user/setUserInfo/setUserInfo.d.ts +11 -0
  387. package/build/src/lib/providers/Segment/events/user/setUserInfo/setUserInfo.test.d.ts +1 -0
  388. package/build/src/lib/providers/Segment/events/user/setUserInfo/setUserInfo.types.d.ts +16 -0
  389. package/build/src/lib/providers/Segment/events/user/updateUserInfo/updateUserInfo.d.ts +11 -0
  390. package/build/src/lib/providers/Segment/events/user/updateUserInfo/updateUserInfo.test.d.ts +1 -0
  391. package/build/src/lib/providers/Segment/events/user/updateUserInfo/updateUserInfo.types.d.ts +16 -0
  392. package/build/src/lib/providers/Segment/events/vendor/changeVendor/changeVendor.d.ts +11 -0
  393. package/build/src/lib/providers/Segment/events/vendor/changeVendor/changeVendor.test.d.ts +1 -0
  394. package/build/src/lib/providers/Segment/events/vendor/changeVendor/changeVendor.types.d.ts +14 -0
  395. package/build/src/lib/providers/Segment/events/vendor/index.d.ts +5 -0
  396. package/build/src/lib/providers/Segment/events/vendor/index.test.d.ts +1 -0
  397. package/build/src/lib/providers/Segment/events/vendor/setVendor/setVendor.d.ts +11 -0
  398. package/build/src/lib/providers/Segment/events/vendor/setVendor/setVendor.test.d.ts +1 -0
  399. package/build/src/lib/providers/Segment/events/vendor/setVendor/setVendor.types.d.ts +14 -0
  400. package/build/src/lib/providers/Segment/events/workflow/index.d.ts +5 -0
  401. package/build/src/lib/providers/Segment/events/workflow/index.test.d.ts +1 -0
  402. package/build/src/lib/providers/Segment/events/workflow/selectWorkflow/selectWorkflow.d.ts +11 -0
  403. package/build/src/lib/providers/Segment/events/workflow/selectWorkflow/selectWorkflow.test.d.ts +1 -0
  404. package/build/src/lib/providers/Segment/events/workflow/selectWorkflow/selectWorkflow.types.d.ts +14 -0
  405. package/build/src/lib/providers/Segment/events/workflow/updateWorkflow/updateWorkflow.d.ts +11 -0
  406. package/build/src/lib/providers/Segment/events/workflow/updateWorkflow/updateWorkflow.test.d.ts +1 -0
  407. package/build/src/lib/providers/Segment/events/workflow/updateWorkflow/updateWorkflow.types.d.ts +14 -0
  408. package/build/src/lib/providers/providers.d.ts +2 -0
  409. package/build/src/types/common.types.d.ts +4 -4
  410. package/build/src/types/event.types.d.ts +2 -1
  411. package/build/src/utils/events.utils.d.ts +25 -0
  412. package/build/src/utils/segment.utils.d.ts +8 -0
  413. package/build/src/utils/state.utils.d.ts +8 -0
  414. package/package.json +6 -6
@@ -1,46 +1,46 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("analytics",[],e):"object"==typeof exports?exports.analytics=e():t.analytics=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){o=n(n({},o),t)},u=function(){return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){o=n(n({},o),t)},u=function(){return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(8),o=r(1).utf8,i=r(1).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(3).Buffer)},function(t,e,r){"use strict";(function(t){
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("analytics",[],e):"object"==typeof exports?exports.analytics=e():t.analytics=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return a})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return i}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,a=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},i=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return a})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return i}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,a=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},i=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,a,i;n=r(8),o=r(1).utf8,a=r(1).bin,(i=function(t,r){var i=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),a=8*t.length,i=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[a>>5]|=128<<24-a%32,r[15+(a+64>>>9<<4)]=a;for(var p=0;p<r.length;p+=16){for(var y=u,d=c,h=l,g=s,b=f,v=0;v<80;v++){if(v<16)i[v]=r[p+v];else{var O=i[v-3]^i[v-8]^i[v-14]^i[v-16];i[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(i[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=y,c+=d,l+=h,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?i:r&&r.asString?a.bytesToString(i):n.bytesToHex(i)})._blocksize=16,i._digestsize=20,t.exports=i}).call(this,r(3).Buffer)},function(t,e,r){"use strict";(function(t){
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
5
5
  * @author Feross Aboukhadijeh <http://feross.org>
6
6
  * @license MIT
7
7
  */
8
- var n=r(5),o=r(6),i=r(7);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(4))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
8
+ var n=r(5),o=r(6),a=r(7);function i(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|y(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&a(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|y(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|y(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function y(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return _(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var a,i=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,u/=2,c/=2,r/=2}function l(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var s=-1;for(a=r;a<u;a++)if(l(t,a)===l(e,-1===s?0:a-s)){if(-1===s&&(s=a),a-s+1===c)return s*i}else-1!==s&&(a-=a-s),s=-1}else for(r+c>u&&(r=u-c),a=r;a>=0;a--){for(var f=!0,p=0;p<c;p++)if(l(t,a+p)!==l(e,p)){f=!1;break}if(f)return a}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(isNaN(u))return i;t[r+i]=u}return i}function m(t,e,r,n){return q(Y(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function j(t,e,r,n){return w(t,e,r,n)}function P(t,e,r,n){return q(N(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,a=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var a,i,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(a=t[o+1]))&&(c=(31&l)<<6|63&a)>127&&(s=c);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(c=(15&l)<<12|(63&a)<<6|63&i)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(c=(15&l)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function E(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=e;a<r;++a)o+=D(t[a]);return o}function A(t,e,r){for(var n=t.slice(e,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,a){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,a=Math.min(t.length-r,2);o<a;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,a=Math.min(t.length-r,4);o<a;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,a){return a||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,a){return a||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=i(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):h.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(e>>>=0),u=Math.min(a,i),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){a=l[f],i=s[f];break}return a<i?-1:i<a?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return j(this,t,e,r);case"base64":return P(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a<r&&(i*=256);)t<0&&0===u&&0!==this[e+a-1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,a=n-r;if(this===t&&r<e&&e<n)for(o=a-1;o>=0;--o)t[o+e]=this[o+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var i=c.isBuffer(t)?t:Y(new c(t,n).toString()),u=i.length;for(a=0;a<r-e;++a)this[a+e]=i[a%u]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){var r;e=e||1/0;for(var n=t.length,o=null,a=[],i=0;i<n;++i){if((r=t.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(4))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),i=n[0],u=n[1],c=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,u)),s=0,f=u>0?i-4:i;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,a=[],i=0,u=r-o;i<u;i+=16383)a.push(s(t,i,i+16383>u?u:i+16383));return 1===o?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),a.join("")};for(var n=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=i.length;u<c;++u)n[u]=i[u],o[i.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,a,i=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(n[(a=o)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
9
9
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"handleHttpCache",(function(){return f})),r.d(e,"transformResponse",(function(){return c}));var n=r(0),o=r(2),i=r.n(o),a=["vendorId","storeId","catalogueId","categoryId","productId"],u=["accountId"],c=function(t,e,r){var n,o=null==e?void 0:e.message;try{o=e?JSON.parse(e.message):e}catch(t){}return{data:null!==(n=null==t?void 0:t.data)&&void 0!==n?n:t,hints:l(r),config:r,error:o,pagination:{hasMorePages:null==t?void 0:t.hasMorePages,page:null==t?void 0:t.page}}},l=function(t){var e={};return Object.entries(t.query).forEach((function(t){var r=t,n=r[0],o=r[1];a.includes(n)&&(e[n]=o)})),Object.entries(t.headers).forEach((function(t){var r=t,n=r[0],o=r[1];u.includes(n)&&(e[n]=o)})),e},s=function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},f=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var r,o,a,u,l,f;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(p){switch(p.label){case 0:if(h=t.url,r=i()(h),o=function(t){return Object(n.getState)().apiCache[t]}(r),d=Object(n.getState)().expiresAt,(a=(new Date).getTime()>=d)&&function(){var t=Object(n.getState)().timeout,e=void 0===t?0:t;Object(n.setState)({apiCache:{},expiresAt:(new Date).getTime()+e})}(),o&&!a)return[3,4];p.label=1;case 1:return p.trys.push([1,3,,4]),[4,e(t)];case 2:return u=p.sent(),f=c(u,void 0,t),function(t,e){var r,o=Object(n.getState)().apiCache,i=s(s({},o),((r={})[t]=e,r));Object(n.setState)({apiCache:i})}(r,f),[2,f];case 3:return l=p.sent(),[2,f=c(void 0,l,t)];case 4:return[2,o]}var d,h}))}))},p=3e5,d={artisanApp:void 0,apiCache:{},expiresAt:(new Date).getTime()+p,timeout:p};Object(n.initState)(d)}])},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(6),e),o(r(7),e),o(r(8),e),o(r(9),e),o(r(10),e),o(r(11),e),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e)},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(30),o=r(3).utf8,i=r(3).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(25).Buffer)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";(function(t){
10
+ e.read=function(t,e,r,n,o){var a,i,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,y=t[e+f];for(f+=p,a=y&(1<<-s)-1,y>>=-s,s+=u;s>0;a=256*a+t[e+f],f+=p,s-=8);for(i=a&(1<<-s)-1,a>>=-s,s+=n;s>0;i=256*i+t[e+f],f+=p,s-=8);if(0===a)a=1-l;else{if(a===c)return i?NaN:1/0*(y?-1:1);i+=Math.pow(2,n),a-=l}return(y?-1:1)*i*Math.pow(2,a-n)},e.write=function(t,e,r,n,o,a){var i,u,c,l=8*a-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,d=n?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,i=s):(i=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-i))<1&&(i--,c*=2),(e+=i+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=s?(u=0,i=s):i+f>=1?(u=(e*c-1)*Math.pow(2,o),i+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;t[r+y]=255&u,y+=d,u/=256,o-=8);for(i=i<<o|u,l+=o;l>0;t[r+y]=255&i,y+=d,i/=256,l-=8);t[r+y-d]|=128*h}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)8*n+6*a<=8*t.length?e.push(r.charAt(o>>>6*(3-a)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"flushCache",(function(){return a})),r.d(e,"handleHttpCache",(function(){return p})),r.d(e,"initCache",(function(){return g})),r.d(e,"transformResponse",(function(){return s}));var n=r(0),o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=function(){var t=Object(n.getState)().timeout,e=void 0===t?0:t;Object(n.setState)({apiCache:{},expiresAt:(new Date).getTime()+e})},i=r(2),u=r.n(i),c=["vendorId","storeId","catalogueId","categoryId","productId"],l=["accountId"],s=function(t,e,r){var n,o=null==e?void 0:e.message;try{o=e?JSON.parse(e.message):e}catch(t){}return{data:null!==(n=null==t?void 0:t.data)&&void 0!==n?n:t,hints:f(r),config:r,error:o,pagination:{hasMorePages:null==t?void 0:t.hasMorePages,page:null==t?void 0:t.page}}},f=function(t){var e={};return Object.entries(t.query).forEach((function(t){var r=t,n=r[0],o=r[1];c.includes(n)&&(e[n]=o)})),Object.entries(t.headers).forEach((function(t){var r=t,n=r[0],o=r[1];l.includes(n)&&(e[n]=o)})),e},p=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{i(n.next(t))}catch(t){e(t)}}function a(t){try{i(n.throw(t))}catch(t){e(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,a)}i((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var r,i,c,l,f,p;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(y){switch(y.label){case 0:if(h=t.url,r=u()(h),i=function(t){return Object(n.getState)().apiCache[t]}(r),d=Object(n.getState)().expiresAt,(c=(new Date).getTime()>=d)&&a(),i&&!c)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,e(t)];case 2:return l=y.sent(),p=s(l,void 0,t),function(t,e){var r,a=Object(n.getState)().apiCache,i=o(o({},a),((r={})[t]=e,r));Object(n.setState)({apiCache:i})}(r,p),[2,p];case 3:return f=y.sent(),[2,p=s(void 0,f,t)];case 4:return[2,i]}var d,h}))}))},y=3e5,d={apiCache:{},expiresAt:(new Date).getTime()+y,timeout:y},h=function(){return(h=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},g=function(t){Object(n.initState)(d);var e=t.timeout;if(void 0!==e){var r=Object(n.getState)();Object(n.setState)(h(h({},r),{expiresAt:(new Date).getTime()+e,timeout:e}))}}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,a,i;n=r(10),o=r(2).utf8,a=r(2).bin,(i=function(t,r){var i=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),a=8*t.length,i=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[a>>5]|=128<<24-a%32,r[15+(a+64>>>9<<4)]=a;for(var p=0;p<r.length;p+=16){for(var y=u,d=c,h=l,g=s,b=f,v=0;v<80;v++){if(v<16)i[v]=r[p+v];else{var O=i[v-3]^i[v-8]^i[v-14]^i[v-16];i[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(i[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=y,c+=d,l+=h,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?i:r&&r.asString?a.bytesToString(i):n.bytesToHex(i)})._blocksize=16,i._digestsize=20,t.exports=i}).call(this,r(5).Buffer)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";(function(t){
11
11
  /*!
12
12
  * The buffer module from node.js, for the browser.
13
13
  *
14
14
  * @author Feross Aboukhadijeh <http://feross.org>
15
15
  * @license MIT
16
16
  */
17
- var n=r(27),o=r(28),i=r(29);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(26))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
17
+ var n=r(7),o=r(8),a=r(9);function i(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|y(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&a(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|y(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|y(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function y(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return _(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var a,i=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,u/=2,c/=2,r/=2}function l(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var s=-1;for(a=r;a<u;a++)if(l(t,a)===l(e,-1===s?0:a-s)){if(-1===s&&(s=a),a-s+1===c)return s*i}else-1!==s&&(a-=a-s),s=-1}else for(r+c>u&&(r=u-c),a=r;a>=0;a--){for(var f=!0,p=0;p<c;p++)if(l(t,a+p)!==l(e,p)){f=!1;break}if(f)return a}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(isNaN(u))return i;t[r+i]=u}return i}function m(t,e,r,n){return q(Y(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function j(t,e,r,n){return w(t,e,r,n)}function P(t,e,r,n){return q(N(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,a=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var a,i,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(a=t[o+1]))&&(c=(31&l)<<6|63&a)>127&&(s=c);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(c=(15&l)<<12|(63&a)<<6|63&i)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(c=(15&l)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function E(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=e;a<r;++a)o+=D(t[a]);return o}function A(t,e,r){for(var n=t.slice(e,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,a){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,a=Math.min(t.length-r,2);o<a;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,a=Math.min(t.length-r,4);o<a;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,a){return a||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,a){return a||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=i(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):h.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(e>>>=0),u=Math.min(a,i),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){a=l[f],i=s[f];break}return a<i?-1:i<a?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return j(this,t,e,r);case"base64":return P(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a<r&&(i*=256);)t<0&&0===u&&0!==this[e+a-1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,a=n-r;if(this===t&&r<e&&e<n)for(o=a-1;o>=0;--o)t[o+e]=this[o+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var i=c.isBuffer(t)?t:Y(new c(t,n).toString()),u=i.length;for(a=0;a<r-e;++a)this[a+e]=i[a%u]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){var r;e=e||1/0;for(var n=t.length,o=null,a=[],i=0;i<n;++i){if((r=t.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(6))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),i=n[0],u=n[1],c=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,u)),s=0,f=u>0?i-4:i;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,a=[],i=0,u=r-o;i<u;i+=16383)a.push(s(t,i,i+16383>u?u:i+16383));return 1===o?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),a.join("")};for(var n=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=i.length;u<c;++u)n[u]=i[u],o[i.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,a,i=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(n[(a=o)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
18
18
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
19
- e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return q})),r.d(e,"getProductDetails",(function(){return St})),r.d(e,"getProducts",(function(){return kt})),r.d(e,"getRecommendedProducts",(function(){return xt})),r.d(e,"getRelatedProducts",(function(){return Tt})),r.d(e,"getStoreDetails",(function(){return Ut})),r.d(e,"registerModifiersForm",(function(){return ne})),r.d(e,"validateProduct",(function(){return ue})),r.d(e,"initProducts",(function(){return pe})),r.d(e,"getProductTotals",(function(){return de})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return c})),r.d(n,"isProductDetails",(function(){return l})),r.d(n,"isCartProduct",(function(){return s})),r.d(n,"isFormCartProduct",(function(){return f}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return w})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return I})),r.d(i,"toFormCartProduct",(function(){return _})),r.d(i,"toFormCartProductHelper",(function(){return E})),r.d(i,"toFormCartProductFromProductDetails",(function(){return k})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return T}));var a=r(2),u=function(t){console.error(t)},c=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,a=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof a&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},l=function(t){if(!c(t))return!1;var e=t.questions;return!!Array.isArray(e)},s=function(t){if(!l(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,u=t.priceCategory,c=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof c&&!!(e=a.PriceCategoryType,Object.keys(e)).includes(u)&&!!Array.isArray(s)},f=function(t){var e;if(!s(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},p=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},d=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},h=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,a=o.max;0===i&&0===a&&(a=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>a&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+a}),e&&u<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,i=t.modifiers,a=o.min,u=i.some((function(t){return"FAIL"===t.status})),c=i.some((function(t){return"IDLE"===t.status})),l=i.some((function(t){return"INCOMPLETE"===t.status})),s=i.reduce((function(t,e){return t+e.amount}),0);return b({touched:e,errors:r,required:n,min:a,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},g=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,a=t.required,u=t.min,c=t.amount;return b({touched:o,errors:i,required:a,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},b=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,a=t.reviewChildren,c=t.childrenWithError,l=t.childrenIdle,s=t.childrenIncomplete,f=i>0&&!e;return f||e||!n?f||e||n?r.length||a&&c?"FAIL":a&&(l||s)||i<o?"INCOMPLETE":i>=o?"OK":(u("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},O=function(){return(O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(O(O({},t),{amount:r}));return O(O({},n),{amount:t.amount*e})}))},w=function(t){return P(t,(function(t,e){var r=w(t);return O(O({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return O(O({},t),{answers:r})}));return O(O({},t),{questionsAndAnswers:i})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(t,e){if(void 0===e&&(e={}),s(t))return j(j({},t),e);if(l(t))return S(t,e);var r=A(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:a.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},A=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},_=function(t,e){if(void 0===e&&(e={}),f(t))return j(j({},t),e);if(l(t))return k(t,e);var r=A(t);return k(r,e)},E=function(t,e){void 0===e&&(e={});var r=w(t),n=r.priceCategory,o=r.productId,i=r.amount,a=r.questions.map((function(t){var e,a=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=a?a:t,c=u.questionId,l=u.min,s=u.max,f={rootId:o,min:l,max:s,type:p(u),modifiersCount:t.answers.length,amount:i,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==a?void 0:a.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(f),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(f),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:u,groupType:f.type,type:o.renderType}),s=o.questions.length,p=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:i,max:u,renderType:l});return j(j({},p),{questions:s?E(p).questions:[]})}))})}));return j(j(j({},r),{questions:a}),e)},k=function(t,e){void 0===e&&(e={});var r=S(t);return E(r,e)},x=function(t,e){return void 0===e&&(e={}),E(t,e)},T=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),R=["vendorId","storeId","catalogueId","categoryId","productId"],B=["category"],U=["type","method"],M=["alphabetic","price","predefined"],D=["asc","desc"],Y=["page","vendor","store","catalogue","category","product"],L=["price","query","tags","manufacturerId","weight","dimensions"],N=3e5,H={artisanApp:void 0,timeout:N,apiCache:{},expiresAt:(new Date).getTime()+N,forms:{}},q=function(){console.log("Not supported yet")},F=function(){return(F=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=Y,V=L,G=U,$=R,W=B,K=D,J=M,Q=function(t){var e=Z(t),r=X(e),n=tt(r),o=et(n);return rt(o)},Z=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,a=o.categoryId,u=o.productId,c=F(F({},{vendorId:r,storeId:n,catalogueId:i,categoryId:a,productId:u}),t.filterBy),l=nt(c,$,"filter"),s=it(l);return F(F({},t),{filterBy:s})},X=function(t){var e=ot(t,W,"groupBy");return F({},e)},tt=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=nt(r,G,"orderBy"),o=F({},n),i=r.method,a=r.type;return a&&!J.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+a),J.includes(a)||(delete o.type,o.type="predefined"),i&&!K.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),K.includes(i)||(delete o.method,o.method="asc"),F(F({},t),{orderBy:o})},et=function(t){var e=t.pagination,r=nt(void 0===e?{}:e,z,"pagination"),n=F({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,F(F({},t),{pagination:n})},rt=function(t){var e=t.additionalFilters,r=nt(void 0===e?{}:e,V,"additionalFilters");return F(F({},t),{additionalFilters:r})},nt=function(t,e,r){var n=F({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},ot=function(t,e,r){var n=F({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},it=function(t){var e=F({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&at(n[0])||at(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},at=function(t){var e=typeof t;return"number"===e||"string"===e},ut=(r(4),function(){return(ut=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),ct=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,a=i.vendorId,u=i.storeId,c=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=Q(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,a=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=i;return Array.isArray(i)&&(a=i.reduce((function(t,e){return t+","+e}))),ut(ut({},t),"catalogueId"===o?((r={})[o]=a,r.channelId=a,r):((n={})[o]=a,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(a),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?ut(ut({},t),((r={})[n]=o,r)):t}),{})}(i),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?ut(ut({},t),{page:i}):"product"===r?ut(ut({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?ut(ut({},t),{size:i.size}):t}),{})}(u),p=ut(ut(ut(ut(ut({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var d=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],a=i[0],u=i[1],c=new RegExp("/:"+a,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),h=Object(C.getState)().artisanApp,y=(null!=h?h:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+d+"?");return ut(ut({},r),{url:g,query:p})}(t,e,r)},lt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e,r,n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),i={code:null,status:"failed",message:a.message,stack:a.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},st=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},ft=r(5),pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ht=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},yt={"Content-Type":"application/json"},gt=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),dt(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s,f,p,d,h,y,g,b;return ht(this,(function(v){switch(v.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,a=null!==(d=null!==(p=null===(f=e.account)||void 0===f?void 0:f.toString())&&void 0!==p?p:null==i?void 0:i.toString())&&void 0!==d?d:"",u=null!==(y=null!==(h=e.Platform)&&void 0!==h?h:o)&&void 0!==y?y:"",c=u,null===(g=e.Authorization)||void 0===g?[3,1]:(s=g,[3,3]);case 1:return[4,bt(t)];case 2:s=v.sent(),v.label=3;case 3:return l=null!==(b=s)&&void 0!==b?b:"",[2,new Headers(pt(pt(pt({},yt),e),{Authorization:l,Platform:c,account:a}))]}}))}))},bt=function(t,e){return void 0===t&&(t=!0),dt(void 0,void 0,void 0,(function(){var r,n,o;return ht(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(ft.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(u("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},vt=r(1),Ot=function(){return(Ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mt=function(t,e){var r=Q(e).pagination,n=t.pagination;return Ot(Ot({},t),{pagination:wt(r,n)})},wt=function(t,e){return Ot(Ot({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},Pt=function(){return(Pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},It=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},St=function(t,e){return jt(void 0,void 0,void 0,(function(){var r,n,o;return It(this,(function(i){switch(i.label){case 0:return[4,gt(!1)];case 1:return r=i.sent(),n=ct("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(vt.handleHttpCache)(n,(function(t){return jt(void 0,void 0,void 0,(function(){var e,r;return It(this,(function(n){switch(n.label){case 0:return[4,st(t)];case 1:return e=n.sent(),r=T(e.data),[2,Pt(Pt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,mt(o,e)]}}))}))},At=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},_t=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Et=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},kt=function(t){return _t(void 0,void 0,void 0,(function(){var e,r,n;return Et(this,(function(o){switch(o.label){case 0:return[4,gt(!1)];case 1:return e=o.sent(),r=ct("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(vt.handleHttpCache)(r,(function(t){return _t(void 0,void 0,void 0,(function(){return Et(this,(function(e){switch(e.label){case 0:return[4,At(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},xt=function(){console.log("Not implemented yet")},Tt=function(){console.log("not implemented yet")},Ct=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},Rt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Bt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ut=function(t){return Rt(void 0,void 0,void 0,(function(){var e,r,n;return Bt(this,(function(o){switch(o.label){case 0:return[4,gt(!1)];case 1:return e=o.sent(),r=ct("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(vt.handleHttpCache)(r,(function(t){return Rt(void 0,void 0,void 0,(function(){return Bt(this,(function(e){switch(e.label){case 0:return[4,Ct(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Yt=function(t,e){for(var r=Dt([],e),n=t,o=t[0];r.length;)o=Nt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Lt=function(t,e,r){for(var n=Dt([],e),o=t,i=Nt(o,n[0]),a=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Nt(o,n[0]),n=n.slice(1),a=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Dt([],a?i.modifiers:i.groups);var u=n[0];if(1===e.length&&(i={groups:t},a=!1),a){var c=i.modifiers.map((function(t){return t.id===u?Mt({},r):Mt({},t)}));i.modifiers=c}else{var l=i.groups.map((function(t){return t.id===u?Mt({},r):Mt({},t)}));i.groups=l}return 1===e.length?Dt([],i.groups):Dt([],t)},Nt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Ht=function(){return(Ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Ft=function(t,e,r,n,o){var i=Ht(Ht({},r),{amount:n,touched:!0,errors:d(r,n,o),totals:de(Ht(Ht({},r.data),{amount:n})),data:Ht(Ht({},r.data),{amount:n})});return i.status=g(i),Lt(t,e,i)},zt=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),a=qt([],i.modifiers);"RADIO"!==i.type||n||(a=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Ht({},t):Ht(Ht({},t),{amount:0,error:"",totals:de(Ht(Ht({},t.data),{amount:0})),data:Ht(Ht({},t.data),{amount:0})})})));var u=(a=a.map((function(e){var o=x(e.data),i=qt(qt([],r.slice(0,-1)),[e.id]),a=Ht(Ht({},e),{groups:Kt(o,{rootId:t,path:i},e.groups)});return a.errors=d(a,a.amount,n),a.status=g(a),a}))).map((function(t){return Ht({},t.data)})),c=Ht(Ht({},i.data),{answers:u}),l=Ht(Ht({},i),{touched:!0,modifiers:a,data:c});l.errors=h(l,n),l.status=y(l);var s=Lt(e,o,l);return o.length>1&&(s=Vt(t,s,o,n)),s},Vt=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),a=i.groups.map((function(t){return Ht({},t.data)})),u=Ht(Ht({},i.data),{questions:a}),c=i.groups.map((function(t){var e=Ht({},t);return e.errors=h(e,n),e.status=y(e),e})),l=Ht(Ht({},i),{touched:!0,groups:c,data:u});l.errors=d(l,l.amount,n),l.status=g(l);var s=Lt(e,o,l);return o.length>1&&(s=zt(t,s,o,n)),s},Gt=function(){return(Gt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$t=function(){return($t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Kt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Jt(e,{amount:t.amount,rootId:n,path:Wt([],o)},i)}))},Jt=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,a=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,f=e.path,d=null!=r?r:{},h=d.errors,g=d.touched,b={id:n,name:o,description:null!=i?i:"",images:Wt([],null!=c?c:[]),data:$t({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:p(t)},v={rootId:s,max:a,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Wt(Wt([],f),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return Qt(t,v,e)})),m=$t($t({},b),{modifiers:O});return $t($t({},m),{status:y(m)})},Qt=function(t,e,r){var n,o,i=t.productId,a=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,d=x(t),h=e.rootId,y=e.path,b=Wt(Wt([],y),[i]),O=Kt(d,{rootId:h,path:b},null==r?void 0:r.groups),m={id:i,groupId:a,name:u,images:Wt([],c),amount:l,data:$t({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:de($t($t({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Gt({},Object(C.getState)().forms),i=o[t],a=Yt(i.renderer,e),u=Ft(i.renderer,e,a,r,!1);u=zt(t,u,e,!1);var c=Xt(u,i.product),l=Gt(Gt({},i),{renderer:u,product:c,status:v(u)}),s=Gt(Gt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Gt({},l);delete f.callback,i.callback(f)}(e.rootId,b,t)}};return $t($t({},m),{status:g(m)})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){var r=I(e);return Zt(Zt({},r),{questionsAndAnswers:te(t),updatedAt:""})},te=function(t){return t.map((function(t){return Zt(Zt({},t.data),{answers:ee(t.modifiers)})}))},ee=function(t){return t.map((function(t){return t.amount?Zt(Zt({},t.data),{questionsAndAnswers:te(t.groups)}):Zt(Zt({},t.data),{questionsAndAnswers:[]})}))},re=function(){return(re=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ne=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return u("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var e,r=_(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=Kt(r,{rootId:r.productId,path:[]});return{product:Xt(n,t),renderer:n,validate:function(){return ue(t.productId)},status:v(n)}}(t),a=re(re({},o),((r={})[n]=re(re({},i),{callback:e}),r));return Object(C.setState)({forms:a}),e(re({},i)),function(){return oe(n)}},oe=function(t){var e=Object(C.getState)().forms,r=re({},e);delete r[t],Object(C.setState)({forms:r})},ie=function(){return(ie=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ae=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},ue=function(t){var e,r=ie({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,a=n.product,u=ae([],o);o.forEach((function(e){var r=[e.id];u=ce(e,u,t,r)}));var c=Xt(u,a),l=ie(ie({},n),{renderer:u,product:c,status:v(u)}),s=ie(ie({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=ie({},l);return delete f.callback,i(f),l.status},ce=function(t,e,r,n){var o=t.modifiers,i=t.id,a=!o.length,u=ae([],e);return a?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),u):(o.forEach((function(t){var e=ae(ae([],n),[t.id]);u=le(t,u,r,e)})),u)},le=function(t,e,r,n){var o=t.groups,i=t.amount,a=t.status,u=t.required,c=!o.length||0===i,l=ae([],e);if(c){var s="IDLE"===a&&u||"FAIL"===a||"INCOMPLETE"===a?"FAIL":a,f=ie(ie({},t),{status:s}),p=ae([],n);l=Ft(l,p,f,f.amount,!0),l=zt(r,l,p,!0)}else o.forEach((function(t){var e=ae(ae([],n),[t.id]);l=ce(t,l,r,e)}));return l},se=function(){return(se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fe=!1,pe=function(t,e){if(void 0===e&&(e={}),fe)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(Object(C.setState)(se({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(fe=!0)}},de=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?w(r):t;return{unitGrossPrice:ge(n,1),unitTotalDiscounts:be(n,1),unitTotalTaxes:he(n,1),unitNetPrice:ve(n,1),amount:e,grossPrice:ge(n,e),totalDiscounts:be(n,e),totalTaxes:he(n,e),netPrice:ve(n,e)}},he=function(t,e){var r=I(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice,c=we(a,u);return ye(r,e)+c*o},ye=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice;return t+o*(we(a,u)+ye(r,e))}),0)*e}),0)},ge=function(t,e){return Oe(t,"grossPrice",e)},be=function(t,e){return 0},ve=function(t,e){return Oe(t,"netPrice",e)},Oe=function(t,e,r){var n=I(t,{amount:r}),o=n.prices,i=n.amount,a=o[n.priceCategory][e];return(me(n,e)+a)*i},me=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+me(r,e))}),0)}),0)},we=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(H)}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){o=n(n({},o),t)},u=function(){return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){o=n(n({},o),t)},u=function(){return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(8),o=r(1).utf8,i=r(1).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(3).Buffer)},function(t,e,r){"use strict";(function(t){
19
+ e.read=function(t,e,r,n,o){var a,i,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,y=t[e+f];for(f+=p,a=y&(1<<-s)-1,y>>=-s,s+=u;s>0;a=256*a+t[e+f],f+=p,s-=8);for(i=a&(1<<-s)-1,a>>=-s,s+=n;s>0;i=256*i+t[e+f],f+=p,s-=8);if(0===a)a=1-l;else{if(a===c)return i?NaN:1/0*(y?-1:1);i+=Math.pow(2,n),a-=l}return(y?-1:1)*i*Math.pow(2,a-n)},e.write=function(t,e,r,n,o,a){var i,u,c,l=8*a-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,d=n?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,i=s):(i=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-i))<1&&(i--,c*=2),(e+=i+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=s?(u=0,i=s):i+f>=1?(u=(e*c-1)*Math.pow(2,o),i+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;t[r+y]=255&u,y+=d,u/=256,o-=8);for(i=i<<o|u,l+=o;l>0;t[r+y]=255&i,y+=d,i/=256,l-=8);t[r+y-d]|=128*h}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)8*n+6*a<=8*t.length?e.push(r.charAt(o>>>6*(3-a)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return T})),r.d(e,"getProductDetails",(function(){return ht})),r.d(e,"getProducts",(function(){return Ot})),r.d(e,"getRecommendedProducts",(function(){return mt})),r.d(e,"getRelatedProducts",(function(){return wt})),r.d(e,"getStoreDetails",(function(){return St})),r.d(e,"registerModifiersForm",(function(){return Gt})),r.d(e,"validateProduct",(function(){return Qt})),r.d(e,"initProducts",(function(){return ne})),r.d(e,"closeProducts",(function(){return oe})),r.d(e,"getProductTotals",(function(){return ae})),r.d(e,"transformers",(function(){return a})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return i})),r.d(n,"isProductDetails",(function(){return u})),r.d(n,"isCartProduct",(function(){return c})),r.d(n,"isFormCartProduct",(function(){return l}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return O})),r.d(o,"divideProductQA",(function(){return m})),r.d(o,"operationOnProductQA",(function(){return w}));var a={};r.r(a),r.d(a,"toCartProduct",(function(){return P})),r.d(a,"toFormCartProduct",(function(){return x})),r.d(a,"toFormCartProductHelper",(function(){return k})),r.d(a,"toFormCartProductFromProductDetails",(function(){return _})),r.d(a,"toFormCartProductFromAnswer",(function(){return E})),r.d(a,"normalizeProductDetails",(function(){return A}));var i=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,a=t.prices,i=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof i&&!("object"!=typeof a||"object"==typeof a&&Object.keys(a).length<1)&&!!Array.isArray(o)},u=function(t){if(!i(t))return!1;var e=t.questions;return!!Array.isArray(e)},c=function(t){if(!u(t))return!1;var e=t.hash,r=t.createdAt,n=t.updatedAt,o=t.amount,a=t.priceCategory,i=t.comment,c=t.questionsAndAnswers;return"string"==typeof e&&"string"==typeof r&&"string"==typeof n&&"number"==typeof o&&"string"==typeof i&&!!["NORMAL","POINTS"].includes(a)&&!!Array.isArray(c)},l=function(t){var e;if(!c(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},s=function(t){console.error(t)},f=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},p=function(t,e,r){var n=[],o=t.max,a=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<a&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+a}),n},y=function(t,e){var r=[],n=t.modifiers,o=t.data,a=o.min,i=o.max;0===a&&0===i&&(i=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>i&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+i}),e&&u<a&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+a}),r},d=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,a=t.modifiers,i=o.min,u=a.some((function(t){return"FAIL"===t.status})),c=a.some((function(t){return"IDLE"===t.status})),l=a.some((function(t){return"INCOMPLETE"===t.status})),s=a.reduce((function(t,e){return t+e.amount}),0);return g({touched:e,errors:r,required:n,min:i,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},h=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,a=t.errors,i=t.required,u=t.min,c=t.amount;return g({touched:o,errors:a,required:i,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},g=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,a=t.amount,i=t.reviewChildren,u=t.childrenWithError,c=t.childrenIdle,l=t.childrenIncomplete,f=a>0&&!e;return f||e||!n?f||e||n?r.length||i&&u?"FAIL":i&&(c||l)||a<o?"INCOMPLETE":a>=o?"OK":(s("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:a},void 0,2)),"FAIL"):"OK":"IDLE"},b=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},v=function(){return(v=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},O=function(t){return w(t,(function(t,e){var r=t.amount*e,n=O(v(v({},t),{amount:r}));return v(v({},n),{amount:t.amount*e})}))},m=function(t){return w(t,(function(t,e){var r=m(t);return v(v({},r),{amount:t.amount/e})}))},w=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,a=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return v(v({},t),{answers:r})}));return v(v({},t),{questionsAndAnswers:a})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},P=function(t,e){if(void 0===e&&(e={}),c(t))return j(j({},t),e);if(u(t))return I(t,e);var r=S(t);return I(r,e)},I=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,a=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=a?a:0,priceCategory:null!=o?o:"NORMAL",comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},S=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},x=function(t,e){if(void 0===e&&(e={}),l(t))return j(j({},t),e);if(u(t))return _(t,e);var r=S(t);return _(r,e)},k=function(t,e){void 0===e&&(e={});var r=m(t),n=r.priceCategory,o=r.productId,a=r.amount,i=r.questions.map((function(t){var e,i=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=i?i:t,c=u.questionId,l=u.min,s=u.max,p={rootId:o,min:l,max:s,type:f(u),modifiersCount:t.answers.length,amount:a,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==i?void 0:i.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,a=function(t){return 1===t.modifiersCount?t.min:0}(p),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(p),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:a,max:u,groupType:p.type,type:o.renderType}),s=o.questions.length,f=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:a,max:u,renderType:l});return j(j({},f),{questions:s?k(f).questions:[]})}))})}));return j(j(j({},r),{questions:i}),e)},_=function(t,e){void 0===e&&(e={});var r=I(t);return k(r,e)},E=function(t,e){return void 0===e&&(e={}),k(t,e)},A=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},T=function(){console.log("Not supported yet")},C=r(0),R=function(){return(R=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},B=["page","vendor","store","catalogue","category","product"],U=["price","query","tags","manufacturerId","weight","dimensions"],M=["type","method"],H=["vendorId","storeId","catalogueId","categoryId","productId"],L=["category"],D=["asc","desc"],Y=["alphabetic","price","predefined"],N=function(t){var e=q(t),r=F(e),n=z(r),o=V(n);return $(o)},q=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),a=o.catalogueId,i=o.categoryId,u=o.productId,c=R(R({},{vendorId:r,storeId:n,catalogueId:a,categoryId:i,productId:u}),t.filterBy),l=G(c,H,"filter"),s=K(l);return R(R({},t),{filterBy:s})},F=function(t){var e=W(t,L,"groupBy");return R({},e)},z=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=G(r,M,"orderBy"),o=R({},n),a=r.method,i=r.type;return i&&!Y.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+i),Y.includes(i)||(delete o.type,o.type="predefined"),a&&!D.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+a),D.includes(a)||(delete o.method,o.method="asc"),R(R({},t),{orderBy:o})},V=function(t){var e=t.pagination,r=G(void 0===e?{}:e,B,"pagination"),n=R({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,R(R({},t),{pagination:n})},$=function(t){var e=t.additionalFilters,r=G(void 0===e?{}:e,U,"additionalFilters");return R(R({},t),{additionalFilters:r})},G=function(t,e,r){var n=R({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},W=function(t,e,r){var n=R({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},K=function(t){var e=R({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&J(n[0])||J(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},J=function(t){var e=typeof t;return"number"===e||"string"===e},Q=(r(3),function(){return(Q=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),Z=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,a=t.filterBy,i=a.vendorId,u=a.storeId,c=a.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(i,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=N(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,a=e.additionalFilters,i=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],a=e[1],i=a;return Array.isArray(a)&&(i=a.reduce((function(t,e){return t+","+e}))),Q(Q({},t),"catalogueId"===o?((r={})[o]=i,r.channelId=i,r):((n={})[o]=i,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(i),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?Q(Q({},t),((r={})[n]=o,r)):t}),{})}(a),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],a=void 0===n?{}:n;return"page"===r?Q(Q({},t),{page:a}):"product"===r?Q(Q({},t),o?{productsByGroup:a.size}:{size:a.size}):"category"===r?Q(Q({},t),{size:a.size}):t}),{})}(u),p=Q(Q(Q(Q(Q({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var y=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var a=o[n],i=a[0],u=a[1],c=new RegExp("/:"+i,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),d=Object(C.getState)().artisanApp,h=(null!=d?d:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),h+"/"+y+"?");return Q(Q({},r),{url:g,query:p})}(t,e,r)},X=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e,r,n,o,a,i;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return a=u.sent(),[3,4];case 3:return i=u.sent(),a={code:null,status:"failed",message:i.message,stack:i.stack},[3,4];case 4:if(a.code<200||a.code>299)throw new Error(JSON.stringify({code:a.code,status:a.status,message:a.message,warnings:a.warning,stack:a.stack}));return[2,a]}}))}))},tt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(e){switch(e.label){case 0:return[4,X(t)];case 1:return[2,e.sent()]}}))}))},et=r(4),rt=function(){return(rt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},nt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},ot=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},at={"Content-Type":"application/json"},it=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),nt(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,c,l,s,f,p,y,d,h,g,b,v,O,m;return ot(this,(function(w){switch(w.label){case 0:return r=Object(C.getState)(),n=r.artisanApp,o=r.accountId,a=n.settings,i=a.platform,u=a.accountId,c=null!==(g=null!==(h=null!==(d=null===(y=e.account)||void 0===y?void 0:y.toString())&&void 0!==d?d:null==o?void 0:o.toString())&&void 0!==h?h:null==u?void 0:u.toString())&&void 0!==g?g:"",l=null!==(v=null!==(b=e.Platform)&&void 0!==b?b:i)&&void 0!==v?v:"",s=l,null===(O=e.Authorization)||void 0===O?[3,1]:(p=O,[3,3]);case 1:return[4,ut(t)];case 2:p=w.sent(),w.label=3;case 3:return f=null!==(m=p)&&void 0!==m?m:"",[2,new Headers(rt(rt(rt({},at),e),{Authorization:f,Platform:s,account:c}))]}}))}))},ut=function(t,e){return void 0===t&&(t=!0),nt(void 0,void 0,void 0,(function(){var r,n,o;return ot(this,(function(a){switch(a.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(et.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=a.sent())||t?!n&&t?(s("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},ct=r(1),lt=function(){return(lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},st=function(t,e){var r=N(e).pagination,n=t.pagination;return lt(lt({},t),{pagination:ft(r,n)})},ft=function(t,e){return lt(lt({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},dt=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},ht=function(t,e){return yt(void 0,void 0,void 0,(function(){var r,n,o;return dt(this,(function(a){switch(a.label){case 0:return[4,it(!1)];case 1:return r=a.sent(),n=Z("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(ct.handleHttpCache)(n,(function(t){return yt(void 0,void 0,void 0,(function(){var e,r;return dt(this,(function(n){switch(n.label){case 0:return[4,tt(t)];case 1:return e=n.sent(),r=A(e.data),[2,pt(pt({},e),{data:r})]}}))}))}))];case 2:return o=a.sent(),[2,st(o,e)]}}))}))},gt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(e){switch(e.label){case 0:return[4,X(t)];case 1:return[2,e.sent()]}}))}))},bt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},vt=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Ot=function(t){return bt(void 0,void 0,void 0,(function(){var e,r,n;return vt(this,(function(o){switch(o.label){case 0:return[4,it(!1)];case 1:return e=o.sent(),r=Z("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ct.handleHttpCache)(r,(function(t){return bt(void 0,void 0,void 0,(function(){return vt(this,(function(e){switch(e.label){case 0:return[4,gt(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,st(n,t)]}}))}))},mt=function(){console.log("Not implemented yet")},wt=function(){console.log("not implemented yet")},jt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(e){switch(e.label){case 0:return[4,X(t)];case 1:return[2,e.sent()]}}))}))},Pt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},It=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},St=function(t){return Pt(void 0,void 0,void 0,(function(){var e,r,n;return It(this,(function(o){switch(o.label){case 0:return[4,it(!1)];case 1:return e=o.sent(),r=Z("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ct.handleHttpCache)(r,(function(t){return Pt(void 0,void 0,void 0,(function(){return It(this,(function(e){switch(e.label){case 0:return[4,jt(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,st(n,t)]}}))}))},xt=function(){return(xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},_t=function(t,e){for(var r=kt([],e),n=t,o=t[0];r.length;)o=At(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Et=function(t,e,r){for(var n=kt([],e),o=t,a=At(o,n[0]),i=Object.prototype.hasOwnProperty.call(a,"modifiers");n.length>1;)a=At(o,n[0]),n=n.slice(1),i=Object.prototype.hasOwnProperty.call(a,"modifiers"),o=kt([],i?a.modifiers:a.groups);var u=n[0];if(1===e.length&&(a={groups:t},i=!1),i){var c=a.modifiers.map((function(t){return t.id===u?xt({},r):xt({},t)}));a.modifiers=c}else{var l=a.groups.map((function(t){return t.id===u?xt({},r):xt({},t)}));a.groups=l}return 1===e.length?kt([],a.groups):kt([],t)},At=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Tt=function(){return(Tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ct=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Rt=function(t,e,r,n,o){var a=Tt(Tt({},r),{amount:n,touched:!0,errors:p(r,n,o),totals:ae(Tt(Tt({},r.data),{amount:n})),data:Tt(Tt({},r.data),{amount:n})});return a.status=h(a),Et(t,e,a)},Bt=function(t,e,r,n){var o=r.slice(0,-1),a=_t(e,o),i=Ct([],a.modifiers);"RADIO"!==a.type||n||(i=a.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Tt({},t):Tt(Tt({},t),{amount:0,error:"",totals:ae(Tt(Tt({},t.data),{amount:0})),data:Tt(Tt({},t.data),{amount:0})})})));var u=(i=i.map((function(e){var o=E(e.data),a=Ct(Ct([],r.slice(0,-1)),[e.id]),i=Tt(Tt({},e),{groups:Dt(o,{rootId:t,path:a},e.groups)});return i.errors=p(i,i.amount,n),i.status=h(i),i}))).map((function(t){return Tt({},t.data)})),c=Tt(Tt({},a.data),{answers:u}),l=Tt(Tt({},a),{touched:!0,modifiers:i,data:c});l.errors=y(l,n),l.status=d(l);var s=Et(e,o,l);return o.length>1&&(s=Ut(t,s,o,n)),s},Ut=function(t,e,r,n){var o=r.slice(0,-1),a=_t(e,o),i=a.groups.map((function(t){return Tt({},t.data)})),u=Tt(Tt({},a.data),{questions:i}),c=a.groups.map((function(t){var e=Tt({},t);return e.errors=y(e,n),e.status=d(e),e})),l=Tt(Tt({},a),{touched:!0,groups:c,data:u});l.errors=p(l,l.amount,n),l.status=h(l);var s=Et(e,o,l);return o.length>1&&(s=Bt(t,s,o,n)),s},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(){return(Ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Dt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var a=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Yt(e,{amount:t.amount,rootId:n,path:Lt([],o)},a)}))},Yt=function(t,e,r){var n=t.questionId,o=t.name,a=t.description,i=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,p=e.path,y=null!=r?r:{},h=y.errors,g=y.touched,b={id:n,name:o,description:null!=a?a:"",images:Lt([],null!=c?c:[]),data:Ht({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:f(t)},v={rootId:s,max:i,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Lt(Lt([],p),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return Nt(t,v,e)})),m=Ht(Ht({},b),{modifiers:O});return Ht(Ht({},m),{status:d(m)})},Nt=function(t,e,r){var n,o,a=t.productId,i=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,y=E(t),d=e.rootId,g=e.path,v=Lt(Lt([],g),[a]),O=Dt(y,{rootId:d,path:v},null==r?void 0:r.groups),m={id:a,groupId:i,name:u,images:Lt([],c),amount:l,data:Ht({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:ae(Ht(Ht({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Mt({},Object(C.getState)().forms),a=o[t],i=_t(a.renderer,e),u=Rt(a.renderer,e,i,r,!1);u=Bt(t,u,e,!1);var c=Ft(u,a.product),l=Mt(Mt({},a),{renderer:u,product:c,status:b(u)}),s=Mt(Mt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Mt({},l);delete f.callback,a.callback(f)}(e.rootId,v,t)}};return Ht(Ht({},m),{status:h(m)})},qt=function(){return(qt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ft=function(t,e){var r=P(e);return qt(qt({},r),{questionsAndAnswers:zt(t),updatedAt:""})},zt=function(t){return t.map((function(t){return qt(qt({},t.data),{answers:Vt(t.modifiers)})}))},Vt=function(t){return t.map((function(t){return t.amount?qt(qt({},t.data),{questionsAndAnswers:zt(t.groups)}):qt(qt({},t.data),{questionsAndAnswers:[]})}))},$t=function(){return($t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return s("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var a=function(t){var e,r=x(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=Dt(r,{rootId:r.productId,path:[]});return{product:Ft(n,t),renderer:n,validate:function(){return Qt(t.productId)},status:b(n)}}(t),i=$t($t({},o),((r={})[n]=$t($t({},a),{callback:e}),r));return Object(C.setState)({forms:i}),e($t({},a)),function(){return Wt(n)}},Wt=function(t){var e=Object(C.getState)().forms,r=$t({},e);delete r[t],Object(C.setState)({forms:r})},Kt=function(){return(Kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Qt=function(t){var e,r=Kt({},Object(C.getState)().forms),n=r[t],o=n.renderer,a=n.callback,i=n.product,u=Jt([],o);o.forEach((function(e){var r=[e.id];u=Zt(e,u,t,r)}));var c=Ft(u,i),l=Kt(Kt({},n),{renderer:u,product:c,status:b(u)}),s=Kt(Kt({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=Kt({},l);return delete f.callback,a(f),l.status},Zt=function(t,e,r,n){var o=t.modifiers,a=t.id,i=!o.length,u=Jt([],e);return i?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+a+" of product 0."),u):(o.forEach((function(t){var e=Jt(Jt([],n),[t.id]);u=Xt(t,u,r,e)})),u)},Xt=function(t,e,r,n){var o=t.groups,a=t.amount,i=t.status,u=t.required,c=!o.length||0===a,l=Jt([],e);if(c){var s="IDLE"===i&&u||"FAIL"===i||"INCOMPLETE"===i?"FAIL":i,f=Kt(Kt({},t),{status:s}),p=Jt([],n);l=Rt(l,p,f,f.amount,!0),l=Bt(r,l,p,!0)}else o.forEach((function(t){var e=Jt(Jt([],n),[t.id]);l=Zt(t,l,r,e)}));return l},te={artisanApp:void 0,forms:{},accountId:void 0},ee=function(){return(ee=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},re=!1,ne=function(t,e){void 0===e&&(e={}),re?console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once"):(Object(C.initState)(te),Object(C.setState)(ee({artisanApp:t},e)),Object(ct.initCache)({timeout:e.timeout}),"undefined"==typeof window||(re=!0))},oe=function(){Object(C.setState)(ee({},te)),re=!1},ae=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?m(r):t;return{unitGrossPrice:ce(n,1),unitTotalDiscounts:le(n,1),unitTotalTaxes:ie(n,1),unitNetPrice:se(n,1),amount:e,grossPrice:ce(n,e),totalDiscounts:le(n,e),totalTaxes:ie(n,e),netPrice:se(n,e)}},ie=function(t,e){var r=P(t,{amount:e}),n=r.prices,o=r.amount,a=n[r.priceCategory],i=a.taxes,u=a.grossPrice,c=ye(i,u);return ue(r,e)+c*o},ue=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,a=n[r.priceCategory],i=a.taxes,u=a.grossPrice;return t+o*(ye(i,u)+ue(r,e))}),0)*e}),0))&&void 0!==n?n:0},ce=function(t,e){return fe(t,"grossPrice",e)},le=function(t,e){return 0},se=function(t,e){return fe(t,"netPrice",e)},fe=function(t,e,r){var n=P(t,{amount:r}),o=n.prices,a=n.amount,i=o[n.priceCategory][e];return(pe(n,e)+i)*a},pe=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+pe(r,e))}),0)}),0))&&void 0!==n?n:0},ye=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return a})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return i}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,a=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},i=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return a})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return i}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,a=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},i=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,a,i;n=r(8),o=r(1).utf8,a=r(1).bin,(i=function(t,r){var i=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),a=8*t.length,i=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[a>>5]|=128<<24-a%32,r[15+(a+64>>>9<<4)]=a;for(var p=0;p<r.length;p+=16){for(var y=u,d=c,h=l,g=s,b=f,v=0;v<80;v++){if(v<16)i[v]=r[p+v];else{var O=i[v-3]^i[v-8]^i[v-14]^i[v-16];i[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(i[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=y,c+=d,l+=h,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?i:r&&r.asString?a.bytesToString(i):n.bytesToHex(i)})._blocksize=16,i._digestsize=20,t.exports=i}).call(this,r(3).Buffer)},function(t,e,r){"use strict";(function(t){
20
20
  /*!
21
21
  * The buffer module from node.js, for the browser.
22
22
  *
23
23
  * @author Feross Aboukhadijeh <http://feross.org>
24
24
  * @license MIT
25
25
  */
26
- var n=r(5),o=r(6),i=r(7);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(4))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
26
+ var n=r(5),o=r(6),a=r(7);function i(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|y(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&a(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|y(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|y(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function y(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return _(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var a,i=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,u/=2,c/=2,r/=2}function l(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var s=-1;for(a=r;a<u;a++)if(l(t,a)===l(e,-1===s?0:a-s)){if(-1===s&&(s=a),a-s+1===c)return s*i}else-1!==s&&(a-=a-s),s=-1}else for(r+c>u&&(r=u-c),a=r;a>=0;a--){for(var f=!0,p=0;p<c;p++)if(l(t,a+p)!==l(e,p)){f=!1;break}if(f)return a}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(isNaN(u))return i;t[r+i]=u}return i}function m(t,e,r,n){return q(Y(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function j(t,e,r,n){return w(t,e,r,n)}function P(t,e,r,n){return q(N(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,a=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var a,i,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(a=t[o+1]))&&(c=(31&l)<<6|63&a)>127&&(s=c);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(c=(15&l)<<12|(63&a)<<6|63&i)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(c=(15&l)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function E(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=e;a<r;++a)o+=D(t[a]);return o}function A(t,e,r){for(var n=t.slice(e,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,a){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,a=Math.min(t.length-r,2);o<a;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,a=Math.min(t.length-r,4);o<a;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,a){return a||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,a){return a||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=i(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):h.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(e>>>=0),u=Math.min(a,i),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){a=l[f],i=s[f];break}return a<i?-1:i<a?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return j(this,t,e,r);case"base64":return P(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a<r&&(i*=256);)t<0&&0===u&&0!==this[e+a-1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,a=n-r;if(this===t&&r<e&&e<n)for(o=a-1;o>=0;--o)t[o+e]=this[o+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var i=c.isBuffer(t)?t:Y(new c(t,n).toString()),u=i.length;for(a=0;a<r-e;++a)this[a+e]=i[a%u]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){var r;e=e||1/0;for(var n=t.length,o=null,a=[],i=0;i<n;++i){if((r=t.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(4))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),i=n[0],u=n[1],c=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,u)),s=0,f=u>0?i-4:i;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,a=[],i=0,u=r-o;i<u;i+=16383)a.push(s(t,i,i+16383>u?u:i+16383));return 1===o?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),a.join("")};for(var n=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=i.length;u<c;++u)n[u]=i[u],o[i.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,a,i=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(n[(a=o)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
27
27
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
28
- e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"handleHttpCache",(function(){return f})),r.d(e,"transformResponse",(function(){return c}));var n=r(0),o=r(2),i=r.n(o),a=["vendorId","storeId","catalogueId","categoryId","productId"],u=["accountId"],c=function(t,e,r){var n,o=null==e?void 0:e.message;try{o=e?JSON.parse(e.message):e}catch(t){}return{data:null!==(n=null==t?void 0:t.data)&&void 0!==n?n:t,hints:l(r),config:r,error:o,pagination:{hasMorePages:null==t?void 0:t.hasMorePages,page:null==t?void 0:t.page}}},l=function(t){var e={};return Object.entries(t.query).forEach((function(t){var r=t,n=r[0],o=r[1];a.includes(n)&&(e[n]=o)})),Object.entries(t.headers).forEach((function(t){var r=t,n=r[0],o=r[1];u.includes(n)&&(e[n]=o)})),e},s=function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},f=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var r,o,a,u,l,f;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(p){switch(p.label){case 0:if(h=t.url,r=i()(h),o=function(t){return Object(n.getState)().apiCache[t]}(r),d=Object(n.getState)().expiresAt,(a=(new Date).getTime()>=d)&&function(){var t=Object(n.getState)().timeout,e=void 0===t?0:t;Object(n.setState)({apiCache:{},expiresAt:(new Date).getTime()+e})}(),o&&!a)return[3,4];p.label=1;case 1:return p.trys.push([1,3,,4]),[4,e(t)];case 2:return u=p.sent(),f=c(u,void 0,t),function(t,e){var r,o=Object(n.getState)().apiCache,i=s(s({},o),((r={})[t]=e,r));Object(n.setState)({apiCache:i})}(r,f),[2,f];case 3:return l=p.sent(),[2,f=c(void 0,l,t)];case 4:return[2,o]}var d,h}))}))},p=3e5,d={artisanApp:void 0,apiCache:{},expiresAt:(new Date).getTime()+p,timeout:p};Object(n.initState)(d)}])},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(6),e),o(r(7),e),o(r(8),e),o(r(9),e),o(r(10),e),o(r(11),e),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e)},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(30),o=r(3).utf8,i=r(3).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(25).Buffer)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";(function(t){
28
+ e.read=function(t,e,r,n,o){var a,i,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,y=t[e+f];for(f+=p,a=y&(1<<-s)-1,y>>=-s,s+=u;s>0;a=256*a+t[e+f],f+=p,s-=8);for(i=a&(1<<-s)-1,a>>=-s,s+=n;s>0;i=256*i+t[e+f],f+=p,s-=8);if(0===a)a=1-l;else{if(a===c)return i?NaN:1/0*(y?-1:1);i+=Math.pow(2,n),a-=l}return(y?-1:1)*i*Math.pow(2,a-n)},e.write=function(t,e,r,n,o,a){var i,u,c,l=8*a-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,d=n?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,i=s):(i=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-i))<1&&(i--,c*=2),(e+=i+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=s?(u=0,i=s):i+f>=1?(u=(e*c-1)*Math.pow(2,o),i+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;t[r+y]=255&u,y+=d,u/=256,o-=8);for(i=i<<o|u,l+=o;l>0;t[r+y]=255&i,y+=d,i/=256,l-=8);t[r+y-d]|=128*h}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)8*n+6*a<=8*t.length?e.push(r.charAt(o>>>6*(3-a)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"flushCache",(function(){return a})),r.d(e,"handleHttpCache",(function(){return p})),r.d(e,"initCache",(function(){return g})),r.d(e,"transformResponse",(function(){return s}));var n=r(0),o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=function(){var t=Object(n.getState)().timeout,e=void 0===t?0:t;Object(n.setState)({apiCache:{},expiresAt:(new Date).getTime()+e})},i=r(2),u=r.n(i),c=["vendorId","storeId","catalogueId","categoryId","productId"],l=["accountId"],s=function(t,e,r){var n,o=null==e?void 0:e.message;try{o=e?JSON.parse(e.message):e}catch(t){}return{data:null!==(n=null==t?void 0:t.data)&&void 0!==n?n:t,hints:f(r),config:r,error:o,pagination:{hasMorePages:null==t?void 0:t.hasMorePages,page:null==t?void 0:t.page}}},f=function(t){var e={};return Object.entries(t.query).forEach((function(t){var r=t,n=r[0],o=r[1];c.includes(n)&&(e[n]=o)})),Object.entries(t.headers).forEach((function(t){var r=t,n=r[0],o=r[1];l.includes(n)&&(e[n]=o)})),e},p=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{i(n.next(t))}catch(t){e(t)}}function a(t){try{i(n.throw(t))}catch(t){e(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,a)}i((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var r,i,c,l,f,p;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(y){switch(y.label){case 0:if(h=t.url,r=u()(h),i=function(t){return Object(n.getState)().apiCache[t]}(r),d=Object(n.getState)().expiresAt,(c=(new Date).getTime()>=d)&&a(),i&&!c)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,e(t)];case 2:return l=y.sent(),p=s(l,void 0,t),function(t,e){var r,a=Object(n.getState)().apiCache,i=o(o({},a),((r={})[t]=e,r));Object(n.setState)({apiCache:i})}(r,p),[2,p];case 3:return f=y.sent(),[2,p=s(void 0,f,t)];case 4:return[2,i]}var d,h}))}))},y=3e5,d={apiCache:{},expiresAt:(new Date).getTime()+y,timeout:y},h=function(){return(h=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},g=function(t){Object(n.initState)(d);var e=t.timeout;if(void 0!==e){var r=Object(n.getState)();Object(n.setState)(h(h({},r),{expiresAt:(new Date).getTime()+e,timeout:e}))}}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,a,i;n=r(10),o=r(2).utf8,a=r(2).bin,(i=function(t,r){var i=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),a=8*t.length,i=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[a>>5]|=128<<24-a%32,r[15+(a+64>>>9<<4)]=a;for(var p=0;p<r.length;p+=16){for(var y=u,d=c,h=l,g=s,b=f,v=0;v<80;v++){if(v<16)i[v]=r[p+v];else{var O=i[v-3]^i[v-8]^i[v-14]^i[v-16];i[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(i[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=y,c+=d,l+=h,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?i:r&&r.asString?a.bytesToString(i):n.bytesToHex(i)})._blocksize=16,i._digestsize=20,t.exports=i}).call(this,r(5).Buffer)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";(function(t){
29
29
  /*!
30
30
  * The buffer module from node.js, for the browser.
31
31
  *
32
32
  * @author Feross Aboukhadijeh <http://feross.org>
33
33
  * @license MIT
34
34
  */
35
- var n=r(27),o=r(28),i=r(29);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(26))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
35
+ var n=r(7),o=r(8),a=r(9);function i(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|y(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&a(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|y(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|y(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function y(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return _(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var a,i=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,u/=2,c/=2,r/=2}function l(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var s=-1;for(a=r;a<u;a++)if(l(t,a)===l(e,-1===s?0:a-s)){if(-1===s&&(s=a),a-s+1===c)return s*i}else-1!==s&&(a-=a-s),s=-1}else for(r+c>u&&(r=u-c),a=r;a>=0;a--){for(var f=!0,p=0;p<c;p++)if(l(t,a+p)!==l(e,p)){f=!1;break}if(f)return a}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(isNaN(u))return i;t[r+i]=u}return i}function m(t,e,r,n){return q(Y(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function j(t,e,r,n){return w(t,e,r,n)}function P(t,e,r,n){return q(N(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,a=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var a,i,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(a=t[o+1]))&&(c=(31&l)<<6|63&a)>127&&(s=c);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(c=(15&l)<<12|(63&a)<<6|63&i)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(c=(15&l)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function E(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=e;a<r;++a)o+=D(t[a]);return o}function A(t,e,r){for(var n=t.slice(e,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,a){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,a=Math.min(t.length-r,2);o<a;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,a=Math.min(t.length-r,4);o<a;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,a){return a||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,a){return a||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=i(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):h.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(e>>>=0),u=Math.min(a,i),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){a=l[f],i=s[f];break}return a<i?-1:i<a?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return j(this,t,e,r);case"base64":return P(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a<r&&(i*=256);)t<0&&0===u&&0!==this[e+a-1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,a=n-r;if(this===t&&r<e&&e<n)for(o=a-1;o>=0;--o)t[o+e]=this[o+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var i=c.isBuffer(t)?t:Y(new c(t,n).toString()),u=i.length;for(a=0;a<r-e;++a)this[a+e]=i[a%u]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){var r;e=e||1/0;for(var n=t.length,o=null,a=[],i=0;i<n;++i){if((r=t.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(6))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),i=n[0],u=n[1],c=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,u)),s=0,f=u>0?i-4:i;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,a=[],i=0,u=r-o;i<u;i+=16383)a.push(s(t,i,i+16383>u?u:i+16383));return 1===o?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),a.join("")};for(var n=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=i.length;u<c;++u)n[u]=i[u],o[i.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,a,i=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(n[(a=o)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
36
36
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
37
- e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return U})),r.d(e,"getProductDetails",(function(){return vt})),r.d(e,"getProducts",(function(){return Pt})),r.d(e,"getRecommendedProducts",(function(){return jt})),r.d(e,"getRelatedProducts",(function(){return It})),r.d(e,"getStoreDetails",(function(){return Et})),r.d(e,"registerModifiersForm",(function(){return Jt})),r.d(e,"validateProduct",(function(){return te})),r.d(e,"initProducts",(function(){return ie})),r.d(e,"getProductTotals",(function(){return ae})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return c})),r.d(n,"isProductDetails",(function(){return l})),r.d(n,"isCartProduct",(function(){return s})),r.d(n,"isFormCartProduct",(function(){return f}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return w})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return I})),r.d(i,"toFormCartProduct",(function(){return _})),r.d(i,"toFormCartProductHelper",(function(){return E})),r.d(i,"toFormCartProductFromProductDetails",(function(){return k})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return T}));var a=r(2),u=function(t){console.error(t)},c=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,a=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof a&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},l=function(t){if(!c(t))return!1;var e=t.questions;return!!Array.isArray(e)},s=function(t){if(!l(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,u=t.priceCategory,c=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof c&&!!(e=a.PriceCategoryType,Object.keys(e)).includes(u)&&!!Array.isArray(s)},f=function(t){var e;if(!s(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},p=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},d=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},h=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,a=o.max;0===i&&0===a&&(a=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>a&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+a}),e&&u<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,i=t.modifiers,a=o.min,u=i.some((function(t){return"FAIL"===t.status})),c=i.some((function(t){return"IDLE"===t.status})),l=i.some((function(t){return"INCOMPLETE"===t.status})),s=i.reduce((function(t,e){return t+e.amount}),0);return b({touched:e,errors:r,required:n,min:a,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},g=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,a=t.required,u=t.min,c=t.amount;return b({touched:o,errors:i,required:a,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},b=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,a=t.reviewChildren,c=t.childrenWithError,l=t.childrenIdle,s=t.childrenIncomplete,f=i>0&&!e;return f||e||!n?f||e||n?r.length||a&&c?"FAIL":a&&(l||s)||i<o?"INCOMPLETE":i>=o?"OK":(u("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},O=function(){return(O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(O(O({},t),{amount:r}));return O(O({},n),{amount:t.amount*e})}))},w=function(t){return P(t,(function(t,e){var r=w(t);return O(O({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return O(O({},t),{answers:r})}));return O(O({},t),{questionsAndAnswers:i})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(t,e){if(void 0===e&&(e={}),s(t))return j(j({},t),e);if(l(t))return S(t,e);var r=A(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:a.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},A=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},_=function(t,e){if(void 0===e&&(e={}),f(t))return j(j({},t),e);if(l(t))return k(t,e);var r=A(t);return k(r,e)},E=function(t,e){void 0===e&&(e={});var r=w(t),n=r.priceCategory,o=r.productId,i=r.amount,a=r.questions.map((function(t){var e,a=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=a?a:t,c=u.questionId,l=u.min,s=u.max,f={rootId:o,min:l,max:s,type:p(u),modifiersCount:t.answers.length,amount:i,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==a?void 0:a.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(f),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(f),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:u,groupType:f.type,type:o.renderType}),s=o.questions.length,p=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:i,max:u,renderType:l});return j(j({},p),{questions:s?E(p).questions:[]})}))})}));return j(j(j({},r),{questions:a}),e)},k=function(t,e){void 0===e&&(e={});var r=S(t);return E(r,e)},x=function(t,e){return void 0===e&&(e={}),E(t,e)},T=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),R=3e5,B={artisanApp:void 0,timeout:R,apiCache:{},expiresAt:(new Date).getTime()+R,forms:{}},U=function(){console.log("Not supported yet")},M=function(){return(M=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=["page","vendor","store","catalogue","category","product"],Y=["price","query","tags","manufacturerId","weight","dimensions"],L=["type","method"],N=["vendorId","storeId","catalogueId","categoryId","productId"],H=["category"],q=["asc","desc"],F=["alphabetic","price","predefined"],z=function(t){var e=V(t),r=G(e),n=$(r),o=W(n);return K(o)},V=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,a=o.categoryId,u=o.productId,c=M(M({},{vendorId:r,storeId:n,catalogueId:i,categoryId:a,productId:u}),t.filterBy),l=J(c,N,"filter"),s=Z(l);return M(M({},t),{filterBy:s})},G=function(t){var e=Q(t,H,"groupBy");return M({},e)},$=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=J(r,L,"orderBy"),o=M({},n),i=r.method,a=r.type;return a&&!F.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+a),F.includes(a)||(delete o.type,o.type="predefined"),i&&!q.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),q.includes(i)||(delete o.method,o.method="asc"),M(M({},t),{orderBy:o})},W=function(t){var e=t.pagination,r=J(void 0===e?{}:e,D,"pagination"),n=M({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,M(M({},t),{pagination:n})},K=function(t){var e=t.additionalFilters,r=J(void 0===e?{}:e,Y,"additionalFilters");return M(M({},t),{additionalFilters:r})},J=function(t,e,r){var n=M({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},Q=function(t,e,r){var n=M({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},Z=function(t){var e=M({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&X(n[0])||X(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},X=function(t){var e=typeof t;return"number"===e||"string"===e},tt=(r(4),function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),et=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,a=i.vendorId,u=i.storeId,c=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=z(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,a=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=i;return Array.isArray(i)&&(a=i.reduce((function(t,e){return t+","+e}))),tt(tt({},t),"catalogueId"===o?((r={})[o]=a,r.channelId=a,r):((n={})[o]=a,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(a),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?tt(tt({},t),((r={})[n]=o,r)):t}),{})}(i),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?tt(tt({},t),{page:i}):"product"===r?tt(tt({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?tt(tt({},t),{size:i.size}):t}),{})}(u),p=tt(tt(tt(tt(tt({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var d=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],a=i[0],u=i[1],c=new RegExp("/:"+a,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),h=Object(C.getState)().artisanApp,y=(null!=h?h:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+d+"?");return tt(tt({},r),{url:g,query:p})}(t,e,r)},rt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var e,r,n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),i={code:null,status:"failed",message:a.message,stack:a.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},nt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},ot=r(5),it=function(){return(it=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},at=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ut=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},ct={"Content-Type":"application/json"},lt=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),at(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s,f,p,d,h,y,g,b;return ut(this,(function(v){switch(v.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,a=null!==(d=null!==(p=null===(f=e.account)||void 0===f?void 0:f.toString())&&void 0!==p?p:null==i?void 0:i.toString())&&void 0!==d?d:"",u=null!==(y=null!==(h=e.Platform)&&void 0!==h?h:o)&&void 0!==y?y:"",c=u,null===(g=e.Authorization)||void 0===g?[3,1]:(s=g,[3,3]);case 1:return[4,st(t)];case 2:s=v.sent(),v.label=3;case 3:return l=null!==(b=s)&&void 0!==b?b:"",[2,new Headers(it(it(it({},ct),e),{Authorization:l,Platform:c,account:a}))]}}))}))},st=function(t,e){return void 0===t&&(t=!0),at(void 0,void 0,void 0,(function(){var r,n,o;return ut(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(ot.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(u("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},ft=r(1),pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dt=function(t,e){var r=z(e).pagination,n=t.pagination;return pt(pt({},t),{pagination:ht(r,n)})},ht=function(t,e){return pt(pt({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},yt=function(){return(yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},bt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},vt=function(t,e){return gt(void 0,void 0,void 0,(function(){var r,n,o;return bt(this,(function(i){switch(i.label){case 0:return[4,lt(!1)];case 1:return r=i.sent(),n=et("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(ft.handleHttpCache)(n,(function(t){return gt(void 0,void 0,void 0,(function(){var e,r;return bt(this,(function(n){switch(n.label){case 0:return[4,nt(t)];case 1:return e=n.sent(),r=T(e.data),[2,yt(yt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,dt(o,e)]}}))}))},Ot=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},mt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},wt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Pt=function(t){return mt(void 0,void 0,void 0,(function(){var e,r,n;return wt(this,(function(o){switch(o.label){case 0:return[4,lt(!1)];case 1:return e=o.sent(),r=et("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ft.handleHttpCache)(r,(function(t){return mt(void 0,void 0,void 0,(function(){return wt(this,(function(e){switch(e.label){case 0:return[4,Ot(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,dt(n,t)]}}))}))},jt=function(){console.log("Not implemented yet")},It=function(){console.log("not implemented yet")},St=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},At=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},_t=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Et=function(t){return At(void 0,void 0,void 0,(function(){var e,r,n;return _t(this,(function(o){switch(o.label){case 0:return[4,lt(!1)];case 1:return e=o.sent(),r=et("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ft.handleHttpCache)(r,(function(t){return At(void 0,void 0,void 0,(function(){return _t(this,(function(e){switch(e.label){case 0:return[4,St(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,dt(n,t)]}}))}))},kt=function(){return(kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Tt=function(t,e){for(var r=xt([],e),n=t,o=t[0];r.length;)o=Rt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Ct=function(t,e,r){for(var n=xt([],e),o=t,i=Rt(o,n[0]),a=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Rt(o,n[0]),n=n.slice(1),a=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=xt([],a?i.modifiers:i.groups);var u=n[0];if(1===e.length&&(i={groups:t},a=!1),a){var c=i.modifiers.map((function(t){return t.id===u?kt({},r):kt({},t)}));i.modifiers=c}else{var l=i.groups.map((function(t){return t.id===u?kt({},r):kt({},t)}));i.groups=l}return 1===e.length?xt([],i.groups):xt([],t)},Rt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Bt=function(){return(Bt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ut=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Mt=function(t,e,r,n,o){var i=Bt(Bt({},r),{amount:n,touched:!0,errors:d(r,n,o),totals:ae(Bt(Bt({},r.data),{amount:n})),data:Bt(Bt({},r.data),{amount:n})});return i.status=g(i),Ct(t,e,i)},Dt=function(t,e,r,n){var o=r.slice(0,-1),i=Tt(e,o),a=Ut([],i.modifiers);"RADIO"!==i.type||n||(a=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Bt({},t):Bt(Bt({},t),{amount:0,error:"",totals:ae(Bt(Bt({},t.data),{amount:0})),data:Bt(Bt({},t.data),{amount:0})})})));var u=(a=a.map((function(e){var o=x(e.data),i=Ut(Ut([],r.slice(0,-1)),[e.id]),a=Bt(Bt({},e),{groups:qt(o,{rootId:t,path:i},e.groups)});return a.errors=d(a,a.amount,n),a.status=g(a),a}))).map((function(t){return Bt({},t.data)})),c=Bt(Bt({},i.data),{answers:u}),l=Bt(Bt({},i),{touched:!0,modifiers:a,data:c});l.errors=h(l,n),l.status=y(l);var s=Ct(e,o,l);return o.length>1&&(s=Yt(t,s,o,n)),s},Yt=function(t,e,r,n){var o=r.slice(0,-1),i=Tt(e,o),a=i.groups.map((function(t){return Bt({},t.data)})),u=Bt(Bt({},i.data),{questions:a}),c=i.groups.map((function(t){var e=Bt({},t);return e.errors=h(e,n),e.status=y(e),e})),l=Bt(Bt({},i),{touched:!0,groups:c,data:u});l.errors=d(l,l.amount,n),l.status=g(l);var s=Ct(e,o,l);return o.length>1&&(s=Dt(t,s,o,n)),s},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(){return(Nt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},qt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Ft(e,{amount:t.amount,rootId:n,path:Ht([],o)},i)}))},Ft=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,a=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,f=e.path,d=null!=r?r:{},h=d.errors,g=d.touched,b={id:n,name:o,description:null!=i?i:"",images:Ht([],null!=c?c:[]),data:Nt({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:p(t)},v={rootId:s,max:a,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Ht(Ht([],f),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return zt(t,v,e)})),m=Nt(Nt({},b),{modifiers:O});return Nt(Nt({},m),{status:y(m)})},zt=function(t,e,r){var n,o,i=t.productId,a=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,d=x(t),h=e.rootId,y=e.path,b=Ht(Ht([],y),[i]),O=qt(d,{rootId:h,path:b},null==r?void 0:r.groups),m={id:i,groupId:a,name:u,images:Ht([],c),amount:l,data:Nt({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:ae(Nt(Nt({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Lt({},Object(C.getState)().forms),i=o[t],a=Tt(i.renderer,e),u=Mt(i.renderer,e,a,r,!1);u=Dt(t,u,e,!1);var c=Gt(u,i.product),l=Lt(Lt({},i),{renderer:u,product:c,status:v(u)}),s=Lt(Lt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Lt({},l);delete f.callback,i.callback(f)}(e.rootId,b,t)}};return Nt(Nt({},m),{status:g(m)})},Vt=function(){return(Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r=I(e);return Vt(Vt({},r),{questionsAndAnswers:$t(t),updatedAt:""})},$t=function(t){return t.map((function(t){return Vt(Vt({},t.data),{answers:Wt(t.modifiers)})}))},Wt=function(t){return t.map((function(t){return t.amount?Vt(Vt({},t.data),{questionsAndAnswers:$t(t.groups)}):Vt(Vt({},t.data),{questionsAndAnswers:[]})}))},Kt=function(){return(Kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jt=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return u("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var e,r=_(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=qt(r,{rootId:r.productId,path:[]});return{product:Gt(n,t),renderer:n,validate:function(){return te(t.productId)},status:v(n)}}(t),a=Kt(Kt({},o),((r={})[n]=Kt(Kt({},i),{callback:e}),r));return Object(C.setState)({forms:a}),e(Kt({},i)),function(){return Qt(n)}},Qt=function(t){var e=Object(C.getState)().forms,r=Kt({},e);delete r[t],Object(C.setState)({forms:r})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},te=function(t){var e,r=Zt({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,a=n.product,u=Xt([],o);o.forEach((function(e){var r=[e.id];u=ee(e,u,t,r)}));var c=Gt(u,a),l=Zt(Zt({},n),{renderer:u,product:c,status:v(u)}),s=Zt(Zt({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=Zt({},l);return delete f.callback,i(f),l.status},ee=function(t,e,r,n){var o=t.modifiers,i=t.id,a=!o.length,u=Xt([],e);return a?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),u):(o.forEach((function(t){var e=Xt(Xt([],n),[t.id]);u=re(t,u,r,e)})),u)},re=function(t,e,r,n){var o=t.groups,i=t.amount,a=t.status,u=t.required,c=!o.length||0===i,l=Xt([],e);if(c){var s="IDLE"===a&&u||"FAIL"===a||"INCOMPLETE"===a?"FAIL":a,f=Zt(Zt({},t),{status:s}),p=Xt([],n);l=Mt(l,p,f,f.amount,!0),l=Dt(r,l,p,!0)}else o.forEach((function(t){var e=Xt(Xt([],n),[t.id]);l=ee(t,l,r,e)}));return l},ne=function(){return(ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oe=!1,ie=function(t,e){if(void 0===e&&(e={}),oe)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(Object(C.setState)(ne({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(oe=!0)}},ae=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?w(r):t;return{unitGrossPrice:le(n,1),unitTotalDiscounts:se(n,1),unitTotalTaxes:ue(n,1),unitNetPrice:fe(n,1),amount:e,grossPrice:le(n,e),totalDiscounts:se(n,e),totalTaxes:ue(n,e),netPrice:fe(n,e)}},ue=function(t,e){var r=I(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice,c=he(a,u);return ce(r,e)+c*o},ce=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice;return t+o*(he(a,u)+ce(r,e))}),0)*e}),0)},le=function(t,e){return pe(t,"grossPrice",e)},se=function(t,e){return 0},fe=function(t,e){return pe(t,"netPrice",e)},pe=function(t,e,r){var n=I(t,{amount:r}),o=n.prices,i=n.amount,a=o[n.priceCategory][e];return(de(n,e)+a)*i},de=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+de(r,e))}),0)}),0)},he=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(B)}])},function(t,e,r){t.exports=function(){"use strict";var t="millisecond",e="second",r="minute",n="hour",o="day",i="week",a="month",u="quarter",c="year",l="date",s=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},d=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},h={s:d,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+d(n,2,"0")+":"+d(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,a),i=r-o<0,u=e.clone().add(n+(i?-1:1),a);return+(-(n+(r-o)/(i?o-u:u-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(s){return{M:a,y:c,w:i,d:o,D:l,h:n,m:r,s:e,ms:t,Q:u}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",g={};g[y]=p;var b=function(t){return t instanceof w},v=function(t,e,r){var n;if(!t)return y;if("string"==typeof t)g[t]&&(n=t),e&&(g[t]=e,n=t);else{var o=t.name;g[o]=t,n=o}return!r&&n&&(y=n),n||!r&&y},O=function(t,e){if(b(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new w(r)},m=h;m.l=v,m.i=b,m.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var w=function(){function p(t){this.$L=v(t.locale,null,!0),this.parse(t)}var d=p.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(m.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(s);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return m},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},d.isAfter=function(t,e){return O(t)<this.startOf(e)},d.isBefore=function(t,e){return this.endOf(e)<O(t)},d.$g=function(t,e,r){return m.u(t)?this[e]:this.set(r,t)},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(t,u){var s=this,f=!!m.u(u)||u,p=m.p(t),d=function(t,e){var r=m.w(s.$u?Date.UTC(s.$y,e,t):new Date(s.$y,e,t),s);return f?r:r.endOf(o)},h=function(t,e){return m.w(s.toDate()[t].apply(s.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(e)),s)},y=this.$W,g=this.$M,b=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case c:return f?d(1,0):d(31,11);case a:return f?d(1,g):d(0,g+1);case i:var O=this.$locale().weekStart||0,w=(y<O?y+7:y)-O;return d(f?b-w:b+(6-w),g);case o:case l:return h(v+"Hours",0);case n:return h(v+"Minutes",1);case r:return h(v+"Seconds",2);case e:return h(v+"Milliseconds",3);default:return this.clone()}},d.endOf=function(t){return this.startOf(t,!1)},d.$set=function(i,u){var s,f=m.p(i),p="set"+(this.$u?"UTC":""),d=(s={},s[o]=p+"Date",s[l]=p+"Date",s[a]=p+"Month",s[c]=p+"FullYear",s[n]=p+"Hours",s[r]=p+"Minutes",s[e]=p+"Seconds",s[t]=p+"Milliseconds",s)[f],h=f===o?this.$D+(u-this.$W):u;if(f===a||f===c){var y=this.clone().set(l,1);y.$d[d](h),y.init(),this.$d=y.set(l,Math.min(this.$D,y.daysInMonth())).$d}else d&&this.$d[d](h);return this.init(),this},d.set=function(t,e){return this.clone().$set(t,e)},d.get=function(t){return this[m.p(t)]()},d.add=function(t,u){var l,s=this;t=Number(t);var f=m.p(u),p=function(e){var r=O(s);return m.w(r.date(r.date()+Math.round(e*t)),s)};if(f===a)return this.set(a,this.$M+t);if(f===c)return this.set(c,this.$y+t);if(f===o)return p(1);if(f===i)return p(7);var d=(l={},l[r]=6e4,l[n]=36e5,l[e]=1e3,l)[f]||1,h=this.$d.getTime()+t*d;return m.w(h,this)},d.subtract=function(t,e){return this.add(-1*t,e)},d.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=m.z(this),o=this.$locale(),i=this.$H,a=this.$m,u=this.$M,c=o.weekdays,l=o.months,s=function(t,n,o,i){return t&&(t[n]||t(e,r))||o[n].substr(0,i)},p=function(t){return m.s(i%12||12,t,"0")},d=o.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},h={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:m.s(u+1,2,"0"),MMM:s(o.monthsShort,u,l,3),MMMM:s(l,u),D:this.$D,DD:m.s(this.$D,2,"0"),d:String(this.$W),dd:s(o.weekdaysMin,this.$W,c,2),ddd:s(o.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(i),HH:m.s(i,2,"0"),h:p(1),hh:p(2),a:d(i,a,!0),A:d(i,a,!1),m:String(a),mm:m.s(a,2,"0"),s:String(this.$s),ss:m.s(this.$s,2,"0"),SSS:m.s(this.$ms,3,"0"),Z:n};return r.replace(f,(function(t,e){return e||h[t]||n.replace(":","")}))},d.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},d.diff=function(t,l,s){var f,p=m.p(l),d=O(t),h=6e4*(d.utcOffset()-this.utcOffset()),y=this-d,g=m.m(this,d);return g=(f={},f[c]=g/12,f[a]=g,f[u]=g/3,f[i]=(y-h)/6048e5,f[o]=(y-h)/864e5,f[n]=y/36e5,f[r]=y/6e4,f[e]=y/1e3,f)[p]||y,s?g:m.a(g)},d.daysInMonth=function(){return this.endOf(a).$D},d.$locale=function(){return g[this.$L]},d.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=v(t,e,!0);return n&&(r.$L=n),r},d.clone=function(){return m.w(this.$d,this)},d.toDate=function(){return new Date(this.valueOf())},d.toJSON=function(){return this.isValid()?this.toISOString():null},d.toISOString=function(){return this.$d.toISOString()},d.toString=function(){return this.$d.toUTCString()},p}(),P=w.prototype;return O.prototype=P,[["$ms",t],["$s",e],["$m",r],["$H",n],["$W",o],["$M",a],["$y",c],["$D",l]].forEach((function(t){P[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,w,O),t.$i=!0),O},O.locale=v,O.isDayjs=b,O.unix=function(t){return O(1e3*t)},O.en=g[y],O.Ls=g,O.p={},O}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(11),o=r(2).utf8,i=r(2).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(6).Buffer)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e),o(r(25),e),o(r(26),e),o(r(27),e),o(r(28),e),o(r(29),e),o(r(30),e)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";(function(t){
37
+ e.read=function(t,e,r,n,o){var a,i,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,y=t[e+f];for(f+=p,a=y&(1<<-s)-1,y>>=-s,s+=u;s>0;a=256*a+t[e+f],f+=p,s-=8);for(i=a&(1<<-s)-1,a>>=-s,s+=n;s>0;i=256*i+t[e+f],f+=p,s-=8);if(0===a)a=1-l;else{if(a===c)return i?NaN:1/0*(y?-1:1);i+=Math.pow(2,n),a-=l}return(y?-1:1)*i*Math.pow(2,a-n)},e.write=function(t,e,r,n,o,a){var i,u,c,l=8*a-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,d=n?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,i=s):(i=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-i))<1&&(i--,c*=2),(e+=i+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=s?(u=0,i=s):i+f>=1?(u=(e*c-1)*Math.pow(2,o),i+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;t[r+y]=255&u,y+=d,u/=256,o-=8);for(i=i<<o|u,l+=o;l>0;t[r+y]=255&i,y+=d,i/=256,l-=8);t[r+y-d]|=128*h}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)8*n+6*a<=8*t.length?e.push(r.charAt(o>>>6*(3-a)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return T})),r.d(e,"getProductDetails",(function(){return ht})),r.d(e,"getProducts",(function(){return Ot})),r.d(e,"getRecommendedProducts",(function(){return mt})),r.d(e,"getRelatedProducts",(function(){return wt})),r.d(e,"getStoreDetails",(function(){return St})),r.d(e,"registerModifiersForm",(function(){return Gt})),r.d(e,"validateProduct",(function(){return Qt})),r.d(e,"initProducts",(function(){return ne})),r.d(e,"closeProducts",(function(){return oe})),r.d(e,"getProductTotals",(function(){return ae})),r.d(e,"transformers",(function(){return a})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return i})),r.d(n,"isProductDetails",(function(){return u})),r.d(n,"isCartProduct",(function(){return c})),r.d(n,"isFormCartProduct",(function(){return l}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return O})),r.d(o,"divideProductQA",(function(){return m})),r.d(o,"operationOnProductQA",(function(){return w}));var a={};r.r(a),r.d(a,"toCartProduct",(function(){return P})),r.d(a,"toFormCartProduct",(function(){return x})),r.d(a,"toFormCartProductHelper",(function(){return k})),r.d(a,"toFormCartProductFromProductDetails",(function(){return _})),r.d(a,"toFormCartProductFromAnswer",(function(){return E})),r.d(a,"normalizeProductDetails",(function(){return A}));var i=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,a=t.prices,i=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof i&&!("object"!=typeof a||"object"==typeof a&&Object.keys(a).length<1)&&!!Array.isArray(o)},u=function(t){if(!i(t))return!1;var e=t.questions;return!!Array.isArray(e)},c=function(t){if(!u(t))return!1;var e=t.hash,r=t.createdAt,n=t.updatedAt,o=t.amount,a=t.priceCategory,i=t.comment,c=t.questionsAndAnswers;return"string"==typeof e&&"string"==typeof r&&"string"==typeof n&&"number"==typeof o&&"string"==typeof i&&!!["NORMAL","POINTS"].includes(a)&&!!Array.isArray(c)},l=function(t){var e;if(!c(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},s=function(t){console.error(t)},f=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},p=function(t,e,r){var n=[],o=t.max,a=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<a&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+a}),n},y=function(t,e){var r=[],n=t.modifiers,o=t.data,a=o.min,i=o.max;0===a&&0===i&&(i=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>i&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+i}),e&&u<a&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+a}),r},d=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,a=t.modifiers,i=o.min,u=a.some((function(t){return"FAIL"===t.status})),c=a.some((function(t){return"IDLE"===t.status})),l=a.some((function(t){return"INCOMPLETE"===t.status})),s=a.reduce((function(t,e){return t+e.amount}),0);return g({touched:e,errors:r,required:n,min:i,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},h=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,a=t.errors,i=t.required,u=t.min,c=t.amount;return g({touched:o,errors:a,required:i,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},g=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,a=t.amount,i=t.reviewChildren,u=t.childrenWithError,c=t.childrenIdle,l=t.childrenIncomplete,f=a>0&&!e;return f||e||!n?f||e||n?r.length||i&&u?"FAIL":i&&(c||l)||a<o?"INCOMPLETE":a>=o?"OK":(s("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:a},void 0,2)),"FAIL"):"OK":"IDLE"},b=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},v=function(){return(v=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},O=function(t){return w(t,(function(t,e){var r=t.amount*e,n=O(v(v({},t),{amount:r}));return v(v({},n),{amount:t.amount*e})}))},m=function(t){return w(t,(function(t,e){var r=m(t);return v(v({},r),{amount:t.amount/e})}))},w=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,a=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return v(v({},t),{answers:r})}));return v(v({},t),{questionsAndAnswers:a})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},P=function(t,e){if(void 0===e&&(e={}),c(t))return j(j({},t),e);if(u(t))return I(t,e);var r=S(t);return I(r,e)},I=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,a=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=a?a:0,priceCategory:null!=o?o:"NORMAL",comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},S=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},x=function(t,e){if(void 0===e&&(e={}),l(t))return j(j({},t),e);if(u(t))return _(t,e);var r=S(t);return _(r,e)},k=function(t,e){void 0===e&&(e={});var r=m(t),n=r.priceCategory,o=r.productId,a=r.amount,i=r.questions.map((function(t){var e,i=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=i?i:t,c=u.questionId,l=u.min,s=u.max,p={rootId:o,min:l,max:s,type:f(u),modifiersCount:t.answers.length,amount:a,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==i?void 0:i.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,a=function(t){return 1===t.modifiersCount?t.min:0}(p),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(p),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:a,max:u,groupType:p.type,type:o.renderType}),s=o.questions.length,f=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:a,max:u,renderType:l});return j(j({},f),{questions:s?k(f).questions:[]})}))})}));return j(j(j({},r),{questions:i}),e)},_=function(t,e){void 0===e&&(e={});var r=I(t);return k(r,e)},E=function(t,e){return void 0===e&&(e={}),k(t,e)},A=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},T=function(){console.log("Not supported yet")},C=r(0),R=function(){return(R=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},B=["page","vendor","store","catalogue","category","product"],U=["price","query","tags","manufacturerId","weight","dimensions"],M=["type","method"],H=["vendorId","storeId","catalogueId","categoryId","productId"],L=["category"],D=["asc","desc"],Y=["alphabetic","price","predefined"],N=function(t){var e=q(t),r=F(e),n=z(r),o=V(n);return $(o)},q=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),a=o.catalogueId,i=o.categoryId,u=o.productId,c=R(R({},{vendorId:r,storeId:n,catalogueId:a,categoryId:i,productId:u}),t.filterBy),l=G(c,H,"filter"),s=K(l);return R(R({},t),{filterBy:s})},F=function(t){var e=W(t,L,"groupBy");return R({},e)},z=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=G(r,M,"orderBy"),o=R({},n),a=r.method,i=r.type;return i&&!Y.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+i),Y.includes(i)||(delete o.type,o.type="predefined"),a&&!D.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+a),D.includes(a)||(delete o.method,o.method="asc"),R(R({},t),{orderBy:o})},V=function(t){var e=t.pagination,r=G(void 0===e?{}:e,B,"pagination"),n=R({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,R(R({},t),{pagination:n})},$=function(t){var e=t.additionalFilters,r=G(void 0===e?{}:e,U,"additionalFilters");return R(R({},t),{additionalFilters:r})},G=function(t,e,r){var n=R({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},W=function(t,e,r){var n=R({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},K=function(t){var e=R({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&J(n[0])||J(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},J=function(t){var e=typeof t;return"number"===e||"string"===e},Q=(r(3),function(){return(Q=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),Z=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,a=t.filterBy,i=a.vendorId,u=a.storeId,c=a.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(i,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=N(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,a=e.additionalFilters,i=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],a=e[1],i=a;return Array.isArray(a)&&(i=a.reduce((function(t,e){return t+","+e}))),Q(Q({},t),"catalogueId"===o?((r={})[o]=i,r.channelId=i,r):((n={})[o]=i,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(i),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?Q(Q({},t),((r={})[n]=o,r)):t}),{})}(a),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],a=void 0===n?{}:n;return"page"===r?Q(Q({},t),{page:a}):"product"===r?Q(Q({},t),o?{productsByGroup:a.size}:{size:a.size}):"category"===r?Q(Q({},t),{size:a.size}):t}),{})}(u),p=Q(Q(Q(Q(Q({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var y=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var a=o[n],i=a[0],u=a[1],c=new RegExp("/:"+i,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),d=Object(C.getState)().artisanApp,h=(null!=d?d:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),h+"/"+y+"?");return Q(Q({},r),{url:g,query:p})}(t,e,r)},X=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{i(n.next(t))}catch(t){e(t)}}function a(t){try{i(n.throw(t))}catch(t){e(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,a)}i((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var e,r,n,o,a,i;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return a=u.sent(),[3,4];case 3:return i=u.sent(),a={code:null,status:"failed",message:i.message,stack:i.stack},[3,4];case 4:if(a.code<200||a.code>299)throw new Error(JSON.stringify({code:a.code,status:a.status,message:a.message,warnings:a.warning,stack:a.stack}));return[2,a]}}))}))},tt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{i(n.next(t))}catch(t){e(t)}}function a(t){try{i(n.throw(t))}catch(t){e(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,a)}i((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(e){switch(e.label){case 0:return[4,X(t)];case 1:return[2,e.sent()]}}))}))},et=r(4),rt=function(){return(rt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},nt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},ot=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},at={"Content-Type":"application/json"},it=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),nt(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,c,l,s,f,p,y,d,h,g,b,v,O,m;return ot(this,(function(w){switch(w.label){case 0:return r=Object(C.getState)(),n=r.artisanApp,o=r.accountId,a=n.settings,i=a.platform,u=a.accountId,c=null!==(g=null!==(h=null!==(d=null===(y=e.account)||void 0===y?void 0:y.toString())&&void 0!==d?d:null==o?void 0:o.toString())&&void 0!==h?h:null==u?void 0:u.toString())&&void 0!==g?g:"",l=null!==(v=null!==(b=e.Platform)&&void 0!==b?b:i)&&void 0!==v?v:"",s=l,null===(O=e.Authorization)||void 0===O?[3,1]:(p=O,[3,3]);case 1:return[4,ut(t)];case 2:p=w.sent(),w.label=3;case 3:return f=null!==(m=p)&&void 0!==m?m:"",[2,new Headers(rt(rt(rt({},at),e),{Authorization:f,Platform:s,account:c}))]}}))}))},ut=function(t,e){return void 0===t&&(t=!0),nt(void 0,void 0,void 0,(function(){var r,n,o;return ot(this,(function(a){switch(a.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(et.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=a.sent())||t?!n&&t?(s("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},ct=r(1),lt=function(){return(lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},st=function(t,e){var r=N(e).pagination,n=t.pagination;return lt(lt({},t),{pagination:ft(r,n)})},ft=function(t,e){return lt(lt({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},dt=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},ht=function(t,e){return yt(void 0,void 0,void 0,(function(){var r,n,o;return dt(this,(function(a){switch(a.label){case 0:return[4,it(!1)];case 1:return r=a.sent(),n=Z("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(ct.handleHttpCache)(n,(function(t){return yt(void 0,void 0,void 0,(function(){var e,r;return dt(this,(function(n){switch(n.label){case 0:return[4,tt(t)];case 1:return e=n.sent(),r=A(e.data),[2,pt(pt({},e),{data:r})]}}))}))}))];case 2:return o=a.sent(),[2,st(o,e)]}}))}))},gt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{i(n.next(t))}catch(t){e(t)}}function a(t){try{i(n.throw(t))}catch(t){e(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,a)}i((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(e){switch(e.label){case 0:return[4,X(t)];case 1:return[2,e.sent()]}}))}))},bt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},vt=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Ot=function(t){return bt(void 0,void 0,void 0,(function(){var e,r,n;return vt(this,(function(o){switch(o.label){case 0:return[4,it(!1)];case 1:return e=o.sent(),r=Z("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ct.handleHttpCache)(r,(function(t){return bt(void 0,void 0,void 0,(function(){return vt(this,(function(e){switch(e.label){case 0:return[4,gt(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,st(n,t)]}}))}))},mt=function(){console.log("Not implemented yet")},wt=function(){console.log("not implemented yet")},jt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{i(n.next(t))}catch(t){e(t)}}function a(t){try{i(n.throw(t))}catch(t){e(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,a)}i((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(e){switch(e.label){case 0:return[4,X(t)];case 1:return[2,e.sent()]}}))}))},Pt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},It=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},St=function(t){return Pt(void 0,void 0,void 0,(function(){var e,r,n;return It(this,(function(o){switch(o.label){case 0:return[4,it(!1)];case 1:return e=o.sent(),r=Z("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ct.handleHttpCache)(r,(function(t){return Pt(void 0,void 0,void 0,(function(){return It(this,(function(e){switch(e.label){case 0:return[4,jt(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,st(n,t)]}}))}))},xt=function(){return(xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},_t=function(t,e){for(var r=kt([],e),n=t,o=t[0];r.length;)o=At(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Et=function(t,e,r){for(var n=kt([],e),o=t,a=At(o,n[0]),i=Object.prototype.hasOwnProperty.call(a,"modifiers");n.length>1;)a=At(o,n[0]),n=n.slice(1),i=Object.prototype.hasOwnProperty.call(a,"modifiers"),o=kt([],i?a.modifiers:a.groups);var u=n[0];if(1===e.length&&(a={groups:t},i=!1),i){var c=a.modifiers.map((function(t){return t.id===u?xt({},r):xt({},t)}));a.modifiers=c}else{var l=a.groups.map((function(t){return t.id===u?xt({},r):xt({},t)}));a.groups=l}return 1===e.length?kt([],a.groups):kt([],t)},At=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Tt=function(){return(Tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ct=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Rt=function(t,e,r,n,o){var a=Tt(Tt({},r),{amount:n,touched:!0,errors:p(r,n,o),totals:ae(Tt(Tt({},r.data),{amount:n})),data:Tt(Tt({},r.data),{amount:n})});return a.status=h(a),Et(t,e,a)},Bt=function(t,e,r,n){var o=r.slice(0,-1),a=_t(e,o),i=Ct([],a.modifiers);"RADIO"!==a.type||n||(i=a.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Tt({},t):Tt(Tt({},t),{amount:0,error:"",totals:ae(Tt(Tt({},t.data),{amount:0})),data:Tt(Tt({},t.data),{amount:0})})})));var u=(i=i.map((function(e){var o=E(e.data),a=Ct(Ct([],r.slice(0,-1)),[e.id]),i=Tt(Tt({},e),{groups:Dt(o,{rootId:t,path:a},e.groups)});return i.errors=p(i,i.amount,n),i.status=h(i),i}))).map((function(t){return Tt({},t.data)})),c=Tt(Tt({},a.data),{answers:u}),l=Tt(Tt({},a),{touched:!0,modifiers:i,data:c});l.errors=y(l,n),l.status=d(l);var s=Et(e,o,l);return o.length>1&&(s=Ut(t,s,o,n)),s},Ut=function(t,e,r,n){var o=r.slice(0,-1),a=_t(e,o),i=a.groups.map((function(t){return Tt({},t.data)})),u=Tt(Tt({},a.data),{questions:i}),c=a.groups.map((function(t){var e=Tt({},t);return e.errors=y(e,n),e.status=d(e),e})),l=Tt(Tt({},a),{touched:!0,groups:c,data:u});l.errors=p(l,l.amount,n),l.status=h(l);var s=Et(e,o,l);return o.length>1&&(s=Bt(t,s,o,n)),s},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(){return(Ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Dt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var a=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Yt(e,{amount:t.amount,rootId:n,path:Lt([],o)},a)}))},Yt=function(t,e,r){var n=t.questionId,o=t.name,a=t.description,i=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,p=e.path,y=null!=r?r:{},h=y.errors,g=y.touched,b={id:n,name:o,description:null!=a?a:"",images:Lt([],null!=c?c:[]),data:Ht({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:f(t)},v={rootId:s,max:i,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Lt(Lt([],p),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return Nt(t,v,e)})),m=Ht(Ht({},b),{modifiers:O});return Ht(Ht({},m),{status:d(m)})},Nt=function(t,e,r){var n,o,a=t.productId,i=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,y=E(t),d=e.rootId,g=e.path,v=Lt(Lt([],g),[a]),O=Dt(y,{rootId:d,path:v},null==r?void 0:r.groups),m={id:a,groupId:i,name:u,images:Lt([],c),amount:l,data:Ht({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:ae(Ht(Ht({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Mt({},Object(C.getState)().forms),a=o[t],i=_t(a.renderer,e),u=Rt(a.renderer,e,i,r,!1);u=Bt(t,u,e,!1);var c=Ft(u,a.product),l=Mt(Mt({},a),{renderer:u,product:c,status:b(u)}),s=Mt(Mt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Mt({},l);delete f.callback,a.callback(f)}(e.rootId,v,t)}};return Ht(Ht({},m),{status:h(m)})},qt=function(){return(qt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ft=function(t,e){var r=P(e);return qt(qt({},r),{questionsAndAnswers:zt(t),updatedAt:""})},zt=function(t){return t.map((function(t){return qt(qt({},t.data),{answers:Vt(t.modifiers)})}))},Vt=function(t){return t.map((function(t){return t.amount?qt(qt({},t.data),{questionsAndAnswers:zt(t.groups)}):qt(qt({},t.data),{questionsAndAnswers:[]})}))},$t=function(){return($t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return s("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var a=function(t){var e,r=x(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=Dt(r,{rootId:r.productId,path:[]});return{product:Ft(n,t),renderer:n,validate:function(){return Qt(t.productId)},status:b(n)}}(t),i=$t($t({},o),((r={})[n]=$t($t({},a),{callback:e}),r));return Object(C.setState)({forms:i}),e($t({},a)),function(){return Wt(n)}},Wt=function(t){var e=Object(C.getState)().forms,r=$t({},e);delete r[t],Object(C.setState)({forms:r})},Kt=function(){return(Kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Qt=function(t){var e,r=Kt({},Object(C.getState)().forms),n=r[t],o=n.renderer,a=n.callback,i=n.product,u=Jt([],o);o.forEach((function(e){var r=[e.id];u=Zt(e,u,t,r)}));var c=Ft(u,i),l=Kt(Kt({},n),{renderer:u,product:c,status:b(u)}),s=Kt(Kt({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=Kt({},l);return delete f.callback,a(f),l.status},Zt=function(t,e,r,n){var o=t.modifiers,a=t.id,i=!o.length,u=Jt([],e);return i?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+a+" of product 0."),u):(o.forEach((function(t){var e=Jt(Jt([],n),[t.id]);u=Xt(t,u,r,e)})),u)},Xt=function(t,e,r,n){var o=t.groups,a=t.amount,i=t.status,u=t.required,c=!o.length||0===a,l=Jt([],e);if(c){var s="IDLE"===i&&u||"FAIL"===i||"INCOMPLETE"===i?"FAIL":i,f=Kt(Kt({},t),{status:s}),p=Jt([],n);l=Rt(l,p,f,f.amount,!0),l=Bt(r,l,p,!0)}else o.forEach((function(t){var e=Jt(Jt([],n),[t.id]);l=Zt(t,l,r,e)}));return l},te={artisanApp:void 0,forms:{},accountId:void 0},ee=function(){return(ee=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},re=!1,ne=function(t,e){void 0===e&&(e={}),re?console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once"):(Object(C.initState)(te),Object(C.setState)(ee({artisanApp:t},e)),Object(ct.initCache)({timeout:e.timeout}),"undefined"==typeof window||(re=!0))},oe=function(){Object(C.setState)(ee({},te)),re=!1},ae=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?m(r):t;return{unitGrossPrice:ce(n,1),unitTotalDiscounts:le(n,1),unitTotalTaxes:ie(n,1),unitNetPrice:se(n,1),amount:e,grossPrice:ce(n,e),totalDiscounts:le(n,e),totalTaxes:ie(n,e),netPrice:se(n,e)}},ie=function(t,e){var r=P(t,{amount:e}),n=r.prices,o=r.amount,a=n[r.priceCategory],i=a.taxes,u=a.grossPrice,c=ye(i,u);return ue(r,e)+c*o},ue=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,a=n[r.priceCategory],i=a.taxes,u=a.grossPrice;return t+o*(ye(i,u)+ue(r,e))}),0)*e}),0))&&void 0!==n?n:0},ce=function(t,e){return fe(t,"grossPrice",e)},le=function(t,e){return 0},se=function(t,e){return fe(t,"netPrice",e)},fe=function(t,e,r){var n=P(t,{amount:r}),o=n.prices,a=n.amount,i=o[n.priceCategory][e];return(pe(n,e)+i)*a},pe=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+pe(r,e))}),0)}),0))&&void 0!==n?n:0},ye=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)}}])},function(t,e,r){t.exports=function(){"use strict";var t="millisecond",e="second",r="minute",n="hour",o="day",a="week",i="month",u="quarter",c="year",l="date",s=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},d={s:y,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+y(n,2,"0")+":"+y(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,i),a=r-o<0,u=e.clone().add(n+(a?-1:1),i);return+(-(n+(r-o)/(a?o-u:u-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(s){return{M:i,y:c,w:a,d:o,D:l,h:n,m:r,s:e,ms:t,Q:u}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},h="en",g={};g[h]=p;var b=function(t){return t instanceof w},v=function(t,e,r){var n;if(!t)return h;if("string"==typeof t)g[t]&&(n=t),e&&(g[t]=e,n=t);else{var o=t.name;g[o]=t,n=o}return!r&&n&&(h=n),n||!r&&h},O=function(t,e){if(b(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new w(r)},m=d;m.l=v,m.i=b,m.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var w=function(){function p(t){this.$L=v(t.locale,null,!0),this.parse(t)}var y=p.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(m.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(s);if(n){var o=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return m},y.isValid=function(){return!("Invalid Date"===this.$d.toString())},y.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},y.isAfter=function(t,e){return O(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<O(t)},y.$g=function(t,e,r){return m.u(t)?this[e]:this.set(r,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,u){var s=this,f=!!m.u(u)||u,p=m.p(t),y=function(t,e){var r=m.w(s.$u?Date.UTC(s.$y,e,t):new Date(s.$y,e,t),s);return f?r:r.endOf(o)},d=function(t,e){return m.w(s.toDate()[t].apply(s.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(e)),s)},h=this.$W,g=this.$M,b=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case c:return f?y(1,0):y(31,11);case i:return f?y(1,g):y(0,g+1);case a:var O=this.$locale().weekStart||0,w=(h<O?h+7:h)-O;return y(f?b-w:b+(6-w),g);case o:case l:return d(v+"Hours",0);case n:return d(v+"Minutes",1);case r:return d(v+"Seconds",2);case e:return d(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(a,u){var s,f=m.p(a),p="set"+(this.$u?"UTC":""),y=(s={},s[o]=p+"Date",s[l]=p+"Date",s[i]=p+"Month",s[c]=p+"FullYear",s[n]=p+"Hours",s[r]=p+"Minutes",s[e]=p+"Seconds",s[t]=p+"Milliseconds",s)[f],d=f===o?this.$D+(u-this.$W):u;if(f===i||f===c){var h=this.clone().set(l,1);h.$d[y](d),h.init(),this.$d=h.set(l,Math.min(this.$D,h.daysInMonth())).$d}else y&&this.$d[y](d);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[m.p(t)]()},y.add=function(t,u){var l,s=this;t=Number(t);var f=m.p(u),p=function(e){var r=O(s);return m.w(r.date(r.date()+Math.round(e*t)),s)};if(f===i)return this.set(i,this.$M+t);if(f===c)return this.set(c,this.$y+t);if(f===o)return p(1);if(f===a)return p(7);var y=(l={},l[r]=6e4,l[n]=36e5,l[e]=1e3,l)[f]||1,d=this.$d.getTime()+t*y;return m.w(d,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=m.z(this),o=this.$locale(),a=this.$H,i=this.$m,u=this.$M,c=o.weekdays,l=o.months,s=function(t,n,o,a){return t&&(t[n]||t(e,r))||o[n].substr(0,a)},p=function(t){return m.s(a%12||12,t,"0")},y=o.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},d={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:m.s(u+1,2,"0"),MMM:s(o.monthsShort,u,l,3),MMMM:s(l,u),D:this.$D,DD:m.s(this.$D,2,"0"),d:String(this.$W),dd:s(o.weekdaysMin,this.$W,c,2),ddd:s(o.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(a),HH:m.s(a,2,"0"),h:p(1),hh:p(2),a:y(a,i,!0),A:y(a,i,!1),m:String(i),mm:m.s(i,2,"0"),s:String(this.$s),ss:m.s(this.$s,2,"0"),SSS:m.s(this.$ms,3,"0"),Z:n};return r.replace(f,(function(t,e){return e||d[t]||n.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(t,l,s){var f,p=m.p(l),y=O(t),d=6e4*(y.utcOffset()-this.utcOffset()),h=this-y,g=m.m(this,y);return g=(f={},f[c]=g/12,f[i]=g,f[u]=g/3,f[a]=(h-d)/6048e5,f[o]=(h-d)/864e5,f[n]=h/36e5,f[r]=h/6e4,f[e]=h/1e3,f)[p]||h,s?g:m.a(g)},y.daysInMonth=function(){return this.endOf(i).$D},y.$locale=function(){return g[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=v(t,e,!0);return n&&(r.$L=n),r},y.clone=function(){return m.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},p}(),j=w.prototype;return O.prototype=j,[["$ms",t],["$s",e],["$m",r],["$H",n],["$W",o],["$M",i],["$y",c],["$D",l]].forEach((function(t){j[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,w,O),t.$i=!0),O},O.locale=v,O.isDayjs=b,O.unix=function(t){return O(1e3*t)},O.en=g[h],O.Ls=g,O.p={},O}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,a,i;n=r(10),o=r(2).utf8,a=r(2).bin,(i=function(t,r){var i=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),a=8*t.length,i=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[a>>5]|=128<<24-a%32,r[15+(a+64>>>9<<4)]=a;for(var p=0;p<r.length;p+=16){for(var y=u,d=c,h=l,g=s,b=f,v=0;v<80;v++){if(v<16)i[v]=r[p+v];else{var O=i[v-3]^i[v-8]^i[v-14]^i[v-16];i[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(i[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=y,c+=d,l+=h,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?i:r&&r.asString?a.bytesToString(i):n.bytesToHex(i)})._blocksize=16,i._digestsize=20,t.exports=i}).call(this,r(5).Buffer)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";(function(t){
38
38
  /*!
39
39
  * The buffer module from node.js, for the browser.
40
40
  *
41
41
  * @author Feross Aboukhadijeh <http://feross.org>
42
42
  * @license MIT
43
43
  */
44
- var n=r(8),o=r(9),i=r(10);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(7))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
44
+ var n=r(7),o=r(8),a=r(9);function i(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|y(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&a(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|y(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|y(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function y(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return _(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var a,i=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,u/=2,c/=2,r/=2}function l(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var s=-1;for(a=r;a<u;a++)if(l(t,a)===l(e,-1===s?0:a-s)){if(-1===s&&(s=a),a-s+1===c)return s*i}else-1!==s&&(a-=a-s),s=-1}else for(r+c>u&&(r=u-c),a=r;a>=0;a--){for(var f=!0,p=0;p<c;p++)if(l(t,a+p)!==l(e,p)){f=!1;break}if(f)return a}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(isNaN(u))return i;t[r+i]=u}return i}function m(t,e,r,n){return q(Y(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function j(t,e,r,n){return w(t,e,r,n)}function P(t,e,r,n){return q(N(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,a=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var a,i,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(a=t[o+1]))&&(c=(31&l)<<6|63&a)>127&&(s=c);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(c=(15&l)<<12|(63&a)<<6|63&i)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(c=(15&l)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function E(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=e;a<r;++a)o+=D(t[a]);return o}function A(t,e,r){for(var n=t.slice(e,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,a){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,a=Math.min(t.length-r,2);o<a;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,a=Math.min(t.length-r,4);o<a;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,a){return a||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,a){return a||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=i(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):h.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(e>>>=0),u=Math.min(a,i),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){a=l[f],i=s[f];break}return a<i?-1:i<a?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return j(this,t,e,r);case"base64":return P(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,a=0;++a<e&&(o*=256);)n+=this[t+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a<r&&(o*=256);)this[e+a]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a<r&&(i*=256);)t<0&&0===u&&0!==this[e+a-1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,a=n-r;if(this===t&&r<e&&e<n)for(o=a-1;o>=0;--o)t[o+e]=this[o+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var i=c.isBuffer(t)?t:Y(new c(t,n).toString()),u=i.length;for(a=0;a<r-e;++a)this[a+e]=i[a%u]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){var r;e=e||1/0;for(var n=t.length,o=null,a=[],i=0;i<n;++i){if((r=t.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(6))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),i=n[0],u=n[1],c=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,u)),s=0,f=u>0?i-4:i;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,a=[],i=0,u=r-o;i<u;i+=16383)a.push(s(t,i,i+16383>u?u:i+16383));return 1===o?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),a.join("")};for(var n=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=i.length;u<c;++u)n[u]=i[u],o[i.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,a,i=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(n[(a=o)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
45
45
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
46
- e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},,function(t,e,r){"use strict";r.r(e),r.d(e,"initShoppingCart",(function(){return p})),r.d(e,"closeShoppingCart",(function(){return d})),r.d(e,"listenShoppingCart",(function(){return _})),r.d(e,"getShoppingCart",(function(){return A})),r.d(e,"addProduct",(function(){return it})),r.d(e,"subtractProduct",(function(){return pt})),r.d(e,"removeProduct",(function(){return gt})),r.d(e,"setProduct",(function(){return jt})),r.d(e,"replaceProduct",(function(){return At})),r.d(e,"createShoppingCart",(function(){return xt})),r.d(e,"emptyShoppingCart",(function(){return Bt})),r.d(e,"deleteShoppingCart",(function(){return Mt})),r.d(e,"getShoppingCartTotal",(function(){return J})),r.d(e,"getShoppingCartProducts",(function(){return Q})),r.d(e,"validateShoppingCart",(function(){return Kt})),r.d(e,"setShoppingCartAdditionalInfo",(function(){return Qt})),r.d(e,"getProductHash",(function(){return W})),r.d(e,"UNSAFE_listenBenefitsWallet",(function(){return de})),r.d(e,"listenBenefitsWallet",(function(){return ve})),r.d(e,"applyBenefits",(function(){return Pe})),r.d(e,"redeemCoupon",(function(){return Se})),r.d(e,"useBenefit",(function(){return Ee})),r.d(e,"unuseBenefit",(function(){return Te}));var n="YYYY-MM-DD hh:mm:ss.SSS",o="default",i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a={artisanApp:void 0,accountId:void 0,customerId:void 0,activeShoppingCart:o,maxShoppingCarts:2,wallets:{}};Object.freeze(a);var u=i({},a);Object.seal(u);var c=function(t){u=i(i({},u),t)},l=function(){return i({},u)},s=function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},f=!1,p=function(t,e){void 0===e&&(e={}),f?console.warn("initShoppingCart has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initShoppingCart is only called once "):(c(s({artisanApp:t},e)),"undefined"==typeof window||(f=!0))},d=function(){var t;null===(t=l().artisanApp)||void 0===t||t.__internals__.firestore().terminate(),c(s({},a)),f=!1},h=function(t){if(void 0===t&&(t=""),!l().artisanApp)throw new Error("Artisan app must be provided, you probably forgot to initialize the shopping cart. Please make sure initShoppingCart has been called beforehand. "+t)},y=function(t,e){void 0===e&&(e="");var r=l().accountId;if(void 0===t&&void 0===r)throw new Error("AccountId must be defined. Either provide a global accountId or at the function call level. "+e)},g=function(t,e){void 0===e&&(e="");var r=l().customerId;if(void 0===t&&void 0===r)throw new Error("CustomerId must be defined. Either provide a global customerId or at the function call level. "+e)},b=function(t,e){void 0===e&&(e="");var r=l().store;if(void 0===t&&void 0===r)throw new Error("StoreId must be defined. Either provide a global storeId or at the function call level. "+e)},v=function(t){void 0===t&&(t={});var e=t.accountId,r=t.customerId;y(e),g(r)},O=function(t){var e=t.customerId;!function(t,e){if(void 0===e&&(e=""),void 0===t)throw new Error("VendorId must be defined. Either provide a global vendorId or at the function call level to retrieve a wallet. "+e)}(t.vendorId),g(e)},m=function(t){var e=null!=t?t:{},r=e.Platform,n=e.account;!function(t,e){void 0===e&&(e="");var r=l().artisanApp.settings.platform;if(void 0===t&&void 0===r)throw new Error("Platform must be defined. Either provide a global Plafform in the artisan object or at the function call level. "+e)}(r),y(n)},w=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},P=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},j=o,I=function(t){return void 0===t&&(t={}),w(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s;return P(this,(function(f){switch(f.label){case 0:return e=l(),r=e.artisanApp,n=e.accountId,o=l().customerId,i=t.accountId,a=t.customerId,h(),v(t),u=null==r?void 0:r.__internals__.firestore(),[4,null===(s=null===(c=null==u?void 0:u.collection("shoppingCartByUser"))||void 0===c?void 0:c.doc(String(null!=a?a:o)))||void 0===s?void 0:s.collection(String(null!=i?i:n))];case 1:return[2,f.sent()]}}))}))},S=function(t,e){return w(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=e?e:l().activeShoppingCart,[4,I(t)];case 1:return(n=o.sent())?[4,n.where("name","==",r).get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,o.sent()]}}))}))},A=function(t,e){return w(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=t?t:l().activeShoppingCart,[4,S(e,r)];case 1:return(n=o.sent())?(c({activeShoppingCart:r}),[4,n.data()]):[2];case 2:return[2,o.sent()]}}))}))},_=function(t,e,r){return void 0===r&&(r={}),w(void 0,void 0,void 0,(function(){var n,o;return P(this,(function(i){switch(i.label){case 0:return n=null!=e?e:l().activeShoppingCart,[4,I(r)];case 1:return(o=i.sent())?(c({activeShoppingCart:n}),o.where("name","==",n).onSnapshot((function(e){return w(void 0,void 0,void 0,(function(){var r;return P(this,(function(o){switch(o.label){case 0:return e.docs[0]?[4,e.docs[0].data()]:(n!==j&&console.warn("Failed to fetch a shopping cart with name "+n+" because there wasn't any."),[2,t(void 0)]);case 1:return r=o.sent(),[2,t(r)]}}))}))})),[2]):[2]}}))}))},E=r(1),k=r.n(E),x=r(0),T=function(){return(T=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=o,R=function(t){return void 0===t&&(t=C),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){switch(r.label){case 0:return[4,S({},t)];case 1:return[2,null==(e=r.sent())?void 0:e.id]}}))}))},B=function(t){if(void 0!==t)return"number"==typeof t?t:t.storeId},U=function(t,e){var r=B(t);return T("number"!=typeof t?T({},t):{},e[r])},M=function(t){var e=t.store,r=t.amount,n=B(e);b(n),function(t){if("number"!=typeof t)throw new Error("Invalid amount recieved, please make sure you include a valid amount.");if(t<0)throw new Error("Cannot receive a negative amount of an item. Please ensure you have added a proper amount of items.");if(0===t)throw new Error("Attempting to pass 0 amount. This might indicate a problem with your code. Please ensure you have added a proper amount of items.")}(r)},D=r(3),Y=r.n(D),L=r(4),N=function(t,e,r){var n=e[t],o=r[t];return n>o?1:o>n?-1:0},H=function(t,e){return N("productId",t,e)},q=function(t,e){return N("questionId",t,e)},F=function(t){console.error(t)},z=function(){return(z=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},V=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},G=x.transformers.toCartProduct,$=x.modifierUtils.divideProductQA,W=function(t){var e=$(t),r=e.productId,n=e.questionsAndAnswers,o=e.priceCategory,i=r+"-"+K(n).sort(q).reduce((function(t,e){var r=e.answers.sort(H).reduce((function(t,e,r){var n=e.productId,o=e.amount,i=W(e),a=i?"{"+i+"}":"";return 0===r?n+"="+o+a:t+"|"+n+"="+o+a}),""),n=e.questionId+":"+r;return""===t?""+n:t+"-"+n}),"")+"*"+o;return Y()(i)},K=function(t){return t.reduce((function(t,e){var r=e.answers.filter((function(t){return t.amount>0})).map((function(t){var e=K(t.questionsAndAnswers);return z(z({},t),{questionsAndAnswers:e})}));return V(V([],t),[z(z({},e),{answers:r})])}),[]).filter((function(t){return t.answers.length>0}))},J=function(t,e){void 0===e&&(e={});var r=Q(t).reduce((function(t,e){var r=G(e),n=r.priceCategory,o=Object(x.getProductTotals)(r),i=n===L.PriceCategoryType.POINTS,a=i?o.netPrice:0,u=i?0:o.netPrice,c=i?0:o.grossPrice;return{subtotal:t.subtotal+c,totalDiscounts:t.totalDiscounts+o.totalDiscounts,totalTaxes:t.totalTaxes+o.totalTaxes,totalPoints:t.totalPoints+a,total:t.total+u}}),{subtotal:0,totalDiscounts:0,totalTaxes:0,totalPoints:0,total:0}),n=Z(null==t?void 0:t.additional_info,null==t?void 0:t.benefits,r),o=e.shippingCost,i=void 0===o?t.shippingCost:o;if(!i)return n;var a=i.grossPrice,u=i.netPrice,c=i.taxTotal,l=i.discountTotal;return{subtotal:n.subtotal+a,totalDiscounts:n.totalDiscounts+l,totalTaxes:n.totalTaxes+c,shippingCost:u,totalPoints:n.totalPoints,total:n.total+u}},Q=function(t){return Object.values(t.stores).reduce((function(t,e){var r=Object.values(e.products);return V(V([],t),r)}),[])},Z=function(t,e,r){return e?Object.values(e).reduce((function(e,r){return"DISCOUNT"===r.type?X(r,e,t):e}),r):r},X=function(t,e,r){var n=e.subtotal,o=e.total,i=e.totalDiscounts,a=.01*t.discountPercentage;if(void 0!==(null==r?void 0:r.copayment)){var u=null==r?void 0:r.copayment,c=u*a,l=i+c,s=(u-c).toFixed(4);return z(z({},e),{totalDiscounts:l,total:Number(s)})}var f=n*a,p=i+f,d=o-f;return z(z({},e),{totalDiscounts:p,total:d})},tt=function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},et=n,rt=x.transformers.toCartProduct,nt=x.modifierUtils.multiplyProductQA,ot=x.modifierUtils.divideProductQA,it=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return M(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot add a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=at(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},at=function(t,e,r){var n=e.amount||1,o=rt(e,tt(tt({},r),{amount:null!=n?n:1})),i=rt(e,r),a=l().store,u=r.store,c=null!=u?u:a,s=B(c),f=W(o),p=tt({},t),d=tt({},t.stores),h=U(c,d),y=tt({},h.products),g=y[f],b=k()().format(et);g?(y[f]=ot(y[f]),y[f].amount+=i.amount):(y[f]=i,y[f].hash=f,y[f].createdAt=b),y[f].updatedAt=b;var v=y[f],O=(v=nt(v)).questionsAndAnswers,m=K(O);return y[f]=tt(tt({},v),{questionsAndAnswers:m}),h.products=y,d[s]=h,p.stores=d,p},ut=function(){return(ut=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ct=n,lt=x.transformers.toCartProduct,st=x.modifierUtils.multiplyProductQA,ft=x.modifierUtils.divideProductQA,pt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return M(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot subtract product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=dt(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},dt=function(t,e,r){var n=e.amount||1,o=lt(e,ut(ut({},r),{amount:null!=n?n:1})),i=lt(e,r),a=l().store,u=r.store,c=null!=u?u:a,s=B(c),f=W(o),p=ut({},t),d=ut({},t.stores);if(void 0===d[s])return console.warn("StoreId given is invalid. There is no store with id "+s+" on the shopping cart."),t;var h=U(c,d),y=ut({},h.products),g=y[f],b=k()().format(ct);if(!g)return console.warn("Attempting to subtract the amount of product that is not in the given shopping cart store."),t;y[f]=ft(y[f]);var v=y[f].amount-i.amount;return v>0?(y[f].amount=v,y[f].updatedAt=b,y[f]=st(y[f])):delete y[f],h.products=y,Object.keys(h.products).length?d[s]=h:delete d[s],p.stores=d,p},ht=function(){return(ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yt=x.transformers.toCartProduct,gt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return function(t){var e=t.store,r=B(e);b(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot remove a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=bt(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},bt=function(t,e,r){var n=e.hash;if(!n){var o=yt(e);n=W(o)}var i=l().store,a=r.store,u=null!=a?a:i,c=B(u),s=ht({},t),f=ht({},t.stores);if(void 0===f[c])return console.warn("StoreId given is invalid. There is no store with id "+c+" on the shopping cart."),t;var p=U(u,f),d=ht({},p.products);return d[n]?(delete d[n],p.products=d,Object.keys(p.products).length?f[c]=p:delete f[c],s.stores=f,s):(console.warn("Attempting to remove product that is not in the given shopping cart store."),t)},vt=function(){return(vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ot=n,mt=x.transformers.toCartProduct,wt=x.modifierUtils.multiplyProductQA,Pt=x.modifierUtils.divideProductQA,jt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(f){switch(f.label){case 0:return r=null!==(s=null!==(c=e.amount)&&void 0!==c?c:null===(l=t)||void 0===l?void 0:l.amount)&&void 0!==s?s:1,n=vt(vt({},e),{amount:r}),M(n),o=e.shoppingCartName,[4,S(e,o)];case 1:return(i=f.sent())?[4,i.data()]:(console.warn("Cannot set product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return a=f.sent(),u=It(a,t,n),[4,i.ref.set(u)];case 3:return f.sent(),[2]}}))}))},It=function(t,e,r){var n,o,i=null!==(o=null===(n=e)||void 0===n?void 0:n.amount)&&void 0!==o?o:1,a=mt(e,vt(vt({},r),{amount:i})),u=l().store,c=r.store,s=null!=c?c:u,f=B(s),p=W(a),d=vt({},t),h=vt({},t.stores),y=U(s,h),g=vt({},y.products),b=g[p],v=k()().format(Ot);g[p]=a,b?g[p]=Pt(g[p]):(g[p].createdAt=v,g[p].hash=p),g[p].updatedAt=v;var O=mt(g[p],r),m=(O=wt(O)).questionsAndAnswers,w=K(m);return g[p]=vt(vt({},O),{questionsAndAnswers:w}),y.products=g,h[f]=y,d.stores=h,d},St=function(){return(St=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},At=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return function(t){var e=t.store,r=B(e);b(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot replace product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=_t(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},_t=function(t,e,r){var n=r.hash,o=null!=n?n:e.hash,i=l().store,a=r.store,u=null!=a?a:i,c=B(u),s=St({},t.stores),f=U(u,s),p=St({},f.products);if(!p[o])return console.warn("Cannot replace a product because no product was found in the given store"),t;delete p[o],f.products=p,Object.keys(f.products).length?s[c]=f:delete s[c];var d=St({},t);d.stores=s;var h=St(St({},e),{amount:0});return at(d,h,r)},Et=function(){return(Et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kt=o,xt=function(t,e){return void 0===t&&(t={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(s){switch(s.label){case 0:return[4,I(e)];case 1:return r=s.sent(),n=Tt(t),r?(o=n.name,[4,r.get()]):(console.warn("Couldn't find a shopping cart collection with the given config. Please make sure everything is correct in your configuration before continue."),[2]);case 2:if(i=null===(c=s.sent())||void 0===c?void 0:c.docs.length,a=l().maxShoppingCarts,i>=a)throw new Error("Cannot add more carts. Carts limit ("+a+") reached.");return[4,r.where("name","==",o).get()];case 3:if(s.sent().docs.length>0)throw new Error("Attempted to add a shopping cart with the name "+o+", but there is already one shopping cart with that name.");return[4,r.add(n)];case 4:return(u=s.sent())?[4,u.set(Et(Et({},n),{id:u.id}))]:(console.error("Failed to create a new shopping cart"),[2]);case 5:return s.sent(),[2]}}))}))},Tt=function(t){void 0===t&&(t={});var e=(new Date).toISOString();return Et({id:"",name:kt,latitude:-1,longitude:-1,createdAt:e,updatedAt:e,channelId:1,stores:{},billTotal:{}},t)},Ct=function(){return(Ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rt=o,Bt=function(t,e){return void 0===t&&(t=Rt),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(i){switch(i.label){case 0:return[4,S(e,t)];case 1:return(r=i.sent())?[4,r.data()]:(console.warn("Cannot empty cart, shopping cart nodes not found. Please ensure you have a shopping cart with name "+t+" before continue."),[2]);case 2:return n=i.sent(),o=Ct(Ct({},n),{stores:{}}),[4,r.ref.set(o)];case 3:return i.sent(),[2]}}))}))},Ut=o,Mt=function(t,e){return void 0===t&&(t=Ut),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){switch(n.label){case 0:return[4,S(e,t)];case 1:return(r=n.sent())?[4,r.ref.delete()]:(console.warn("Coundn't find any shopping cart with name "+t+" with the given config."),[2]);case 2:return n.sent(),[2]}}))}))},Dt=r(5),Yt={"Content-Type":"application/json"},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Ht=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},qt=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s,f,p,d,h,y,g;return Ht(this,(function(b){switch(b.label){case 0:return e=l().artisanApp.settings,r=e.platform,n=e.accountId,o=null!==(p=null!==(f=null===(s=null==t?void 0:t.account)||void 0===s?void 0:s.toString())&&void 0!==f?f:null==n?void 0:n.toString())&&void 0!==p?p:"",i=null!==(h=null!==(d=null==t?void 0:t.Platform)&&void 0!==d?d:r)&&void 0!==h?h:"",a=i,null===(y=null==t?void 0:t.Authorization)||void 0===y?[3,1]:(c=y,[3,3]);case 1:return[4,Ft()];case 2:c=b.sent(),b.label=3;case 3:return u=null!==(g=c)&&void 0!==g?g:"",[2,new Headers(Lt(Lt(Lt({},Yt),t),{Authorization:u,Platform:a,account:o}))]}}))}))},Ft=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n;return Ht(this,(function(o){switch(o.label){case 0:return e=l().artisanApp,[4,null===(n=Object(Dt.initAuth)(e).currentUser)||void 0===n?void 0:n.getIdToken(t)];case 1:return(r=o.sent())?[2,"Bearer "+r]:(F("Please make sure you are authenticated before trying to call a restricted action."),[2])}}))}))},zt=function(){return(zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Gt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},$t=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Wt=function(t,e){return Vt(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,s,f,p;return Gt(this,(function(d){switch(d.label){case 0:return r=l().artisanApp.apiURL,n=t.id,o=t.latitude,i=t.longitude,[4,qt(zt({},e))];case 1:a=d.sent(),d.label=2;case 2:return d.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/"+n+"/validateShoppingCart?latitude="+o+"&longitude="+i,{headers:a}).then((function(t){return Vt(void 0,void 0,void 0,(function(){return Gt(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(u=d.sent(),!(c=u.data))throw new Error("No shopping cart was found.");return s=Object.values(c.stores).reduce((function(t,e){return e.alerts.length?$t($t([],t),e.alerts):t}),[]),f=Object.values(c.stores).some((function(t){return!!t.alerts.length||Object.values(t.products).some((function(t){return t.alerts.length}))})),[2,{stores:s,products:f}];case 4:return p=d.sent(),console.error(p.message),[2,{stores:[{errorLevel:1,message:"Occurrió un error desconocido, comuníquese con soporte",type:""}],products:!1}];case 5:return[2]}}))}))},Kt=function(t,e,r){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:return function(t,e){!function(t,e){void 0===e&&(e="");var r=l().artisanApp.apiURL;if(void 0===t&&void 0===r)throw new Error("ApiURL must be defined. Either provide a global ApiURL or at the function call level. "+e)}(t.apiURL),m(e)}(t,e),n=null!=r?r:l().activeShoppingCart,[4,R(n)];case 1:return void 0===(o=u.sent())?(console.error("Cannot use undefined as a shopping cart id. Shopping cart "+n+" was not found. Validation canceled."),[2]):(i=t.latitude,a=t.longitude,[4,Wt({id:o,latitude:i,longitude:a},e)]);case 2:return[2,u.sent()]}}))}))},Jt=function(){return(Jt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return[4,S({},e)];case 1:return(r=a.sent())?[4,r.data()]:(n=null!=e?e:l().activeShoppingCart,console.warn("Cannot set additional info because no shopping cart was found. Please ensure you create a shopping cart with name "+n+" before continue."),[2]);case 2:return o=a.sent(),i=Zt(o,t),[4,r.ref.set(i)];case 3:return a.sent(),[2]}}))}))},Zt=function(t,e){return Jt(Jt({},t),{additional_info:e(t.additional_info)})},Xt=function(){return(Xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},te=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ee=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},re=function(t){return void 0===t&&(t={}),Xt({benefits:[],usedBenefits:[],unusedBenefits:[]},t)},ne=function(t,e){var r,n=l().wallets,o=Xt(Xt({},n),((r={})[t]=Xt({},e),r));c({wallets:o})},oe=function(t){return void 0===t&&(t={}),te(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s;return ee(this,(function(f){switch(f.label){case 0:return e=l(),r=e.artisanApp,n=e.customerId,o=e.accountId,i=t.accountId,a=t.customerId,h(),v(t),u=null==r?void 0:r.__internals__.firestore(),[4,null===(s=null===(c=null==u?void 0:u.collection("benefitsByUser"))||void 0===c?void 0:c.doc(String(null!=a?a:n)))||void 0===s?void 0:s.collection(String(null!=i?i:o))];case 1:return[2,f.sent()]}}))}))},ie=function(t){return te(void 0,void 0,void 0,(function(){var e;return ee(this,(function(r){switch(r.label){case 0:return[4,oe(t)];case 1:return(e=r.sent())?[4,e.get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,r.sent()]}}))}))},ae=function(t){return te(void 0,void 0,void 0,(function(){var e,r;return ee(this,(function(n){switch(n.label){case 0:return[4,ie(t)];case 1:return(e=n.sent())?0===Object.keys(e.data()).length?[2,[]]:(r=e.id,[2,Object.values(e.data()).map((function(t){return Xt(Xt({},t),{hash:r})}))]):[2]}}))}))},ue=function(){return(ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ce=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},le=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},se=function(t,e){return ce(void 0,void 0,void 0,(function(){var r,n,o,i,a;return le(this,(function(u){switch(u.label){case 0:return r=l().artisanApp.apiURL,n=t.vendorId,o=t.customerId,[4,qt(ue(ue({},e),{uid:o.toString()}))];case 1:i=u.sent(),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/retrieveBenefits?vendorId="+n,{headers:i}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(!u.sent())throw new Error("The benefits wallet is not defined. Make sure coupons arewell configured");return[3,5];case 4:throw a=u.sent(),Error(a.message);case 5:return[2]}}))}))},fe=function(t,e,r){return ce(void 0,void 0,void 0,(function(){var n,o,i,a,u,c;return le(this,(function(s){switch(s.label){case 0:return n=l().artisanApp.apiURL,o=t.customerId,[4,qt(ue(ue({},r),{uid:o.toString()}))];case 1:i=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,fetch(n+"/api/wallet_profit/apply",{method:"post",body:JSON.stringify({code:e}),headers:i}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(a=s.sent(),200===(u=a).code)return[2,!0];if(null===u.data||!u.data)throw new Error(u.message);return F("Unhandled response when redeeming coupon "+JSON.stringify(u,void 0,2)),[2,!1];case 4:throw c=s.sent(),new Error("Failed to redeem coupon "+e+". "+c.message);case 5:return[2]}}))}))},pe=function(){return(pe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},de=function(t,e,r,n){O(e);var o=l().customerId,i=l(),a=i.activeShoppingCart,u=i.wallets,s=null!=r?r:a,f=u[s],p=e.customerId,d=null!=p?p:o;return f?(F("There is already a listener for wallet of name "+s+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return he(s)}):(function(t,e,r,n){new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,o,i,a,l;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(f){switch(f.label){case 0:r=pe(pe({},e),{customerId:d}),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,se(r,n)];case 2:return f.sent(),[3,4];case 3:return f.sent(),[2,function(){return he(s)}];case 4:return[4,ae()];case 5:return(o=f.sent())?(i={benefits:o,unusedBenefits:o,usedBenefits:[]},a=pe(pe({},u),((l={})[s]=pe(pe({},i),{callback:t}),l)),c({wallets:a}),t(i),[2]):[2,function(){return he(s)}]}}))})),function(){return he(s)})},he=function(t){var e=l().wallets,r=pe({},e);delete r[t],c({wallets:r})},ye=function(){return(ye=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ge=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},be=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},ve=function(t,e,r,n){O(e),m(n);var o=l().customerId,i=l(),a=i.activeShoppingCart,u=i.wallets,c=null!=r?r:a,s=u[c],f=e.customerId,p=null!=f?f:o;if(s)return F("There is already a listener for wallet of name "+c+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return Oe(c)};var d=re();ne(c,ye(ye({},d),{callback:t}));var h=void 0;return ge(void 0,void 0,void 0,(function(){var r,o;return be(this,(function(i){switch(i.label){case 0:r=ye(ye({},e),{customerId:p}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,se(r,n)];case 2:return i.sent(),[3,4];case 3:return i.sent(),console.error("Failed to retrieve the user's wallet"),[2];case 4:return[4,oe(e)];case 5:return(o=i.sent())?(h=o.onSnapshot((function(e){return ge(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,l;return be(this,(function(s){return r=null!==(l=null===(u=e.docs[0])||void 0===u?void 0:u.data())&&void 0!==l?l:{},0===Object.keys(r).length?(n=re(),ne(c,ye(ye({},n),{callback:t})),t(n),[2]):(o=e.docs[0].id,i=function(t,e){return Object.values(t).map((function(t){return Xt(Xt({},t),{hash:e})}))}(r,o),a=re({benefits:i,unusedBenefits:i}),ne(c,ye(ye({},a),{callback:t})),t(a),[2])}))}))})),[2]):(console.error("Failed to retrieve the benefits wallet node"),[2])}}))})),function(){return Oe(c,h)}},Oe=function(t,e){var r=l().wallets,n=ye({},r);delete n[t],c({wallets:n}),e&&e()},me=function(){return(me=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},we=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Pe=function(t,e,r){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,a,u,s,f,p,d,h,y,g,b,O,w;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(P){switch(P.label){case 0:if(n=l().customerId,v(t),m(r),o=l(),i=o.activeShoppingCart,a=o.wallets,!(s=a[u=null!=e?e:i]))return F("No benefits wallet available for "+u+", you probably forgot to call listenBenefitsWallet beforehand."),[2];f=s.usedBenefits,p=t.customerId,d=null!=p?p:n,h=me(me({},t),{customerId:d}),y=f.map((function(t){var e=t.hash,n=t.benefitId;return function(t,e){return ce(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,s;return le(this,(function(f){switch(f.label){case 0:return r=t.benefitId,n=t.benefitHash,o=t.shoppingCartId,i=t.customerId,a=l().artisanApp.apiURL,[4,qt(ue(ue({},e),{uid:i.toString()}))];case 1:return u=f.sent(),c={benefitId:r,shoppingCartId:o},[4,fetch(a+"/api/shopping-cart/benefitsByUser/"+n+"/applyBenefit",{method:"post",body:JSON.stringify(c),headers:u}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 2:if((s=f.sent()).benefits){if(Object.keys(null==s?void 0:s.benefits).length>0)return[2,s];if(0===Object.keys(null==s?void 0:s.benefits).length)throw Error("No benefits were applied to the current shopping cart")}if(200!==(null==s?void 0:s.code))throw Error(s.message);return[2]}}))}))}(me(me({},h),{benefitId:n,benefitHash:e}),r)})),P.label=1;case 1:return P.trys.push([1,3,,4]),[4,Promise.all(y)];case 2:return P.sent(),[3,4];case 3:throw g=P.sent(),Error(g.message);case 4:return b={benefits:we([],s.unusedBenefits),unusedBenefits:we([],s.unusedBenefits),usedBenefits:[],callback:s.callback},O=me(me({},a),((w={})[u]=b,w)),c({wallets:O}),s.callback(b),[2]}}))}))},je=function(){return(je=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ie=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Se=function(t,e,r,n){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var o,i,a,u,s,f,p,d,h,y,g,b,O,w;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(P){switch(P.label){case 0:return o=l().customerId,v(t),m(n),i=l(),a=i.activeShoppingCart,u=i.wallets,(f=u[s=null!=r?r:a])||F("No benefits wallet available for "+s+", you probably forgot to call listenBenefitsWallet beforehand."),p=t.customerId,d=null!=p?p:o,h=je(je({},t),{customerId:d}),[4,fe(h,e,n)];case 1:if(!P.sent())return[2];P.label=2;case 2:return P.trys.push([2,4,,5]),[4,se(h,n)];case 3:return P.sent(),[3,5];case 4:return P.sent(),console.error("Failed to retrieve the user's wallet after redeeming coupon"),[2];case 5:return[4,ae()];case 6:if(!(y=P.sent()))throw new Error("Failed to fetch benefits from ArtisanDB for the current customer after redeeming coupon");return g=re({benefits:y,unusedBenefits:y,usedBenefits:[]}),b={benefits:Ie([],g.benefits),unusedBenefits:Ie(Ie([],f.unusedBenefits),g.unusedBenefits),usedBenefits:Ie(Ie([],f.usedBenefits),g.usedBenefits),callback:f.callback},O=je(je({},u),((w={})[s]=b,w)),c({wallets:O}),f.callback(g),[2]}}))}))},Ae=function(){return(Ae=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_e=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Ee=function(t,e){var r,n=l(),o=n.activeShoppingCart,i=n.wallets,a=null!=e?e:o,u=i[a],s=t.benefitId;if(u){var f=u.benefits.find((function(t){return t.benefitId===s}));if(f){var p=u.unusedBenefits.filter((function(t){return t.benefitId!==s})),d=Ae(Ae({},u),{unusedBenefits:p,usedBenefits:_e(_e([],u.usedBenefits),[f])}),h=Ae(Ae({},d),{callback:u.callback}),y=Ae(Ae({},i),((r={})[a]=h,r));c({wallets:y}),u.callback(d)}else F("There is no benefit to apply with the id "+s+" on the current cart. This might indicate something bad configured.")}else F("No benefits wallet available for "+a+", you probably forgot to call listenBenefitsWallet beforehand.")},ke=function(){return(ke=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xe=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Te=function(t,e){var r,n=l(),o=n.activeShoppingCart,i=n.wallets,a=null!=e?e:o,u=i[a],s=t.benefitId;if(u){var f=u.benefits.find((function(t){return t.benefitId===s}));if(f){var p=u.usedBenefits.filter((function(t){return t.benefitId!==s})),d=ke(ke({},u),{unusedBenefits:xe(xe([],u.unusedBenefits),[f]),usedBenefits:p}),h=ke(ke({},d),{callback:u.callback}),y=ke(ke({},i),((r={})[a]=h,r));c({wallets:y}),u.callback(d)}else F("There is no benefit to unuse with the id "+s+" on the current cart. This might indicate something bad configured.")}else F("No benefits wallet available for "+a+", you probably forgot to call listenBenefitsWallet beforehand.")}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){o=n(n({},o),t)},u=function(){return n({},o)}}])},function(t){t.exports=JSON.parse('{"name":"@artisan-commerce/analytics-web","description":"Artisan commerce analytics web library","version":"0.1.0-canary.7","main":"./build/main.bundle.js","types":"./build/src/index.d.ts","files":["build/","LICENSE","README.md"],"scripts":{"start":"webpack --config webpack.dev.js","dev":"yarn start","build":"webpack --config webpack.prod.js","start:build":"nodemon ./build/main.bundle.js","test":"jest --watchAll --runInBand","test:all":"yarn test --watchAll=false --coverage","test:ci":"cross-env CI=true jest --runInBand","test:staged":"yarn test:ci --findRelatedTests ./src","check-types":"tsc --noEmit","lint":"eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .","lint:staged":"yarn lint --max-warnings=0","prettier":"prettier --ignore-path .gitignore \\"**/*.+(js|jsx|ts|tsx|json|css|scss|html)\\"","format":"yarn prettier --write","check-format":"yarn prettier --list-different","validate":"cross-env CI=true npm-run-all --parallel test:ci check-types check-format lint build","validate:ci":"npm-run-all --parallel check-types check-format lint"},"author":"Luis Eduardo Andrade","license":"MIT","dependencies":{"@artisan-commerce/state":"0.2.2-canary.3","snake-case":"^3.0.4"},"devDependencies":{"@artisan-commerce/products":"0.8.2-canary.9","@artisan-commerce/shopping-cart":"0.11.0-canary.9","@artisan-commerce/types":"0.13.0-canary.5","@babel/core":"^7.10.5","@babel/preset-env":"^7.10.4","@babel/preset-react":"^7.10.4","@types/faker":"^4.1.12","@types/jest":"^26.0.5","@types/jest-in-case":"^1.0.2","@types/node":"^14.0.24","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","avn":"^0.2.4","avn-nvm":"^0.2.2","clean-webpack-plugin":"^3.0.0","dotenv-webpack":"^2.0.0","env-cmd":"^10.1.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-config-react-app":"^5.2.1","eslint-config-universe":"^4.0.0","eslint-plugin-cypress":"^2.11.1","eslint-plugin-flowtype":"^5.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.3","eslint-plugin-react-hooks":"^4.0.8","is-ci-cli":"^2.1.2","jest-axe":"^3.5.0","jest-extended":"^0.11.5","jest-in-case":"^1.0.2","jest-styled-components":"^7.0.2","nodemon":"^2.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","start-server-and-test":"^1.11.2","test-data-bot":"^0.8.0","ts-jest":"^26.1.4","ts-loader":"^8.0.2","webpack":"^4.43.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","webpack-merge":"^5.0.9"},"peerDependencies":{"@artisan-commerce/products":"*","@artisan-commerce/shopping-cart":"*"}}')},,function(t,e,r){"use strict";r.r(e),r.d(e,"initAnalytics",(function(){return j})),r.d(e,"Providers",(function(){return v})),r.d(e,"events",(function(){return Qs}));var n=r(2),o=r(3),i={providers:[],activeVendor:void 0,vendors:[],shareArtisanAnalytics:!1,debug:!1,meta:{accountId:void 0,vendorId:void 0,vendorName:void 0,storeId:void 0,storeName:void 0,catalogueId:void 0,catalogueName:void 0,appName:void 0,platform:"web",versionApp:void 0,versionSDK:o.version}},a=function(){return Object(n.getState)()},u={GLOBAL_TRACKING_ID:"G-JZ7R91ZNMB"},c=function(){return(c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},s=function(t,e){var r=a().debug,n="artisan-commerce/analytics";if("debug"!==e||r)switch(e){case"debug":console.log("%c(Debug) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"log":console.log("%c(Log) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"warn":console.warn("%c(Warning) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"error":console.error("%c(Error) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"severe":throw new Error(n+": \n"+t);default:throw new Error("Log message "+t+" of type "+e+" is not a supported type.")}},f=function(){function t(){this.initialized=!1,this._type="GOOGLE_ANALYTICS",this._name="__GLOBAL_PROVIDER__",this._trackingId=u.GLOBAL_TRACKING_ID,this._sampleRate=100,this._currency="USD"}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trackingId",{get:function(){return this._trackingId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),Object.defineProperty(t,"instance",{get:function(){return t._instance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=a().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.setVendors=function(t){this._vendors=t},t.prototype.init=function(){if("undefined"!=typeof window){if(this.initialized)return s("Provider "+this._name+" was already initialized. Do not call init unless you know what you are doing.","severe");this.initialized=!0;var t=document.createElement("script");t.setAttribute("async","true"),t.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this._trackingId);var e=document.createElement("script");e.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this._trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.body.appendChild(t),document.body.appendChild(e)}},t.prototype.updateConfig=function(t){void 0===t&&(t={});var e=Object.entries(t).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),r=t.userId,n=t.currency,o=t.language;e.includes("userId")&&(this._userId=r),e.includes("currency")&&(this._currency=n),e.includes("language")&&(this._language=o),gtag("set",this._trackingId,t)},t._instance=new t,t}(),p=function(){function t(t){this.initialized=!1;var e=t.type,r=t.name,n=t.trackingId,o=t.vendors;this.type=e,this.name=r,this.trackingId=n,this._vendors=o}return Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=a().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.init=function(){if("undefined"!=typeof window)return this.initialized?s("Provider "+this.name+" was already initialized. Do not call init unless you know what you are doing.","severe"):void(this.initialized=!0)},t.prototype.updateConfig=function(t){!function(t,e){if(t.trackingId!==u.GLOBAL_TRACKING_ID){var r=Object.entries(e).reduce((function(t,e,r){var n=e[0],o=e[1];return 0===r?n+": "+o:t+"\n"+n+": "+o}),"");s(t.name+" config updated for the following fields.\n "+r,"debug")}}(this,t),f.instance.updateConfig(t)},t}(),d=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),h=function(){return(h=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){function e(e){var r=this,n=e.version,o=e.currency;return(r=t.call(this,h(h({},e),{type:"FACEBOOK_PIXEL"}))||this)._version=null!=n?n:"10.0",r._currency=null!=o?o:"USD",r}return d(e,t),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("script");e.innerText="!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='"+this.version+"';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '"+this.trackingId+"');fbq('trackSingle', '"+this.trackingId+"', 'PageView');";var r=document.createElement("noscript");r.innerHTML='\n <img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id={'+this.trackingId+'}&noscript=1"/>\n ',document.body.appendChild(e),document.body.appendChild(r)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.currency;r.includes("currency")&&(this._currency=n),t.prototype.updateConfig.call(this,e)},e}(p),g=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),b=function(){return(b=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},v={FacebookPixel:y,GoogleAnalytics:function(t){function e(e){var r=t.call(this,b(b({},e),{type:"GOOGLE_ANALYTICS"}))||this,n=e.userId,o=e.currency,i=e.language,a=e.sampleRate;return r._sampleRate=a,r._userId=n,r._language=i,r._currency=null!=o?o:"USD",r}return g(e,t),Object.defineProperty(e.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("script");e.setAttribute("async","true"),e.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this.trackingId);var r=document.createElement("script");r.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this.trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.body.appendChild(e),document.body.appendChild(r)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.userId,o=e.currency,i=e.language;r.includes("userId")&&(this._userId=n),r.includes("currency")&&(this._currency=o),r.includes("language")&&(this._language=i),gtag("set",this.trackingId,e),t.prototype.updateConfig.call(this,e)},e}(p)},O=function(){return(O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},w=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},P=!1,j=function(t){if(P)s("initAnalytics has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initAnalytics is only called once.","warn");else if(!("undefined"==typeof window)){P=!0;var e=t.providers,r=t.shareArtisanAnalytics;if(!e.length)return s("At least one provider should be included but none were found","severe");if(!function(t){var e=t.map((function(t){return t.name}));return new Set(e).size===e.length}(e))return s("Providers names must be unique, check that no provider names are repeated","severe");if(!function(t){var e=t.map((function(t){return t.trackingId}));return new Set(e).size===e.length}(e))return s("Providers trackerId must be unique, check that no provider trackerId are repeated","severe");var i,a=t.meta,u=m(t,["meta"]),c=r?w([f.instance],e):e,l=O(O({},u),{providers:c,meta:O(O({},a),{vendorId:u.activeVendor,platform:"web",versionSDK:o.version})});i=l,Object(n.setState)(i);var p,d={};c.forEach((function(t){d=O(O({},d),t),t.init()})),p=(null==(p=c.reduce((function(t,e){return w(w([],t),e.vendors)}),[]))?void 0:p.length)?p:void 0,f.instance.updateConfig(d),f.instance.setVendors(p)}};var I=function(){return(I=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.create;Object.create;function S(t){return t.toLowerCase()}var A=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],_=/[^A-Z0-9]+/gi;function E(t,e,r){return e instanceof RegExp?t.replace(e,r):e.reduce((function(t,e){return t.replace(e,r)}),t)}function k(t,e){return void 0===e&&(e={}),function(t,e){void 0===e&&(e={});for(var r=e.splitRegexp,n=void 0===r?A:r,o=e.stripRegexp,i=void 0===o?_:o,a=e.transform,u=void 0===a?S:a,c=e.delimiter,l=void 0===c?" ":c,s=E(E(t,n,"$1\0$2"),i,"\0"),f=0,p=s.length;"\0"===s.charAt(f);)f++;for(;"\0"===s.charAt(p-1);)p--;return s.slice(f,p).split("\0").map(u).join(l)}(t,I({delimiter:"."},e))}var x=function(){return(x=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},T=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=(void 0===n&&(n={}),k(o,I({delimiter:"_"},n)));return x(x({},t),((r={})[a]=i,r))}),{})},C=function(){return(C=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},R=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},B=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=R(e,["callback","userId"]),c=null!=i?i:n,l=C(C({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","change_password_attempt",C(C({send_to:r,event_callback:o},s),p))},U=function(){return(U=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},M=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},D=function(t,e){var r=t.trackingId,n=M(e,[]);delete n.userId;var o=U({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ChangePasswordAttempt",U(U({},i),c))},Y=r(1),L=r(0),N=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},H=function(t,e){var r=e.vendors,n=a().activeVendor;return(!n||!r.includes(n))&&(void 0===n?s("No active vendor is set. Please make sure you configure an active vendor before trying to emit an event","warn"):function(t,e){var r=a().activeVendor;e.trackingId!==u.GLOBAL_TRACKING_ID&&s("Skipping vendor "+r+" for event "+t+" of provider "+e.name+" as configured","debug")}(t,e),!0)},q=function(t){if(!t.length)return s("No providers found, the initAnalytics probably hasn't been run yet","severe"),!1;var e=function(t){var e=new Set(t.map((function(t){return t.type})));return Array.from(e).reduce((function(t,e){switch(e){case"GOOGLE_ANALYTICS":if("undefined"==typeof gtag)return N(N([],t),[e]);break;case"FACEBOOK_PIXEL":if("undefined"==typeof fbq)return N(N([],t),[e]);break;default:throw new Error("Profiver of type "+e+" is not supported")}return t}),[])}(t);return!e.length||(e.forEach((function(t){!function(t){s(t+" SDK not initialized. Please make sure the SDK is initialized before trying to emit an event","severe")}(t)})),!1)},F=function(){return(F=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},V=function(t,e,r){var n=r.facebookPixelHandler,o=r.googleAnalyticsHandler,i=a().providers;if(q(i)){var f=F(F({},e),{artisanEvent:t}),p=i.reduce((function(e,r){if(H(t,r))return e;switch(r.type){case"FACEBOOK_PIXEL":n(r,f);break;case"GOOGLE_ANALYTICS":o(r,f);break;default:throw new Error("Provider of type "+r.type+" is not supported")}return z(z([],e),[r])}),[]);!function(t,e){var r=e.reduce((function(t,e){var r,n;if(e.trackingId===u.GLOBAL_TRACKING_ID)return t;var o=e.name,i=e.type,a=null!==(n=t[i])&&void 0!==n?n:[];return c(c({},t),((r={})[i]=l(l([],a),[o]),r))}),{}),n=Object.entries(r).reduce((function(t,e){var r=e[0],n=e[1];return""+t+(r.charAt(0).toUpperCase()+r.slice(1))+": "+n.join(", ")+"\n"}),"");s("Event "+t+" was successfully sent to the following providers "+n,"debug")}(t,p)}},G=function(t){return Object(Y.getShoppingCartProducts)(t).map((function(t){return t.productId}))},$=function(t){return Object(Y.getShoppingCartProducts)(t).map((function(t){return W(t)}))},W=function(t){var e=Object(L.getProductTotals)(t);return t.name+":"+e.netPrice},K=function(t,e){return Object(Y.getShoppingCartProducts)(t).map((function(t){return J(t,e)}))},J=function(t,e){var r=Object(L.getProductTotals)(t);return{item_id:t.productId,item_name:t.name,quantity:t.amount,price:r.netPrice,currency:e}},Q=function(t){V("changePasswordAttempt",t,{googleAnalyticsHandler:B,facebookPixelHandler:D})},Z=function(){return(Z=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},X=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=X(e,["callback","userId"]),c=null!=i?i:n,l=Z(Z({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","sign_up_attempt",Z(Z({send_to:r,event_callback:o},s),p))},et=function(){return(et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},rt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},nt=function(t,e){var r=t.trackingId,n=rt(e,[]);delete n.userId;var o=et({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SignUpAttempt",et(et({},i),c))},ot=function(t){V("signUpAttempt",t,{googleAnalyticsHandler:tt,facebookPixelHandler:nt})},it=function(){return(it=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},at=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ut=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=at(e,["callback","userId"]),c=null!=i?i:n,l=it(it({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","change_password_fail",it(it({send_to:r,event_callback:o},s),p))},ct=function(){return(ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},st=function(t,e){var r=t.trackingId,n=lt(e,[]);delete n.userId;var o=ct({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ChangePasswordFail",ct(ct({},i),c))},ft=function(t){V("changePasswordFail",t,{googleAnalyticsHandler:ut,facebookPixelHandler:st})},pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ht=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=dt(e,["callback","userId"]),c=null!=i?i:n,l=pt(pt({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","change_password_success",pt(pt({send_to:r,event_callback:o},s),p))},yt=function(){return(yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bt=function(t,e){var r=t.trackingId,n=gt(e,[]);delete n.userId;var o=yt({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ChangePasswordSuccess",yt(yt({},i),c))},vt=function(t){V("changePasswordSuccess",t,{googleAnalyticsHandler:ht,facebookPixelHandler:bt})},Ot=function(){return(Ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=mt(e,["callback","userId"]),c=null!=i?i:n,l=Ot(Ot({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","login",Ot(Ot({send_to:r,event_callback:o},s),p))},Pt=function(){return(Pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},It=function(t,e){var r=t.trackingId,n=jt(e,[]);delete n.userId;var o=Pt({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SignIn",Pt(Pt({},i),c))},St=function(t){V("signIn",t,{googleAnalyticsHandler:wt,facebookPixelHandler:It})},At=function(){return(At=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_t=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Et=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=_t(e,["callback","userId"]),c=null!=i?i:n,l=At(At({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","sign_out",At(At({send_to:r,event_callback:o},s),p))},kt=function(){return(kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tt=function(t,e){var r=t.trackingId,n=xt(e,[]);delete n.userId;var o=kt({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SignOut",kt(kt({},i),c))},Ct=function(t){V("signOut",t,{googleAnalyticsHandler:Et,facebookPixelHandler:Tt})},Rt=function(){return(Rt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ut=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Bt(e,["callback","userId"]),c=null!=i?i:n,l=Rt(Rt({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","sign_up",Rt(Rt({send_to:r,event_callback:o},s),p))},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yt=function(t,e){var r=t.trackingId,n=Dt(e,[]);delete n.userId;var o=Mt({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingle",r,"CompleteRegistration",Mt(Mt({},i),c))},Lt=function(t){V("signUp",t,{googleAnalyticsHandler:Ut,facebookPixelHandler:Yt})},Nt={logChangePasswordAttempt:Q,logSignUpAttempt:ot,logChangePasswordFail:ft,logChangePasswordSuccess:vt,logSignIn:St,logSignOut:Ct,logSignUp:Lt},Ht=Nt,qt=function(){return(qt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ft=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Ft(e,["callback","userId"]),c=null!=i?i:n,l=qt(qt({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","banner_impression",qt(qt({send_to:r,event_callback:o},s),p))},Vt=function(){return(Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$t=function(t,e){var r=t.trackingId,n=Gt(e,[]);delete n.userId;var o=Vt({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"BannerImpression",Vt(Vt({},i),c))},Wt=function(t){V("bannerImpression",t,{googleAnalyticsHandler:zt,facebookPixelHandler:$t})},Kt=function(){return(Kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Jt(e,["callback","userId"]),c=null!=i?i:n,l=Kt(Kt({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","select_content",Kt(Kt({send_to:r,event_callback:o,content_type:"banner"},s),p))},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},te=function(t,e){var r=t.trackingId,n=Xt(e,[]);delete n.userId;var o=Zt({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SelectBanner",Zt(Zt({},i),c))},ee=function(t){V("selectBanner",t,{googleAnalyticsHandler:Qt,facebookPixelHandler:te})},re={logBannerImpression:Wt,logSelectBanner:ee},ne=re,oe=function(){return(oe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ie=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ae=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=ie(e,["callback","userId"]),c=null!=i?i:n,l=oe(oe({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","add_billing_info",oe(oe({send_to:r,event_callback:o},s),p))},ue=function(){return(ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ce=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},le=function(t,e){var r=t.trackingId,n=ce(e,[]);delete n.userId;var o=ue({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"AddBillingInfo",ue(ue({},i),c))},se=function(t){V("addBillingInfo",t,{googleAnalyticsHandler:ae,facebookPixelHandler:le})},fe=function(){return(fe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},de=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=pe(e,["callback","userId"]),c=null!=i?i:n,l=fe(fe({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","select_billing_info",fe(fe({send_to:r,event_callback:o},s),p))},he=function(){return(he=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ye=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ge=function(t,e){var r=t.trackingId,n=ye(e,[]);delete n.userId;var o=he({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SelectBillingInfo",he(he({},i),c))},be=function(t){V("selectBillingInfo",t,{googleAnalyticsHandler:de,facebookPixelHandler:ge})},ve=function(){return(ve=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Oe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},me=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Oe(e,["callback","userId"]),c=null!=i?i:n,l=ve(ve({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","update_billing_info",ve(ve({send_to:r,event_callback:o},s),p))},we=function(){return(we=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},je=function(t,e){var r=t.trackingId,n=Pe(e,[]);delete n.userId;var o=we({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"UpdateBillingInfo",we(we({},i),c))},Ie=function(t){V("updateBillingInfo",t,{googleAnalyticsHandler:me,facebookPixelHandler:je})},Se={logAddBillingInfo:se,logSelectBillingInfo:be,logUpdateBillingInfo:Ie},Ae=Se,_e=function(){return(_e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ee=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ke=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Ee(e,["callback","userId"]),c=null!=i?i:n,l=_e(_e({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","book_appointment",_e(_e({send_to:r,event_callback:o},s),p))},xe=function(){return(xe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Te=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ce=function(t,e){var r=t.trackingId,n=Te(e,[]);delete n.userId;var o=xe({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingle",r,"Schedule",xe(xe({},i),c))},Re=function(t){V("bookAppointment",t,{googleAnalyticsHandler:ke,facebookPixelHandler:Ce})},Be={logBookAppointment:Re},Ue=Be,Me=function(){return(Me=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},De=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ye=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.category,c=e.list,l=e.itemBrand,s=De(e,["callback","userId","category","list","itemBrand"]),f=e.position,p=[{item_brand:l,item_id:""+u.categoryId,item_list_name:c,item_name:u.name,index:f}],d=null!=i?i:n,h=Me(Me({},s),{userId:d}),y=T(h),g=a().meta,b=T(g);gtag("event","view_item_list",Me(Me({send_to:r,event_callback:o,item_list_name:c,items:p},y),b))},Le=function(){return(Le=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ne=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},He=function(t,e){var r=t.trackingId,n=e.category,o=Ne(e,["category"]);delete o.userId;var i=n.categoryId,u=n.name,c=Le(Le({},o),{categoryId:i,categoryName:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"CategoryImpression",Le(Le({},l),f))},qe=function(t){V("categoryImpression",t,{googleAnalyticsHandler:Ye,facebookPixelHandler:He})},Fe=function(){return(Fe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ze=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ve=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.query,c=ze(e,["callback","userId","query"]),l=null!=i?i:n,s=Fe(Fe({},c),{userId:l}),f=T(s),p=a().meta,d=T(p);gtag("event","search",Fe(Fe({send_to:r,event_callback:o,search_term:u},f),d))},Ge=function(){return(Ge=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},We=function(t,e){var r=t.trackingId,n=e.query,o=$e(e,["query"]);delete o.userId;var i=Ge({},o),u=T(i),c=a().meta,l=T(c);fbq("trackSingle",r,"Search",Ge(Ge({search_string:n},u),l))},Ke=function(t){V("searchCategoryAttempt",t,{googleAnalyticsHandler:Ve,facebookPixelHandler:We})},Je=function(){return(Je=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ze=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.category,c=Qe(e,["callback","userId","category"]);c.contentType&&delete c.contentType;var l=u.categoryId,s=u.name,f=null!=i?i:n,p=Je(Je({},c),{userId:f,categoryId:l,categoryName:s}),d=T(p),h=a().meta,y=T(h);gtag("event","select_content",Je(Je({send_to:r,event_callback:o,content_type:"category"},d),y))},Xe=function(){return(Xe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},er=function(t,e){var r=t.trackingId,n=e.category,o=tr(e,["category"]);delete o.userId;var i=n.categoryId,u=n.name,c=Xe(Xe({},o),{categoryId:i,categoryName:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"SelectCategory",Xe(Xe({},l),f))},rr=function(t){V("selectCategory",t,{googleAnalyticsHandler:Ze,facebookPixelHandler:er})},nr=function(){return(nr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},or=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ir=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.category,c=or(e,["callback","userId","category"]),l=u.categoryId,s=u.name,f=null!=i?i:n,p=nr(nr({},c),{userId:f,categoryId:l,categoryName:s}),d=T(p),h=a().meta,y=T(h);gtag("event","view_cateogry",nr(nr({send_to:r,event_callback:o},d),y))},ar=function(){return(ar=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ur=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cr=function(t,e){var r=t.trackingId,n=e.category,o=ur(e,["category"]);delete o.userId;var i=n.categoryId,u=n.name,c=ar(ar({},o),{categoryId:i,categoryName:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"ViewCategory",ar(ar({},l),f))},lr=function(t){V("viewCategory",t,{googleAnalyticsHandler:ir,facebookPixelHandler:cr})},sr={logCategoryImpression:qe,logSearchCategoryAttempt:Ke,logSelectCategory:rr,logViewCategory:lr},fr=sr,pr=function(){return(pr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=dr(e,["callback","userId"]),l=null!=u?u:n,s=pr(pr({},c),{userId:l,currency:o}),f=T(s),p=a().meta,d=T(p);gtag("event","checkout_action",pr(pr({send_to:r,event_callback:i},f),d))},yr=function(){return(yr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},br=function(t,e){var r=t.trackingId,n=gr(e,[]);delete n.userId;var o=yr({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"CheckoutAction",yr(yr({},i),c))},vr=function(t){V("checkoutAction",t,{googleAnalyticsHandler:hr,facebookPixelHandler:br})},Or=function(){return(Or=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.shoppingCart,l=e.currency,s=mr(e,["callback","userId","shoppingCart","currency"]),f=null!=u?u:n,p=null!=l?l:o,d=Or(Or({},s),{userId:f,currency:p}),h=T(d),y=a().meta,g=T(y);gtag("event","begin_checkout",Or(Or({send_to:r,event_callback:i,items:K(c,p),value:Object(Y.getShoppingCartTotal)(c).total},h),g))},Pr=function(){return(Pr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ir=function(t,e){var r=t.trackingId,n=t.currency,o=e.shoppingCart,i=e.currency,u=jr(e,["shoppingCart","currency"]);delete u.userId;var c=null!=i?i:n,l=Pr(Pr({},u),{currency:c}),s=T(l),f=a().meta,p=T(f),d=G(o);fbq("trackSingle",r,"InitiateCheckout",Pr(Pr({content_ids:d,contents:$(o),num_items:d.length,value:Object(Y.getShoppingCartTotal)(o).total},s),p))},Sr=function(t){V("initiateCheckout",t,{googleAnalyticsHandler:wr,facebookPixelHandler:Ir})},Ar={logCheckoutAction:vr,logInitiateCheckout:Sr},_r=Ar,Er=function(){return(Er=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},xr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=kr(e,["callback","userId","currency"]),s=null!=u?u:n,f=null!=c?c:o,p=Er(Er({},l),{userId:s,currency:f}),d=T(p),h=a().meta,y=T(h);gtag("event","apply_benefit",Er(Er({send_to:r,event_callback:i},d),y))},Tr=function(){return(Tr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Cr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Rr=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Cr(e,["currency"]);delete i.userId;var u=null!=o?o:n,c=Tr(Tr({},i),{currency:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"ApplyBenefit",Tr(Tr({},l),f))},Br=function(t){V("applyBenefit",t,{googleAnalyticsHandler:xr,facebookPixelHandler:Rr})},Ur=function(){return(Ur=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Mr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Dr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=Mr(e,["callback","userId","currency"]),s=null!=u?u:n,f=null!=c?c:o,p=Ur(Ur({},l),{userId:s,currency:f}),d=T(p),h=a().meta,y=T(h);gtag("event","coupon_code_error",Ur(Ur({send_to:r,event_callback:i},d),y))},Yr=function(){return(Yr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Nr=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Lr(e,["currency"]);delete i.userId;var u=null!=o?o:n,c=Yr(Yr({},i),{currency:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"CouponCodeError",Yr(Yr({},l),f))},Hr=function(t){V("couponCodeError",t,{googleAnalyticsHandler:Dr,facebookPixelHandler:Nr})},qr=function(){return(qr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Fr(e,["callback","userId"]),c=null!=i?i:n,l=qr(qr({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","redeem_coupon_code",qr(qr({send_to:r,event_callback:o},s),p))},Vr=function(){return(Vr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$r=function(t,e){var r=t.trackingId,n=Gr(e,[]);delete n.userId;var o=Vr({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"RedeemCouponCode",Vr(Vr({},i),c))},Wr=function(t){V("redeemCouponCode",t,{googleAnalyticsHandler:zr,facebookPixelHandler:$r})},Kr=function(){return(Kr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=Jr(e,["callback","userId","currency"]),s=null!=u?u:n,f=null!=c?c:o,p=Kr(Kr({},l),{userId:s,currency:f}),d=T(p),h=a().meta,y=T(h);gtag("event","remove_benefit",Kr(Kr({send_to:r,event_callback:i},d),y))},Zr=function(){return(Zr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Xr(e,["currency"]);delete i.userId;var u=null!=o?o:n,c=Zr(Zr({},i),{currency:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"RemoveBenefit",Zr(Zr({},l),f))},en=function(t){V("removeBenefit",t,{googleAnalyticsHandler:Qr,facebookPixelHandler:tn})},rn=function(){return(rn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},nn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},on=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=nn(e,["callback","userId","currency"]),s=null!=u?u:n,f=null!=c?c:o,p=rn(rn({},l),{userId:s,currency:f}),d=T(p),h=a().meta,y=T(h);gtag("event","view_benefit_details",rn(rn({send_to:r,event_callback:i},d),y))},an=function(){return(an=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},un=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=un(e,["currency"]);delete i.userId;var u=null!=o?o:n,c=an(an({},i),{currency:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"ViewBenefitDetails",an(an({},l),f))},ln=function(t){V("viewBenefitDetails",t,{googleAnalyticsHandler:on,facebookPixelHandler:cn})},sn=function(){return(sn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=fn(e,["callback","userId"]),c=null!=i?i:n,l=sn(sn({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_benefits_wallet",sn(sn({send_to:r,event_callback:o},s),p))},dn=function(){return(dn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},hn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yn=function(t,e){var r=t.trackingId,n=hn(e,[]);delete n.userId;var o=dn({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewBenefitsWallet",dn(dn({},i),c))},gn=function(t){V("viewBenefitsWallet",t,{googleAnalyticsHandler:pn,facebookPixelHandler:yn})},bn=function(){return(bn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},vn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},On=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=vn(e,["callback","userId"]),c=null!=i?i:n,l=bn(bn({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_qr_store_coupon",bn(bn({send_to:r,event_callback:o},s),p))},mn=function(){return(mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pn=function(t,e){var r=t.trackingId,n=wn(e,[]);delete n.userId;var o=mn({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewQRStoreCoupon",mn(mn({},i),c))},jn=function(t){void 0===t&&(t={}),V("viewQRStoreCoupon",t,{googleAnalyticsHandler:On,facebookPixelHandler:Pn})},In={logApplyBenefit:Br,logCouponCodeError:Hr,logRedeemCouponCode:Wr,logRemoveBenefit:en,logViewBenefitDetails:ln,logViewBenefitsWallet:gn,logViewQRStoreCoupon:jn},Sn=In,An=function(){return(An=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},En=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=e.amount,s=_n(e,["callback","userId","currency","amount"]),f=null!=u?u:n,p=null!=c?c:o,d=An(An({},s),{userId:f,currency:p,amount:l,value:l}),h=T(d),y=a().meta,g=T(y);gtag("event","add_credits",An(An({send_to:r,event_callback:i},h),g))},kn=function(){return(kn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tn=function(t,e){var r=t.trackingId,n=t.currency,o=e.amount,i=e.currency,u=xn(e,["amount","currency"]);delete u.userId;var c=null!=i?i:n,l=kn(kn({},u),{currency:c,amount:o,value:o}),s=T(l),f=a().meta,p=T(f);fbq("trackSingleCustom",r,"AddCredits",kn(kn({},s),p))},Cn=function(t){V("addCredits",t,{googleAnalyticsHandler:En,facebookPixelHandler:Tn})},Rn=function(){return(Rn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Un=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=e.amount,s=Bn(e,["callback","userId","currency","amount"]),f=null!=u?u:n,p=null!=c?c:o,d=Rn(Rn({},s),{userId:f,currency:p,amount:l,value:l}),h=T(d),y=a().meta,g=T(y);gtag("event","spend_credits",Rn(Rn({send_to:r,event_callback:i},h),g))},Mn=function(){return(Mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.amount,u=Dn(e,["currency","amount"]);delete u.userId;var c=null!=o?o:n,l=Mn(Mn({},u),{currency:c,amount:i,value:i}),s=T(l),f=a().meta,p=T(f);fbq("trackSingleCustom",r,"SpendCredits",Mn(Mn({},s),p))},Ln=function(t){V("spendCredits",t,{googleAnalyticsHandler:Un,facebookPixelHandler:Yn})},Nn=function(){return(Nn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Hn(e,["callback","userId"]),c=null!=i?i:n,l=Nn(Nn({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_credits",Nn(Nn({send_to:r,event_callback:o},s),p))},Fn=function(){return(Fn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vn=function(t,e){var r=t.trackingId,n=zn(e,[]);delete n.userId;var o=Fn({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewCredits",Fn(Fn({},i),c))},Gn=function(t){V("viewCredits",t,{googleAnalyticsHandler:qn,facebookPixelHandler:Vn})},$n={logAddCredits:Cn,logSpendCredits:Ln,logViewCredits:Gn},Wn=$n,Kn=function(){return(Kn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qn=function(t,e,r){var n=e.trackingId,o=e.userId,i=r.callback,u=r.userId,c=Jn(r,["callback","userId"]),l=null!=u?u:o,s=Kn(Kn({},c),{userId:l}),f=T(s),p=a().meta,d=T(p);gtag("event",t,Kn(Kn(Kn({send_to:n,event_callback:i},f),{artisan_event:"custom_event"}),d))},Zn=function(){return(Zn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},to=function(t,e,r){var n=e.trackingId,o=Xn(r,[]);delete o.userId;var i=Zn({},o),u=T(i),c=a().meta,l=T(c);fbq("trackSingleCustom",n,t,Zn(Zn(Zn({},u),{artisan_event:"CustomEvent"}),l))},eo=function(t,e){void 0===e&&(e={}),V(t,e,{googleAnalyticsHandler:function(e,r){return Qn(t,e,r)},facebookPixelHandler:function(e,r){return to(t,e,r)}})},ro=function(){return(ro=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},no=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},oo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=no(e,["callback","userId"]),c=null!=i?i:n,l=ro(ro({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_fulfillment_step",ro(ro({send_to:r,event_callback:o},s),p))},io=function(){return(io=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ao=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uo=function(t,e){var r=t.trackingId,n=ao(e,[]);delete n.userId;var o=io({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewFulfillmentStep",io(io({},i),c))},co=function(t){V("viewFulfillmentStep",t,{googleAnalyticsHandler:oo,facebookPixelHandler:uo})},lo=function(){return(lo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},so=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=so(e,["callback","userId"]),c=null!=i?i:n,l=lo(lo({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_tracking",lo(lo({send_to:r,event_callback:o},s),p))},po=function(){return(po=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ho=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yo=function(t,e){var r=t.trackingId,n=ho(e,[]);delete n.userId;var o=po({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewTracking",po(po({},i),c))},go=function(t){V("viewTracking",t,{googleAnalyticsHandler:fo,facebookPixelHandler:yo})},bo={logViewFulfillmentStep:co,logViewTracking:go},vo=bo,Oo=function(){return(Oo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=mo(e,["callback","userId"]),c=null!=i?i:n,l=Oo(Oo({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","change_location",Oo(Oo({send_to:r,event_callback:o},s),p))},Po=function(){return(Po=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Io=function(t,e){var r=t.trackingId,n=jo(e,[]);delete n.userId;var o=Po({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ChangeLocation",Po(Po({},i),c))},So=function(t){V("changeLocation",t,{googleAnalyticsHandler:wo,facebookPixelHandler:Io})},Ao=function(){return(Ao=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Eo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=_o(e,["callback","userId"]),c=null!=i?i:n,l=Ao(Ao({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","find_location",Ao(Ao({send_to:r,event_callback:o},s),p))},ko=function(){return(ko=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},To=function(t,e){var r=t.trackingId,n=xo(e,[]);delete n.userId;var o=ko({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingle",r,"FindLocation",ko(ko({},i),c))},Co=function(t){V("findLocation",t,{googleAnalyticsHandler:Eo,facebookPixelHandler:To})},Ro=function(){return(Ro=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Uo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Bo(e,["callback","userId"]),c=null!=i?i:n,l=Ro(Ro({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","out_of_coverage",Ro(Ro({send_to:r,event_callback:o},s),p))},Mo=function(){return(Mo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Do=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yo=function(t,e){var r=t.trackingId,n=Do(e,[]);delete n.userId;var o=Mo({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"OutOfCoverage",Mo(Mo({},i),c))},Lo=function(t){V("outOfCoverage",t,{googleAnalyticsHandler:Uo,facebookPixelHandler:Yo})},No=function(){return(No=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ho=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Ho(e,["callback","userId"]),c=null!=i?i:n,l=No(No({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","set_location",No(No({send_to:r,event_callback:o},s),p))},Fo=function(){return(Fo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vo=function(t,e){var r=t.trackingId,n=zo(e,[]);delete n.userId;var o=Fo({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SetLocation",Fo(Fo({},i),c))},Go=function(t){V("setLocation",t,{googleAnalyticsHandler:qo,facebookPixelHandler:Vo})},$o={logChangeLocation:So,logFindLocation:Co,logOutOfCoverage:Lo,logSetLocation:Go},Wo=$o,Ko=function(){return(Ko=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Jo(e,["callback","userId"]),c=null!=i?i:n,l=Ko(Ko({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","request_assistance",Ko(Ko({send_to:r,event_callback:o},s),p))},Zo=function(){return(Zo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ti=function(t,e){var r=t.trackingId,n=Xo(e,[]);delete n.userId;var o=Zo({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingle",r,"Contact",Zo(Zo({},i),c))},ei=function(t){V("requestAssistance",t,{googleAnalyticsHandler:Qo,facebookPixelHandler:ti})},ri={logRequestAssistance:ei},ni=ri,oi=function(){return(oi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ii=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ai=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.currencyName,c=e.amount,l=ii(e,["callback","userId","currencyName","amount"]),s=null!=i?i:n,f=oi(oi({},l),{userId:s}),p=T(f),d=a().meta,h=T(d);gtag("event","earn_virtual_currency",oi(oi({send_to:r,event_callback:o,virtual_currency_name:u,value:c},p),h))},ui=function(){return(ui=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ci=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},li=function(t,e){var r=t.trackingId,n=ci(e,[]);delete n.userId;var o=ui({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"EarnPoints",ui(ui({},i),c))},si=function(t){V("earnPoints",t,{googleAnalyticsHandler:ai,facebookPixelHandler:li})},fi=function(){return(fi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},di=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=pi(e,["callback","userId"]),c=null!=i?i:n,l=fi(fi({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","share_points",fi(fi({send_to:r,event_callback:o},s),p))},hi=function(){return(hi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},gi=function(t,e){var r=t.trackingId,n=yi(e,[]);delete n.userId;var o=hi({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SharePoints",hi(hi({},i),c))},bi=function(t){V("sharePoints",t,{googleAnalyticsHandler:di,facebookPixelHandler:gi})},vi=function(){return(vi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Oi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},mi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.currencyName,c=e.amount,l=Oi(e,["callback","userId","currencyName","amount"]),s=null!=i?i:n,f=vi(vi({},l),{userId:s}),p=T(f),d=a().meta,h=T(d);gtag("event","spend_virtual_currency",vi(vi({send_to:r,event_callback:o,virtual_currency_name:u,value:c},p),h))},wi=function(){return(wi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ji=function(t,e){var r=t.trackingId,n=Pi(e,[]);delete n.userId;var o=wi({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SpendPoints",wi(wi({},i),c))},Ii=function(t){V("spendPoints",t,{googleAnalyticsHandler:mi,facebookPixelHandler:ji})},Si=function(){return(Si=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ai=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_i=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Ai(e,["callback","userId"]),c=null!=i?i:n,l=Si(Si({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_loyalty_level",Si(Si({send_to:r,event_callback:o},s),p))},Ei=function(){return(Ei=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ki=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},xi=function(t,e){var r=t.trackingId,n=ki(e,[]);delete n.userId;var o=Ei({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewLoyaltyLevel",Ei(Ei({},i),c))},Ti=function(t){V("viewLoyaltyLevel",t,{googleAnalyticsHandler:_i,facebookPixelHandler:xi})},Ci={logEarnPoints:si,logSharePoints:bi,logSpendPoints:Ii,logViewLoyaltyLevel:Ti},Ri=Ci,Bi=function(){return(Bi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ui=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Mi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Ui(e,["callback","userId"]),c=null!=i?i:n,l=Bi(Bi({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","cancel_order",Bi(Bi({send_to:r,event_callback:o},s),p))},Di=function(){return(Di=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Li=function(t,e){var r=t.trackingId,n=Yi(e,[]);delete n.userId;var o=Di({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"CancelOrder",Di(Di({},i),c))},Ni=function(t){V("cancelOrder",t,{googleAnalyticsHandler:Mi,facebookPixelHandler:Li})},Hi=function(){return(Hi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=qi(e,["callback","userId"]),c=null!=i?i:n,l=Hi(Hi({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","rate_order",Hi(Hi({send_to:r,event_callback:o},s),p))},zi=function(){return(zi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gi=function(t,e){var r=t.trackingId,n=e.maxScore,o=e.score,i=Vi(e,["maxScore","score"]);delete i.userId;var u=zi(zi({},i),{maxScore:n,score:o}),c=T(u),l=a().meta,s=T(l);fbq("trackSingleCustom",r,"RateOrder",zi(zi({max_rating_value:n,value:o},c),s))},$i=function(t){V("rateOrder",t,{googleAnalyticsHandler:Fi,facebookPixelHandler:Gi})},Wi=function(){return(Wi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ki=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ji=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=e.orderId,s=e.orderTotal,f=Ki(e,["callback","userId","currency","orderId","orderTotal"]),p=null!=u?u:n,d=null!=c?c:o,h=Wi(Wi({},f),{userId:p,currency:d}),y=T(h),g=a().meta,b=T(g);gtag("event","refund",Wi(Wi({send_to:r,event_callback:i,transaction_id:l,value:s},y),b))},Qi=function(){return(Qi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xi=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.orderTotal,u=Zi(e,["currency","orderTotal"]);delete u.userId;var c=null!=o?o:n,l=Qi(Qi({},u),{currency:c}),s=T(l),f=a().meta,p=T(f);fbq("trackSingleCustom",r,"RequestRefund",Qi(Qi({value:i},s),p))},ta=function(t){V("requestRefund",t,{googleAnalyticsHandler:Ji,facebookPixelHandler:Xi})},ea={logCancelOrder:Ni,logRateOrder:$i,logRequestRefund:ta},ra=ea,na=function(){return(na=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ia=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=oa(e,["callback","userId"]),c=null!=i?i:n,l=na(na({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","generate_lead",na(na({send_to:r,event_callback:o},s),p))},aa=function(){return(aa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ua=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ca=function(t,e){var r=t.trackingId,n=ua(e,[]);delete n.userId;var o=aa({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingle",r,"Lead",aa(aa({},i),c))},la=function(t){void 0===t&&(t={}),V("generateLead",t,{googleAnalyticsHandler:ia,facebookPixelHandler:ca})},sa=function(){return(sa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pa=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=fa(e,[]);delete n.userId;var o=sa({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingle",r,"PageView",sa(sa({},i),c))},da=function(){return(da=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ha=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ya=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=t.userId,o=e.pathname,i=e.name,u=e.callback,c=e.userId,l=ha(e,["pathname","name","callback","userId"]),s=null!=c?c:n,f=da(da({},l),{userId:s}),p=T(f),d=a().meta,h=T(d);gtag("event","page_view",da(da({page_title:i,page_path:o,send_to:r,event_callback:u},p),h))},ga=function(t){V("pageView",t,{googleAnalyticsHandler:ya,facebookPixelHandler:pa})},ba=function(){return(ba=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},va=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Oa=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.query,c=va(e,["callback","userId","query"]),l=null!=i?i:n,s=ba(ba({},c),{userId:l}),f=T(s),p=a().meta,d=T(p);gtag("event","search",ba(ba({send_to:r,event_callback:o,search_term:u},f),d))},ma=function(){return(ma=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pa=function(t,e){var r=t.trackingId,n=e.query,o=wa(e,["query"]);delete o.userId;var i=ma({},o),u=T(i),c=a().meta,l=T(c);fbq("trackSingle",r,"Search",ma(ma({search_string:n},u),l))},ja=function(t){V("searchPageContent",t,{googleAnalyticsHandler:Oa,facebookPixelHandler:Pa})},Ia={logGenerateLead:la,logPageView:ga,logSearchPageContent:ja},Sa=Ia,Aa=function(){return(Aa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ea=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=_a(e,["callback","userId","currency"]),s=null!=u?u:n,f=null!=c?c:o,p=Aa(Aa({},l),{userId:s,currency:f}),d=T(p),h=a().meta,y=T(h);gtag("event","change_payment_type",Aa(Aa({send_to:r,event_callback:i},d),y))},ka=function(){return(ka=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ta=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=xa(e,["currency"]);delete i.userId;var u=null!=o?o:n,c=ka(ka({},i),{currency:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"ChangePaymentType",ka(ka({},l),f))},Ca=function(t){V("changePaymentType",t,{googleAnalyticsHandler:Ea,facebookPixelHandler:Ta})},Ra=function(){return(Ra=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ba=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ua=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=Ba(e,["callback","userId","currency"]),s=null!=u?u:n,f=null!=c?c:o,p=Ra(Ra({},l),{userId:s,currency:f}),d=T(p),h=a().meta,y=T(h);gtag("event","select_payment_type",Ra(Ra({send_to:r,event_callback:i},d),y))},Ma=function(){return(Ma=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Da=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ya=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Da(e,["currency"]);delete i.userId;var u=null!=o?o:n,c=Ma(Ma({},i),{currency:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"SelectPaymentType",Ma(Ma({},l),f))},La=function(t){V("selectPaymentType",t,{googleAnalyticsHandler:Ua,facebookPixelHandler:Ya})},Na=function(){return(Na=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ha=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qa=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=Ha(e,["callback","userId","currency"]),s=null!=u?u:n,f=null!=c?c:o,p=Na(Na({},l),{userId:s,currency:f}),d=T(p),h=a().meta,y=T(h);gtag("event","add_payment_info",Na(Na({send_to:r,event_callback:i},d),y))},Fa=function(){return(Fa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},za=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Va=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=za(e,["currency"]);delete i.userId;var u=null!=o?o:n,c=Fa(Fa({},i),{currency:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingle",r,"AddPaymentInfo",Fa(Fa({success:1},l),f))},Ga=function(t){V("setPaymentInfo",t,{googleAnalyticsHandler:qa,facebookPixelHandler:Va})},$a={logChangePaymentType:Ca,logSelectPaymentType:La,logSetPaymentInfo:Ga},Wa=$a,Ka=function(){return(Ka=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ja=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qa=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.product,c=Ja(e,["callback","userId","product"]),l=null!=i?i:n,s=u.productId,f=u.name,p=Ka(Ka({},c),{userId:l,productId:s,productName:f}),d=T(p),h=a().meta,y=T(h);gtag("event","customize_product",Ka(Ka({send_to:r,event_callback:o},d),y))},Za=function(){return(Za=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tu=function(t,e){var r=t.trackingId,n=e.product,o=Xa(e,["product"]);delete o.userId;var i=n.productId,u=n.name,c=Za(Za({},o),{productId:i,productName:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingle",r,"CustomizeProduct",Za(Za({},l),f))},eu=function(t){V("customizeProduct",t,{googleAnalyticsHandler:Qa,facebookPixelHandler:tu})},ru=function(){return(ru=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},nu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ou=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=nu(e,["callback","userId"]),c=null!=i?i:n,l=ru(ru({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","filter_products",ru(ru({send_to:r,event_callback:o},s),p))},iu=function(){return(iu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},au=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uu=function(t,e){var r=t.trackingId,n=au(e,[]);delete n.userId;var o=iu({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"FilterProducts",iu(iu({},i),c))},cu=function(t){V("filterProducts",t,{googleAnalyticsHandler:ou,facebookPixelHandler:uu})},lu=function(){return(lu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},su=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fu=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=su(e,["callback","userId","product","currency"]),f=null!=u?u:n,p=null!=l?l:o,d=c.productId,h=c.name,y=lu(lu({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(L.getProductTotals)(c),b=T(y),v=a().meta,O=T(v);gtag("event","product_impression",lu(lu({send_to:r,event_callback:i,value:g.netPrice},b),O))},pu=function(){return(pu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},du=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hu=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,u=du(e,["product","currency"]);delete u.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(L.getProductTotals)(o),p=pu(pu({},u),{productId:l,productName:s,currency:c}),d=T(p),h=a().meta,y=T(h);fbq("trackSingleCustom",r,"ProductImpression",pu(pu({value:f.netPrice},d),y))},yu=function(t){V("productImpression",t,{googleAnalyticsHandler:fu,facebookPixelHandler:hu})},gu=function(){return(gu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=bu(e,["callback","userId"]),c=null!=i?i:n,l=gu(gu({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","search_product_success",gu(gu({send_to:r,event_callback:o},s),p))},Ou=function(){return(Ou=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wu=function(t,e){var r=t.trackingId,n=e.query,o=mu(e,["query"]);delete o.userId;var i=Ou({},o),u=T(i),c=a().meta,l=T(c);fbq("trackSingle",r,"Search",Ou(Ou({search_string:n,success:1},u),l))},Pu=function(t){V("searchProductSuccess",t,{googleAnalyticsHandler:vu,facebookPixelHandler:wu})},ju=function(){return(ju=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Iu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Su=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.query,c=Iu(e,["callback","userId","query"]),l=null!=i?i:n,s=ju(ju({},c),{userId:l}),f=T(s),p=a().meta,d=T(p);gtag("event","search",ju(ju({send_to:r,event_callback:o,search_term:u},f),d))},Au=function(){return(Au=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_u=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Eu=function(t,e){var r=t.trackingId,n=e.query,o=_u(e,["query"]);delete o.userId;var i=Au({},o),u=T(i),c=a().meta,l=T(c);fbq("trackSingle",r,"Search",Au(Au({search_string:n},u),l))},ku=function(t){V("searchProductAttempt",t,{googleAnalyticsHandler:Su,facebookPixelHandler:Eu})},xu=function(){return(xu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Tu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Tu(e,["callback","userId"]),c=null!=i?i:n,l=xu(xu({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","search_product_not_found",xu(xu({send_to:r,event_callback:o},s),p))},Ru=function(){return(Ru=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Uu=function(t,e){var r=t.trackingId,n=e.query,o=Bu(e,["query"]);delete o.userId;var i=Ru({},o),u=T(i),c=a().meta,l=T(c);fbq("trackSingle",r,"Search",Ru(Ru({search_string:n,success:0},u),l))},Mu=function(t){V("searchProductNotFound",t,{googleAnalyticsHandler:Cu,facebookPixelHandler:Uu})},Du=function(){return(Du=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Lu=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=Yu(e,["callback","userId","product","currency"]);s.contentType&&delete s.contentType;var f=null!=u?u:n,p=null!=l?l:o,d=c.productId,h=c.name,y=Du(Du({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(L.getProductTotals)(c),b=T(y),v=a().meta,O=T(v);gtag("event","select_content",Du(Du({send_to:r,event_callback:i,content_type:"product",value:g.netPrice},b),O))},Nu=function(){return(Nu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qu=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,u=Hu(e,["product","currency"]);delete u.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(L.getProductTotals)(o),p=Nu(Nu({},u),{productId:l,productName:s,currency:c}),d=T(p),h=a().meta,y=T(h);fbq("trackSingleCustom",r,"SelectProduct",Nu(Nu({value:f.netPrice},d),y))},Fu=function(t){V("selectProduct",t,{googleAnalyticsHandler:Lu,facebookPixelHandler:qu})},zu=function(){return(zu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Vu(e,["callback","userId"]),c=null!=i?i:n,l=zu(zu({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","sort_products",zu(zu({send_to:r,event_callback:o},s),p))},$u=function(){return($u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ku=function(t,e){var r=t.trackingId,n=Wu(e,[]);delete n.userId;var o=$u({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SortProducts",$u($u({},i),c))},Ju=function(t){V("sortProducts",t,{googleAnalyticsHandler:Gu,facebookPixelHandler:Ku})},Qu=function(){return(Qu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xu=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=Zu(e,["callback","userId","product","currency"]),f=null!=u?u:n,p=null!=l?l:o,d=c.productId,h=c.name,y=Qu(Qu({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(L.getProductTotals)(c),b=T(y),v=a().meta,O=T(v);gtag("event","view_item",Qu(Qu({send_to:r,event_callback:i,value:g.netPrice},b),O))},tc=function(){return(tc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ec=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rc=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,u=ec(e,["product","currency"]);delete u.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(L.getProductTotals)(o),p=tc(tc({},u),{productId:l,productName:s,currency:c}),d=T(p),h=a().meta,y=T(h);fbq("trackSingleCustom",r,"ViewProductDetails",tc(tc({value:f.netPrice},d),y))},nc=function(t){V("viewProductDetails",t,{googleAnalyticsHandler:Xu,facebookPixelHandler:rc})},oc={logCustomizeProduct:eu,logFilterProducts:cu,logProductImpression:yu,logSearchProductSuccess:Pu,logSearchProductAttempt:ku,logSearchProductNotFound:Mu,logSelectProduct:Fu,logSortProducts:Ju,logViewProductDetails:nc},ic=oc,ac=function(){return(ac=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},uc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=e.shoppingCart,s=uc(e,["callback","userId","currency","shoppingCart"]),f=null!=u?u:n,p=null!=c?c:o,d=ac(ac({},s),{userId:f,currency:p}),h=T(d),y=a().meta,g=T(y);gtag("event","purchase_attempt",ac(ac({send_to:r,event_callback:i,items:K(l,p),value:Object(Y.getShoppingCartTotal)(l).total},h),g))},lc=function(){return(lc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fc=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,u=sc(e,["currency","shoppingCart"]);delete u.userId;var c=null!=o?o:n,l=lc(lc({},u),{currency:c}),s=T(l),f=a().meta,p=T(f),d=G(i);fbq("trackSingleCustom",r,"PurchaseAttempt",lc(lc({content_ids:d,contents:$(i),num_items:d.length,value:Object(Y.getShoppingCartTotal)(i).total},s),p))},pc=function(t){V("purchaseAttempt",t,{googleAnalyticsHandler:cc,facebookPixelHandler:fc})},dc=function(){return(dc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},hc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=e.shoppingCart,s=hc(e,["callback","userId","currency","shoppingCart"]),f=null!=u?u:n,p=null!=c?c:o,d=dc(dc({},s),{userId:f,currency:p}),h=T(d),y=a().meta,g=T(y);gtag("event","purchase_fail",dc(dc({send_to:r,event_callback:i,items:K(l,p),value:Object(Y.getShoppingCartTotal)(l).total},h),g))},gc=function(){return(gc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vc=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,u=bc(e,["currency","shoppingCart"]);delete u.userId;var c=null!=o?o:n,l=gc(gc({},u),{currency:c}),s=T(l),f=a().meta,p=T(f),d=G(i);fbq("trackSingleCustom",r,"PurchaseFail",gc(gc({content_ids:d,contents:$(i),num_items:d.length,value:Object(Y.getShoppingCartTotal)(i).total},s),p))},Oc=function(t){V("purchaseFail",t,{googleAnalyticsHandler:yc,facebookPixelHandler:vc})},mc=function(){return(mc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.currency,l=e.shoppingCart,s=e.orderId,f=wc(e,["callback","userId","currency","shoppingCart","orderId"]),p=null!=u?u:n,d=null!=c?c:o,h=mc(mc({},f),{userId:p,currency:d}),y=Object(Y.getShoppingCartTotal)(l),g=y.total,b=y.shippingCost,v=y.totalTaxes,O=T(h),m=a().meta,w=T(m);gtag("event","purchase",mc(mc({send_to:r,event_callback:i,items:K(l,d),value:g,transaction_id:s,shipping:b,tax:v},O),w))},jc=function(){return(jc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ic=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sc=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,u=Ic(e,["currency","shoppingCart"]);delete u.userId;var c=null!=o?o:n,l=jc(jc({},u),{currency:c}),s=T(l),f=a().meta,p=T(f),d=G(i);fbq("trackSingle",r,"Purchase",jc(jc({content_ids:d,contents:$(i),num_items:d.length,value:Object(Y.getShoppingCartTotal)(i).total},s),p))},Ac=function(t){V("purchaseSuccess",t,{googleAnalyticsHandler:Pc,facebookPixelHandler:Sc})},_c={logPurchaseAttempt:pc,logPurchaseFail:Oc,logPurchaseSuccess:Ac},Ec=_c,kc=function(){return(kc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=xc(e,["callback","userId"]),c=null!=i?i:n,l=kc(kc({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_settings",kc(kc({send_to:r,event_callback:o},s),p))},Cc=function(){return(Cc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bc=function(t,e){var r=t.trackingId,n=Rc(e,[]);delete n.userId;var o=Cc({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewSettings",Cc(Cc({},i),c))},Uc=function(t){void 0===t&&(t={}),V("viewSettings",t,{googleAnalyticsHandler:Tc,facebookPixelHandler:Bc})},Mc={logViewSettings:Uc},Dc=Mc,Yc=function(){return(Yc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Nc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Lc(e,["callback","userId"]),c=null!=i?i:n,l=Yc(Yc({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","add_shipping_info",Yc(Yc({send_to:r,event_callback:o},s),p))},Hc=function(){return(Hc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fc=function(t,e){var r=t.trackingId,n=qc(e,[]);delete n.userId;var o=Hc({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"AddShippingAddress",Hc(Hc({},i),c))},zc=function(t){V("addShippingAddress",t,{googleAnalyticsHandler:Nc,facebookPixelHandler:Fc})},Vc=function(){return(Vc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$c=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Gc(e,["callback","userId"]),c=null!=i?i:n,l=Vc(Vc({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","select_shipping_address",Vc(Vc({send_to:r,event_callback:o},s),p))},Wc=function(){return(Wc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jc=function(t,e){var r=t.trackingId,n=Kc(e,[]);delete n.userId;var o=Wc({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SelectShippingAddress",Wc(Wc({},i),c))},Qc=function(){return(Qc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Zc(e,["callback","userId"]),c=null!=i?i:n,l=Qc(Qc({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","update_shipping_info",Qc(Qc({send_to:r,event_callback:o},s),p))},tl=function(){return(tl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},el=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rl=function(t,e){var r=t.trackingId,n=el(e,[]);delete n.userId;var o=tl({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"UpdateShippingAddress",tl(tl({},i),c))},nl=function(){return(nl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},il=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=e.store,f=ol(e,["callback","userId","product","currency","store"]),p=null!=u?u:n,d=null!=l?l:o,h=s.storeName,y=s.storeId,g=nl(nl({},f),{userId:p,storeId:y,storeName:h,currency:d}),b=Object(L.getProductTotals)(c),v=T(g),O=a().meta,m=T(O);gtag("event","add_to_cart",nl(nl({send_to:r,event_callback:i,items:[J(c,d)],value:b.netPrice},v),m))},al=function(){return(al=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ul=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,u=e.currency,c=ul(e,["product","store","currency"]);delete c.userId;var l=null!=u?u:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=al(al({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=T(y),b=a().meta,v=T(b);fbq("trackSingle",r,"AddToCart",al(al({content_id:s,content_name:f,content:W(o),value:Object(L.getProductTotals)(o).netPrice},g),v))},ll=function(){return(ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=sl(e,["callback","userId","product","currency"]),f=null!=u?u:n,p=null!=l?l:o,d=ll(ll({},s),{userId:f,currency:p}),h=Object(L.getProductTotals)(c),y=T(d),g=a().meta,b=T(g);gtag("event","add_to_wishlist",ll(ll({send_to:r,event_callback:i,items:[J(c,p)],value:h.netPrice},y),b))},pl=function(){return(pl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,u=dl(e,["product","currency"]);delete u.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=pl(pl({},u),{amount:f,currency:c}),d=T(p),h=a().meta,y=T(h);fbq("trackSingle",r,"AddToWishlist",pl(pl({content_id:l,content_name:s,content:W(o),value:Object(L.getProductTotals)(o).netPrice},d),y))},yl=function(){return(yl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bl=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=gl(e,["callback","userId"]),c=null!=i?i:n,l=yl(yl({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","clear_cart",yl(yl({send_to:r,event_callback:o},s),p))},vl=function(){return(vl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ml=function(t,e){var r=t.trackingId,n=Ol(e,[]);delete n.userId;var o=vl({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ClearCart",vl(vl({},i),c))},wl=function(){return(wl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},jl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=e.store,f=Pl(e,["callback","userId","product","currency","store"]),p=null!=u?u:n,d=null!=l?l:o,h=c.productId,y=c.name,g=s.storeName,b=s.storeId,v=wl(wl({},f),{userId:p,productId:h,productName:y,storeId:b,storeName:g,currency:d}),O=Object(L.getProductTotals)(c),m=T(v),w=a().meta,P=T(w);gtag("event","remove_product_from_cart",wl(wl({send_to:r,event_callback:i,value:O.netPrice},m),P))},Il=function(){return(Il=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Sl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Al=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,u=e.currency,c=Sl(e,["product","store","currency"]);delete c.userId;var l=null!=u?u:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=Il(Il({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=T(y),b=a().meta,v=T(b);fbq("trackSingleCustom",r,"RemoveProductFromCart",Il(Il({content_id:s,content_name:f,content:W(o),value:Object(L.getProductTotals)(o).netPrice},g),v))},_l=function(){return(_l=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},El=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},kl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=El(e,["callback","userId","product","currency"]),f=null!=u?u:n,p=null!=l?l:o,d=c.productId,h=c.name,y=_l(_l({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(L.getProductTotals)(c),b=T(y),v=a().meta,O=T(v);gtag("event","remove_product_from_wishlist",_l(_l({send_to:r,event_callback:i,value:g.netPrice},b),O))},xl=function(){return(xl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Tl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,u=Tl(e,["product","currency"]);delete u.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=xl(xl({},u),{amount:f,currency:c}),d=T(p),h=a().meta,y=T(h);fbq("trackSingleCustom",r,"RemoveProductFromWishlist",xl(xl({content_id:l,content_name:s,content:W(o),value:Object(L.getProductTotals)(o).netPrice},d),y))},Rl=function(){return(Rl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ul=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=e.store,f=Bl(e,["callback","userId","product","currency","store"]),p=c.productId,d=c.name,h=null!=u?u:n,y=null!=l?l:o,g=s.storeName,b=s.storeId,v=Rl(Rl({},f),{userId:h,storeId:b,storeName:g,productId:p,productName:d,currency:y}),O=Object(L.getProductTotals)(c),m=T(v),w=a().meta,P=T(w);gtag("event","update_product_in_cart",Rl(Rl({send_to:r,event_callback:i,value:O.netPrice},m),P))},Ml=function(){return(Ml=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,u=e.currency,c=Dl(e,["product","store","currency"]);delete c.userId;var l=null!=u?u:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=Ml(Ml({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=T(y),b=a().meta,v=T(b);fbq("trackSingleCustom",r,"UpdateProductInCart",Ml(Ml({content_id:s,content_name:f,content:W(o),value:Object(L.getProductTotals)(o).netPrice},g),v))},Ll=function(){return(Ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,u=e.userId,c=e.product,l=e.currency,s=Nl(e,["callback","userId","product","currency"]),f=c.productId,p=c.name,d=null!=u?u:n,h=null!=l?l:o,y=Ll(Ll({},s),{userId:d,productId:f,productName:p,currency:h}),g=Object(L.getProductTotals)(c),b=T(y),v=a().meta,O=T(v);gtag("event","update_product_in_wishlist",Ll(Ll({send_to:r,event_callback:i,value:g.netPrice},b),O))},ql=function(){return(ql=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,u=Fl(e,["product","currency"]);delete u.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=ql(ql({},u),{amount:f,currency:c}),d=T(p),h=a().meta,y=T(h);fbq("trackSingleCustom",r,"UpdateProductInWishlist",ql(ql({content_id:l,content_name:s,content:W(o),value:Object(L.getProductTotals)(o).netPrice},d),y))},Vl=function(){return(Vl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$l=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Gl(e,["callback","userId"]),c=null!=i?i:n,l=Vl(Vl({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","view_cart",Vl(Vl({send_to:r,event_callback:o},s),p))},Wl=function(){return(Wl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jl=function(t,e){var r=t.trackingId,n=Kl(e,[]);delete n.userId;var o=Wl({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ViewCart",Wl(Wl({},i),c))},Ql=function(){return(Ql=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xl=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.shareTarget,c=e.itemId,l=Zl(e,["callback","userId","shareTarget","itemId"]),s=null!=i?i:n,f=Ql(Ql({},l),{userId:s}),p=T(f),d=a().meta,h=T(d);gtag("event","share",Ql(Ql({send_to:r,event_callback:o,method:u,content_id:c},p),h))},ts=function(){return(ts=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},es=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rs=function(t,e){var r=t.trackingId,n=es(e,[]);delete n.userId;var o=ts({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"Share",ts(ts({},i),c))},ns=function(){return(ns=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},os=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},is=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.previousStore,c=e.nextStore,l=os(e,["callback","userId","previousStore","nextStore"]),s=u.storeId,f=u.storeName,p=c.storeId,d=c.storeName,h=null!=i?i:n,y=ns(ns({},l),{userId:h,previousStoreId:s,previousStoreName:f,nextStoreId:p,nextStoreName:d}),g=T(y),b=a().meta,v=T(b);gtag("event","change_store",ns(ns({send_to:r,event_callback:o},g),v))},as=function(){return(as=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},us=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cs=function(t,e){var r=t.trackingId,n=e.previousStore,o=e.nextStore,i=us(e,["previousStore","nextStore"]);delete i.userId;var u=n.storeId,c=n.storeName,l=o.storeId,s=o.storeName,f=as(as({},i),{previousStoreId:u,previousStoreName:c,nextStoreId:l,nextStoreName:s}),p=T(f),d=a().meta,h=T(d);fbq("trackSingleCustom",r,"ChangeStore",as(as({},p),h))},ls=function(){return(ls=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ss=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=e.store,c=ss(e,["callback","userId","store"]),l=u.storeId,s=u.storeName,f=null!=i?i:n,p=ls(ls({},c),{userId:f,storeId:l,storeName:s}),d=T(p),h=a().meta,y=T(h);gtag("event","set_store",ls(ls({send_to:r,event_callback:o},d),y))},ps=function(){return(ps=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ds=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hs=function(t,e){var r=t.trackingId,n=e.store,o=ds(e,["store"]);delete o.userId;var i=n.storeId,u=n.storeName,c=ps(ps({},o),{storeId:i,storeName:u}),l=T(c),s=a().meta,f=T(s);fbq("trackSingleCustom",r,"SetStore",ps(ps({},l),f))},ys=function(){return(ys=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=gs(e,["callback","userId"]),c=null!=i?i:n,l=ys(ys({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","set_user_info",ys(ys({send_to:r,event_callback:o},s),p))},vs=function(){return(vs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Os=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ms=function(t,e){var r=t.trackingId,n=Os(e,[]);delete n.userId;var o=vs({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SetUserInfo",vs(vs({},i),c))},ws=function(){return(ws=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ps=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},js=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Ps(e,["callback","userId"]),c=null!=i?i:n,l=ws(ws({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","update_user_info",ws(ws({send_to:r,event_callback:o},s),p))},Is=function(){return(Is=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ss=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},As=function(t,e){var r=t.trackingId,n=Ss(e,[]);delete n.userId;var o=Is({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"UpdateUserInfo",Is(Is({},i),c))},_s=function(){return(_s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Es=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ks=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Es(e,["callback","userId"]),c=null!=i?i:n,l=_s(_s({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","change_vendor",_s(_s({send_to:r,event_callback:o},s),p))},xs=function(){return(xs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ts=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cs=function(t,e){var r=t.trackingId,n=Ts(e,[]);delete n.userId;var o=xs({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"ChangeVendor",xs(xs({},i),c))},Rs=function(){return(Rs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Us=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Bs(e,["callback","userId"]),c=null!=i?i:n,l=Rs(Rs({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","set_vendor",Rs(Rs({send_to:r,event_callback:o},s),p))},Ms=function(){return(Ms=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ds=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ys=function(t,e){var r=t.trackingId,n=Ds(e,[]);delete n.userId;var o=Ms({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SetVendor",Ms(Ms({},i),c))},Ls=function(){return(Ls=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ns=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Ns(e,["callback","userId"]),c=null!=i?i:n,l=Ls(Ls({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","select_workflow",Ls(Ls({send_to:r,event_callback:o},s),p))},qs=function(){return(qs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zs=function(t,e){var r=t.trackingId,n=Fs(e,[]);delete n.userId;var o=qs({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"SelectWorkflow",qs(qs({},i),c))},Vs=function(){return(Vs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$s=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,u=Gs(e,["callback","userId"]),c=null!=i?i:n,l=Vs(Vs({},u),{userId:c}),s=T(l),f=a().meta,p=T(f);gtag("event","update_workflow",Vs(Vs({send_to:r,event_callback:o},s),p))},Ws=function(){return(Ws=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ks=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Js=function(t,e){var r=t.trackingId,n=Ks(e,[]);delete n.userId;var o=Ws({},n),i=T(o),u=a().meta,c=T(u);fbq("trackSingleCustom",r,"UpdateWorkflow",Ws(Ws({},i),c))},Qs={auth:Ht,banner:ne,billing:Ae,booking:Ue,category:fr,checkout:_r,coupon:Sn,credit:Wn,fulfillment:vo,geo:Wo,help:ni,logCustomEvent:eo,loyalty:Ri,order:ra,other:Sa,payment:Wa,product:ic,purchase:Ec,settings:Dc,shipping:{logAddShippingAddress:zc,logSelectShippingAddress:function(t){V("selectShippingAddress",t,{googleAnalyticsHandler:$c,facebookPixelHandler:Jc})},logUpdateShippingAddress:function(t){V("updateShippingAddress",t,{googleAnalyticsHandler:Xc,facebookPixelHandler:rl})}},shoppingCart:{logAddProductToCart:function(t){V("addProductToCart",t,{googleAnalyticsHandler:il,facebookPixelHandler:cl})},logAddProductToWishlist:function(t){V("addProductToWishlist",t,{googleAnalyticsHandler:fl,facebookPixelHandler:hl})},logClearCart:function(t){V("clearCart",t,{googleAnalyticsHandler:bl,facebookPixelHandler:ml})},logRemoveProductFromCart:function(t){V("removeProductFromCart",t,{googleAnalyticsHandler:jl,facebookPixelHandler:Al})},logRemoveProductFromWishlist:function(t){V("removeProductFromWishlist",t,{googleAnalyticsHandler:kl,facebookPixelHandler:Cl})},logUpdateProductInCart:function(t){V("updateProductInCart",t,{googleAnalyticsHandler:Ul,facebookPixelHandler:Yl})},logUpdateProductInWishlist:function(t){V("updateProductInWishlist",t,{googleAnalyticsHandler:Hl,facebookPixelHandler:zl})},logViewCart:function(t){V("viewCart",t,{googleAnalyticsHandler:$l,facebookPixelHandler:Jl})}},social:{logShare:function(t){V("share",t,{googleAnalyticsHandler:Xl,facebookPixelHandler:rs})}},store:{logChangeStore:function(t){V("changeStore",t,{googleAnalyticsHandler:is,facebookPixelHandler:cs})},logSetStore:function(t){V("setStore",t,{googleAnalyticsHandler:fs,facebookPixelHandler:hs})}},user:{logSetUserInfo:function(t){V("setUserInfo",t,{googleAnalyticsHandler:bs,facebookPixelHandler:ms})},logUpdateUserInfo:function(t){V("updateUserInfo",t,{googleAnalyticsHandler:js,facebookPixelHandler:As})}},vendor:{logChangeVendor:function(t){V("changeVendor",t,{googleAnalyticsHandler:ks,facebookPixelHandler:Cs})},logSetVendor:function(t){V("setVendor",t,{googleAnalyticsHandler:Us,facebookPixelHandler:Ys})}},workflow:{logSelectWorkflow:function(t){V("selectWorkflow",t,{googleAnalyticsHandler:Hs,facebookPixelHandler:zs})},logUpdateWorkflow:function(t){V("updateWorkflow",t,{googleAnalyticsHandler:$s,facebookPixelHandler:Js})}}};Object(n.initState)(i)}])}));
46
+ e.read=function(t,e,r,n,o){var a,i,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,y=t[e+f];for(f+=p,a=y&(1<<-s)-1,y>>=-s,s+=u;s>0;a=256*a+t[e+f],f+=p,s-=8);for(i=a&(1<<-s)-1,a>>=-s,s+=n;s>0;i=256*i+t[e+f],f+=p,s-=8);if(0===a)a=1-l;else{if(a===c)return i?NaN:1/0*(y?-1:1);i+=Math.pow(2,n),a-=l}return(y?-1:1)*i*Math.pow(2,a-n)},e.write=function(t,e,r,n,o,a){var i,u,c,l=8*a-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,d=n?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,i=s):(i=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-i))<1&&(i--,c*=2),(e+=i+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=s?(u=0,i=s):i+f>=1?(u=(e*c-1)*Math.pow(2,o),i+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;t[r+y]=255&u,y+=d,u/=256,o-=8);for(i=i<<o|u,l+=o;l>0;t[r+y]=255&i,y+=d,i/=256,l-=8);t[r+y-d]|=128*h}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)8*n+6*a<=8*t.length?e.push(r.charAt(o>>>6*(3-a)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"initShoppingCart",(function(){return p})),r.d(e,"closeShoppingCart",(function(){return y})),r.d(e,"listenShoppingCart",(function(){return R})),r.d(e,"getShoppingCart",(function(){return C})),r.d(e,"addProduct",(function(){return it})),r.d(e,"subtractProduct",(function(){return yt})),r.d(e,"removeProduct",(function(){return bt})),r.d(e,"setProduct",(function(){return It})),r.d(e,"replaceProduct",(function(){return kt})),r.d(e,"createShoppingCart",(function(){return Tt})),r.d(e,"emptyShoppingCart",(function(){return Ut})),r.d(e,"deleteShoppingCart",(function(){return Ht})),r.d(e,"getShoppingCartTotal",(function(){return Q})),r.d(e,"getShoppingCartProducts",(function(){return Z})),r.d(e,"validateShoppingCart",(function(){return Jt})),r.d(e,"setShoppingCartAdditionalInfo",(function(){return Zt})),r.d(e,"getProductHash",(function(){return K})),r.d(e,"listenBenefitsWallet",(function(){return pe})),r.d(e,"applyBenefit",(function(){return ge})),r.d(e,"removeBenefit",(function(){return Pe})),r.d(e,"redeemCoupon",(function(){return Ee}));var n="YYYY-MM-DD hh:mm:ss.SSS",o="default",a=function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i={artisanApp:void 0,accountId:void 0,customerId:void 0,activeShoppingCart:o,maxShoppingCarts:2,wallets:{},anonymous:!1};Object.freeze(i);var u=a({},i);Object.seal(u);var c=function(t){u=a(a({},u),t)},l=function(){return a({},u)},s=function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},f=!1,p=function(t,e){void 0===e&&(e={}),f?console.warn("initShoppingCart has been called more than once. \n This behavior will very likely result in unexpected outcomes so its \n call was skipped. Please make sure initShoppingCart is only called once"):(c(s({artisanApp:t},e)),"undefined"==typeof window||(f=!0))},y=function(){var t;null===(t=l().artisanApp)||void 0===t||t.__internals__.firestore().terminate(),c(s({},i)),f=!1},d=function(t,e,r){var n=e[t],o=r[t];return n>o?1:o>n?-1:0},h=function(t,e){return d("productId",t,e)},g=function(t,e){return d("questionId",t,e)},b=function(t){console.error(t)},v=function(t){var e=(null!=t?t:{}).store,r=(null!=t?t:{}).accountId,n=(null!=t?t:{}).anonymous,o=(null!=t?t:{}).customerId,a=(null!=t?t:{}).shoppingCartName,i=(null!=t?t:{}).maxShoppingCarts,u=l().accountId,c=l().customerId,s=l(),f=s.store,p=s.anonymous,y=l().activeShoppingCart,d=l().maxShoppingCarts;return{shoppingCartName:null!=a?a:y,customerId:null!=o?o:c,store:null!=e?e:f,accountId:null!=r?r:u,anonymous:null!=n?n:p,maxShoppingCarts:null!=i?i:d}},O=function(t){if(void 0===t&&(t=""),!l().artisanApp)throw new Error("Artisan app must be provided, you probably forgot to initialize the shopping cart. Please make sure initShoppingCart has been called beforehand. "+t)},m=function(t,e){void 0===e&&(e="");var r=l().accountId;if(void 0===t&&void 0===r)throw new Error("AccountId must be defined. Either provide a global accountId or at the function call level. "+e)},w=function(t,e){void 0===e&&(e="");var r=l().customerId;if(void 0===t&&void 0===r)throw new Error("CustomerId must be defined. Either provide a global customerId or at the function call level. "+e)},j=function(t,e){void 0===e&&(e="");var r=l().store;if(void 0===t&&void 0===r)throw new Error("StoreId must be defined. Either provide a global storeId or at the function call level. "+e)},P=function(t){void 0===t&&(t={});var e=t.accountId,r=t.customerId;m(e),w(r)},I=function(t,e,r){var n=(null!=r?r:{}).benefitId,o=t[e],a=null==o?void 0:o.benefits;if(S(n),!o||!a)return"No benefits wallet available for "+e+", you probably forgot to call listenBenefitsWallet beforehand."},S=function(t){if(void 0===t)throw new Error("BenefitId must be defined. Provide it at the function call level.")},x=function(t){var e=null!=t?t:{},r=e.Platform,n=e.account;!function(t,e){void 0===e&&(e="");var r=l().artisanApp.settings.platform;if(void 0===t&&void 0===r)throw new Error("Platform must be defined. Either provide a global Plafform in the artisan object or at the function call level. "+e)}(r),m(n)},k=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},_=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},E=o,A=function(t){return void 0===t&&(t={}),k(void 0,void 0,void 0,(function(){var e,r,n,o,a,i,u,c,s,f,p;return _(this,(function(y){switch(y.label){case 0:return e=l(),r=e.artisanApp,n=e.accountId,o=l().customerId,a=l().anonymous,i=t.accountId,u=t.customerId,O(),P(t),c=a?"anonymousShoppingCartByUser":"shoppingCartByUser",s=null==r?void 0:r.__internals__.firestore(),[4,null===(p=null===(f=null==s?void 0:s.collection(c))||void 0===f?void 0:f.doc(String(null!=u?u:o)))||void 0===p?void 0:p.collection(String(null!=i?i:n))];case 1:return[2,y.sent()]}}))}))},T=function(t,e){return k(void 0,void 0,void 0,(function(){var r,n;return _(this,(function(o){switch(o.label){case 0:return r=null!=e?e:l().activeShoppingCart,[4,A(t)];case 1:return(n=o.sent())?[4,n.where("name","==",r).get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,o.sent()]}}))}))},C=function(t,e){return k(void 0,void 0,void 0,(function(){var r,n;return _(this,(function(o){switch(o.label){case 0:return r=null!=t?t:l().activeShoppingCart,[4,T(e,r)];case 1:return(n=o.sent())?(c({activeShoppingCart:r}),[4,n.data()]):[2];case 2:return[2,o.sent()]}}))}))},R=function(t,e){return void 0===e&&(e={}),k(void 0,void 0,void 0,(function(){var r,n,o;return _(this,(function(a){switch(a.label){case 0:return r=v(e),n=r.shoppingCartName,[4,A(e)];case 1:return(o=a.sent())?(c({activeShoppingCart:n}),o.where("name","==",n).onSnapshot((function(e){return k(void 0,void 0,void 0,(function(){var r;return _(this,(function(o){switch(o.label){case 0:return e.docs[0]?[4,e.docs[0].data()]:(n!==E&&console.warn("Failed to fetch a shopping cart with name \n "+n+" because there wasn't any."),[2,t(void 0)]);case 1:return r=o.sent(),[2,t(r)]}}))}))})),[2]):[2]}}))}))},B=r(1),U=r.n(B),M=r(0),H=function(){return(H=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},L=o,D=function(t){return void 0===t&&(t=L),function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(r){switch(r.label){case 0:return[4,T({},t)];case 1:return[2,null==(e=r.sent())?void 0:e.id]}}))}))},Y=function(t){if(void 0!==t)return"number"==typeof t?t:t.storeId},N=function(t,e){var r=Y(t);return H("number"!=typeof t?H({},t):{},e[r])},q=function(t){var e=t.store,r=t.amount,n=Y(e);j(n),function(t){if("number"!=typeof t)throw new Error("Invalid amount recieved, please make sure you include a valid amount.");if(t<0)throw new Error("Cannot receive a negative amount of an item. Please ensure you have added a proper amount of items.");if(0===t)throw new Error("Attempting to pass 0 amount. This might indicate a problem with your code. Please ensure you have added a proper amount of items.")}(r)},F=r(3),z=r.n(F),V=function(){return(V=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},G=M.transformers.toCartProduct,W=M.modifierUtils.divideProductQA,K=function(t){var e=W(t),r=e.productId,n=e.questionsAndAnswers,o=e.priceCategory,a=r+"-"+J(n).sort(g).reduce((function(t,e){var r=e.answers.sort(h).reduce((function(t,e,r){var n=e.productId,o=e.amount,a=K(e),i=a?"{"+a+"}":"";return 0===r?n+"="+o+i:t+"|"+n+"="+o+i}),""),n=e.questionId+":"+r;return""===t?""+n:t+"-"+n}),"")+"*"+o;return z()(a)},J=function(t){return t.reduce((function(t,e){var r=e.answers.filter((function(t){return t.amount>0})).map((function(t){var e=J(t.questionsAndAnswers);return V(V({},t),{questionsAndAnswers:e})}));return $($([],t),[V(V({},e),{answers:r})])}),[]).filter((function(t){return t.answers.length>0}))},Q=function(t,e){void 0===e&&(e={});var r=Z(t).reduce((function(t,e){var r=G(e),n=r.priceCategory,o=Object(M.getProductTotals)(r),a="POINTS"===n,i=a?o.netPrice:0,u=a?0:o.netPrice,c=a?0:o.grossPrice;return{subtotal:t.subtotal+c,totalDiscounts:t.totalDiscounts+o.totalDiscounts,totalTaxes:t.totalTaxes+o.totalTaxes,totalPoints:t.totalPoints+i,total:t.total+u}}),{subtotal:0,totalDiscounts:0,totalTaxes:0,totalPoints:0,total:0}),n=X(null==t?void 0:t.additional_info,null==t?void 0:t.benefits,r),o=e.shippingCost,a=void 0===o?t.shippingCost:o;if(!a)return n;var i=a.grossPrice,u=a.netPrice,c=a.taxTotal,l=a.discountTotal;return{subtotal:n.subtotal+i,totalDiscounts:n.totalDiscounts+l,totalTaxes:n.totalTaxes+c,shippingCost:u,totalPoints:n.totalPoints,total:n.total+u}},Z=function(t){return Object.values(t.stores).reduce((function(t,e){var r=Object.values(e.products);return $($([],t),r)}),[])},X=function(t,e,r){return e?Object.values(e).reduce((function(e,r){return"DISCOUNT"===r.type?tt(r,e,t):e}),r):r},tt=function(t,e,r){var n=e.subtotal,o=e.total,a=e.totalDiscounts,i=.01*t.discountPercentage;if(void 0!==(null==r?void 0:r.copayment)){var u=null==r?void 0:r.copayment,c=u*i,l=a+c,s=(u-c).toFixed(4);return V(V({},e),{totalDiscounts:l,total:Number(s)})}var f=n*i,p=a+f,y=o-f;return V(V({},e),{totalDiscounts:p,total:y})},et=function(){return(et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},rt=n,nt=M.transformers.toCartProduct,ot=M.modifierUtils.multiplyProductQA,at=M.modifierUtils.divideProductQA,it=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,a;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(i){switch(i.label){case 0:return q(e),r=e.shoppingCartName,[4,T(e,r)];case 1:return(n=i.sent())?[4,n.data()]:(console.warn("Cannot add a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=i.sent(),a=ut(o,t,e),[4,n.ref.set(a)];case 3:return i.sent(),[2]}}))}))},ut=function(t,e,r){var n=e.amount||1,o=nt(e,et(et({},r),{amount:null!=n?n:1})),a=nt(e,r),i=l().store,u=r.store,c=null!=u?u:i,s=Y(c),f=K(o),p=et({},t),y=et({},t.stores),d=N(c,y),h=et({},d.products),g=h[f],b=U()().format(rt);g?(h[f]=at(h[f]),h[f].amount+=a.amount):(h[f]=a,h[f].hash=f,h[f].createdAt=b),h[f].updatedAt=b;var v=h[f],O=(v=ot(v)).questionsAndAnswers,m=J(O);return h[f]=et(et({},v),{questionsAndAnswers:m}),d.products=h,y[s]=d,p.stores=y,p},ct=function(){return(ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lt=n,st=M.transformers.toCartProduct,ft=M.modifierUtils.multiplyProductQA,pt=M.modifierUtils.divideProductQA,yt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,a;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(i){switch(i.label){case 0:return q(e),r=e.shoppingCartName,[4,T(e,r)];case 1:return(n=i.sent())?[4,n.data()]:(console.warn("Cannot subtract product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=i.sent(),a=dt(o,t,e),[4,n.ref.set(a)];case 3:return i.sent(),[2]}}))}))},dt=function(t,e,r){var n=e.amount||1,o=st(e,ct(ct({},r),{amount:null!=n?n:1})),a=st(e,r),i=l().store,u=r.store,c=null!=u?u:i,s=Y(c),f=K(o),p=ct({},t),y=ct({},t.stores);if(void 0===y[s])return console.warn("StoreId given is invalid. There is no store with id "+s+" on the shopping cart."),t;var d=N(c,y),h=ct({},d.products),g=h[f],b=U()().format(lt);if(!g)return console.warn("Attempting to subtract the amount of product that is not in the given shopping cart store."),t;h[f]=pt(h[f]);var v=h[f].amount-a.amount;return v>0?(h[f].amount=v,h[f].updatedAt=b,h[f]=ft(h[f])):delete h[f],d.products=h,Object.keys(d.products).length?y[s]=d:delete y[s],p.stores=y,p},ht=function(){return(ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gt=M.transformers.toCartProduct,bt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,a;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(i){switch(i.label){case 0:return function(t){var e=t.store,r=Y(e);j(r)}(e),r=e.shoppingCartName,[4,T(e,r)];case 1:return(n=i.sent())?[4,n.data()]:(console.warn("Cannot remove a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=i.sent(),a=vt(o,t,e),[4,n.ref.set(a)];case 3:return i.sent(),[2]}}))}))},vt=function(t,e,r){var n=e.hash;if(!n){var o=gt(e);n=K(o)}var a=l().store,i=r.store,u=null!=i?i:a,c=Y(u),s=ht({},t),f=ht({},t.stores);if(void 0===f[c])return console.warn("StoreId given is invalid. There is no store with id "+c+" on the shopping cart."),t;var p=N(u,f),y=ht({},p.products);return y[n]?(delete y[n],p.products=y,Object.keys(p.products).length?f[c]=p:delete f[c],s.stores=f,s):(console.warn("Attempting to remove product that is not in the given shopping cart store."),t)},Ot=function(){return(Ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mt=n,wt=M.transformers.toCartProduct,jt=M.modifierUtils.multiplyProductQA,Pt=M.modifierUtils.divideProductQA,It=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,c,l,s;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(f){switch(f.label){case 0:return r=null!==(s=null!==(c=e.amount)&&void 0!==c?c:null===(l=t)||void 0===l?void 0:l.amount)&&void 0!==s?s:1,n=Ot(Ot({},e),{amount:r}),q(n),o=e.shoppingCartName,[4,T(e,o)];case 1:return(a=f.sent())?[4,a.data()]:(console.warn("Cannot set product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return i=f.sent(),u=St(i,t,n),[4,a.ref.set(u)];case 3:return f.sent(),[2]}}))}))},St=function(t,e,r){var n,o,a=null!==(o=null===(n=e)||void 0===n?void 0:n.amount)&&void 0!==o?o:1,i=wt(e,Ot(Ot({},r),{amount:a})),u=l().store,c=r.store,s=null!=c?c:u,f=Y(s),p=K(i),y=Ot({},t),d=Ot({},t.stores),h=N(s,d),g=Ot({},h.products),b=g[p],v=U()().format(mt);g[p]=i,b?g[p]=Pt(g[p]):(g[p].createdAt=v,g[p].hash=p),g[p].updatedAt=v;var O=wt(g[p],r),m=(O=jt(O)).questionsAndAnswers,w=J(m);return g[p]=Ot(Ot({},O),{questionsAndAnswers:w}),h.products=g,d[f]=h,y.stores=d,y},xt=function(){return(xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,a;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(i){switch(i.label){case 0:return function(t){var e=t.store,r=Y(e);j(r)}(e),r=e.shoppingCartName,[4,T(e,r)];case 1:return(n=i.sent())?[4,n.data()]:(console.warn("Cannot replace product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=i.sent(),a=_t(o,t,e),[4,n.ref.set(a)];case 3:return i.sent(),[2]}}))}))},_t=function(t,e,r){var n=r.hash,o=null!=n?n:e.hash,a=l().store,i=r.store,u=null!=i?i:a,c=Y(u),s=xt({},t.stores),f=N(u,s),p=xt({},f.products);if(!p[o])return console.warn("Cannot replace a product because no product was found in the given store"),t;delete p[o],f.products=p,Object.keys(f.products).length?s[c]=f:delete s[c];var y=xt({},t);y.stores=s;var d=xt(xt({},e),{amount:0});return ut(y,d,r)},Et=function(){return(Et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},At=o,Tt=function(t,e){return void 0===t&&(t={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,c,s;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(f){switch(f.label){case 0:return r=v(e),[4,A(r)];case 1:return n=f.sent(),o=Ct(t),n?(a=o.name,[4,n.get()]):(console.warn("Couldn't find a shopping cart collection with the given config. \n Please make sure everything is correct in your configuration \n before continue."),[2]);case 2:if(i=null===(s=f.sent())||void 0===s?void 0:s.docs.length,u=l().maxShoppingCarts,i>=u)throw new Error("Cannot add more carts. Carts limit ("+u+") reached.");return[4,n.where("name","==",a).get()];case 3:if(f.sent().docs.length>0)throw new Error("Attempted to add a shopping cart with the name "+a+", but there is already one shopping cart with that name.");return[4,n.add(o)];case 4:return(c=f.sent())?[4,c.set(Et(Et({},o),{id:c.id}))]:(console.error("Failed to create a new shopping cart"),[2]);case 5:return f.sent(),[2]}}))}))},Ct=function(t){void 0===t&&(t={});var e=(new Date).toISOString();return Et({id:"",name:At,latitude:-1,longitude:-1,createdAt:e,updatedAt:e,channelId:1,stores:{},billTotal:{},shippingCost:null},t)},Rt=function(){return(Rt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bt=o,Ut=function(t,e){return void 0===t&&(t=Bt),function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(a){switch(a.label){case 0:return[4,T(e,t)];case 1:return(r=a.sent())?[4,r.data()]:(console.warn("Cannot empty cart, shopping cart nodes not found. Please ensure you have a shopping cart with name "+t+" before continue."),[2]);case 2:return n=a.sent(),o=Rt(Rt({},n),{stores:{}}),[4,r.ref.set(o)];case 3:return a.sent(),[2]}}))}))},Mt=o,Ht=function(t,e){return void 0===t&&(t=Mt),function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(n){switch(n.label){case 0:return[4,T(e,t)];case 1:return(r=n.sent())?[4,r.ref.delete()]:(console.warn("Coundn't find any shopping cart with name "+t+" with the given config."),[2]);case 2:return n.sent(),[2]}}))}))},Lt=r(4),Dt={"Content-Type":"application/json"},Yt=function(){return(Yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},qt=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Ft=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n,o,a,i,u,c,s,f,p,y,d,h,g,b,v,O,m;return qt(this,(function(w){switch(w.label){case 0:return e=l(),r=e.artisanApp,n=e.accountId,o=r.settings,a=o.platform,i=o.accountId,u=null!==(g=null!==(h=null!==(d=null===(y=t.account)||void 0===y?void 0:y.toString())&&void 0!==d?d:null==n?void 0:n.toString())&&void 0!==h?h:null==i?void 0:i.toString())&&void 0!==g?g:"",c=null!==(v=null!==(b=null==t?void 0:t.Platform)&&void 0!==b?b:a)&&void 0!==v?v:"",s=c,null===(O=null==t?void 0:t.Authorization)||void 0===O?[3,1]:(p=O,[3,3]);case 1:return[4,zt()];case 2:p=w.sent(),w.label=3;case 3:return f=null!==(m=p)&&void 0!==m?m:"",[2,new Headers(Yt(Yt(Yt({},Dt),t),{Authorization:f,Platform:s,account:u}))]}}))}))},zt=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n;return qt(this,(function(o){switch(o.label){case 0:return e=l().artisanApp,[4,null===(n=Object(Lt.initAuth)(e).currentUser)||void 0===n?void 0:n.getIdToken(t)];case 1:return(r=o.sent())?[2,"Bearer "+r]:(b("Please make sure you are authenticated before trying to call a restricted action."),[2])}}))}))},Vt=function(){return(Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$t=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},Gt=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Wt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Kt=function(t,e){return $t(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,c,s,f,p;return Gt(this,(function(y){switch(y.label){case 0:return r=l().artisanApp.apiURL,n=t.id,o=t.latitude,a=t.longitude,[4,Ft(Vt({},e))];case 1:i=y.sent(),y.label=2;case 2:return y.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/"+n+"/validateShoppingCart?latitude="+o+"&longitude="+a,{headers:i}).then((function(t){return $t(void 0,void 0,void 0,(function(){return Gt(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(u=y.sent(),!(c=u.data))throw new Error("No shopping cart was found.");return s=Object.values(c.stores).reduce((function(t,e){return e.alerts.length?Wt(Wt([],t),e.alerts):t}),[]),f=Object.values(c.stores).some((function(t){return!!t.alerts.length||Object.values(t.products).some((function(t){return t.alerts.length}))})),[2,{stores:s,products:f}];case 4:return p=y.sent(),console.error(p.message),[2,{stores:[{errorLevel:1,message:"Occurrió un error desconocido, comuníquese con soporte",type:""}],products:!1}];case 5:return[2]}}))}))},Jt=function(t,e,r){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,a,i;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(u){switch(u.label){case 0:return function(t,e){!function(t,e){void 0===e&&(e="");var r=l().artisanApp.apiURL;if(void 0===t&&void 0===r)throw new Error("ApiURL must be defined. Either provide a global ApiURL or at the function call level. "+e)}(t.apiURL),x(e)}(t,e),n=null!=r?r:l().activeShoppingCart,[4,D(n)];case 1:return void 0===(o=u.sent())?(console.error("Cannot use undefined as a shopping cart id. Shopping cart "+n+" was not found. Validation canceled."),[2]):(a=t.latitude,i=t.longitude,[4,Kt({id:o,latitude:a,longitude:i},e)]);case 2:return[2,u.sent()]}}))}))},Qt=function(){return(Qt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,a;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(i){switch(i.label){case 0:return[4,T({},e)];case 1:return(r=i.sent())?[4,r.data()]:(n=null!=e?e:l().activeShoppingCart,console.warn("Cannot set additional info because no shopping cart was found. Please ensure you create a shopping cart with name "+n+" before continue."),[2]);case 2:return o=i.sent(),a=Xt(o,t),[4,r.ref.set(a)];case 3:return i.sent(),[2]}}))}))},Xt=function(t,e){return Qt(Qt({},t),{additional_info:e(t.additional_info)})},te=function(){return(te=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ee=function(t){return void 0===t&&(t={}),te({benefits:[]},t)},re=function(t,e){var r,n=l().wallets,o=te(te({},n),((r={})[t]=te({},e),r));c({wallets:o})},ne=function(t){return void 0===t&&(t={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e,r,n,o,a,i,u,c,s;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(f){switch(f.label){case 0:return e=l(),r=e.artisanApp,n=e.customerId,o=e.accountId,a=t.accountId,i=t.customerId,O(),P(t),u=null==r?void 0:r.__internals__.firestore(),[4,null===(s=null===(c=null==u?void 0:u.collection("benefitsByUser"))||void 0===c?void 0:c.doc(String(null!=i?i:n)))||void 0===s?void 0:s.collection(String(null!=a?a:o))];case 1:return[2,f.sent()]}}))}))},oe=function(){return(oe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ae=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},ie=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},ue=function(t,e){return ae(void 0,void 0,void 0,(function(){var r,n,o,a,i,u;return ie(this,(function(c){switch(c.label){case 0:return r=l().artisanApp.apiURL,n=t.vendorId,o=t.customerId,[4,Ft(oe(oe({},e),{uid:o.toString()}))];case 1:a=c.sent(),i="/api/shopping-cart/retrieveBenefits",n&&(i=i+"?vendorId="+n),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,fetch(""+r+i,{headers:a}).then((function(t){return ae(void 0,void 0,void 0,(function(){return ie(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(!c.sent())throw new Error("The benefits wallet is not defined. Make sure coupons arewell configured");return[3,5];case 4:throw u=c.sent(),Error(u.message);case 5:return[2]}}))}))},ce=function(t,e,r){return ae(void 0,void 0,void 0,(function(){var n,o,a,i,u,c;return ie(this,(function(s){switch(s.label){case 0:return n=l().artisanApp.apiURL,o=t.customerId,[4,Ft(oe(oe({},r),{uid:o.toString()}))];case 1:a=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,fetch(n+"/api/wallet_profit/apply",{method:"post",body:JSON.stringify({code:e}),headers:a}).then((function(t){return ae(void 0,void 0,void 0,(function(){return ie(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(i=s.sent(),200===(u=i).code)return[2,!0];if(null===u.data||!u.data)throw new Error(u.message);return b("Unhandled response when redeeming coupon "+JSON.stringify(u,void 0,2)),[2,!1];case 4:throw c=s.sent(),new Error("Failed to redeem coupon "+e+". "+c.message);case 5:return[2]}}))}))},le=function(){return(le=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},se=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},fe=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},pe=function(t,e,r,n){!function(t){var e=(null!=t?t:{}).customerId;w(e)}(e),x(n);var o=l().customerId,a=l(),i=a.activeShoppingCart,u=a.wallets,c=null!=r?r:i,s=u[c],f=(null!=e?e:{}).customerId,p=null!=f?f:o;if(s)return b("There is already a listener for wallet of name "+c+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return ye(c)};var y=ee();re(c,le(le({},y),{onSnapshot:t}));var d=void 0;return se(void 0,void 0,void 0,(function(){var r,o;return fe(this,(function(a){switch(a.label){case 0:r=le(le({},e),{customerId:p}),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,ue(r,n)];case 2:return a.sent(),[3,4];case 3:return a.sent(),console.error("Failed to retrieve the user's wallet"),[2];case 4:return[4,ne(e)];case 5:return(o=a.sent())?(d=o.onSnapshot((function(e){return se(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,l;return fe(this,(function(s){return r=null!==(l=null===(u=e.docs[0])||void 0===u?void 0:u.data())&&void 0!==l?l:{},0===Object.keys(r).length?(n=ee(),re(c,le(le({},n),{onSnapshot:t})),t(n),[2]):(o=e.docs[0].id,a=function(t,e){return Object.values(t).map((function(t){return te(te({},t),{hash:e})}))}(r,o),i=ee({benefits:a}),re(c,le(le({},i),{onSnapshot:t})),t(i),[2])}))}))})),[2]):(console.error("Failed to retrieve the benefits wallet node"),[2])}}))})),function(){return ye(c,d)}},ye=function(t,e){var r=l().wallets,n=le({},r);delete n[t],c({wallets:n}),e&&e()},de=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},he=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},ge=function(t,e){return de(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,c,s,f;return he(this,(function(p){if(P(t),r=l(),n=r.activeShoppingCart,o=r.wallets,i=I(o,a=null!=e?e:n,t))return b(i),[2];if(u=o[a],c=u.benefits,s=t.benefitId,!(f=c.find((function(t){return t.benefitId===s}))))return b("No benefit was found in the benefits wallet with the benefitId provided."),[2];switch(f.type){case"PRODUCT":return[2,be(t,f,a)];case"ALTER_DELIVERY":return[2,ve(t,f,a)];default:b("The benefit to be applied is not of type PRODUCT or ALTER_DELIVERY.")}return[2]}))}))},be=function(t,e,r){return de(void 0,void 0,void 0,(function(){var n,o,a,i;return he(this,(function(u){switch(u.label){case 0:return n=t.benefitProductConfig,o=e.benefitId,n?(a=n.product,i=n.config,a.benefitId=o,[4,Oe(t,e,r)]):(b("The product has not been provided to apply the selected benefit."),[2]);case 1:return u.sent(),[2,it(a,i)]}}))}))},ve=function(t,e,r){return de(void 0,void 0,void 0,(function(){var n,o,a,i,u,c,l,s,f;return he(this,(function(p){switch(p.label){case 0:return n=t.shippingCost,o=t.latitude,a=t.longitude,n&&o&&a?(i=e.benefitWalletId,u=e.award,c=u.benefitId,l=u.discountPercentage,s=n.subtotalBeforeTaxes,(f=[]).push({benefitWalletId:i,benefitId:c,discountBase:s,percentage:l,priceCategory:"NORMAL",value:s*(l/100)}),n.discounts=f,[4,Oe(t,e,r,n)]):(b("The shippingCost, latitude and longitude are require to apply the selected benefit."),[2]);case 1:return p.sent(),[2,Jt({latitude:o,longitude:a})]}}))}))},Oe=function(t,e,r,n){return de(void 0,void 0,void 0,(function(){var o,a,i,u;return he(this,(function(c){switch(c.label){case 0:return o=t.customerId,[4,T({customerId:o},r)];case 1:return(a=c.sent())?[4,a.data()]:(console.warn("Cannot add benefit because no shopping cart nodes were found. Please ensure you have a shopping cart before continue."),[2]);case 2:return i=c.sent(),u=me(i,e,n),[4,a.ref.set(u)];case 3:return c.sent(),[2]}}))}))},me=function(t,e,r){var n=e.hash,o=t.benefits,a=null!=o?o:[];return a.push(e),t.benefits=a,t.benefitsHash=n,r&&(t.shippingCost=r),t},we=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},je=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Pe=function(t,e){return we(void 0,void 0,void 0,(function(){var r,n,o,a,i,u,c,s,f;return je(this,(function(p){if(P(t),r=l(),n=r.activeShoppingCart,o=r.wallets,i=I(o,a=null!=e?e:n,t))return b(i),[2];if(u=o[a],c=u.benefits,s=t.benefitId,!(f=c.find((function(t){return t.benefitId===s}))))return b("No benefit was found in the benefits wallet with the benefitId provided."),[2];switch(f.type){case"PRODUCT":return[2,Ie(t,f,a)];case"ALTER_DELIVERY":return[2,Se(t,f,a)];default:b("The benefit to be removed is not of type PRODUCT or ALTER_DELIVERY.")}return[2]}))}))},Ie=function(t,e,r){return we(void 0,void 0,void 0,(function(){var n,o,a,i,u;return je(this,(function(c){switch(c.label){case 0:return n=t.benefitProductConfig,a=(o=null!=n?n:{}).product,i=o.config,u=(null!=i?i:{}).store,a&&u?[4,xe(t,e,r)]:(b("The cart product and the store, inside benefitProductConfig object, are required to remove the selected benefit."),[2]);case 1:return c.sent(),[2,bt(a,i)]}}))}))},Se=function(t,e,r){return we(void 0,void 0,void 0,(function(){var n;return je(this,(function(o){return(n=t.shippingCost)?[2,xe(t,e,r,n)]:(b("The shippingCost is require to remove the selected benefit."),[2])}))}))},xe=function(t,e,r,n){return we(void 0,void 0,void 0,(function(){var o,a,i,u;return je(this,(function(c){switch(c.label){case 0:return o=t.customerId,[4,T({customerId:o},r)];case 1:return(a=c.sent())?[4,a.data()]:(console.warn("Cannot remove benefit because no shopping cart nodes were found. Please ensure you have a shopping cart before continue."),[2]);case 2:return i=c.sent(),u=ke(i,e,n),[4,a.ref.set(u)];case 3:return c.sent(),[2]}}))}))},ke=function(t,e,r){var n=t.benefits,o=e.benefitId;if(!n)return console.warn("Cannot remove benefit because the shopping cart does not have benifits applied."),t;var a=n.findIndex((function(t){return t.benefitId===o}));return a<0?(console.warn("This benefit can not be removed beacuse it is not applied to shopping cart."),t):(n.splice(a,1),t.benefitsHash=void 0,r&&(t.shippingCost=r),t)},_e=function(){return(_e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ee=function(t,e,r,n){return function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var o,a,i,u,c,s,f;return function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}(this,(function(p){return o=l().customerId,P(t),x(n),a=l(),i=a.activeShoppingCart,a.wallets[u=null!=r?r:i]||b("No benefits wallet available for "+u+", you probably forgot to call listenBenefitsWallet beforehand."),c=t.customerId,s=null!=c?c:o,f=_e(_e({},t),{customerId:s}),[2,ce(f,e,n)]}))}))}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return a})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return i}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,a=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},i=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t){t.exports=JSON.parse('{"name":"@artisan-commerce/analytics-web","description":"Artisan commerce analytics web library","version":"0.1.0-canary.26","main":"./build/main.bundle.js","types":"./build/src/index.d.ts","files":["build/","LICENSE","README.md"],"scripts":{"start":"webpack --config webpack.dev.js","dev":"yarn start","build":"webpack --config webpack.prod.js","start:build":"nodemon ./build/main.bundle.js","test":"jest --watchAll --runInBand","test:all":"yarn test --watchAll=false --coverage","test:ci":"cross-env CI=true jest --runInBand","test:staged":"yarn test:ci --findRelatedTests ./src","check-types":"tsc --noEmit","lint":"eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .","lint:staged":"yarn lint --max-warnings=0","prettier":"prettier --ignore-path .gitignore \\"**/*.+(js|jsx|ts|tsx|json|css|scss|html)\\"","format":"yarn prettier --write","check-format":"yarn prettier --list-different","validate":"cross-env CI=true npm-run-all --parallel test:ci check-types check-format lint build","validate:ci":"npm-run-all --parallel check-types check-format lint"},"author":"Luis Eduardo Andrade","license":"MIT","dependencies":{"@artisan-commerce/state":"0.2.2-canary.4","snake-case":"^3.0.4"},"devDependencies":{"@artisan-commerce/products":"0.8.2-canary.18","@artisan-commerce/shopping-cart":"0.11.0-canary.19","@artisan-commerce/types":"0.13.0-canary.10","@babel/core":"^7.10.5","@babel/preset-env":"^7.10.4","@babel/preset-react":"^7.10.4","@types/faker":"^4.1.12","@types/jest":"^26.0.5","@types/jest-in-case":"^1.0.2","@types/node":"^14.0.24","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","avn":"^0.2.4","avn-nvm":"^0.2.2","clean-webpack-plugin":"^3.0.0","dotenv-webpack":"^2.0.0","env-cmd":"^10.1.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-config-react-app":"^5.2.1","eslint-config-universe":"^4.0.0","eslint-plugin-cypress":"^2.11.1","eslint-plugin-flowtype":"^5.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.3","eslint-plugin-react-hooks":"^4.0.8","is-ci-cli":"^2.1.2","jest-axe":"^3.5.0","jest-extended":"^0.11.5","jest-in-case":"^1.0.2","jest-styled-components":"^7.0.2","nodemon":"^2.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","start-server-and-test":"^1.11.2","test-data-bot":"^0.8.0","ts-jest":"^26.1.4","ts-loader":"^8.0.2","webpack":"^4.43.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","webpack-merge":"^5.0.9"},"peerDependencies":{"@artisan-commerce/products":"*","@artisan-commerce/shopping-cart":"*"}}')},,function(t,e,r){"use strict";r.r(e),r.d(e,"initAnalytics",(function(){return T})),r.d(e,"Providers",(function(){return x})),r.d(e,"events",(function(){return Wh})),r.d(e,"updateActiveVendor",(function(){return l})),r.d(e,"identifyUser",(function(){return Kh}));var n=r(2),o=r(3),a=function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i={providers:[],activeVendor:void 0,vendors:void 0,shareArtisanAnalytics:!1,debug:!1,meta:{accountId:void 0,vendorId:void 0,vendorName:void 0,storeId:void 0,storeName:void 0,catalogueId:void 0,catalogueName:void 0,appName:void 0,platform:"web",versionApp:void 0,versionSDK:o.version}},u=function(){return Object(n.getState)()},c=function(t){return Object(n.setState)(t)},l=function(t){var e=typeof t;if("number"!==e&&"object"!==e&&"undefined"!==e)return y("The type of vendor must be a number or Vendor type","severe");var r=u();if("number"==typeof t||void 0===t)c(a(a({},r),{activeVendor:t,meta:a(a({},r.meta),{vendorName:void 0,vendorId:t})}));else{var n=t.id,o=t.name;c(a(a({},r),{activeVendor:n,meta:a(a({},r.meta),{vendorName:o,vendorId:n})}))}},s={GLOBAL_TRACKING_ID:"G-JZ7R91ZNMB"},f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},p=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},y=function(t,e){var r=u().debug,n="artisan-commerce/analytics";if("debug"!==e||r)switch(e){case"debug":console.log("%c(Debug) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"log":console.log("%c(Log) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"warn":console.warn("%c(Warning) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"error":console.error("%c(Error) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"severe":throw new Error(n+": \n"+t);default:throw new Error("Log message "+t+" of type "+e+" is not a supported type.")}},d=function(){function t(){this.initialized=!1,this._type="GOOGLE_ANALYTICS",this._name="__GLOBAL_PROVIDER__",this._trackingId=s.GLOBAL_TRACKING_ID,this._sampleRate=100,this._currency="USD"}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trackingId",{get:function(){return this._trackingId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),Object.defineProperty(t,"instance",{get:function(){return t._instance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=u().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.setVendors=function(t){this._vendors=t},t.prototype.init=function(){if("undefined"!=typeof window){if(this.initialized)return y("Provider "+this._name+" was already initialized. Do not call init unless you know what you are doing.","severe");this.initialized=!0;var t=document.createElement("script");t.setAttribute("async","true"),t.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this._trackingId);var e=document.createElement("script");e.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this._trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.body.appendChild(t),document.body.appendChild(e)}},t.prototype.updateConfig=function(t){void 0===t&&(t={});var e=Object.entries(t).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),r=t.userId,n=t.currency,o=t.language;e.includes("userId")&&(this._userId=r),e.includes("currency")&&(this._currency=n),e.includes("language")&&(this._language=o),gtag("set",this._trackingId,t)},t._instance=new t,t}(),h=function(){function t(t){this.initialized=!1;var e=t.type,r=t.name,n=t.trackingId,o=t.vendors;this.type=e,this.name=r,this.trackingId=n,this._vendors=o}return Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=u().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.init=function(){if("undefined"!=typeof window)return this.initialized?y("Provider "+this.name+" was already initialized. Do not call init unless you know what you are doing.","severe"):void(this.initialized=!0)},t.prototype.updateConfig=function(t){!function(t,e){if(t.trackingId!==s.GLOBAL_TRACKING_ID){var r=Object.entries(e).reduce((function(t,e,r){var n=e[0],o=e[1];return 0===r?n+": "+o:t+"\n"+n+": "+o}),"");y(t.name+" config updated for the following fields.\n "+r,"debug")}}(this,t),d.instance.updateConfig(t)},t}(),g=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),b=function(){return(b=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},v=function(t){function e(e){var r=this,n=e.version,o=e.currency;return(r=t.call(this,b(b({},e),{type:"FACEBOOK_PIXEL"}))||this)._version=null!=n?n:"10.0",r._currency=null!=o?o:"USD",r}return g(e,t),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("link");e.setAttribute("rel","preconnect"),e.setAttribute("href","https://connect.facebook.net/en_US/fbevents.js");var r=document.createElement("script");r.setAttribute("async","true"),r.innerText="!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='"+this.version+"';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '"+this.trackingId+"');fbq('trackSingle', '"+this.trackingId+"', 'PageView');";var n=document.createElement("noscript");n.innerHTML='\n <img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id={'+this.trackingId+'}&noscript=1"/>\n ',document.head.appendChild(e),document.head.appendChild(r),document.head.appendChild(n)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.currency;r.includes("currency")&&(this._currency=n),t.prototype.updateConfig.call(this,e)},e}(h),O=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),m=function(){return(m=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},w=function(t){function e(e){var r=t.call(this,m(m({},e),{type:"GOOGLE_ANALYTICS"}))||this,n=e.userId,o=e.currency,a=e.language,i=e.sampleRate;return r._sampleRate=i,r._userId=n,r._language=a,r._currency=null!=o?o:"USD",r}return O(e,t),Object.defineProperty(e.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("link");e.setAttribute("rel","preconnect"),e.setAttribute("href","https://www.googletagmanager.com/gtag/js?id="+this.trackingId);var r=document.createElement("script");r.setAttribute("async","true"),r.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this.trackingId);var n=document.createElement("script");n.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this.trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.head.appendChild(e),document.head.appendChild(r),document.head.appendChild(n)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.userId,o=e.currency,a=e.language;r.includes("userId")&&(this._userId=n),r.includes("currency")&&(this._currency=o),r.includes("language")&&(this._language=a),gtag("set",this.trackingId,e),t.prototype.updateConfig.call(this,e)},e}(h),j=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),P=function(){return(P=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))},S=function(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},x={FacebookPixel:v,GoogleAnalytics:w,Segment:function(t){function e(e){var r=t.call(this,P(P({},e),{type:"SEGMENT"}))||this,n=e.writeKey,o=e.currency;return r._writeKey=n,r._currency=null!=o?o:"USD",r}return j(e,t),e.prototype.init=function(){return I(this,void 0,void 0,(function(){var e;return S(this,(function(r){return t.prototype.init.call(this),(e=document.createElement("script")).setAttribute("async","true"),e.innerText='\n !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="'+this._writeKey+'";analytics.SNIPPET_VERSION="4.13.2";\n analytics.load("'+this._writeKey+'");\n analytics.page();\n }}();\n ',document.head.appendChild(e),[2]}))}))},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.currency;r.includes("currency")&&(this._currency=n),t.prototype.updateConfig.call(this,e)},e}(h)},k=function(){return(k=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},E=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},A=!1,T=function(t){if(A)y("initAnalytics has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initAnalytics is only called once.","warn");else if(!("undefined"==typeof window)){A=!0,Object(n.initState)(i);var e=t.providers,r=t.shareArtisanAnalytics;if(!e.length)return y("At least one provider should be included but none were found","severe");if(!function(t){var e=t.map((function(t){return t.name}));return new Set(e).size===e.length}(e))return y("Providers names must be unique, check that no provider names are repeated","severe");if(!function(t){var e=t.map((function(t){return t.trackingId}));return new Set(e).size===e.length}(e))return y("Providers trackerId must be unique, check that no provider trackerId are repeated","severe");var a=t.meta,u=_(t,["meta"]),l=r?E([d.instance],e):e,s=k(k({},u),{providers:l,meta:k(k({},a),{vendorId:u.activeVendor,platform:"web",versionSDK:o.version})});c(s),e.forEach((function(t){var e=t.vendors,r=t.name;e||y("The provider "+r+" has no set vendors, as a result no events will be skipped for this provider","debug")}));var f,p={};l.forEach((function(t){p=k(k({},p),t),t.init()})),f=(null==(f=l.reduce((function(t,e){return e.vendors?E(E([],t),e.vendors):t}),[]))?void 0:f.length)?f:void 0,d.instance.updateConfig(p),d.instance.setVendors(f)}};var C=function(){return(C=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.create;Object.create;function R(t){return t.toLowerCase()}var B=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],U=/[^A-Z0-9]+/gi;function M(t,e,r){return e instanceof RegExp?t.replace(e,r):e.reduce((function(t,e){return t.replace(e,r)}),t)}function H(t,e){return void 0===e&&(e={}),function(t,e){void 0===e&&(e={});for(var r=e.splitRegexp,n=void 0===r?B:r,o=e.stripRegexp,a=void 0===o?U:o,i=e.transform,u=void 0===i?R:i,c=e.delimiter,l=void 0===c?" ":c,s=M(M(t,n,"$1\0$2"),a,"\0"),f=0,p=s.length;"\0"===s.charAt(f);)f++;for(;"\0"===s.charAt(p-1);)p--;return s.slice(f,p).split("\0").map(u).join(l)}(t,C({delimiter:"."},e))}var L=function(){return(L=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],a=e[1],i=(void 0===n&&(n={}),H(o,C({delimiter:"_"},n)));return L(L({},t),((r={})[i]=a,r))}),{})},Y=function(){return(Y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},N=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},q=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=N(e,["callback","userId"]),c=null!=a?a:n,l=Y(Y({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","change_password_attempt",Y(Y({send_to:r,event_callback:o},s),p))},F=function(){return(F=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},V=function(t,e){var r=t.trackingId,n=z(e,[]);delete n.userId;var o=F({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ChangePasswordAttempt",F(F({},a),c))},$=function(){return($=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},G=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},W=function(t,e){var r=G(e,[]);delete r.userId;var n=$({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Change Password Attempt",$($({},o),i))},K=r(1),J=r(0),Q=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Z=function(t,e){var r=e.vendors,n=u().activeVendor;return-1!==n&&(void 0!==r&&((!n||!r.includes(n))&&(void 0===n?y("No active vendor is set. Please make sure you configure an active vendor before trying to emit an event","warn"):function(t,e){var r=u().activeVendor;e.trackingId!==s.GLOBAL_TRACKING_ID&&y("Skipping vendor "+r+" for event "+t+" of provider "+e.name+" as configured","debug")}(t,e),!0)))},X=function(t){if(!t.length)return y("No providers found, the initAnalytics probably hasn't been run yet","severe"),!1;var e=function(t){var e=new Set(t.map((function(t){return t.type})));return Array.from(e).reduce((function(t,e){switch(e){case"GOOGLE_ANALYTICS":if("undefined"==typeof gtag)return Q(Q([],t),[e]);break;case"FACEBOOK_PIXEL":if("undefined"==typeof fbq)return Q(Q([],t),[e]);break;case"SEGMENT":if("undefined"==typeof analytics)return Q(Q([],t),[e]);break;default:throw new Error("Profiver of type "+e+" is not supported")}return t}),[])}(t);return!e.length||(e.forEach((function(t){!function(t){y(t+" SDK not initialized. Please make sure the SDK is initialized before trying to emit an event","severe")}(t)})),!1)},tt=function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},et=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},rt=function(t,e,r){var n=r.facebookPixelHandler,o=r.googleAnalyticsHandler,a=r.segmentHandler,i=u().providers;if(X(i)){var c=tt(tt({},e),{artisanEvent:t}),l=i.reduce((function(e,r){if(Z(t,r))return e;switch(r.type){case"FACEBOOK_PIXEL":n(r,c);break;case"GOOGLE_ANALYTICS":o(r,c);break;case"SEGMENT":a(r,c);break;default:throw new Error("Provider of type "+r.type+" is not supported")}return et(et([],e),[r])}),[]);!function(t,e){var r=e.reduce((function(t,e){var r,n;if(e.trackingId===s.GLOBAL_TRACKING_ID)return t;var o=e.name,a=e.type,i=null!==(n=t[a])&&void 0!==n?n:[];return f(f({},t),((r={})[a]=p(p([],i),[o]),r))}),{}),n=Object.entries(r).reduce((function(t,e){var r=e[0],n=e[1];return""+t+(r.charAt(0).toUpperCase()+r.slice(1))+": "+n.join(", ")+"\n"}),"");y("Event "+t+" was successfully sent to the following providers "+n,"debug")}(t,l)}},nt=function(t){return Object(K.getShoppingCartProducts)(t).map((function(t){return t.productId}))},ot=function(t){return Object(K.getShoppingCartProducts)(t).map((function(t){return at(t)}))},at=function(t){var e=Object(J.getProductTotals)(t);return t.name+":"+e.netPrice},it=function(t,e){return Object(K.getShoppingCartProducts)(t).map((function(t){return ut(t,e)}))},ut=function(t,e){var r=Object(J.getProductTotals)(t);return{item_id:t.productId,item_name:t.name,quantity:t.amount,price:r.netPrice,currency:e}},ct=function(t){return t.join(",")},lt=function(t){return t.map((function(t){return function(t){return{product_id:t.productId,name:t.name,price:Object(J.getProductTotals)(t).netPrice}}(t)}))},st=function(t){rt("changePasswordAttempt",t,{googleAnalyticsHandler:q,facebookPixelHandler:V,segmentHandler:W})},ft=function(){return(ft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=pt(e,["callback","userId"]),c=null!=a?a:n,l=ft(ft({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","sign_up_attempt",ft(ft({send_to:r,event_callback:o},s),p))},dt=function(){return(dt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ht=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},gt=function(t,e){var r=t.trackingId,n=ht(e,[]);delete n.userId;var o=dt({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SignUpAttempt",dt(dt({},a),c))},bt=function(){return(bt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},vt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ot=function(t,e){var r=vt(e,[]);delete r.userId;var n=bt({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Sign Up Attempt",bt(bt({},o),i))},mt=function(t){rt("signUpAttempt",t,{googleAnalyticsHandler:yt,facebookPixelHandler:gt,segmentHandler:Ot})},wt=function(){return(wt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=jt(e,["callback","userId"]),c=null!=a?a:n,l=wt(wt({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","change_password_fail",wt(wt({send_to:r,event_callback:o},s),p))},It=function(){return(It=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},St=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},xt=function(t,e){var r=t.trackingId,n=St(e,[]);delete n.userId;var o=It({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ChangePasswordFail",It(It({},a),c))},kt=function(){return(kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_t=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Et=function(t,e){var r=_t(e,[]);delete r.userId;var n=kt({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Change Password Fail",kt(kt({},o),i))},At=function(t){rt("changePasswordFail",t,{googleAnalyticsHandler:Pt,facebookPixelHandler:xt,segmentHandler:Et})},Tt=function(){return(Tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ct=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Rt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Ct(e,["callback","userId"]),c=null!=a?a:n,l=Tt(Tt({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","change_password_success",Tt(Tt({send_to:r,event_callback:o},s),p))},Bt=function(){return(Bt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ut=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Mt=function(t,e){var r=t.trackingId,n=Ut(e,[]);delete n.userId;var o=Bt({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ChangePasswordSuccess",Bt(Bt({},a),c))},Ht=function(){return(Ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Dt=function(t,e){var r=Lt(e,[]);delete r.userId;var n=Ht({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Change Password Success",Ht(Ht({},o),i))},Yt=function(t){rt("changePasswordSuccess",t,{googleAnalyticsHandler:Rt,facebookPixelHandler:Mt,segmentHandler:Dt})},Nt=function(){return(Nt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ft=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=qt(e,["callback","userId"]);delete i.identify;var c=null!=a?a:n,l=Nt(Nt({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","login",Nt(Nt({send_to:r,event_callback:o},s),p))},zt=function(){return(zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$t=function(t,e){var r=t.trackingId,n=Vt(e,[]);delete n.userId,delete n.identify;var o=zt({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SignIn",zt(zt({},a),c))},Gt=function(){return(Gt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Kt=function(t,e){var r=e.name,n=e.identify,o=Wt(e,["name","identify"]);delete o.userId;var a=Gt(Gt({},o),{username:r}),i=D(a),c=u().meta,l=D(c);if(analytics.track("Signed In",Gt(Gt({},i),l)),n){var s=n.name,f=void 0===s?r:s,p=Wt(n,["name"]);analytics.identify(n.id,Gt({name:f},p))}},Jt=function(t){rt("signIn",t,{googleAnalyticsHandler:Ft,facebookPixelHandler:$t,segmentHandler:Kt})},Qt=function(){return(Qt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Zt(e,["callback","userId"]),c=null!=a?a:n,l=Qt(Qt({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","sign_out",Qt(Qt({send_to:r,event_callback:o},s),p))},te=function(){return(te=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ee=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},re=function(t,e){var r=t.trackingId,n=ee(e,[]);delete n.userId;var o=te({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SignOut",te(te({},a),c))},ne=function(){return(ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ae=function(t,e){var r=e.name,n=oe(e,["name"]);delete n.userId;var o=ne(ne({},n),{username:r}),a=D(o),i=u().meta,c=D(i);analytics.track("Signed Out",ne(ne({},a),c)),analytics.reset()},ie=function(t){rt("signOut",t,{googleAnalyticsHandler:Xt,facebookPixelHandler:re,segmentHandler:ae})},ue=function(){return(ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ce=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},le=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=ce(e,["callback","userId"]);delete i.identify;var c=null!=a?a:n,l=ue(ue({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","sign_up",ue(ue({send_to:r,event_callback:o},s),p))},se=function(){return(se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pe=function(t,e){var r=t.trackingId,n=fe(e,[]);delete n.userId,delete n.identify;var o=se({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingle",r,"CompleteRegistration",se(se({},a),c))},ye=function(){return(ye=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},de=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},he=function(t,e){var r=e.name,n=e.method,o=e.identify,a=de(e,["name","method","identify"]);delete a.userId;var i=ye(ye({},a),{username:r,type:n}),c=D(i),l=u().meta,s=D(l);if(analytics.track("Signed Up",ye(ye({},c),s)),o){var f=o.name,p=void 0===f?r:f,y=o.email,d=void 0===y?a.email:y,h=de(o,["name","email"]);analytics.identify(o.id,ye({name:p,email:d},h))}},ge=function(t){rt("signUp",t,{googleAnalyticsHandler:le,facebookPixelHandler:pe,segmentHandler:he})},be={logChangePasswordAttempt:st,logSignUpAttempt:mt,logChangePasswordFail:At,logChangePasswordSuccess:Yt,logSignIn:Jt,logSignOut:ie,logSignUp:ge},ve=be,Oe=function(){return(Oe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},me=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},we=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=me(e,["callback","userId"]),c=null!=a?a:n,l=Oe(Oe({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","banner_impression",Oe(Oe({send_to:r,event_callback:o},s),p))},je=function(){return(je=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ie=function(t,e){var r=t.trackingId,n=Pe(e,[]);delete n.userId;var o=je({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"BannerImpression",je(je({},a),c))},Se=function(){return(Se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ke=function(t,e){var r=xe(e,[]);delete r.userId;var n=Se({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Banner Impression",Se(Se({},o),i))},_e=function(t){rt("bannerImpression",t,{googleAnalyticsHandler:we,facebookPixelHandler:Ie,segmentHandler:ke})},Ee=function(){return(Ee=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ae=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Te=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Ae(e,["callback","userId"]),c=null!=a?a:n,l=Ee(Ee({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","select_content",Ee(Ee({send_to:r,event_callback:o,content_type:"banner"},s),p))},Ce=function(){return(Ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Re=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Be=function(t,e){var r=t.trackingId,n=Re(e,[]);delete n.userId;var o=Ce({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SelectBanner",Ce(Ce({},a),c))},Ue=function(){return(Ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Me=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},He=function(t,e){var r=Me(e,[]);delete r.userId;var n=Ue({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Select Banner",Ue(Ue({},o),i))},Le=function(t){rt("selectBanner",t,{googleAnalyticsHandler:Te,facebookPixelHandler:Be,segmentHandler:He})},De={logBannerImpression:_e,logSelectBanner:Le},Ye=De,Ne=function(){return(Ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fe=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=qe(e,["callback","userId"]),c=null!=a?a:n,l=Ne(Ne({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","add_billing_info",Ne(Ne({send_to:r,event_callback:o},s),p))},ze=function(){return(ze=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ve=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$e=function(t,e){var r=t.trackingId,n=Ve(e,[]);delete n.userId;var o=ze({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"AddBillingInfo",ze(ze({},a),c))},Ge=function(){return(Ge=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},We=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ke=function(t,e){var r=We(e,[]);delete r.userId;var n=Ge({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Add Billing Info",Ge(Ge({},o),i))},Je=function(t){rt("addBillingInfo",t,{googleAnalyticsHandler:Fe,facebookPixelHandler:$e,segmentHandler:Ke})},Qe=function(){return(Qe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ze=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xe=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Ze(e,["callback","userId"]),c=null!=a?a:n,l=Qe(Qe({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","select_billing_info",Qe(Qe({send_to:r,event_callback:o},s),p))},tr=function(){return(tr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},er=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rr=function(t,e){var r=t.trackingId,n=er(e,[]);delete n.userId;var o=tr({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SelectBillingInfo",tr(tr({},a),c))},nr=function(){return(nr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},or=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ar=function(t,e){var r=or(e,[]);delete r.userId;var n=nr({},r),o=D(n),a=u().meta,i=D(a);analytics.track("SelectBilling Info",nr(nr({},o),i))},ir=function(t){rt("selectBillingInfo",t,{googleAnalyticsHandler:Xe,facebookPixelHandler:rr,segmentHandler:ar})},ur=function(){return(ur=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},cr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},lr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=cr(e,["callback","userId"]),c=null!=a?a:n,l=ur(ur({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","update_billing_info",ur(ur({send_to:r,event_callback:o},s),p))},sr=function(){return(sr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pr=function(t,e){var r=t.trackingId,n=fr(e,[]);delete n.userId;var o=sr({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"UpdateBillingInfo",sr(sr({},a),c))},yr=function(){return(yr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hr=function(t,e){var r=e.fields,n=dr(e,["fields"]);delete n.userId;var o=yr(yr({},n),{fields:ct(r)}),a=D(o),i=u().meta,c=D(i);analytics.track("Update Billing Info",yr(yr({},a),c))},gr=function(t){rt("updateBillingInfo",t,{googleAnalyticsHandler:lr,facebookPixelHandler:pr,segmentHandler:hr})},br={logAddBillingInfo:Je,logSelectBillingInfo:ir,logUpdateBillingInfo:gr},vr=br,Or=function(){return(Or=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=mr(e,["callback","userId"]),c=null!=a?a:n,l=Or(Or({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","book_appointment",Or(Or({send_to:r,event_callback:o},s),p))},jr=function(){return(jr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ir=function(t,e){var r=t.trackingId,n=Pr(e,[]);delete n.userId;var o=jr({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingle",r,"Schedule",jr(jr({},a),c))},Sr=function(){return(Sr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},kr=function(t,e){var r=xr(e,[]);delete r.userId;var n=Sr({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Book Appointment",Sr(Sr({},o),i))},_r=function(t){rt("bookAppointment",t,{googleAnalyticsHandler:wr,facebookPixelHandler:Ir,segmentHandler:kr})},Er={logBookAppointment:_r},Ar=Er,Tr=function(){return(Tr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Cr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Rr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.category,c=e.list,l=e.itemBrand,s=Cr(e,["callback","userId","category","list","itemBrand"]),f=e.position,p=[{item_brand:l,item_id:""+i.categoryId,item_list_name:c,item_name:i.name,index:f}],y=null!=a?a:n,d=Tr(Tr({},s),{userId:y}),h=D(d),g=u().meta,b=D(g);gtag("event","view_item_list",Tr(Tr({send_to:r,event_callback:o,item_list_name:c,items:p},h),b))},Br=function(){return(Br=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ur=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Mr=function(t,e){var r=t.trackingId,n=e.category,o=Ur(e,["category"]);delete o.userId;var a=n.categoryId,i=n.name,c=Br(Br({},o),{categoryId:a,categoryName:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"CategoryImpression",Br(Br({},l),f))},Hr=function(){return(Hr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Dr=function(t,e){var r=e.category,n=Lr(e,["category"]);delete n.userId;var o=r.categoryId,a=r.name,i=Hr(Hr({},n),{categoryId:o,categoryName:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Category Impression",Hr(Hr({},c),s))},Yr=function(t){rt("categoryImpression",t,{googleAnalyticsHandler:Rr,facebookPixelHandler:Mr,segmentHandler:Dr})},Nr=function(){return(Nr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.query,c=qr(e,["callback","userId","query"]),l=null!=a?a:n,s=Nr(Nr({},c),{userId:l}),f=D(s),p=u().meta,y=D(p);gtag("event","search",Nr(Nr({send_to:r,event_callback:o,search_term:i},f),y))},zr=function(){return(zr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$r=function(t,e){var r=t.trackingId,n=e.query,o=Vr(e,["query"]);delete o.userId;var a=zr({},o),i=D(a),c=u().meta,l=D(c);fbq("trackSingle",r,"Search",zr(zr({search_string:n},i),l))},Gr=function(){return(Gr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Kr=function(t,e){var r=Wr(e,[]);delete r.userId;var n=Gr({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Search Category",Gr(Gr({},o),i))},Jr=function(t){rt("searchCategoryAttempt",t,{googleAnalyticsHandler:Fr,facebookPixelHandler:$r,segmentHandler:Kr})},Qr=function(){return(Qr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.category,c=Zr(e,["callback","userId","category"]);c.contentType&&delete c.contentType;var l=i.categoryId,s=i.name,f=null!=a?a:n,p=Qr(Qr({},c),{userId:f,categoryId:l,categoryName:s}),y=D(p),d=u().meta,h=D(d);gtag("event","select_content",Qr(Qr({send_to:r,event_callback:o,content_type:"category"},y),h))},tn=function(){return(tn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},en=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rn=function(t,e){var r=t.trackingId,n=e.category,o=en(e,["category"]);delete o.userId;var a=n.categoryId,i=n.name,c=tn(tn({},o),{categoryId:a,categoryName:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"SelectCategory",tn(tn({},l),f))},nn=function(){return(nn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},on=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},an=function(t,e){var r=e.category,n=on(e,["category"]);delete n.userId;var o=r.categoryId,a=r.name,i=nn(nn({},n),{categoryId:o,categoryName:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Select Category",nn(nn({},c),s))},un=function(t){rt("selectCategory",t,{googleAnalyticsHandler:Xr,facebookPixelHandler:rn,segmentHandler:an})},cn=function(){return(cn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ln=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},sn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.category,c=ln(e,["callback","userId","category"]),l=i.categoryId,s=i.name,f=null!=a?a:n,p=cn(cn({},c),{userId:f,categoryId:l,categoryName:s}),y=D(p),d=u().meta,h=D(d);gtag("event","view_cateogry",cn(cn({send_to:r,event_callback:o},y),h))},fn=function(){return(fn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yn=function(t,e){var r=t.trackingId,n=e.category,o=pn(e,["category"]);delete o.userId;var a=n.categoryId,i=n.name,c=fn(fn({},o),{categoryId:a,categoryName:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"ViewCategory",fn(fn({},l),f))},dn=function(){return(dn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},hn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},gn=function(t,e){var r=e.category,n=e.products,o=hn(e,["category","products"]);delete o.userId;var a=r.categoryId,i=r.name,c=dn(dn({},o),{listId:a,category:i}),l=D(c),s=u().meta,f=D(s);analytics.track("Product List Viewed",dn(dn({products:lt(n)},l),f))},bn=function(t){rt("viewCategory",t,{googleAnalyticsHandler:sn,facebookPixelHandler:yn,segmentHandler:gn})},vn={logCategoryImpression:Yr,logSearchCategoryAttempt:Jr,logSelectCategory:un,logViewCategory:bn},On=vn,mn=function(){return(mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},jn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=wn(e,["callback","userId"]),l=null!=i?i:n,s=mn(mn({},c),{userId:l,currency:o}),f=D(s),p=u().meta,y=D(p);gtag("event","checkout_action",mn(mn({send_to:r,event_callback:a},f),y))},Pn=function(){return(Pn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},In=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sn=function(t,e){var r=t.trackingId,n=In(e,[]);delete n.userId;var o=Pn({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"CheckoutAction",Pn(Pn({},a),c))},xn=function(){return(xn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_n=function(t,e){var r=kn(e,[]);delete r.userId;var n=xn({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Checkout Step Completed",xn(xn({},o),i))},En=function(t){rt("checkoutAction",t,{googleAnalyticsHandler:jn,facebookPixelHandler:Sn,segmentHandler:_n})},An=function(){return(An=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Tn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.shoppingCart,l=e.currency,s=Tn(e,["callback","userId","shoppingCart","currency"]),f=null!=i?i:n,p=null!=l?l:o,y=An(An({},s),{userId:f,currency:p}),d=D(y),h=u().meta,g=D(h);gtag("event","begin_checkout",An(An({send_to:r,event_callback:a,items:it(c,p),value:Object(K.getShoppingCartTotal)(c).total},d),g))},Rn=function(){return(Rn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Un=function(t,e){var r=t.trackingId,n=t.currency,o=e.shoppingCart,a=e.currency,i=Bn(e,["shoppingCart","currency"]);delete i.userId;var c=null!=a?a:n,l=Rn(Rn({},i),{currency:c}),s=D(l),f=u().meta,p=D(f),y=nt(o);fbq("trackSingle",r,"InitiateCheckout",Rn(Rn({content_ids:y,contents:ot(o),num_items:y.length,value:Object(K.getShoppingCartTotal)(o).total},s),p))},Mn=function(){return(Mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ln=function(t,e){var r=t.currency,n=e.shoppingCart,o=e.currency,a=Hn(e,["shoppingCart","currency"]);delete a.userId;var i=null!=o?o:r,c=Mn(Mn({},a),{currency:i}),l=D(c),s=u().meta,f=D(s),p=Object(K.getShoppingCartTotal)(n),y=Object(K.getShoppingCartProducts)(n),d=p.total,h=p.totalTaxes,g=p.shippingCost;analytics.track("Initiate Checkout",Mn(Mn({total:d,revenue:d-h-(null!=g?g:0),shipping:g,tax:h,products:lt(y)},l),f))},Dn=function(t){rt("initiateCheckout",t,{googleAnalyticsHandler:Cn,facebookPixelHandler:Un,segmentHandler:Ln})},Yn={logCheckoutAction:En,logInitiateCheckout:Dn},Nn=Yn,qn=function(){return(qn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=Fn(e,["callback","userId","currency"]),s=null!=i?i:n,f=null!=c?c:o,p=qn(qn({},l),{userId:s,currency:f}),y=D(p),d=u().meta,h=D(d);gtag("event","apply_benefit",qn(qn({send_to:r,event_callback:a},y),h))},Vn=function(){return(Vn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=$n(e,["currency"]);delete a.userId;var i=null!=o?o:n,c=Vn(Vn({},a),{currency:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"ApplyBenefit",Vn(Vn({},l),f))},Wn=function(){return(Wn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jn=function(t,e){var r=t.currency,n=e.currency,o=Kn(e,["currency"]);delete o.userId;var a=null!=n?n:r,i=Wn(Wn({},o),{currency:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Apply Benefit",Wn(Wn({},c),s))},Qn=function(t){rt("applyBenefit",t,{googleAnalyticsHandler:zn,facebookPixelHandler:Gn,segmentHandler:Jn})},Zn=function(){return(Zn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},to=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=Xn(e,["callback","userId","currency"]),s=null!=i?i:n,f=null!=c?c:o,p=Zn(Zn({},l),{userId:s,currency:f}),y=D(p),d=u().meta,h=D(d);gtag("event","coupon_code_error",Zn(Zn({send_to:r,event_callback:a},y),h))},eo=function(){return(eo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ro=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},no=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=ro(e,["currency"]);delete a.userId;var i=null!=o?o:n,c=eo(eo({},a),{currency:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"CouponCodeError",eo(eo({},l),f))},oo=function(){return(oo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ao=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},io=function(t,e){var r=t.currency,n=e.currency,o=ao(e,["currency"]);delete o.userId;var a=null!=n?n:r,i=oo(oo({},o),{currency:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Coupon Code Error",oo(oo({},c),s))},uo=function(t){rt("couponCodeError",t,{googleAnalyticsHandler:to,facebookPixelHandler:no,segmentHandler:io})},co=function(){return(co=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},so=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=lo(e,["callback","userId"]),c=null!=a?a:n,l=co(co({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","redeem_coupon_code",co(co({send_to:r,event_callback:o},s),p))},fo=function(){return(fo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},po=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yo=function(t,e){var r=t.trackingId,n=po(e,[]);delete n.userId;var o=fo({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"RedeemCouponCode",fo(fo({},a),c))},ho=function(){return(ho=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},go=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bo=function(t,e){var r=go(e,[]);delete r.userId;var n=ho({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Redeem Coupon Code",ho(ho({},o),i))},vo=function(t){rt("redeemCouponCode",t,{googleAnalyticsHandler:so,facebookPixelHandler:yo,segmentHandler:bo})},Oo=function(){return(Oo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wo=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=mo(e,["callback","userId","currency"]),s=null!=i?i:n,f=null!=c?c:o,p=Oo(Oo({},l),{userId:s,currency:f}),y=D(p),d=u().meta,h=D(d);gtag("event","remove_benefit",Oo(Oo({send_to:r,event_callback:a},y),h))},jo=function(){return(jo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Po=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Io=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=Po(e,["currency"]);delete a.userId;var i=null!=o?o:n,c=jo(jo({},a),{currency:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"RemoveBenefit",jo(jo({},l),f))},So=function(){return(So=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ko=function(t,e){var r=t.currency,n=e.currency,o=xo(e,["currency"]);delete o.userId;var a=null!=n?n:r,i=So(So({},o),{currency:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Remove Benefit",So(So({},c),s))},_o=function(t){rt("removeBenefit",t,{googleAnalyticsHandler:wo,facebookPixelHandler:Io,segmentHandler:ko})},Eo=function(){return(Eo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ao=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},To=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=Ao(e,["callback","userId","currency"]),s=null!=i?i:n,f=null!=c?c:o,p=Eo(Eo({},l),{userId:s,currency:f}),y=D(p),d=u().meta,h=D(d);gtag("event","view_benefit_details",Eo(Eo({send_to:r,event_callback:a},y),h))},Co=function(){return(Co=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ro=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bo=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=Ro(e,["currency"]);delete a.userId;var i=null!=o?o:n,c=Co(Co({},a),{currency:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"ViewBenefitDetails",Co(Co({},l),f))},Uo=function(){return(Uo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Mo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ho=function(t,e){var r=t.currency,n=e.currency,o=Mo(e,["currency"]);delete o.userId;var a=null!=n?n:r,i=Uo(Uo({},o),{currency:a}),c=D(i),l=u().meta,s=D(l);analytics.track("View Benefit Details",Uo(Uo({},c),s))},Lo=function(t){rt("viewBenefitDetails",t,{googleAnalyticsHandler:To,facebookPixelHandler:Bo,segmentHandler:Ho})},Do=function(){return(Do=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},No=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Yo(e,["callback","userId"]),c=null!=a?a:n,l=Do(Do({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_benefits_wallet",Do(Do({send_to:r,event_callback:o},s),p))},qo=function(){return(qo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zo=function(t,e){var r=t.trackingId,n=Fo(e,[]);delete n.userId;var o=qo({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewBenefitsWallet",qo(qo({},a),c))},Vo=function(){return(Vo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Go=function(t,e){var r=$o(e,[]);delete r.userId;var n=Vo({},r),o=D(n),a=u().meta,i=D(a);analytics.track("View Benefits Wallet",Vo(Vo({},o),i))},Wo=function(t){rt("viewBenefitsWallet",t,{googleAnalyticsHandler:No,facebookPixelHandler:zo,segmentHandler:Go})},Ko=function(){return(Ko=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Jo(e,["callback","userId"]),c=null!=a?a:n,l=Ko(Ko({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_qr_store_coupon",Ko(Ko({send_to:r,event_callback:o},s),p))},Zo=function(){return(Zo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ta=function(t,e){var r=t.trackingId,n=Xo(e,[]);delete n.userId;var o=Zo({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewQRStoreCoupon",Zo(Zo({},a),c))},ea=function(){return(ea=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ra=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},na=function(t,e){var r=ra(e,[]);delete r.userId;var n=ea({},r),o=D(n),a=u().meta,i=D(a);analytics.track("View QR Store Coupon",ea(ea({},o),i))},oa=function(t){void 0===t&&(t={}),rt("viewQRStoreCoupon",t,{googleAnalyticsHandler:Qo,facebookPixelHandler:ta,segmentHandler:na})},aa={logApplyBenefit:Qn,logCouponCodeError:uo,logRedeemCouponCode:vo,logRemoveBenefit:_o,logViewBenefitDetails:Lo,logViewBenefitsWallet:Wo,logViewQRStoreCoupon:oa},ia=aa,ua=function(){return(ua=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ca=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},la=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=e.amount,s=ca(e,["callback","userId","currency","amount"]),f=null!=i?i:n,p=null!=c?c:o,y=ua(ua({},s),{userId:f,currency:p,amount:l,value:l}),d=D(y),h=u().meta,g=D(h);gtag("event","add_credits",ua(ua({send_to:r,event_callback:a},d),g))},sa=function(){return(sa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pa=function(t,e){var r=t.trackingId,n=t.currency,o=e.amount,a=e.currency,i=fa(e,["amount","currency"]);delete i.userId;var c=null!=a?a:n,l=sa(sa({},i),{currency:c,amount:o,value:o}),s=D(l),f=u().meta,p=D(f);fbq("trackSingleCustom",r,"AddCredits",sa(sa({},s),p))},ya=function(){return(ya=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},da=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ha=function(t,e){var r=t.currency,n=e.amount,o=e.currency,a=da(e,["amount","currency"]);delete a.userId;var i=null!=o?o:r,c=ya(ya({},a),{currency:i,amount:n,value:n}),l=D(c),s=u().meta,f=D(s);analytics.track("Add Credits",ya(ya({},l),f))},ga=function(t){rt("addCredits",t,{googleAnalyticsHandler:la,facebookPixelHandler:pa,segmentHandler:ha})},ba=function(){return(ba=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},va=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Oa=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=e.amount,s=va(e,["callback","userId","currency","amount"]),f=null!=i?i:n,p=null!=c?c:o,y=ba(ba({},s),{userId:f,currency:p,amount:l,value:l}),d=D(y),h=u().meta,g=D(h);gtag("event","spend_credits",ba(ba({send_to:r,event_callback:a},d),g))},ma=function(){return(ma=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ja=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=e.amount,i=wa(e,["currency","amount"]);delete i.userId;var c=null!=o?o:n,l=ma(ma({},i),{currency:c,amount:a,value:a}),s=D(l),f=u().meta,p=D(f);fbq("trackSingle",r,"SpendCredits",ma(ma({},s),p))},Pa=function(){return(Pa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ia=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sa=function(t,e){var r=t.currency,n=e.currency,o=e.amount,a=Ia(e,["currency","amount"]);delete a.userId;var i=null!=n?n:r,c=Pa(Pa({},a),{currency:i,amount:o,value:o}),l=D(c),s=u().meta,f=D(s);analytics.track("Spend Credits",Pa(Pa({},l),f))},xa=function(t){rt("spendCredits",t,{googleAnalyticsHandler:Oa,facebookPixelHandler:ja,segmentHandler:Sa})},ka=function(){return(ka=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ea=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=_a(e,["callback","userId"]),c=null!=a?a:n,l=ka(ka({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_credits",ka(ka({send_to:r,event_callback:o},s),p))},Aa=function(){return(Aa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ta=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ca=function(t,e){var r=t.trackingId,n=Ta(e,[]);delete n.userId;var o=Aa({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewCredits",Aa(Aa({},a),c))},Ra=function(){return(Ra=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ba=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ua=function(t,e){var r=Ba(e,[]);delete r.userId;var n=Ra({},r),o=D(n),a=u().meta,i=D(a);analytics.track("View Credits",Ra(Ra({},o),i))},Ma=function(t){rt("viewCredits",t,{googleAnalyticsHandler:Ea,facebookPixelHandler:Ca,segmentHandler:Ua})},Ha={logAddCredits:ga,logSpendCredits:xa,logViewCredits:Ma},La=Ha,Da=function(){return(Da=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ya=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Na=function(t,e,r){var n=e.trackingId,o=e.userId,a=r.callback,i=r.userId,c=Ya(r,["callback","userId"]),l=null!=i?i:o,s=Da(Da({},c),{userId:l}),f=D(s),p=u().meta,y=D(p);gtag("event",t,Da(Da(Da({send_to:n,event_callback:a},f),{artisan_event:"custom_event"}),y))},qa=function(){return(qa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},za=function(t,e,r){var n=e.trackingId,o=Fa(r,[]);delete o.userId;var a=qa({},o),i=D(a),c=u().meta,l=D(c);fbq("trackSingleCustom",n,t,qa(qa(qa({},i),{artisan_event:"CustomEvent"}),l))},Va=function(){return(Va=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ga=function(t,e,r){var n=$a(r,[]);delete n.userId;var o=Va({},n),a=D(o),i=u().meta,c=D(i);analytics.track(t,Va(Va(Va({},a),{artisan_event:"Custom Event"}),c))},Wa=function(t,e){void 0===e&&(e={}),rt(t,e,{googleAnalyticsHandler:function(e,r){return Na(t,e,r)},facebookPixelHandler:function(e,r){return za(t,e,r)},segmentHandler:function(e,r){return Ga(t,e,r)}})},Ka=function(){return(Ka=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ja=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qa=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Ja(e,["callback","userId"]),c=null!=a?a:n,l=Ka(Ka({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_fulfillment_step",Ka(Ka({send_to:r,event_callback:o},s),p))},Za=function(){return(Za=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ti=function(t,e){var r=t.trackingId,n=Xa(e,[]);delete n.userId;var o=Za({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewFulfillmentStep",Za(Za({},a),c))},ei=function(){return(ei=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ri=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ni=function(t,e){var r=ri(e,[]);delete r.userId;var n=ei({},r),o=D(n),a=u().meta,i=D(a);analytics.track("View Fulfillment Step",ei(ei({},o),i))},oi=function(t){rt("viewFulfillmentStep",t,{googleAnalyticsHandler:Qa,facebookPixelHandler:ti,segmentHandler:ni})},ai=function(){return(ai=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ii=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ui=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=ii(e,["callback","userId"]),c=null!=a?a:n,l=ai(ai({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_tracking",ai(ai({send_to:r,event_callback:o},s),p))},ci=function(){return(ci=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},li=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},si=function(t,e){var r=t.trackingId,n=li(e,[]);delete n.userId;var o=ci({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewTracking",ci(ci({},a),c))},fi=function(){return(fi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yi=function(t,e){var r=pi(e,[]);delete r.userId;var n=fi({},r),o=D(n),a=u().meta,i=D(a);analytics.track("View Tracking",fi(fi({},o),i))},di=function(t){rt("viewTracking",t,{googleAnalyticsHandler:ui,facebookPixelHandler:si,segmentHandler:yi})},hi={logViewFulfillmentStep:oi,logViewTracking:di},gi=hi,bi=function(){return(bi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},vi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Oi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=vi(e,["callback","userId"]),c=null!=a?a:n,l=bi(bi({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","change_location",bi(bi({send_to:r,event_callback:o},s),p))},mi=function(){return(mi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ji=function(t,e){var r=t.trackingId,n=wi(e,[]);delete n.userId;var o=mi({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ChangeLocation",mi(mi({},a),c))},Pi=function(){return(Pi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ii=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Si=function(t,e){var r=Ii(e,[]);delete r.userId;var n=Pi({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Change Location",Pi(Pi({},o),i))},xi=function(t){void 0===t&&(t={}),rt("changeLocation",t,{googleAnalyticsHandler:Oi,facebookPixelHandler:ji,segmentHandler:Si})},ki=function(){return(ki=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ei=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=_i(e,["callback","userId"]),c=null!=a?a:n,l=ki(ki({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","find_location",ki(ki({send_to:r,event_callback:o},s),p))},Ai=function(){return(Ai=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ti=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ci=function(t,e){var r=t.trackingId,n=Ti(e,[]);delete n.userId;var o=Ai({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingle",r,"FindLocation",Ai(Ai({},a),c))},Ri=function(){return(Ri=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ui=function(t,e){var r=Bi(e,[]);delete r.userId;var n=Ri({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Find Location",Ri(Ri({},o),i))},Mi=function(t){void 0===t&&(t={}),rt("findLocation",t,{googleAnalyticsHandler:Ei,facebookPixelHandler:Ci,segmentHandler:Ui})},Hi=function(){return(Hi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Li=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Di=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Li(e,["callback","userId"]),c=null!=a?a:n,l=Hi(Hi({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","out_of_coverage",Hi(Hi({send_to:r,event_callback:o},s),p))},Yi=function(){return(Yi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ni=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qi=function(t,e){var r=t.trackingId,n=Ni(e,[]);delete n.userId;var o=Yi({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"OutOfCoverage",Yi(Yi({},a),c))},Fi=function(){return(Fi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vi=function(t,e){var r=zi(e,[]);delete r.userId;var n=Fi({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Out Of Coverage",Fi(Fi({},o),i))},$i=function(t){void 0===t&&(t={}),rt("outOfCoverage",t,{googleAnalyticsHandler:Di,facebookPixelHandler:qi,segmentHandler:Vi})},Gi=function(){return(Gi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ki=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Wi(e,["callback","userId"]),c=null!=a?a:n,l=Gi(Gi({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","set_location",Gi(Gi({send_to:r,event_callback:o},s),p))},Ji=function(){return(Ji=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Zi=function(t,e){var r=t.trackingId,n=Qi(e,[]);delete n.userId;var o=Ji({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SetLocation",Ji(Ji({},a),c))},Xi=function(){return(Xi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},eu=function(t,e){var r=e.lat,n=e.lng,o=tu(e,["lat","lng"]);delete o.userId;var a=r&&n?r+", "+n:"Not available",i=Xi(Xi({},o),{location:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Set Location",Xi(Xi({},c),s))},ru=function(t){void 0===t&&(t={}),rt("setLocation",t,{googleAnalyticsHandler:Ki,facebookPixelHandler:Zi,segmentHandler:eu})},nu={logChangeLocation:xi,logFindLocation:Mi,logOutOfCoverage:$i,logSetLocation:ru},ou=nu,au=function(){return(au=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},iu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=iu(e,["callback","userId"]),c=null!=a?a:n,l=au(au({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","request_assistance",au(au({send_to:r,event_callback:o},s),p))},cu=function(){return(cu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},su=function(t,e){var r=t.trackingId,n=lu(e,[]);delete n.userId;var o=cu({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingle",r,"Contact",cu(cu({},a),c))},fu=function(){return(fu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yu=function(t,e){var r=pu(e,[]);delete r.userId;var n=fu({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Request Assistance",fu(fu({},o),i))},du=function(t){rt("requestAssistance",t,{googleAnalyticsHandler:uu,facebookPixelHandler:su,segmentHandler:yu})},hu={logRequestAssistance:du},gu=hu,bu=function(){return(bu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},vu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ou=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.currencyName,c=e.amount,l=vu(e,["callback","userId","currencyName","amount"]),s=null!=a?a:n,f=bu(bu({},l),{userId:s}),p=D(f),y=u().meta,d=D(y);gtag("event","earn_virtual_currency",bu(bu({send_to:r,event_callback:o,virtual_currency_name:i,value:c},p),d))},mu=function(){return(mu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ju=function(t,e){var r=t.trackingId,n=wu(e,[]);delete n.userId;var o=mu({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"EarnPoints",mu(mu({},a),c))},Pu=function(){return(Pu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Iu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Su=function(t,e){var r=Iu(e,[]);delete r.userId;var n=Pu({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Earn Points",Pu(Pu({},o),i))},xu=function(t){rt("earnPoints",t,{googleAnalyticsHandler:Ou,facebookPixelHandler:ju,segmentHandler:Su})},ku=function(){return(ku=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_u=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Eu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=_u(e,["callback","userId"]),c=null!=a?a:n,l=ku(ku({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","share_points",ku(ku({send_to:r,event_callback:o},s),p))},Au=function(){return(Au=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Tu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cu=function(t,e){var r=t.trackingId,n=Tu(e,[]);delete n.userId;var o=Au({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SharePoints",Au(Au({},a),c))},Ru=function(){return(Ru=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Uu=function(t,e){var r=Bu(e,[]);delete r.userId;var n=Ru({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Share Points",Ru(Ru({},o),i))},Mu=function(t){rt("sharePoints",t,{googleAnalyticsHandler:Eu,facebookPixelHandler:Cu,segmentHandler:Uu})},Hu=function(){return(Hu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Du=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.currencyName,c=e.amount,l=Lu(e,["callback","userId","currencyName","amount"]),s=null!=a?a:n,f=Hu(Hu({},l),{userId:s}),p=D(f),y=u().meta,d=D(y);gtag("event","spend_virtual_currency",Hu(Hu({send_to:r,event_callback:o,virtual_currency_name:i,value:c},p),d))},Yu=function(){return(Yu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qu=function(t,e){var r=t.trackingId,n=Nu(e,[]);delete n.userId;var o=Yu({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SpendPoints",Yu(Yu({},a),c))},Fu=function(){return(Fu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vu=function(t,e){var r=zu(e,[]);delete r.userId;var n=Fu({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Spend Points",Fu(Fu({},o),i))},$u=function(t){rt("spendPoints",t,{googleAnalyticsHandler:Du,facebookPixelHandler:qu,segmentHandler:Vu})},Gu=function(){return(Gu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ku=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Wu(e,["callback","userId"]),c=null!=a?a:n,l=Gu(Gu({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_loyalty_level",Gu(Gu({send_to:r,event_callback:o},s),p))},Ju=function(){return(Ju=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Zu=function(t,e){var r=t.trackingId,n=Qu(e,[]);delete n.userId;var o=Ju({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewLoyaltyLevel",Ju(Ju({},a),c))},Xu=function(){return(Xu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ec=function(t,e){var r=tc(e,[]);delete r.userId;var n=Xu({},r),o=D(n),a=u().meta,i=D(a);analytics.track("View Loyalty Level",Xu(Xu({},o),i))},rc=function(t){rt("viewLoyaltyLevel",t,{googleAnalyticsHandler:Ku,facebookPixelHandler:Zu,segmentHandler:ec})},nc={logEarnPoints:xu,logSharePoints:Mu,logSpendPoints:$u,logViewLoyaltyLevel:rc},oc=nc,ac=function(){return(ac=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ic=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=ic(e,["callback","userId"]),c=null!=a?a:n,l=ac(ac({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","cancel_order",ac(ac({send_to:r,event_callback:o},s),p))},cc=function(){return(cc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},sc=function(t,e){var r=t.trackingId,n=lc(e,[]);delete n.userId;var o=cc({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"CancelOrder",cc(cc({},a),c))},fc=function(){return(fc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yc=function(t,e){var r=t.currency,n=e.currency,o=e.orderTotal,a=e.products,i=pc(e,["currency","orderTotal","products"]);delete i.userId;var c=null!=n?n:r,l=fc(fc({},i),{revenue:o,currency:c}),s=D(l),f=u().meta,p=D(f);analytics.track("Order Cancelled",fc(fc({products:lt(a)},s),p))},dc=function(t){rt("cancelOrder",t,{googleAnalyticsHandler:uc,facebookPixelHandler:sc,segmentHandler:yc})},hc=function(){return(hc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=gc(e,["callback","userId"]),c=null!=a?a:n,l=hc(hc({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","rate_order",hc(hc({send_to:r,event_callback:o},s),p))},vc=function(){return(vc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Oc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},mc=function(t,e){var r=t.trackingId,n=e.maxScore,o=e.score,a=Oc(e,["maxScore","score"]);delete a.userId;var i=vc(vc({},a),{maxScore:n,score:o}),c=D(i),l=u().meta,s=D(l);fbq("trackSingleCustom",r,"RateOrder",vc(vc({max_rating_value:n,value:o},c),s))},wc=function(){return(wc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pc=function(t,e){var r=jc(e,[]);delete r.userId;var n=wc({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Rate Order",wc(wc({},o),i))},Ic=function(t){rt("rateOrder",t,{googleAnalyticsHandler:bc,facebookPixelHandler:mc,segmentHandler:Pc})},Sc=function(){return(Sc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},kc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=e.orderId,s=e.orderTotal,f=xc(e,["callback","userId","currency","orderId","orderTotal"]),p=null!=i?i:n,y=null!=c?c:o,d=Sc(Sc({},f),{userId:p,currency:y}),h=D(d),g=u().meta,b=D(g);gtag("event","refund",Sc(Sc({send_to:r,event_callback:a,transaction_id:l,value:s},h),b))},_c=function(){return(_c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ec=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ac=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=e.orderTotal,i=Ec(e,["currency","orderTotal"]);delete i.userId;var c=null!=o?o:n,l=_c(_c({},i),{currency:c}),s=D(l),f=u().meta,p=D(f);fbq("trackSingleCustom",r,"RequestRefund",_c(_c({value:a},s),p))},Tc=function(){return(Tc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Cc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Rc=function(t,e){var r=t.currency,n=e.currency,o=e.orderTotal,a=e.products,i=Cc(e,["currency","orderTotal","products"]);delete i.userId;var c=null!=n?n:r,l=Tc(Tc({},i),{revenue:o,currency:c}),s=D(l),f=u().meta,p=D(f);analytics.track("Order Refunded",Tc(Tc({products:lt(a)},s),p))},Bc=function(t){rt("requestRefund",t,{googleAnalyticsHandler:kc,facebookPixelHandler:Ac,segmentHandler:Rc})},Uc={logCancelOrder:dc,logRateOrder:Ic,logRequestRefund:Bc},Mc=Uc,Hc=function(){return(Hc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Dc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Lc(e,["callback","userId"]),c=null!=a?a:n,l=Hc(Hc({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","generate_lead",Hc(Hc({send_to:r,event_callback:o},s),p))},Yc=function(){return(Yc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qc=function(t,e){var r=t.trackingId,n=Nc(e,[]);delete n.userId;var o=Yc({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingle",r,"Lead",Yc(Yc({},a),c))},Fc=function(){return(Fc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vc=function(t,e){var r=zc(e,[]);delete r.userId;var n=Fc({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Generate Lead",Fc(Fc({},o),i))},$c=function(t){void 0===t&&(t={}),rt("generateLead",t,{googleAnalyticsHandler:Dc,facebookPixelHandler:qc,segmentHandler:Vc})},Gc=function(){return(Gc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Kc=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=Wc(e,[]);delete n.userId;var o=Gc({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingle",r,"PageView",Gc(Gc({},a),c))},Jc=function(){return(Jc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Zc=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=t.userId,o=e.pathname,a=e.name,i=e.callback,c=e.userId,l=Qc(e,["pathname","name","callback","userId"]),s=null!=c?c:n,f=Jc(Jc({},l),{userId:s}),p=D(f),y=u().meta,d=D(y);gtag("event","page_view",Jc(Jc({page_title:a,page_path:o,send_to:r,event_callback:i},p),d))},Xc=function(){return(Xc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},el=function(t,e){var r=e.name,n=tl(e,["name"]),o=D(n),a=u().meta,i=D(a);analytics.page(r,Xc(Xc({},o),i))},rl=function(t){rt("pageView",t,{googleAnalyticsHandler:Zc,facebookPixelHandler:Kc,segmentHandler:el})},nl=function(){return(nl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},al=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.query,c=ol(e,["callback","userId","query"]),l=null!=a?a:n,s=nl(nl({},c),{userId:l}),f=D(s),p=u().meta,y=D(p);gtag("event","search",nl(nl({send_to:r,event_callback:o,search_term:i},f),y))},il=function(){return(il=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ul=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cl=function(t,e){var r=t.trackingId,n=e.query,o=ul(e,["query"]);delete o.userId;var a=il({},o),i=D(a),c=u().meta,l=D(c);fbq("trackSingle",r,"Search",il(il({search_string:n},i),l))},ll=function(){return(ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fl=function(t,e){var r=sl(e,[]);delete r.userId;var n=ll({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Search Page Content",ll(ll({},o),i))},pl=function(t){rt("searchPageContent",t,{googleAnalyticsHandler:al,facebookPixelHandler:cl,segmentHandler:fl})},yl={logGenerateLead:$c,logPageView:rl,logSearchPageContent:pl},dl=yl,hl=function(){return(hl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=gl(e,["callback","userId","currency"]),s=null!=i?i:n,f=null!=c?c:o,p=hl(hl({},l),{userId:s,currency:f}),y=D(p),d=u().meta,h=D(d);gtag("event","change_payment_type",hl(hl({send_to:r,event_callback:a},y),h))},vl=function(){return(vl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ml=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=Ol(e,["currency"]);delete a.userId;var i=null!=o?o:n,c=vl(vl({},a),{currency:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"ChangePaymentType",vl(vl({},l),f))},wl=function(){return(wl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pl=function(t,e){var r=t.currency,n=e.currency,o=jl(e,["currency"]);delete o.userId;var a=null!=n?n:r,i=wl(wl({},o),{currency:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Change Payment Type",wl(wl({},c),s))},Il=function(t){rt("changePaymentType",t,{googleAnalyticsHandler:bl,facebookPixelHandler:ml,segmentHandler:Pl})},Sl=function(){return(Sl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},kl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=xl(e,["callback","userId","currency"]),s=null!=i?i:n,f=null!=c?c:o,p=Sl(Sl({},l),{userId:s,currency:f}),y=D(p),d=u().meta,h=D(d);gtag("event","select_payment_type",Sl(Sl({send_to:r,event_callback:a},y),h))},_l=function(){return(_l=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},El=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Al=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=El(e,["currency"]);delete a.userId;var i=null!=o?o:n,c=_l(_l({},a),{currency:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"SelectPaymentType",_l(_l({},l),f))},Tl=function(){return(Tl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Cl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Rl=function(t,e){var r=t.currency,n=e.currency,o=Cl(e,["currency"]);delete o.userId;var a=null!=n?n:r,i=Tl(Tl({},o),{currency:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Select Payment Type",Tl(Tl({},c),s))},Bl=function(t){rt("selectPaymentType",t,{googleAnalyticsHandler:kl,facebookPixelHandler:Al,segmentHandler:Rl})},Ul=function(){return(Ul=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ml=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=Ml(e,["callback","userId","currency"]),s=null!=i?i:n,f=null!=c?c:o,p=Ul(Ul({},l),{userId:s,currency:f}),y=D(p),d=u().meta,h=D(d);gtag("event","add_payment_info",Ul(Ul({send_to:r,event_callback:a},y),h))},Ll=function(){return(Ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yl=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=Dl(e,["currency"]);delete a.userId;var i=null!=o?o:n,c=Ll(Ll({},a),{currency:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingle",r,"AddPaymentInfo",Ll(Ll({success:1},l),f))},Nl=function(){return(Nl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ql=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fl=function(t,e){var r=t.currency,n=e.currency,o=ql(e,["currency"]);delete o.userId;var a=null!=n?n:r,i=Nl(Nl({},o),{currency:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Set Payment Info",Nl(Nl({},c),s))},zl=function(t){rt("setPaymentInfo",t,{googleAnalyticsHandler:Hl,facebookPixelHandler:Yl,segmentHandler:Fl})},Vl={logChangePaymentType:Il,logSelectPaymentType:Bl,logSetPaymentInfo:zl},$l=Vl,Gl=function(){return(Gl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Kl=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.product,c=Wl(e,["callback","userId","product"]),l=null!=a?a:n,s=i.productId,f=i.name,p=Gl(Gl({},c),{userId:l,productId:s,productName:f}),y=D(p),d=u().meta,h=D(d);gtag("event","customize_product",Gl(Gl({send_to:r,event_callback:o},y),h))},Jl=function(){return(Jl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ql=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Zl=function(t,e){var r=t.trackingId,n=e.product,o=Ql(e,["product"]);delete o.userId;var a=n.productId,i=n.name,c=Jl(Jl({},o),{productId:a,productName:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingle",r,"CustomizeProduct",Jl(Jl({},l),f))},Xl=function(){return(Xl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ts=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},es=function(t,e){var r=e.product,n=ts(e,["product"]);delete n.userId;var o=r.productId,a=r.name,i=Xl(Xl({},n),{productId:o,productName:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Customize Product",Xl(Xl({},c),s))},rs=function(t){rt("customizeProduct",t,{googleAnalyticsHandler:Kl,facebookPixelHandler:Zl,segmentHandler:es})},ns=function(){return(ns=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},os=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},as=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=os(e,["callback","userId"]),c=null!=a?a:n,l=ns(ns({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","filter_products",ns(ns({send_to:r,event_callback:o},s),p))},is=function(){return(is=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},us=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cs=function(t,e){var r=t.trackingId,n=us(e,[]);delete n.userId;var o=is({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"FilterProducts",is(is({},a),c))},ls=function(){return(ls=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ss=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fs=function(t,e){var r=e.filterBy,n=ss(e,["filterBy"]);delete n.userId;var o=ls(ls({},n),{filterBy:ct(r)}),a=D(o),i=u().meta,c=D(i);analytics.track("Filter Products",ls(ls({},a),c))},ps=function(t){rt("filterProducts",t,{googleAnalyticsHandler:as,facebookPixelHandler:cs,segmentHandler:fs})},ys=function(){return(ys=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ds=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hs=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=ds(e,["callback","userId","product","currency"]),f=null!=i?i:n,p=null!=l?l:o,y=c.productId,d=c.name,h=ys(ys({},s),{userId:f,productId:y,productName:d,currency:p}),g=Object(J.getProductTotals)(c),b=D(h),v=u().meta,O=D(v);gtag("event","product_impression",ys(ys({send_to:r,event_callback:a,value:g.netPrice},b),O))},gs=function(){return(gs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vs=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.currency,i=bs(e,["product","currency"]);delete i.userId;var c=null!=a?a:n,l=o.productId,s=o.name,f=Object(J.getProductTotals)(o),p=gs(gs({},i),{productId:l,productName:s,currency:c}),y=D(p),d=u().meta,h=D(d);fbq("trackSingleCustom",r,"ProductImpression",gs(gs({value:f.netPrice},y),h))},Os=function(){return(Os=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ms=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ws=function(t,e){var r=t.currency,n=e.product,o=e.currency,a=ms(e,["product","currency"]);delete a.userId;var i=null!=o?o:r,c=n.productId,l=n.name,s=Os(Os({},a),{productId:c,name:l,currency:i}),f=D(s),p=u().meta,y=D(p),d=Object(J.getProductTotals)(n);analytics.track("Product Viewed",Os(Os({price:d.netPrice},f),y))},js=function(t){rt("productImpression",t,{googleAnalyticsHandler:hs,facebookPixelHandler:vs,segmentHandler:ws})},Ps=function(){return(Ps=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Is=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ss=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Is(e,["callback","userId"]),c=null!=a?a:n,l=Ps(Ps({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","search_product_success",Ps(Ps({send_to:r,event_callback:o},s),p))},xs=function(){return(xs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ks=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_s=function(t,e){var r=t.trackingId,n=e.query,o=ks(e,["query"]);delete o.userId;var a=xs({},o),i=D(a),c=u().meta,l=D(c);fbq("trackSingle",r,"Search",xs(xs({search_string:n,success:1},i),l))},Es=function(){return(Es=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},As=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ts=function(t,e){var r=As(e,[]);delete r.userId;var n=Es({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Products Searched",Es(Es({},o),i))},Cs=function(t){rt("searchProductSuccess",t,{googleAnalyticsHandler:Ss,facebookPixelHandler:_s,segmentHandler:Ts})},Rs=function(){return(Rs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Us=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.query,c=Bs(e,["callback","userId","query"]),l=null!=a?a:n,s=Rs(Rs({},c),{userId:l}),f=D(s),p=u().meta,y=D(p);gtag("event","search",Rs(Rs({send_to:r,event_callback:o,search_term:i},f),y))},Ms=function(){return(Ms=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ls=function(t,e){var r=t.trackingId,n=e.query,o=Hs(e,["query"]);delete o.userId;var a=Ms({},o),i=D(a),c=u().meta,l=D(c);fbq("trackSingle",r,"Search",Ms(Ms({search_string:n},i),l))},Ds=function(){return(Ds=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ys=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ns=function(t,e){var r=Ys(e,[]);delete r.userId;var n=Ds({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Search Product Attempt",Ds(Ds({},o),i))},qs=function(t){rt("searchProductAttempt",t,{googleAnalyticsHandler:Us,facebookPixelHandler:Ls,segmentHandler:Ns})},Fs=function(){return(Fs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=zs(e,["callback","userId"]),c=null!=a?a:n,l=Fs(Fs({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","search_product_not_found",Fs(Fs({send_to:r,event_callback:o},s),p))},$s=function(){return($s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ws=function(t,e){var r=t.trackingId,n=e.query,o=Gs(e,["query"]);delete o.userId;var a=$s({},o),i=D(a),c=u().meta,l=D(c);fbq("trackSingle",r,"Search",$s($s({search_string:n,success:0},i),l))},Ks=function(){return(Ks=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Js=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qs=function(t,e){var r=Js(e,[]);delete r.userId;var n=Ks({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Search Product Not Found",Ks(Ks({},o),i))},Zs=function(t){rt("searchProductNotFound",t,{googleAnalyticsHandler:Vs,facebookPixelHandler:Ws,segmentHandler:Qs})},Xs=function(){return(Xs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ef=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=tf(e,["callback","userId","product","currency"]);s.contentType&&delete s.contentType;var f=null!=i?i:n,p=null!=l?l:o,y=c.productId,d=c.name,h=Xs(Xs({},s),{userId:f,productId:y,productName:d,currency:p}),g=Object(J.getProductTotals)(c),b=D(h),v=u().meta,O=D(v);gtag("event","select_content",Xs(Xs({send_to:r,event_callback:a,content_type:"product",value:g.netPrice},b),O))},rf=function(){return(rf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},nf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},of=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.currency,i=nf(e,["product","currency"]);delete i.userId;var c=null!=a?a:n,l=o.productId,s=o.name,f=Object(J.getProductTotals)(o),p=rf(rf({},i),{productId:l,productName:s,currency:c}),y=D(p),d=u().meta,h=D(d);fbq("trackSingleCustom",r,"SelectProduct",rf(rf({value:f.netPrice},y),h))},af=function(){return(af=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},uf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cf=function(t,e){var r=t.currency,n=e.product,o=e.currency,a=uf(e,["product","currency"]);delete a.userId;var i=null!=o?o:r,c=n.productId,l=n.name,s=af(af({},a),{productId:c,name:l,currency:i}),f=D(s),p=u().meta,y=D(p),d=Object(J.getProductTotals)(n);analytics.track("Product Clicked",af(af({price:d.netPrice},f),y))},lf=function(t){rt("selectProduct",t,{googleAnalyticsHandler:ef,facebookPixelHandler:of,segmentHandler:cf})},sf=function(){return(sf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ff=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pf=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=ff(e,["callback","userId"]),c=null!=a?a:n,l=sf(sf({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","sort_products",sf(sf({send_to:r,event_callback:o},s),p))},yf=function(){return(yf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},df=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hf=function(t,e){var r=t.trackingId,n=df(e,[]);delete n.userId;var o=yf({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SortProducts",yf(yf({},a),c))},gf=function(){return(gf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vf=function(t,e){var r=bf(e,[]);delete r.userId;var n=gf({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Sort Products",gf(gf({},o),i))},Of=function(t){rt("sortProducts",t,{googleAnalyticsHandler:pf,facebookPixelHandler:hf,segmentHandler:vf})},mf=function(){return(mf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},jf=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=wf(e,["callback","userId","product","currency"]),f=null!=i?i:n,p=null!=l?l:o,y=c.productId,d=c.name,h=mf(mf({},s),{userId:f,productId:y,productName:d,currency:p}),g=Object(J.getProductTotals)(c),b=D(h),v=u().meta,O=D(v);gtag("event","view_item",mf(mf({send_to:r,event_callback:a,value:g.netPrice},b),O))},Pf=function(){return(Pf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},If=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sf=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.currency,i=If(e,["product","currency"]);delete i.userId;var c=null!=a?a:n,l=o.productId,s=o.name,f=Object(J.getProductTotals)(o),p=Pf(Pf({},i),{productId:l,productName:s,currency:c}),y=D(p),d=u().meta,h=D(d);fbq("trackSingle",r,"ViewContent",Pf(Pf({value:f.netPrice},y),h))},xf=function(){return(xf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_f=function(t,e){var r=t.currency,n=e.product,o=e.currency,a=kf(e,["product","currency"]);delete a.userId;var i=null!=o?o:r,c=n.productId,l=n.name,s=xf(xf({},a),{productId:c,name:l,currency:i}),f=D(s),p=u().meta,y=D(p),d=Object(J.getProductTotals)(n);analytics.track("View Product Details",xf(xf({price:d.netPrice},f),y))},Ef=function(t){rt("viewProductDetails",t,{googleAnalyticsHandler:jf,facebookPixelHandler:Sf,segmentHandler:_f})},Af={logCustomizeProduct:rs,logFilterProducts:ps,logProductImpression:js,logSearchProductSuccess:Cs,logSearchProductAttempt:qs,logSearchProductNotFound:Zs,logSelectProduct:lf,logSortProducts:Of,logViewProductDetails:Ef},Tf=Af,Cf=function(){return(Cf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bf=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=e.shoppingCart,s=Rf(e,["callback","userId","currency","shoppingCart"]),f=null!=i?i:n,p=null!=c?c:o,y=Cf(Cf({},s),{userId:f,currency:p}),d=D(y),h=u().meta,g=D(h);gtag("event","purchase_attempt",Cf(Cf({send_to:r,event_callback:a,items:it(l,p),value:Object(K.getShoppingCartTotal)(l).total},d),g))},Uf=function(){return(Uf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Mf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hf=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=e.shoppingCart,i=Mf(e,["currency","shoppingCart"]);delete i.userId;var c=null!=o?o:n,l=Uf(Uf({},i),{currency:c}),s=D(l),f=u().meta,p=D(f),y=nt(a);fbq("trackSingleCustom",r,"PurchaseAttempt",Uf(Uf({content_ids:y,contents:ot(a),num_items:y.length,value:Object(K.getShoppingCartTotal)(a).total},s),p))},Lf=function(){return(Lf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Df=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yf=function(t,e){var r=t.currency,n=e.currency,o=e.shoppingCart,a=Df(e,["currency","shoppingCart"]);delete a.userId;var i=null!=n?n:r,c=Lf(Lf({},a),{currency:i}),l=D(c),s=u().meta,f=D(s),p=Object(K.getShoppingCartTotal)(o),y=Object(K.getShoppingCartProducts)(o),d=p.total,h=p.totalTaxes,g=p.shippingCost;analytics.track("Purchase Attempt",Lf(Lf({total:d,revenue:d-h-(null!=g?g:0),shipping:g,tax:h,products:lt(y)},l),f))},Nf=function(t){rt("purchaseAttempt",t,{googleAnalyticsHandler:Bf,facebookPixelHandler:Hf,segmentHandler:Yf})},qf=function(){return(qf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ff=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zf=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=e.shoppingCart,s=Ff(e,["callback","userId","currency","shoppingCart"]),f=null!=i?i:n,p=null!=c?c:o,y=qf(qf({},s),{userId:f,currency:p}),d=D(y),h=u().meta,g=D(h);gtag("event","purchase_fail",qf(qf({send_to:r,event_callback:a,items:it(l,p),value:Object(K.getShoppingCartTotal)(l).total},d),g))},Vf=function(){return(Vf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$f=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gf=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=e.shoppingCart,i=$f(e,["currency","shoppingCart"]);delete i.userId;var c=null!=o?o:n,l=Vf(Vf({},i),{currency:c}),s=D(l),f=u().meta,p=D(f),y=nt(a);fbq("trackSingleCustom",r,"PurchaseFail",Vf(Vf({content_ids:y,contents:ot(a),num_items:y.length,value:Object(K.getShoppingCartTotal)(a).total},s),p))},Wf=function(){return(Wf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jf=function(t,e){var r=t.currency,n=e.currency,o=e.shoppingCart,a=Kf(e,["currency","shoppingCart"]);delete a.userId;var i=null!=n?n:r,c=Wf(Wf({},a),{currency:i}),l=D(c),s=u().meta,f=D(s),p=Object(K.getShoppingCartTotal)(o),y=Object(K.getShoppingCartProducts)(o),d=p.total,h=p.totalTaxes,g=p.shippingCost;analytics.track("Purchase Fail",Wf(Wf({total:d,revenue:d-h-(null!=g?g:0),shipping:g,tax:h,products:lt(y)},l),f))},Qf=function(t){rt("purchaseFail",t,{googleAnalyticsHandler:zf,facebookPixelHandler:Gf,segmentHandler:Jf})},Zf=function(){return(Zf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xf=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tp=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.currency,l=e.shoppingCart,s=e.orderId,f=Xf(e,["callback","userId","currency","shoppingCart","orderId"]),p=null!=i?i:n,y=null!=c?c:o,d=Zf(Zf({},f),{userId:p,currency:y}),h=Object(K.getShoppingCartTotal)(l),g=h.total,b=h.shippingCost,v=h.totalTaxes,O=D(d),m=u().meta,w=D(m);gtag("event","purchase",Zf(Zf({send_to:r,event_callback:a,items:it(l,y),value:g,transaction_id:s,shipping:b,tax:v},O),w))},ep=function(){return(ep=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},rp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},np=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,a=e.shoppingCart,i=rp(e,["currency","shoppingCart"]);delete i.userId;var c=null!=o?o:n,l=ep(ep({},i),{currency:c}),s=D(l),f=u().meta,p=D(f),y=nt(a);fbq("trackSingle",r,"Purchase",ep(ep({content_ids:y,contents:ot(a),num_items:y.length,value:Object(K.getShoppingCartTotal)(a).total},s),p))},op=function(){return(op=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ap=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ip=function(t,e){var r=t.currency,n=e.currency,o=e.shoppingCart,a=ap(e,["currency","shoppingCart"]);delete a.userId;var i=null!=n?n:r,c=op(op({},a),{currency:i}),l=D(c),s=u().meta,f=D(s),p=Object(K.getShoppingCartTotal)(o),y=Object(K.getShoppingCartProducts)(o),d=p.total,h=p.totalTaxes,g=p.shippingCost;analytics.track("Order Completed",op(op({total:d,revenue:d-h-(null!=g?g:0),shipping:g,tax:h,products:lt(y)},l),f))},up=function(t){rt("purchaseSuccess",t,{googleAnalyticsHandler:tp,facebookPixelHandler:np,segmentHandler:ip})},cp={logPurchaseAttempt:Nf,logPurchaseFail:Qf,logPurchaseSuccess:up},lp=cp,sp=function(){return(sp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pp=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=fp(e,["callback","userId"]),c=null!=a?a:n,l=sp(sp({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_settings",sp(sp({send_to:r,event_callback:o},s),p))},yp=function(){return(yp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hp=function(t,e){var r=t.trackingId,n=dp(e,[]);delete n.userId;var o=yp({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewSettings",yp(yp({},a),c))},gp=function(){return(gp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vp=function(t,e){var r=bp(e,[]);delete r.userId;var n=gp({},r),o=D(n),a=u().meta,i=D(a);analytics.track("View Settings",gp(gp({},o),i))},Op=function(t){void 0===t&&(t={}),rt("viewSettings",t,{googleAnalyticsHandler:pp,facebookPixelHandler:hp,segmentHandler:vp})},mp={logViewSettings:Op},wp=mp,jp=function(){return(jp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ip=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Pp(e,["callback","userId"]);delete i.identify;var c=null!=a?a:n,l=jp(jp({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","add_shipping_info",jp(jp({send_to:r,event_callback:o},s),p))},Sp=function(){return(Sp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},kp=function(t,e){var r=t.trackingId,n=xp(e,[]);delete n.userId,delete n.identify;var o=Sp({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"AddShippingAddress",Sp(Sp({},a),c))},_p=function(){return(_p=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ep=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ap=function(t,e){var r=e.identify,n=Ep(e,["identify"]);delete n.userId;var o=_p({},n),a=D(o),i=u().meta,c=D(i);analytics.track("Add Shipping Address",_p(_p({},a),c)),r&&analytics.identify(r.id,r)},Tp=function(t){rt("addShippingAddress",t,{googleAnalyticsHandler:Ip,facebookPixelHandler:kp,segmentHandler:Ap})},Cp=function(){return(Cp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bp=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Rp(e,["callback","userId"]);delete i.identify;var c=null!=a?a:n,l=Cp(Cp({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","select_shipping_address",Cp(Cp({send_to:r,event_callback:o},s),p))},Up=function(){return(Up=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Mp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hp=function(t,e){var r=t.trackingId,n=Mp(e,[]);delete n.userId,delete n.identify;var o=Up({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SelectShippingAddress",Up(Up({},a),c))},Lp=function(){return(Lp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yp=function(t,e){var r=e.identify,n=Dp(e,["identify"]);delete n.userId;var o=Lp({},n),a=D(o),i=u().meta,c=D(i);analytics.track("Select Shipping Address",Lp(Lp({},a),c)),r&&analytics.identify(r.id,r)},Np=function(t){rt("selectShippingAddress",t,{googleAnalyticsHandler:Bp,facebookPixelHandler:Hp,segmentHandler:Yp})},qp=function(){return(qp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zp=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Fp(e,["callback","userId"]);delete i.identify;var c=null!=a?a:n,l=qp(qp({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","update_shipping_info",qp(qp({send_to:r,event_callback:o},s),p))},Vp=function(){return(Vp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$p=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gp=function(t,e){var r=t.trackingId,n=$p(e,[]);delete n.userId,delete n.identify;var o=Vp({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"UpdateShippingAddress",Vp(Vp({},a),c))},Wp=function(){return(Wp=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kp=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jp=function(t,e){var r=e.fields,n=e.identify,o=Kp(e,["fields","identify"]);delete o.userId;var a=Wp(Wp({},o),{fields:ct(r)}),i=D(a),c=u().meta,l=D(c);analytics.track("Update Shipping Address",Wp(Wp({},i),l)),n&&analytics.identify(n.id,n)},Qp=function(t){rt("updateShippingAddress",t,{googleAnalyticsHandler:zp,facebookPixelHandler:Gp,segmentHandler:Jp})},Zp={logAddShippingAddress:Tp,logSelectShippingAddress:Np,logUpdateShippingAddress:Qp},Xp=Zp,ty=function(){return(ty=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ey=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ry=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=e.store,f=ey(e,["callback","userId","product","currency","store"]),p=null!=i?i:n,y=null!=l?l:o,d=s.storeName,h=s.storeId,g=ty(ty({},f),{userId:p,storeId:h,storeName:d,currency:y}),b=Object(J.getProductTotals)(c),v=D(g),O=u().meta,m=D(O);gtag("event","add_to_cart",ty(ty({send_to:r,event_callback:a,items:[ut(c,y)],value:b.netPrice},v),m))},ny=function(){return(ny=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ay=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.store,i=e.currency,c=oy(e,["product","store","currency"]);delete c.userId;var l=null!=i?i:n,s=o.productId,f=o.name,p=o.amount,y=a.storeName,d=a.storeId,h=ny(ny({},c),{storeId:d,storeName:y,amount:p,currency:l}),g=D(h),b=u().meta,v=D(b);fbq("trackSingle",r,"AddToCart",ny(ny({content_id:s,content_name:f,content:at(o),value:Object(J.getProductTotals)(o).netPrice},g),v))},iy=function(){return(iy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},uy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cy=function(t,e){var r=t.currency,n=e.product,o=e.store,a=e.currency,i=uy(e,["product","store","currency"]);delete i.userId;var c=null!=a?a:r,l=n.productId,s=n.name,f=n.amount,p=o.storeName,y=o.storeId,d=iy(iy({},i),{storeId:y,storeName:p,productId:l,quantity:f,name:s,currency:c}),h=D(d),g=u().meta,b=D(g),v=Object(J.getProductTotals)(n);analytics.track("Product Added",iy(iy({price:v.netPrice},h),b))},ly=function(t){rt("addProductToCart",t,{googleAnalyticsHandler:ry,facebookPixelHandler:ay,segmentHandler:cy})},sy=function(){return(sy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},py=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=fy(e,["callback","userId","product","currency"]),f=null!=i?i:n,p=null!=l?l:o,y=sy(sy({},s),{userId:f,currency:p}),d=Object(J.getProductTotals)(c),h=D(y),g=u().meta,b=D(g);gtag("event","add_to_wishlist",sy(sy({send_to:r,event_callback:a,items:[ut(c,p)],value:d.netPrice},h),b))},yy=function(){return(yy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hy=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.currency,i=dy(e,["product","currency"]);delete i.userId;var c=null!=a?a:n,l=o.productId,s=o.name,f=o.amount,p=yy(yy({},i),{amount:f,currency:c}),y=D(p),d=u().meta,h=D(d);fbq("trackSingle",r,"AddToWishlist",yy(yy({content_id:l,content_name:s,content:at(o),value:Object(J.getProductTotals)(o).netPrice},y),h))},gy=function(){return(gy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},by=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vy=function(t,e){var r=t.currency,n=e.product,o=e.currency,a=by(e,["product","currency"]);delete a.userId;var i=null!=o?o:r,c=n.productId,l=n.name,s=n.amount,f=gy(gy({},a),{productId:c,quantity:s,name:l,currency:i}),p=D(f),y=u().meta,d=D(y),h=Object(J.getProductTotals)(n);analytics.track("Add Product To Wishlist",gy(gy({price:h.netPrice},p),d))},Oy=function(t){rt("addProductToWishlist",t,{googleAnalyticsHandler:py,facebookPixelHandler:hy,segmentHandler:vy})},my=function(){return(my=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},jy=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=wy(e,["callback","userId"]),c=null!=a?a:n,l=my(my({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","clear_cart",my(my({send_to:r,event_callback:o},s),p))},Py=function(){return(Py=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Iy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sy=function(t,e){var r=t.trackingId,n=Iy(e,[]);delete n.userId;var o=Py({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ClearCart",Py(Py({},a),c))},xy=function(){return(xy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ky=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_y=function(t,e){var r=ky(e,[]);delete r.userId;var n=xy({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Clear Cart",xy(xy({},o),i))},Ey=function(t){rt("clearCart",t,{googleAnalyticsHandler:jy,facebookPixelHandler:Sy,segmentHandler:_y})},Ay=function(){return(Ay=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ty=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cy=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=e.store,f=Ty(e,["callback","userId","product","currency","store"]),p=null!=i?i:n,y=null!=l?l:o,d=c.productId,h=c.name,g=s.storeName,b=s.storeId,v=Ay(Ay({},f),{userId:p,productId:d,productName:h,storeId:b,storeName:g,currency:y}),O=Object(J.getProductTotals)(c),m=D(v),w=u().meta,j=D(w);gtag("event","remove_product_from_cart",Ay(Ay({send_to:r,event_callback:a,value:O.netPrice},m),j))},Ry=function(){return(Ry=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},By=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Uy=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.store,i=e.currency,c=By(e,["product","store","currency"]);delete c.userId;var l=null!=i?i:n,s=o.productId,f=o.name,p=o.amount,y=a.storeName,d=a.storeId,h=Ry(Ry({},c),{storeId:d,storeName:y,amount:p,currency:l}),g=D(h),b=u().meta,v=D(b);fbq("trackSingleCustom",r,"RemoveProductFromCart",Ry(Ry({content_id:s,content_name:f,content:at(o),value:Object(J.getProductTotals)(o).netPrice},g),v))},My=function(){return(My=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ly=function(t,e){var r=t.currency,n=e.product,o=e.store,a=e.currency,i=Hy(e,["product","store","currency"]);delete i.userId;var c=null!=a?a:r,l=n.productId,s=n.name,f=n.amount,p=o.storeName,y=o.storeId,d=My(My({},i),{storeId:y,storeName:p,productId:l,quantity:f,name:s,currency:c}),h=D(d),g=u().meta,b=D(g),v=Object(J.getProductTotals)(n);analytics.track("Product Removed",My(My({price:v.netPrice},h),b))},Dy=function(){return(Dy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ny=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=Yy(e,["callback","userId","product","currency"]),f=null!=i?i:n,p=null!=l?l:o,y=c.productId,d=c.name,h=Dy(Dy({},s),{userId:f,productId:y,productName:d,currency:p}),g=Object(J.getProductTotals)(c),b=D(h),v=u().meta,O=D(v);gtag("event","remove_product_from_wishlist",Dy(Dy({send_to:r,event_callback:a,value:g.netPrice},b),O))},qy=function(){return(qy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zy=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.currency,i=Fy(e,["product","currency"]);delete i.userId;var c=null!=a?a:n,l=o.productId,s=o.name,f=o.amount,p=qy(qy({},i),{amount:f,currency:c}),y=D(p),d=u().meta,h=D(d);fbq("trackSingleCustom",r,"RemoveProductFromWishlist",qy(qy({content_id:l,content_name:s,content:at(o),value:Object(J.getProductTotals)(o).netPrice},y),h))},Vy=function(){return(Vy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$y=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gy=function(t,e){var r=t.currency,n=e.product,o=e.currency,a=$y(e,["product","currency"]);delete a.userId;var i=null!=o?o:r,c=n.productId,l=n.name,s=n.amount,f=Vy(Vy({},a),{productId:c,quantity:s,name:l,currency:i}),p=D(f),y=u().meta,d=D(y),h=Object(J.getProductTotals)(n);analytics.track("Remove Product From Wishlist",Vy(Vy({price:h.netPrice},p),d))},Wy=function(){return(Wy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ky=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jy=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=e.store,f=Ky(e,["callback","userId","product","currency","store"]),p=c.productId,y=c.name,d=null!=i?i:n,h=null!=l?l:o,g=s.storeName,b=s.storeId,v=Wy(Wy({},f),{userId:d,storeId:b,storeName:g,productId:p,productName:y,currency:h}),O=Object(J.getProductTotals)(c),m=D(v),w=u().meta,j=D(w);gtag("event","update_product_in_cart",Wy(Wy({send_to:r,event_callback:a,value:O.netPrice},m),j))},Qy=function(){return(Qy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zy=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xy=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.store,i=e.currency,c=Zy(e,["product","store","currency"]);delete c.userId;var l=null!=i?i:n,s=o.productId,f=o.name,p=o.amount,y=a.storeName,d=a.storeId,h=Qy(Qy({},c),{storeId:d,storeName:y,amount:p,currency:l}),g=D(h),b=u().meta,v=D(b);fbq("trackSingleCustom",r,"UpdateProductInCart",Qy(Qy({content_id:s,content_name:f,content:at(o),value:Object(J.getProductTotals)(o).netPrice},g),v))},td=function(){return(td=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ed=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rd=function(t,e){var r=t.currency,n=e.product,o=e.store,a=e.currency,i=e.fields,c=ed(e,["product","store","currency","fields"]);delete c.userId;var l=null!=a?a:r,s=n.productId,f=n.name,p=n.amount,y=o.storeName,d=o.storeId,h=td(td({},c),{storeId:d,storeName:y,productId:s,quantity:p,name:f,currency:l,fields:ct(i)}),g=D(h),b=u().meta,v=D(b),O=Object(J.getProductTotals)(n);analytics.track("Update Product In Cart",td(td({price:O.netPrice},g),v))},nd=function(){return(nd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},od=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ad=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,a=e.callback,i=e.userId,c=e.product,l=e.currency,s=od(e,["callback","userId","product","currency"]),f=c.productId,p=c.name,y=null!=i?i:n,d=null!=l?l:o,h=nd(nd({},s),{userId:y,productId:f,productName:p,currency:d}),g=Object(J.getProductTotals)(c),b=D(h),v=u().meta,O=D(v);gtag("event","update_product_in_wishlist",nd(nd({send_to:r,event_callback:a,value:g.netPrice},b),O))},id=function(){return(id=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ud=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cd=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,a=e.currency,i=ud(e,["product","currency"]);delete i.userId;var c=null!=a?a:n,l=o.productId,s=o.name,f=o.amount,p=id(id({},i),{amount:f,currency:c}),y=D(p),d=u().meta,h=D(d);fbq("trackSingleCustom",r,"UpdateProductInWishlist",id(id({content_id:l,content_name:s,content:at(o),value:Object(J.getProductTotals)(o).netPrice},y),h))},ld=function(){return(ld=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fd=function(t,e){var r=t.currency,n=e.product,o=e.currency,a=e.fields,i=sd(e,["product","currency","fields"]);delete i.userId;var c=null!=o?o:r,l=n.productId,s=n.name,f=n.amount,p=ld(ld({},i),{productId:l,quantity:f,name:s,currency:c,fields:ct(a)}),y=D(p),d=u().meta,h=D(d),g=Object(J.getProductTotals)(n);analytics.track("Update Product In Wishlist",ld(ld({price:g.netPrice},y),h))},pd=function(){return(pd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},dd=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=yd(e,["callback","userId"]),c=null!=a?a:n,l=pd(pd({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","view_cart",pd(pd({send_to:r,event_callback:o},s),p))},hd=function(){return(hd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bd=function(t,e){var r=t.trackingId,n=gd(e,[]);delete n.userId;var o=hd({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ViewCart",hd(hd({},a),c))},vd=function(){return(vd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Od=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},md=function(t,e){var r=e.products,n=Od(e,["products"]);delete n.userId;var o=vd({},n),a=D(o),i=u().meta,c=D(i);analytics.track("Cart Viewed",vd(vd({products:lt(r)},a),c))},wd=function(){return(wd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pd=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.shareTarget,c=e.itemId,l=jd(e,["callback","userId","shareTarget","itemId"]),s=null!=a?a:n,f=wd(wd({},l),{userId:s}),p=D(f),y=u().meta,d=D(y);gtag("event","share",wd(wd({send_to:r,event_callback:o,method:i,content_id:c},p),d))},Id=function(){return(Id=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Sd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},xd=function(t,e){var r=t.trackingId,n=Sd(e,[]);delete n.userId;var o=Id({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"Share",Id(Id({},a),c))},kd=function(){return(kd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_d=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ed=function(t,e){var r=e.shareTarget,n=_d(e,["shareTarget"]);delete n.userId;var o=kd(kd({},n),{shareVia:r}),a=D(o),i=u().meta,c=D(i);analytics.track("Share",kd(kd({},a),c))},Ad=function(){return(Ad=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Td=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cd=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.previousStore,c=e.nextStore,l=Td(e,["callback","userId","previousStore","nextStore"]),s=i.storeId,f=i.storeName,p=c.storeId,y=c.storeName,d=null!=a?a:n,h=Ad(Ad({},l),{userId:d,previousStoreId:s,previousStoreName:f,nextStoreId:p,nextStoreName:y}),g=D(h),b=u().meta,v=D(b);gtag("event","change_store",Ad(Ad({send_to:r,event_callback:o},g),v))},Rd=function(){return(Rd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ud=function(t,e){var r=t.trackingId,n=e.previousStore,o=e.nextStore,a=Bd(e,["previousStore","nextStore"]);delete a.userId;var i=n.storeId,c=n.storeName,l=o.storeId,s=o.storeName,f=Rd(Rd({},a),{previousStoreId:i,previousStoreName:c,nextStoreId:l,nextStoreName:s}),p=D(f),y=u().meta,d=D(y);fbq("trackSingleCustom",r,"ChangeStore",Rd(Rd({},p),d))},Md=function(){return(Md=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ld=function(t,e){var r=e.previousStore,n=e.nextStore,o=Hd(e,["previousStore","nextStore"]);delete o.userId;var a=r.storeId,i=r.storeName,c=n.storeId,l=n.storeName,s=Md(Md({},o),{previousStoreId:a,previousStoreName:i,nextStoreId:c,nextStoreName:l}),f=D(s),p=u().meta,y=D(p);analytics.track("Change Store",Md(Md({},f),y))},Dd=function(){return(Dd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Nd=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=e.store,c=Yd(e,["callback","userId","store"]),l=i.storeId,s=i.storeName,f=null!=a?a:n,p=Dd(Dd({},c),{userId:f,storeId:l,storeName:s}),y=D(p),d=u().meta,h=D(d);gtag("event","set_store",Dd(Dd({send_to:r,event_callback:o},y),h))},qd=function(){return(qd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zd=function(t,e){var r=t.trackingId,n=e.store,o=Fd(e,["store"]);delete o.userId;var a=n.storeId,i=n.storeName,c=qd(qd({},o),{storeId:a,storeName:i}),l=D(c),s=u().meta,f=D(s);fbq("trackSingleCustom",r,"SetStore",qd(qd({},l),f))},Vd=function(){return(Vd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$d=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gd=function(t,e){var r=e.store,n=$d(e,["store"]);delete n.userId;var o=r.storeId,a=r.storeName,i=Vd(Vd({},n),{storeId:o,storeName:a}),c=D(i),l=u().meta,s=D(l);analytics.track("Set Store",Vd(Vd({},c),s))},Wd=function(){return(Wd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jd=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Kd(e,["callback","userId"]);delete i.identify;var c=null!=a?a:n,l=Wd(Wd({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","set_user_info",Wd(Wd({send_to:r,event_callback:o},s),p))},Qd=function(){return(Qd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xd=function(t,e){var r=t.trackingId,n=Zd(e,[]);delete n.userId,delete n.identify;var o=Qd({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SetUserInfo",Qd(Qd({},a),c))},th=function(){return(th=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},eh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rh=function(t,e){var r=e.identify,n=eh(e,["identify"]);delete n.userId;var o=th({},n),a=D(o),i=u().meta,c=D(i);analytics.track("Set User Info",th(th({},a),c)),r&&analytics.identify(r.id,r)},nh=function(){return(nh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ah=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=oh(e,["callback","userId"]);delete i.identify;var c=null!=a?a:n,l=nh(nh({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","update_user_info",nh(nh({send_to:r,event_callback:o},s),p))},ih=function(){return(ih=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},uh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ch=function(t,e){var r=t.trackingId,n=uh(e,[]);delete n.userId,delete n.identify;var o=ih({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"UpdateUserInfo",ih(ih({},a),c))},lh=function(){return(lh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fh=function(t,e){var r=e.fields,n=e.identify,o=sh(e,["fields","identify"]);delete o.userId;var a=lh(lh({},o),{fields:ct(r)}),i=D(a),c=u().meta,l=D(c);analytics.track("Update User Info",lh(lh({},i),l)),n&&analytics.identify(n.id,n)},ph=function(){return(ph=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},dh=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=yh(e,["callback","userId"]),c=null!=a?a:n,l=ph(ph({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","change_vendor",ph(ph({send_to:r,event_callback:o},s),p))},hh=function(){return(hh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bh=function(t,e){var r=t.trackingId,n=gh(e,[]);delete n.userId;var o=hh({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"ChangeVendor",hh(hh({},a),c))},vh=function(){return(vh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Oh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},mh=function(t,e){var r=Oh(e,[]);delete r.userId;var n=vh({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Change Vendor",vh(vh({},o),i))},wh=function(){return(wh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ph=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=jh(e,["callback","userId"]),c=null!=a?a:n,l=wh(wh({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","set_vendor",wh(wh({send_to:r,event_callback:o},s),p))},Ih=function(){return(Ih=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Sh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},xh=function(t,e){var r=t.trackingId,n=Sh(e,[]);delete n.userId;var o=Ih({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SetVendor",Ih(Ih({},a),c))},kh=function(){return(kh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_h=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Eh=function(t,e){var r=_h(e,[]);delete r.userId;var n=kh({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Set Vendor",kh(kh({},o),i))},Ah=function(){return(Ah=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Th=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ch=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Th(e,["callback","userId"]),c=null!=a?a:n,l=Ah(Ah({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","select_workflow",Ah(Ah({send_to:r,event_callback:o},s),p))},Rh=function(){return(Rh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Uh=function(t,e){var r=t.trackingId,n=Bh(e,[]);delete n.userId;var o=Rh({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"SelectWorkflow",Rh(Rh({},a),c))},Mh=function(){return(Mh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Lh=function(t,e){var r=Hh(e,[]);delete r.userId;var n=Mh({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Select Workflow",Mh(Mh({},o),i))},Dh=function(){return(Dh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Nh=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,a=e.userId,i=Yh(e,["callback","userId"]),c=null!=a?a:n,l=Dh(Dh({},i),{userId:c}),s=D(l),f=u().meta,p=D(f);gtag("event","update_workflow",Dh(Dh({send_to:r,event_callback:o},s),p))},qh=function(){return(qh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fh=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zh=function(t,e){var r=t.trackingId,n=Fh(e,[]);delete n.userId;var o=qh({},n),a=D(o),i=u().meta,c=D(i);fbq("trackSingleCustom",r,"UpdateWorkflow",qh(qh({},a),c))},Vh=function(){return(Vh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$h=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gh=function(t,e){var r=$h(e,[]);delete r.userId;var n=Vh({},r),o=D(n),a=u().meta,i=D(a);analytics.track("Update Workflow",Vh(Vh({},o),i))},Wh={auth:ve,banner:Ye,billing:vr,booking:Ar,category:On,checkout:Nn,coupon:ia,credit:La,fulfillment:gi,geo:ou,help:gu,logCustomEvent:Wa,loyalty:oc,order:Mc,other:dl,payment:$l,product:Tf,purchase:lp,settings:wp,shipping:Xp,shoppingCart:{logAddProductToCart:ly,logAddProductToWishlist:Oy,logClearCart:Ey,logRemoveProductFromCart:function(t){rt("removeProductFromCart",t,{googleAnalyticsHandler:Cy,facebookPixelHandler:Uy,segmentHandler:Ly})},logRemoveProductFromWishlist:function(t){rt("removeProductFromWishlist",t,{googleAnalyticsHandler:Ny,facebookPixelHandler:zy,segmentHandler:Gy})},logUpdateProductInCart:function(t){rt("updateProductInCart",t,{googleAnalyticsHandler:Jy,facebookPixelHandler:Xy,segmentHandler:rd})},logUpdateProductInWishlist:function(t){rt("updateProductInWishlist",t,{googleAnalyticsHandler:ad,facebookPixelHandler:cd,segmentHandler:fd})},logViewCart:function(t){rt("viewCart",t,{googleAnalyticsHandler:dd,facebookPixelHandler:bd,segmentHandler:md})}},social:{logShare:function(t){rt("share",t,{googleAnalyticsHandler:Pd,facebookPixelHandler:xd,segmentHandler:Ed})}},store:{logChangeStore:function(t){rt("changeStore",t,{googleAnalyticsHandler:Cd,facebookPixelHandler:Ud,segmentHandler:Ld})},logSetStore:function(t){rt("setStore",t,{googleAnalyticsHandler:Nd,facebookPixelHandler:zd,segmentHandler:Gd})}},user:{logSetUserInfo:function(t){rt("setUserInfo",t,{googleAnalyticsHandler:Jd,facebookPixelHandler:Xd,segmentHandler:rh})},logUpdateUserInfo:function(t){rt("updateUserInfo",t,{googleAnalyticsHandler:ah,facebookPixelHandler:ch,segmentHandler:fh})}},vendor:{logChangeVendor:function(t){rt("changeVendor",t,{googleAnalyticsHandler:dh,facebookPixelHandler:bh,segmentHandler:mh})},logSetVendor:function(t){rt("setVendor",t,{googleAnalyticsHandler:Ph,facebookPixelHandler:xh,segmentHandler:Eh})}},workflow:{logSelectWorkflow:function(t){rt("selectWorkflow",t,{googleAnalyticsHandler:Ch,facebookPixelHandler:Uh,segmentHandler:Lh})},logUpdateWorkflow:function(t){rt("updateWorkflow",t,{googleAnalyticsHandler:Nh,facebookPixelHandler:zh,segmentHandler:Gh})}}},Kh=function(t){analytics.identify(t.id,t)}}])}));