{ "version": 3, "sources": ["../../../../../../internal/esbuild/entrypoints/modern/checkout.ts", "sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=4857010c-6d14-4eb3-ad0a-18178f5b546c", "../../../../../../internal/esbuild/entrypoints/modern/checkout.ts", "../../../../../../owl-nest/ulule/features/checkout/src/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/utils/localStorage.ts", "../../../../../../owl-nest/ulule/features/checkout/src/utils/product.ts", "../../../../../../owl-nest/ulule/features/checkout/src/models/product.ts", "../../../../../../owl-nest/ulule/features/checkout/src/models/reward.ts", "../../../../../../owl-nest/ulule/features/checkout/src/models/variant.ts", "../../../../../../owl-nest/ulule/features/checkout/src/utils/error.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/hooks/useCart.ts", "../../../../../../owl-nest/ulule/features/checkout/src/hooks/useProject.ts", "../../../../../../owl-nest/ulule/features/checkout/src/utils/UFE.ts", "../../../../../../owl-nest/ulule/features/checkout/src/utils/hydrate.ts", "../../../../../../owl-nest/ulule/features/checkout/src/utils/searchParams.ts", "../../../../../../owl-nest/ulule/features/checkout/src/hooks/useRevealedRewards.ts", "../../../../../../owl-nest/ulule/features/checkout/src/components/Modals/PaymentDisturbanceModal.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Header.js", "../../../../../../owl-nest/ulule/features/checkout/src/Router.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/utils/scrollTo.js", "../../../../../../owl-nest/ulule/features/checkout/src/hooks/useNavigation.ts", "../../../../../../owl-nest/ulule/features/checkout/src/components/FutureItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Item.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/style.js", "../../../../../../owl-nest/ulule/features/checkout/src/components/IdentityItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/selection/index.ts", "../../../../../../owl-nest/ulule/features/checkout/src/components/selection/CartSummary.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/money/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/style.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/selection/style.ts", "../../../../../../owl-nest/ulule/features/checkout/src/components/selection/SelectedShipping.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/ShippingItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/PickupAddressItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/components/AddressManager/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/components/AddressManager/DetailAddress.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/components/NewAddressSubForm.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/components/AddressManager/ListAddress.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/components/ExistingAddressSubForm.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/DropoffAddressItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/ContactAddressItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/HomeDeliveryAddress.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/address/MembershipDeliveryAddress.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Layout.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/MembershipHero.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/ProgressBar.js", "../../../../../../owl-nest/ulule/features/checkout/src/components/Title.js", "../../../../../../owl-nest/ulule/features/checkout/src/views/donation/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/login/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/payment/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/payment/PaymentSection.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/payment/hooks/useOrderError.ts", "../../../../../../owl-nest/ulule/features/checkout/src/views/payment/hooks/usePayment.ts", "../../../../../../owl-nest/ulule/features/checkout/src/models/project.ts", "../../../../../../owl-nest/ulule/features/checkout/src/models/user.ts", "../../../../../../owl-nest/ulule/features/checkout/src/views/payment/components/ModalIncompleteProfile.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Payment/PaymentDisclaimers.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Payment/PaymentMethod.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/pickup/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/pickup/PickupItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/renew/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/Cart.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/components/cart/SelectionItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Modals/RemoveModal.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Form/SelectionQuantity.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/components/cart/SelectionShipping.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/components/cart/CountrySelect.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/components/cart/SingleCountryAndShippingModeLabel.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/components/cart/SelectionTip.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/components/cart/SelectionTotal.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/RewardList.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/components/rewards/Reward.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/utils/filter.ts", "../../../../../../owl-nest/ulule/features/checkout/src/views/selection/ItemTip.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/mondialRelay/index.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/mondialRelay/MondialRelayItem.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/mondialRelay/MondialRelayStep1.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/mondialRelay/StepTitle.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/mondialRelay/MondialRelayStep2.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/components/Modals/RewardTaxDeductionModal.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/EndfunnelRouter.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/Comment.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/components/Sponsorships.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/components/Title.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/PAGES.ts", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/style.ts", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/Processing.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/Aborted.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/components/Buttons.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/Canceled.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/Share.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/components/SocialPreview.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/End.tsx", "../../../../../../owl-nest/ulule/features/checkout/src/views/endfunnel/MembershipThanks.tsx"], "sourcesContent": ["\n import \"_sentry-debug-id-injection-stub\";\n import * as OriginalModule from \"./internal/esbuild/entrypoints/modern/checkout.ts\";\n export default OriginalModule.default;\n export * from \"./internal/esbuild/entrypoints/modern/checkout.ts\";", ";{try{let e=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=\"2f30d46a-7d4a-4f57-a106-d5c2cea44b15\",e._sentryDebugIdIdentifier=\"sentry-dbid-2f30d46a-7d4a-4f57-a106-d5c2cea44b15\")}catch(e){}};", "import '@owl-nest/polyfill'\nimport '@owl-nest/checkout'\n", "import * as React from 'react'\nimport * as ReactDOM from 'react-dom/client'\nimport * as jotai from 'jotai'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport * as api from '@owl-nest/api-client/latest'\nimport * as fb from '@owl-nest/facebook-sdk-init'\nimport * as error from '@owl-nest/error'\nimport { initializeLocalization } from '@owl-nest/localize'\nimport * as logger from '@owl-nest/logger'\nimport * as models from '@owl-nest/models'\nimport * as services from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport * as env from '@owl-nest/config'\n\nimport { saveCartToLocalStorage } from './utils/localStorage'\nimport { hydrate } from './utils/hydrate'\nimport * as UFE from './utils/UFE'\n\nimport { PaymentDisturbanceModal } from './components/Modals/PaymentDisturbanceModal'\nimport { Header } from './components/Header'\nimport { Router } from './Router'\nimport { getProject, initializeProject } from './hooks/useProject'\nimport { CART_STATE } from './hooks/useCart'\n\nconst jotaiStore = jotai.getDefaultStore()\n\nasync function init(): Promise {\n await env.initUserConfig()\n const userConfig = env.getUserConfig()\n\n logger.init({\n dsn: env.SENTRY_PUBLIC_DSN,\n environment: env.ENVIRONMENT,\n user: {\n country: env.USER_COUNTRY,\n currency: userConfig.currency,\n locale: userConfig.lang,\n },\n })\n logger.setTag('feature', 'checkout')\n\n fb.init({ appId: env.FACEBOOK_APP_ID ?? '', locale: api.EXTENDED_LOCALES[userConfig.lang] })\n\n // TODO: UI placeholder, let's be sexy\n await initializeLocalization(userConfig.lang, env.LOCALE_FILES[userConfig.lang])\n await initializeProject(jotaiStore)\n\n renderHeader()\n renderApp()\n}\n\ninit()\n\nfunction renderHeader(): void {\n const headerContainer = document.querySelector('#checkout-app-header')\n if (headerContainer) {\n const headerRoot = ReactDOM.createRoot(headerContainer)\n headerRoot.render(
)\n } else {\n logger.err('Header container is missing')\n }\n}\n\nasync function renderApp(): Promise {\n let initialError\n const appContainer = document.querySelector('#checkout-app-container')\n\n if (appContainer) {\n // TODO: FIXME: hydrate might throw, we need to display error\n const project = await getProject(jotaiStore)\n const applicationStatePromise = hydrate(project, jotaiStore)\n const response = await applicationStatePromise.catch((error) => {\n initialError = error\n })\n\n if (!response || initialError) {\n return error.renderCrashToast('checkout', initialError)\n }\n\n const { cart, initialConfiguration, messages } = response\n\n jotaiStore.set(CART_STATE, { type: 'override', state: cart })\n jotaiStore.set(services.message.MESSAGES_ATOM, { type: 'MESSAGE.SYNC', state: messages })\n saveCartToLocalStorageOnChange(project)\n\n // NOTE: We want to embed current cart state within all checkout related logs\n logger.getCurrentScope().addEventProcessor(function (event) {\n event.extra = {\n ...event.extra,\n cart,\n }\n return event\n })\n logger.setTag('project', project.id)\n\n // NOTE: We do NOT support displaying Checkout for non-online projects. Thus, we exit back to project page.\n if (!models.project.isOnline(project)) {\n window.location.href = project.absolute_url\n }\n\n if (models.project.isFinished(project) || project?.is_cancelled) {\n if (!window.location.pathname.match(/checkout\\/renew/)) {\n window.location.href = `${project.absolute_url}?reward=${project.rewards?.[0].id ?? 1}`\n return\n }\n }\n\n observeStoreForUser((user: api.AuthenticatedUser) => {\n const userConfig = env.getUserConfig()\n\n logger.setUser({\n country: user.country,\n currency: userConfig.currency,\n email: user.email,\n id: String(user.id),\n isCompleted: user.is_completed,\n locale: user.lang,\n timezone: user.timezone,\n username: user.username,\n })\n })\n\n const getUserId = (): number | undefined => {\n const authState = jotaiStore.get(services.user.AUTH_ATOM)\n return authState.type === 'loggedin' ? authState.authenticatedUser.id : undefined\n }\n\n const root = ReactDOM.createRoot(appContainer)\n root.render(\n \n \n \n {!models.project.isOrdersEnabled(project) && }\n \n \n \n ,\n )\n } else {\n logger.err('App container is missing')\n }\n}\n\nfunction observeStoreForUser(onChange: (user: api.AuthenticatedUser) => void): () => void {\n let currentState: services.user.AuthState\n\n function handleChange(): void {\n const nextState = jotaiStore.get(services.user.AUTH_ATOM)\n if (nextState !== currentState && nextState.type === 'loggedin') {\n currentState = nextState\n onChange(currentState.authenticatedUser)\n }\n }\n\n const unsubscribe = jotaiStore.sub(services.user.AUTH_ATOM, handleChange)\n handleChange()\n return unsubscribe\n}\n\nfunction saveCartToLocalStorageOnChange(project: api.Project): () => void {\n return jotaiStore.sub(CART_STATE, () => {\n const state = jotaiStore.get(CART_STATE)\n if (state.dryRunResult) {\n saveCartToLocalStorage(state, project.id)\n }\n })\n}\n", "import * as date from '@owl-nest/date'\nimport { t, tn } from '@owl-nest/localize'\nimport * as api from '@owl-nest/api-client/next'\nimport * as cartService from '@owl-nest/services/src/cart'\n\nimport * as productModel from '../models/product'\nimport * as productUtils from './product'\n\nimport * as errorUtils from '../utils/error'\nimport { INITIAL_STATE } from '../hooks/useCart'\n\nexport const LOCALSTORAGE_NAME_TRACKING = 'ul_checkout_tracking_v3_'\n\nexport function isExpired(expirable: { expirationDate: string }): boolean {\n const currentDate = new Date()\n const expirationDate = new Date(expirable.expirationDate)\n\n return currentDate > expirationDate\n}\n\nfunction cleanAllExpired() {\n const carts = cartService.getAllCarts()\n\n for (const cart of carts) {\n const projectId = cart.cartState.project?.id\n if (projectId !== undefined) {\n if (isExpired(cart)) {\n cartService.removeCartFromLocalStorage(projectId)\n }\n }\n }\n\n const storage = window.localStorage\n for (let i = 0; i < storage.length; i++) {\n const key = storage.key(i)!\n if (key.startsWith(LOCALSTORAGE_NAME_TRACKING)) {\n const stored = storage.getItem(key)\n if (stored) {\n const tracking = JSON.parse(stored)\n if (isExpired(tracking)) {\n storage.removeItem(key)\n }\n }\n }\n }\n}\n\nexport function getTrackingOrderFromLocalStorage(orderId: number) {\n const storage = window.localStorage\n const stored = storage.getItem(`${LOCALSTORAGE_NAME_TRACKING}${orderId}`)\n\n if (stored) {\n const data = JSON.parse(stored)\n\n // Clean expired entries\n cleanAllExpired()\n\n return data\n }\n\n return\n}\n\nexport function setTrackingOrderInLocalStorage(orderId: number) {\n const storage = window.localStorage\n const expirationDate = date.minutesFromNow(30)\n\n storage.setItem(\n `${LOCALSTORAGE_NAME_TRACKING}${orderId}`,\n JSON.stringify({\n expirationDate,\n }),\n )\n}\n\nexport function saveCartToLocalStorage(cartState: cartService.CartState, projectId: number) {\n const expirationDate = date.daysFromNow(7)\n\n const serializableCartState = { ...cartState }\n delete serializableCartState.dryRunResult\n delete serializableCartState.project\n\n cartService.setCartInLocalStorage(projectId, serializableCartState, expirationDate)\n}\n\nexport function loadCartFromLocalStorage(project: api.Project): {\n cartState: cartService.CartState\n error?: LoadError\n} {\n cleanAllExpired()\n\n const cartState = cartService.getCartFromLocalStorage(project.id)\n\n // since local storage format has changed, there can be an entry present in\n // local storage with a deprecated format. Those won't have the\n // `cartState` entry. They are considered empty\n if (cartState === undefined) {\n return { cartState: INITIAL_STATE }\n }\n\n const [products, limitedProducts, soldOutProducts] = productUtils.getProductsFromSavedIds(\n cartState.products.map((product) => ({ reward_id: product.id, quantity: product.quantity })),\n project,\n )\n\n return {\n cartState: {\n project,\n ...cartState,\n },\n error: loadCartError(products, limitedProducts, soldOutProducts),\n }\n}\n\ntype LoadError = errorUtils.ErrorPayload & {\n level: 'alert' | 'error' | 'info' | 'success'\n message: string\n}\n\nfunction loadCartError(\n products: productModel.Product[],\n limitedProducts: productModel.Product[],\n soldOutProducts: productModel.Product[],\n): LoadError | undefined {\n if (limitedProducts.length === 0 && soldOutProducts.length === 0) {\n return\n }\n\n if (limitedProducts.length > 0) {\n const errorLabel = t('Unavailable quantity')\n const errorPayload = errorUtils.unavailableQuantityError('selection', limitedProducts)\n return {\n level: 'error',\n message: errorLabel,\n ...errorPayload,\n }\n } else {\n const errorLabel = tn('Reward out of stock!', 'Rewards out of stock!', soldOutProducts.length)\n if (products.length === 0) {\n const errorPayload = errorUtils.allSelectedProductsAreExpiredError('selection', soldOutProducts.length)\n return {\n level: 'error',\n message: errorLabel,\n ...errorPayload,\n }\n } else {\n const errorPayload = errorUtils.someSelectedProductsAreExpiredError('selection', soldOutProducts)\n return {\n level: 'error',\n message: errorLabel,\n ...errorPayload,\n }\n }\n }\n}\n", "import * as api from '@owl-nest/api-client/latest'\nimport * as logger from '@owl-nest/logger'\nimport * as model from '@owl-nest/models'\n\nimport * as productModel from '../models/product'\n\ntype PreSerializedProduct = {\n quantity: number\n reward_id: number\n}\n\nexport function findProductIndexById(products: Array = [], productId: number): number {\n return products.findIndex((selectedProduct) => {\n return productId === selectedProduct.id\n })\n}\n\n// TODO: Improvement suggestion: we should use a `savedProducts` counter\n// to avoid scanning all project rewards and their variants\n// once all of `savedProducts` were resolved (doing so, probably drop `forEach` altogether).\nexport function getProductsFromSavedIds(\n savedProducts: PreSerializedProduct[] = [],\n project: api.Project,\n): productModel.Product[][] {\n const availableProducts: productModel.Product[] = []\n const limitedProducts: productModel.Product[] = []\n const soldOutProducts: productModel.Product[] = []\n\n if (savedProducts.length === 0 || project.rewards === null || project.rewards === undefined) {\n return [[], [], []]\n }\n\n project.rewards.forEach((reward: api.Reward) => {\n if (reward.variants && reward.variants_count > 0) {\n reward.variants\n .filter((variant) => Boolean(variant))\n .forEach((variant: api.Variant) => {\n if (variant) {\n const product = findAndFormatProduct(variant, reward)\n dispatchProduct(product)\n } else {\n logger.warn('[checkout] Trying to resolve non-existent variant', {\n projectID: project.id,\n rewardID: reward.id,\n variants: reward.variants,\n })\n }\n })\n }\n // We also have to consider rewards with variations, in case one is set in params.\n const product = findAndFormatProduct(reward)\n dispatchProduct(product)\n })\n\n return [availableProducts, limitedProducts, soldOutProducts]\n\n function dispatchProduct(product: productModel.Product | undefined): void {\n if (product) {\n const availableStock = productModel.stock(product).available\n if (\n availableStock === null ||\n availableStock === undefined ||\n (Number.isInteger(availableStock) && availableStock >= product.quantity)\n ) {\n availableProducts.push(product)\n } else if (productModel.hasAvailableStock(product)) {\n limitedProducts.push(product)\n } else {\n soldOutProducts.push(product)\n }\n }\n }\n\n function findAndFormatProduct(\n product?: api.Variant | api.Reward,\n parent?: api.Reward,\n ): productModel.Product | undefined {\n if (!product) {\n return\n }\n const selectedProduct = savedProducts.find((savedProduct) => {\n return savedProduct.reward_id === product.id\n })\n if (selectedProduct) {\n if (parent !== undefined) {\n const reward = model.reward.Reward(parent, project)\n const variant = model.variant.Variant(product as api.Variant, reward)\n return productModel.Product({ project, reward, variant, quantity: selectedProduct.quantity })\n } else {\n const reward = model.reward.Reward(product as api.Reward, project)\n return productModel.Product({ project, reward, quantity: selectedProduct.quantity })\n }\n }\n }\n}\n\nexport function orderRewardsAvailableFirst(rewardList: model.reward.Reward[]): model.reward.Reward[] {\n return rewardList.sort((firstReward, secondReward) => {\n // Hidden rewards should be on the top of the list whereas sold out ones should be at the end\n if (firstReward.is_hidden === secondReward.is_hidden) {\n if (firstReward.available === secondReward.available) {\n return 0\n } else if (firstReward.available) {\n return -1\n } else return 1\n } else if (firstReward.is_hidden) {\n return -1\n } else return 1\n })\n}\n\nexport function preSerialize(products: productModel.Product[]): PreSerializedProduct[] {\n return products.map((product) => ({\n quantity: product.quantity,\n reward_id: product.id,\n }))\n}\n", "import * as api from '@owl-nest/api-client/next'\nimport * as model from '@owl-nest/models'\n\nimport * as rewardModel from './reward'\nimport * as variantModel from './variant'\n\nexport type Product = {\n id: number\n optionValuesIds?: number[]\n project: api.Project\n quantity: number\n reward: model.reward.Reward\n variant?: model.variant.Variant\n}\n\ntype MakeProduct = {\n optionValuesIds?: number[]\n project: api.Project\n quantity?: number\n reward: api.Reward\n variant?: api.Variant\n}\n\nexport function Product({ reward, optionValuesIds, project, variant, quantity = 1 }: MakeProduct): Product {\n const rewardModel = model.reward.Reward(reward, project)\n const variantModel = variant && model.variant.Variant(variant, rewardModel)\n return {\n id: variant?.id ?? reward.id,\n optionValuesIds,\n project,\n quantity,\n reward: rewardModel,\n variant: variantModel,\n }\n}\n\nexport function getDeliveryDate(product: Product): string | undefined {\n return product.reward.shippings?.date_delivery\n}\n\nexport function getImage(product: Product): string | undefined {\n if (product.reward.image === undefined) return\n\n const image = model.i18n.get(product.reward.image, model.project.language(product.project) as api.Lang)\n return image === undefined ? undefined : model.image.getUrl(image.versions, 'full')\n}\n\nexport function getTitle(product: Product): string | undefined {\n if (product.reward.title === undefined) return undefined\n\n return model.i18n.get(product.reward.title, model.project.language(product.project) as api.Lang, '')\n}\n\nexport function getTruncatedDescription(product: Product): string {\n if (product.variant) {\n return variantModel.getTruncatedDescription(product.variant)\n }\n\n return rewardModel.getTruncatedDescription(product.reward)\n}\n\nexport function getTruncatedTitle(product: Product): string | undefined {\n return rewardModel.getTruncatedTitle(product.reward)\n}\n\nexport function stock(product: Product): model.reward.RewardStock {\n return product.variant ? model.variant.stock(product.variant) : model.reward.stock(product.reward)\n}\n\nexport function hasAvailableStock(product: Product): boolean {\n const productStock = stock(product)\n return productStock.available !== undefined && productStock.available !== null && productStock.available > 0\n}\n\nexport function hasLimitedStock(product: Product): boolean {\n const productStock = stock(product)\n return productStock.total !== null && productStock.total !== undefined\n}\n\nexport function hasVariants(product: Product): boolean {\n return !product.variant && product.reward.variants !== undefined && product.reward.variants.length > 0\n}\n\nexport function isLegacy(product: Product): boolean {\n return model.reward.isLegacy(product.reward)\n}\n\nexport function isSelectable(product: Product): boolean {\n const productStock = stock(product)\n\n if (productStock.available === undefined) {\n return true\n }\n return Number(productStock.available) > 0 || !hasLimitedStock(product)\n}\n\nexport function quantityDoesNotExceedStock(product: Product): boolean {\n const productStock = stock(product)\n if (productStock.available === undefined) {\n return true\n }\n return Number(productStock.available) >= 0 || !hasLimitedStock(product)\n}\n\nexport function requiresPhone(product: Product): boolean {\n return product.reward.phone_number_required || false\n}\n", "import * as models from '@owl-nest/models'\nimport { text } from '@owl-nest/utils'\n\nexport type RewardStock = {\n available: number | null\n taken: number\n total: number | null\n}\n\nexport function getTruncatedDescription(reward: models.reward.Reward): string {\n const description = models.reward.description(reward)\n return text.truncate(text.stripTags(description), 150)\n}\n\nexport function getTruncatedTitle(reward: models.reward.Reward): string | undefined {\n const title = models.reward.title(reward)\n return text.truncate(text.stripTags(title), 150)\n}\n", "import { text } from '@owl-nest/utils'\nimport * as models from '@owl-nest/models'\n\nexport const getTruncatedDescription = (variant: models.variant.Variant): string => {\n const description = models.variant.description(variant)\n return text.truncate(text.stripTags(description), 150)\n}\n", "import * as React from 'react'\n\nimport { tn, tnc } from '@owl-nest/localize'\nimport { Link } from '@ulule/owl-kit-components/next'\n\nimport * as productModel from '../models/product'\n\nexport type ErrorPayload = {\n context: string\n focus: boolean\n extra?: {\n action?: {\n label: string\n }\n message: string\n }\n}\n\nexport function allSelectedProductsAreExpiredError(context: string, productCount: number): ErrorPayload {\n return {\n context,\n focus: true,\n extra: {\n message: tn(\n 'The reward you chose is out of stock and has been removed from your selection. Please choose another reward.',\n 'The rewards you chose are out of stock and have been removed from your selection. Please choose another reward.',\n productCount,\n ),\n },\n }\n}\n\nexport function someSelectedProductsAreExpiredError(\n context: string,\n products: productModel.Product[],\n action?: () => void,\n): ErrorPayload {\n return {\n context,\n focus: true,\n extra: {\n message: tnc(\n 'The reward [strong: %(productName)s] you chose is out of stock and has been removed from your selection.[br][br] Please [link: choose another reward] or continue.',\n 'Rewards [strong: %(productName)s] are out of stock and have been removed from your selection.[br][br] Please [link: choose other rewards] or continue.',\n products.length,\n {\n br:
,\n // eslint-disable-next-line jsx-a11y/anchor-has-content,jsx-a11y/anchor-is-valid\n link: action !== undefined ? : ,\n productName: products.map((product) => productModel.getTitle(product)).join(', '),\n strong: ,\n },\n ),\n },\n }\n}\n\nexport function unavailableQuantityError(context: string, products: productModel.Product[]): ErrorPayload {\n const firstProduct = products[0]\n return {\n context,\n focus: true,\n extra: {\n message: tnc(\n `The reward [strong: %(productName)s] is no longer available [strong: at a quantity of %(chosenQuantity)d]. There are only [strong: %(left)d] left: we've updated your selection to reflect this. Click Continue to proceed to payment.`,\n `The rewards you chose are no longer available at selected quantities. We've updated your selection to reflect this. Click Continue to proceed to payment.`,\n products.length,\n {\n chosenQuantity: firstProduct.quantity,\n left: productModel.stock(firstProduct).available,\n productName: productModel.getTitle(firstProduct),\n strong: ,\n },\n ),\n },\n }\n}\n", "import * as jotai from 'jotai'\nimport { atomWithReducer } from 'jotai/utils'\nimport * as React from 'react'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as cartService from '@owl-nest/services/src/cart'\nimport * as orderService from '@owl-nest/services/src/order'\nimport * as models from '@owl-nest/models'\nimport * as env from '@owl-nest/config'\n\nimport { useProject } from './useProject'\nimport * as productModel from '../models/product'\nimport * as projectModel from '../models/project'\nimport { type Location } from '@ulule/duvet'\n\ntype SelectedMondialRelay = {\n address: api.BaseAddress & { longitude: number; latitude: number }\n firstName: string\n lastName: string\n phoneNumber: string\n dropoff: Location\n}\n\nexport const INITIAL_STATE: cartService.CartState = {\n isLoading: false,\n shipping: {\n error: false,\n },\n tip: {},\n products: [],\n}\n\ntype ResetIsLoadingAction = { type: 'reset.isLoading' }\ntype ResetCart = { type: 'reset.cart' }\ntype SetTipAction = {\n type: 'set.tip'\n tip: number\n frequency?: models.project.DonationFrequency\n options?: SetTipOptions\n}\ntype UpdateProductsAction = {\n type: 'update.products'\n products: { id: number; parentId?: number; quantity: number | ((quantity: number) => number); valuesIds?: number[] }[]\n options: SetProductOptions\n}\ntype ResetProducts = { type: 'reset.products' }\ntype SetAddress = { type: 'set.address'; billing?: number; delivery?: number }\ntype ResetAddresses = { type: 'reset.addresses' }\ntype SetSelectedCountry = { type: 'set.selectedCountry'; countryCode: string; forced: boolean }\ntype SetPickupPoint = { type: 'set.pickupPoint'; id: number }\ntype SetMondialRelay = { type: 'set.mondialRelay'; mondialRelay: Partial }\ntype SetShippingMode = { type: 'set.shippingMode'; mode: api.ShippingMode | undefined }\ntype SetShippingError = { type: 'set.shippingError'; error: boolean }\ntype ResetShippingError = { type: 'reset.shippingError' }\ntype Override = { type: 'override'; state: cartService.CartState }\ntype UpdateDryRun = { type: 'update.dryRun'; dryRunResult: api.Order; project: api.Project }\ntype Action =\n | ResetIsLoadingAction\n | SetTipAction\n | UpdateProductsAction\n | ResetProducts\n | SetAddress\n | ResetAddresses\n | SetShippingError\n | ResetShippingError\n | SetSelectedCountry\n | SetPickupPoint\n | SetShippingMode\n | Override\n | UpdateDryRun\n | SetMondialRelay\n | ResetCart\n\nfunction reducer(state: cartService.CartState, action: Action): cartService.CartState {\n switch (action.type) {\n case 'reset.cart': {\n return INITIAL_STATE\n }\n case 'reset.isLoading': {\n return {\n ...state,\n isLoading: false,\n }\n }\n case 'set.tip': {\n return {\n ...state,\n tip: {\n frequency: action.frequency,\n amount: action.tip,\n },\n isLoading: action.options?.withDelay ?? false,\n }\n }\n case 'update.products': {\n const nextProducts: (\n | {\n id: number\n parentId?: number\n quantity: number\n valuesIds?: number[]\n }\n | undefined\n )[] = [...state.products]\n\n for (const product of action.products) {\n const currentProductIndex = state.products.findIndex((currentProduct) => currentProduct.id === product.id)\n\n if (currentProductIndex === -1) {\n const nextQuantity = typeof product.quantity === 'number' ? product.quantity : product.quantity(0)\n if (action.options.createIfNotFound && nextQuantity > 0) {\n nextProducts.push({\n id: product.id,\n parentId: product.parentId,\n quantity: nextQuantity,\n valuesIds: product.valuesIds,\n })\n }\n } else {\n const currentProduct = nextProducts[currentProductIndex]\n const nextQuantity =\n typeof product.quantity === 'number' ? product.quantity : product.quantity(currentProduct?.quantity ?? 0)\n\n if (nextQuantity > 0) {\n nextProducts[currentProductIndex] = {\n id: product.id,\n parentId: product.parentId ?? state.products[currentProductIndex].parentId,\n quantity: nextQuantity,\n valuesIds: product.valuesIds ?? state.products[currentProductIndex].valuesIds,\n }\n } else {\n nextProducts[currentProductIndex] = undefined\n }\n }\n }\n\n const products = nextProducts.filter((product): product is { id: number; quantity: number } => Boolean(product))\n\n const isSameProduct =\n products.find((product) => {\n return (\n state.products.find(\n (stateProduct) => stateProduct.id === product.id || stateProduct.parentId === product.id,\n ) !== undefined\n )\n }) !== undefined\n\n if (isSameProduct) {\n return {\n ...state,\n products: products,\n shipping: {\n ...state.shipping,\n country: products.length === 0 ? undefined : state.shipping.country,\n },\n isLoading: false,\n }\n }\n\n return {\n ...state,\n products: products,\n shipping: {\n ...state.shipping,\n country: products.length === 0 ? undefined : state.shipping.country,\n },\n isLoading: action.options?.withDelay ?? false,\n }\n }\n case 'reset.products': {\n return {\n ...state,\n products: [],\n }\n }\n case 'set.address': {\n const billingAddress = action.billing\n const shippingAddress = action.delivery\n\n return {\n ...state,\n shipping: {\n ...state.shipping,\n billingAddress: billingAddress,\n shippingAddress: shippingAddress,\n },\n }\n }\n case 'reset.addresses': {\n return {\n ...state,\n shipping: {\n ...state.shipping,\n billingAddress: undefined,\n shippingAddress: undefined,\n },\n }\n }\n case 'set.shippingError': {\n return {\n ...state,\n shipping: {\n ...state.shipping,\n error: action.error,\n },\n }\n }\n case 'reset.shippingError': {\n return {\n ...state,\n shipping: {\n ...state.shipping,\n error: false,\n },\n }\n }\n case 'set.selectedCountry': {\n return {\n ...state,\n shipping: {\n ...state.shipping,\n country: { code: action.countryCode, forced: action.forced },\n },\n }\n }\n case 'set.pickupPoint': {\n return {\n ...state,\n shipping: {\n ...state.shipping,\n pickupPoint: action.id,\n },\n }\n }\n case 'set.mondialRelay': {\n return {\n ...state,\n shipping: {\n ...state.shipping,\n mondialRelay: {\n ...state.shipping.mondialRelay,\n ...action.mondialRelay,\n },\n },\n }\n }\n case 'set.shippingMode': {\n return {\n ...state,\n shipping: {\n ...state.shipping,\n mode: action.mode,\n },\n }\n }\n case 'update.dryRun': {\n const nextState: cartService.CartState = {\n ...state,\n isLoading: false,\n dryRunResult: action.dryRunResult,\n project: action.project,\n }\n\n const cart = formatCart(nextState)\n\n if (cart.addressType === 'shipping') {\n // reset shipping data if the cart is emptied\n if (cart.products.length === 0) {\n return {\n ...nextState,\n shipping: {\n mode: 'home_delivery',\n error: false,\n },\n }\n }\n\n // for shipping carts, we preselect a country and/or a pickup point if\n // only one is available, or with a geolocalised one if applicable\n const supportedCountries = cart.availableCountries\n const hasOnlyOneStandardRate = supportedCountries.length === 1\n\n const userCountryCode = env.USER_COUNTRY\n\n const preselectedCountry = hasOnlyOneStandardRate\n ? supportedCountries[0]\n : cart.getRate(userCountryCode, 'home_delivery') !== undefined ||\n cart.getRate(userCountryCode, 'mondial_relay') !== undefined\n ? userCountryCode\n : undefined\n\n const stateWithPreselectedCountry =\n (cart.selectedCountry === undefined || !cart.availableCountries.includes(cart.selectedCountry.code)) &&\n preselectedCountry &&\n cart.selectedShippingMode !== 'pickup_point'\n ? reducer(nextState, {\n type: 'set.selectedCountry',\n countryCode: preselectedCountry,\n forced: cart.selectedCountry !== undefined,\n })\n : nextState\n\n const hasOnlyOnePickupPoint = cart.pickupPoints.length === 1\n\n const geolocalizedPickupPoint = cart.pickupPoints.find((pickupPoint) => {\n pickupPoint.address && pickupPoint.address.country === userCountryCode\n })\n\n const preselectedPickupPoint = hasOnlyOnePickupPoint ? cart.pickupPoints[0].id : geolocalizedPickupPoint?.id\n\n const stateWithPreselectedPickup =\n preselectedPickupPoint && cart.selectedShippingMode !== 'home_delivery'\n ? reducer(stateWithPreselectedCountry, { type: 'set.pickupPoint', id: preselectedPickupPoint })\n : stateWithPreselectedCountry\n\n return state.shipping.mode === undefined\n ? reducer(stateWithPreselectedPickup, { type: 'set.shippingMode', mode: 'home_delivery' })\n : cart.shippingModes.length === 1\n ? reducer(stateWithPreselectedPickup, { type: 'set.shippingMode', mode: cart.shippingModes[0] })\n : !cart.shippingModes.includes(state.shipping.mode)\n ? reducer(stateWithPreselectedPickup, { type: 'set.shippingMode', mode: cart.shippingModes[0] })\n : stateWithPreselectedPickup\n } else if (cart.addressType === 'soft-shipping') {\n return {\n ...nextState,\n shipping: {\n ...nextState.shipping,\n error: false,\n },\n }\n } else {\n // if cart address type is not shipping (contact or none), reset shippings and delivery address (contact will be in billing)\n return {\n ...nextState,\n shipping: {\n ...nextState.shipping,\n mode: 'home_delivery',\n error: false,\n shippingAddress: undefined,\n },\n }\n }\n }\n case 'override': {\n return action.state\n }\n default: {\n return state\n }\n }\n}\n\nexport const CART_STATE = atomWithReducer(INITIAL_STATE, reducer)\n\ntype SetProductOptions = { withDelay?: boolean } & UpdateCartProductOptions\ntype SetTipOptions = { withDelay?: boolean }\n\nexport type CartMethods = {\n setTip: (tip: number, options?: SetTipOptions) => void\n setProduct: (\n id: number,\n quantity: number | ((quantity: number) => number),\n options?: SetProductOptions,\n parentId?: number,\n valuesIds?: number[],\n ) => void\n resetAddresses: () => void\n resetShippingError: () => void\n resetProducts: () => void\n setAddress: (addresses: { billing?: number; delivery?: number }) => void\n setProducts: (\n products: {\n id: number\n quantity: number\n parentId?: number\n valuesIds?: number[]\n }[],\n options?: UpdateCartProductOptions,\n ) => void\n setShippingError: (error: boolean) => void\n setSelectedCountry: (country: string, options?: { forced?: boolean }) => void\n setPickupPoint: (id: number) => void\n setMondialRelay: (mondialRelay: Partial) => void\n setShippingMode: (mode: api.ShippingMode | undefined) => void\n setDonation: (tip: number, frequency?: models.project.DonationFrequency) => void\n}\n\nlet IS_UPDATING_LOCK = false\n\nexport function useCart(): Cart & CartMethods {\n const { project } = useProject()\n\n const [state, dispatch] = jotai.useAtom(CART_STATE)\n\n React.useEffect(() => {\n if (state.project !== undefined && state.project?.id !== project.id) {\n dispatch({ type: 'override', state: INITIAL_STATE })\n }\n if (!IS_UPDATING_LOCK) {\n IS_UPDATING_LOCK = true\n updateDryRunResult(state).then(() => (IS_UPDATING_LOCK = false))\n }\n }, [stateHash(state)])\n\n return {\n ...formatCart(state),\n setTip,\n setProduct,\n resetAddresses,\n resetShippingError,\n resetProducts,\n setAddress,\n setProducts,\n setShippingError,\n setSelectedCountry,\n setPickupPoint,\n setShippingMode,\n setDonation,\n setMondialRelay,\n }\n\n function resetShippingError() {\n dispatch({ type: 'reset.shippingError' })\n }\n\n function setShippingError(error = false) {\n dispatch({ type: 'set.shippingError', error })\n }\n\n function setAddress(addresses: { billing?: number; delivery?: number }) {\n dispatch({ type: 'set.address', ...addresses })\n }\n\n function resetAddresses() {\n dispatch({ type: 'reset.addresses' })\n }\n\n function resetProducts() {\n dispatch({ type: 'reset.products' })\n }\n\n function setShippingMode(mode: api.ShippingMode | undefined) {\n dispatch({ type: 'set.shippingMode', mode })\n }\n\n function setPickupPoint(id: number) {\n dispatch({ type: 'set.pickupPoint', id })\n }\n\n function setSelectedCountry(countryCode: string, { forced = false } = {}) {\n dispatch({ type: 'set.selectedCountry', countryCode, forced })\n }\n\n function setMondialRelay(mondialRelay: Partial) {\n dispatch({ type: 'set.mondialRelay', mondialRelay })\n }\n\n function setTip(tip: number, options: SetTipOptions = {}) {\n dispatch({ type: 'set.tip', tip, options })\n }\n\n function setDonation(tip: number, frequency?: models.project.DonationFrequency) {\n dispatch({ type: 'set.tip', tip, frequency })\n }\n\n function setProduct(\n id: number,\n quantity: number | ((quantity: number) => number),\n options: SetProductOptions = {},\n parentId?: number,\n valuesIds?: number[],\n ) {\n dispatch({ type: 'update.products', products: [{ id, parentId, quantity, valuesIds }], options })\n }\n\n function setProducts(\n products: {\n id: number\n quantity: number\n parentId?: number\n valuesIds?: number[]\n }[],\n options: UpdateCartProductOptions = {},\n ) {\n dispatch({ type: 'update.products', products, options })\n }\n\n async function updateDryRunResult(state: cartService.CartState): Promise {\n const payload = getPayload(state)\n\n const response = await orderService.create(\n project.id,\n { dry_run: true, ...payload },\n // token needed if any address is defined\n (payload.billing_address ??\n payload.billing_address_id ??\n payload.shipping_address ??\n payload.shipping_address_id) !== undefined,\n )\n\n response.caseOf({\n left: (failure) => {\n errorToAction(failure.body)\n },\n right: (order) => {\n dispatch({ type: 'update.dryRun', dryRunResult: order, project })\n },\n })\n }\n\n function errorToAction(body: unknown) {\n if (Array.isArray(body) && body.length > 0) {\n for (const error of body) {\n if ('classification' in error) {\n const actualBody = error\n switch (actualBody.classification) {\n case 'StockError':\n if ('fieldNames' in actualBody && actualBody.fieldNames.includes('rewards')) {\n const regExp = /reward\\s(\\d*)\\s\\(stock is (\\d*)/\n const [_, productId, remainingStock] = regExp.exec(actualBody.message) ?? []\n dispatch({\n options: { createIfNotFound: false, withDelay: true },\n products: [{ id: Number(productId), quantity: Number(remainingStock) }],\n type: 'update.products',\n })\n }\n break\n default:\n dispatch({ type: 'reset.cart' })\n }\n }\n }\n }\n }\n}\n\nfunction stateHash(state: cartService.CartState) {\n return JSON.stringify([\n state.project?.id,\n state.products.map((product) => [product.id, product.quantity]),\n state.tip.amount,\n state.tip.frequency,\n state.shipping.mode,\n state.shipping.country,\n state.shipping.billingAddress,\n state.shipping.mondialRelay,\n state.shipping.pickupPoint,\n state.shipping.shippingAddress,\n ])\n}\n\nfunction getPayload(state: cartService.CartState) {\n return {\n tip: state.tip.amount,\n pickup_point_id: state.shipping.mode === 'pickup_point' ? state.shipping.pickupPoint : undefined,\n rewards: state.products.map((product) => ({ reward_id: product.id, quantity: product.quantity })),\n billing_address_id: state.shipping.billingAddress,\n delivery_type: state.shipping.mode === 'pickup_point' ? undefined : state.shipping.mode,\n shipping_address_id:\n state.shipping.mode === 'home_delivery' || state.dryRunResult?.initial_shipping_address_required\n ? state.shipping.shippingAddress\n : undefined,\n shipping_address:\n state.shipping.mode === 'mondial_relay' && state.shipping.mondialRelay !== undefined\n ? {\n dropoff_id: state.shipping.mondialRelay.dropoff?.id,\n dropoff_name: state.shipping.mondialRelay.dropoff?.name,\n address1: state.shipping.mondialRelay.dropoff?.address,\n city: state.shipping.mondialRelay.dropoff?.city,\n country: state.shipping.country?.code,\n postal_code: state.shipping.mondialRelay.dropoff?.postal_code,\n phone_number: state.shipping.mondialRelay.phoneNumber,\n first_name: state.shipping.mondialRelay.firstName,\n last_name: state.shipping.mondialRelay.lastName,\n latitude: state.shipping.mondialRelay.dropoff?.coordinates.lat,\n longitude: state.shipping.mondialRelay.dropoff?.coordinates.lon,\n }\n : undefined,\n country: state.shipping.country?.code,\n // fake data that is required by the endpoint, but useless for\n // a dry_run\n payment_method: 'credit',\n return_url: location.href,\n } as api.CreateOrder\n}\n\ntype UpdateCartProductOptions = { createIfNotFound?: boolean }\n\ntype BaseCart = {\n isLoading: boolean\n tip: { amount: number; frequency?: models.project.DonationFrequency }\n products: productModel.Product[]\n isEmpty: boolean\n total: number\n subTotal: number\n shippingSubTotal: number\n taxDeductibleTotal: number\n taxDeductible: boolean\n getPayload: () => api.CreateOrder\n}\n\nexport type InitialCart = BaseCart & { addressType?: undefined }\n\nexport type NoneCart = BaseCart & { addressType: 'none' }\n\nexport type ContactCart = BaseCart & {\n addressType: 'contact'\n isTax: boolean\n contactAddress?: number\n needPhone: boolean\n}\n\nexport type SoftShippingCart = BaseCart & {\n addressType: 'soft-shipping'\n isTax: boolean\n shippingAddress?: number\n billingAddress?: number\n billingAddressRequired: boolean\n needAddress: boolean\n needPhone: boolean\n}\n\nexport type ShippingCart = BaseCart & {\n addressType: 'shipping'\n shippingModes: api.ShippingMode[]\n isTax: boolean\n availableCountries: string[]\n pickupPoints: api.PickupPoint[]\n rates: { homeDelivery: Record; mondialRelay: Record }\n selectedCountry?: { code: string; forced: boolean }\n selectedMondialRelay?: Partial\n getRate: (countryCode: string, mode?: api.ShippingMode) => number | undefined\n getPickupPoint: (id: number) => api.PickupPoint | undefined\n selectedPickupPoint?: api.PickupPoint\n selectedShippingMode?: api.ShippingMode\n shippingError: boolean\n shippingAddress?: number\n billingAddress?: number\n billingAddressRequired: boolean\n needAddress: boolean\n needPhone: boolean\n deliveryDates: string[]\n}\n\nexport type Cart = InitialCart | NoneCart | ContactCart | ShippingCart | SoftShippingCart\n\nexport function formatCart(state: cartService.CartState): Cart {\n const tipAmount = state.tip.amount ?? 0\n\n if (state.dryRunResult === undefined || state.project === undefined) {\n return {\n isLoading: state.isLoading,\n tip: { amount: tipAmount },\n subTotal: 0,\n shippingSubTotal: 0,\n products: [],\n isEmpty: tipAmount === 0 && state.products.length === 0,\n total: 0,\n taxDeductibleTotal: 0,\n taxDeductible: false,\n getPayload: () => getPayload(state),\n }\n }\n\n const baseCart: BaseCart = {\n isLoading: state.isLoading,\n tip: { amount: tipAmount, frequency: state.tip.frequency },\n subTotal: state.dryRunResult.order_subtotal,\n products: formatCartProducts(state),\n total: state.dryRunResult.order_total,\n shippingSubTotal: state.dryRunResult.order_shipping_total,\n taxDeductibleTotal: state.dryRunResult.tax_deductible_total ?? 0,\n taxDeductible: state.dryRunResult.tax_deductible,\n isEmpty: tipAmount === 0 && state.products.length === 0,\n getPayload: () => getPayload(state),\n }\n\n const needAddress =\n state.dryRunResult.initial_billing_address_required || state.dryRunResult.initial_shipping_address_required\n\n //TODO: use shipping_address_type === home_delivery instead of this condition\n if (state.dryRunResult.initial_shipping_address_required && state.dryRunResult?.shippings_available) {\n const homeDeliveryRates = state.dryRunResult.shippings_available.standard ?? {}\n const mondialRelayRates = state.dryRunResult.shippings_available.mondial_relay ?? {}\n const pickupPoints = state.dryRunResult.shippings_available.pickup_points ?? []\n const selectedPickupPoint = pickupPoints.find((pickupPoint) => pickupPoint.id === state.shipping.pickupPoint)\n\n const shippingModes: ShippingCart['shippingModes'] = []\n\n const canHandlePickup =\n state.dryRunResult.shipping_modes !== null\n ? state.dryRunResult.shipping_modes.includes('pickup_point') &&\n (state.dryRunResult.shippings_available?.pickup_points?.length ?? 0) !== 0\n : state.dryRunResult.initial_pickup_point_required\n\n const canHandleHomeDelivery =\n state.dryRunResult.shipping_modes !== null\n ? state.dryRunResult.shipping_modes.includes('home_delivery') &&\n Object.keys(state.dryRunResult.shippings_available?.standard ?? {}).length !== 0\n : state.dryRunResult.initial_shipping_address_required\n\n const canHandleMondialRelay =\n state.dryRunResult.shipping_modes !== null\n ? state.dryRunResult.shipping_modes.includes('mondial_relay') &&\n Object.keys(state.dryRunResult.shippings_available?.mondial_relay ?? {}).length !== 0\n : false\n\n if (canHandlePickup) {\n shippingModes.push('pickup_point')\n }\n if (canHandleHomeDelivery) {\n shippingModes.push('home_delivery')\n }\n if (canHandleMondialRelay) {\n shippingModes.push('mondial_relay')\n }\n\n //TODO: use shipping_address_type === membership instead of this condition\n if (state.project.type === api.ProjectType.Membership) {\n return {\n ...baseCart,\n addressType: 'soft-shipping',\n isTax: state.dryRunResult.billing_address_type === 'tax',\n shippingAddress: state.shipping.shippingAddress,\n billingAddressRequired: state.dryRunResult.billing_address_required ?? false,\n needAddress,\n needPhone:\n state.dryRunResult.phone_number_required ||\n (state.shipping.mode !== 'mondial_relay' &&\n baseCart.products.some((product) => productModel.requiresPhone(product))),\n }\n }\n\n return {\n ...baseCart,\n addressType: 'shipping',\n shippingModes: shippingModes,\n isTax: state.dryRunResult.billing_address_type === 'tax',\n pickupPoints,\n rates: { homeDelivery: homeDeliveryRates, mondialRelay: mondialRelayRates },\n availableCountries: state.dryRunResult.countries_available,\n selectedMondialRelay: state.shipping.mondialRelay,\n getRate: (countryCode, mode = state.shipping.mode) =>\n (mode === 'home_delivery' ? homeDeliveryRates : mode === 'mondial_relay' ? mondialRelayRates : {})[countryCode],\n getPickupPoint: (id: number) => pickupPoints.find((pickupPoint) => pickupPoint.id === id),\n selectedCountry: state.shipping.country,\n selectedPickupPoint,\n selectedShippingMode: state.shipping.mode,\n shippingError: state.shipping.error,\n billingAddress: state.shipping.billingAddress,\n shippingAddress: state.shipping.shippingAddress,\n billingAddressRequired: state.dryRunResult.billing_address_required ?? false,\n needAddress,\n needPhone:\n state.shipping.mode !== 'mondial_relay' &&\n baseCart.products.some((product) => productModel.requiresPhone(product)),\n deliveryDates: baseCart.products.reduce((dates: string[], product) => {\n const deliveryDate = productModel.getDeliveryDate(product)\n if (deliveryDate && !dates.includes(deliveryDate)) {\n dates.push(deliveryDate)\n }\n return dates\n }, []),\n }\n }\n //TODO: use initial_billing_address_required instead in this condition\n else if (needAddress) {\n return {\n ...baseCart,\n addressType: 'contact',\n isTax: state.dryRunResult.billing_address_type === 'tax',\n contactAddress: state.shipping.billingAddress,\n needPhone: state.project.phone_number_required ?? false,\n }\n } else {\n return {\n ...baseCart,\n addressType: 'none',\n }\n }\n}\n\nexport function formatCartProducts(state: cartService.CartState): productModel.Product[] {\n const products = state.products ?? []\n const dryRunResult = state.dryRunResult\n const project = state.project\n\n if (dryRunResult === undefined || project === undefined) {\n return []\n }\n\n return products.flatMap(({ id, quantity }) => {\n let productReward = undefined\n let productVariant = undefined\n const items = dryRunResult.items ?? []\n for (const item of items) {\n if (item.reward.id === id) {\n if (item.reward.parent === undefined) {\n productReward = item.reward\n } else {\n productVariant = item.reward\n productReward = item.reward.parent\n }\n }\n }\n\n // Between adding a product and the response of the resulting dryrun, no\n // reward will be found in the dryRunResult (because it is the result of a\n // request before the product was added). We ignore this product (because\n // there is no way for us to match it right now), but this is transitory and\n // the product will be matched when the dryRun is done (since it will\n // trigger a rerender and another call to `formatCartProducts`).\n //\n // In summary, when adding a product to the cart, it is added immediatly to\n // the state, but visually it will be added to the cart only when the\n // resulting dryRun is done.\n if (productReward === undefined) {\n return []\n }\n\n return [\n productModel.Product({\n project,\n reward: productReward,\n variant: productVariant,\n quantity,\n }),\n ]\n })\n}\n", "import * as jotai from 'jotai'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as projectService from '@owl-nest/services/src/project'\n\nimport * as UFE from '../utils/UFE'\n\nconst CHECKOUT_EXTRA_FIELDS = [\n 'account',\n 'delivery',\n 'partnerships',\n 'rewards',\n 'analytics',\n 'sponsorships',\n 'shippings',\n 'socials',\n] as const\n\nexport type CheckoutExtraFields = (typeof CHECKOUT_EXTRA_FIELDS)[number]\n\nexport async function initializeProject(\n store: ReturnType,\n): Promise> {\n const id = UFE.PROJECT_ID\n\n const projectResponse = await projectService.load(id, {\n extraFields: CHECKOUT_EXTRA_FIELDS,\n })\n const project = projectResponse.doThrow()\n\n projectService.setInitialProject(store, id, project)\n\n return project\n}\n\nexport async function getProject(\n store: ReturnType,\n): Promise> {\n const id = UFE.PROJECT_ID\n\n const cache = store.get(projectService.SHARED_PROJECT_CACHE)\n\n return cache[id]?.data as api.Project\n}\n\nexport function useProject(): projectService.UseProject & {\n project: api.Project\n} {\n const useProject = projectService.useProject(UFE.PROJECT_ID, {\n extraFields: CHECKOUT_EXTRA_FIELDS,\n })\n\n // since project is initialized when first rendering the app, the project is guaranteed to exist\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const project = useProject.response.data!\n\n return { ...useProject, project }\n}\n", "import { lens } from '@owl-nest/config'\n\ntype Window = {\n UFE: {\n data: {\n project: {\n id: number\n }\n }\n gtmKey: string\n support_email: string\n tracking: string\n flags: {\n paypal_enabled: boolean\n }\n\n }\n CHECKOUT_ASSETS: {\n payment_partners_logos: {\n mangopay?: string\n mastercard?: string\n ssl?: string\n visa?: string\n }\n concours: string\n concours_mobile: string\n endfunnel: {\n confetti: string\n }\n contest: string\n contest_mobile: string\n }\n}\n\nconst windowLens = lens()\n\nexport const CHECKOUT_ASSETS = windowLens.get('CHECKOUT_ASSETS').value(window, { trust: true })\n\nexport const FLAGS = windowLens.get('UFE').get('flags').value(window)\n\nexport const GTM_KEY = windowLens.get('UFE').get('gtmKey').value(window)\n\nexport const PROJECT_ID = windowLens.get('UFE').get('data').get('project').get('id').value(window)\n\nexport const SUPPORT_EMAIL = windowLens.get('UFE').get('support_email').value(window, { forgive: true, silent: true })\n\nexport const TRACKING = windowLens.get('UFE').get('tracking').value(window)\n", "import * as jotai from 'jotai'\n\nimport { t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as api from '@owl-nest/api-client/next'\nimport * as cartService from '@owl-nest/services/src/cart'\nimport * as services from '@owl-nest/services'\n\nimport { loadCartFromLocalStorage } from './localStorage'\nimport {\n cleanSearchParams,\n extractDonationFromSearchParams,\n extractVariantFromSearchParams,\n getProductFromSearchParams,\n updateCartBasedOnProduct,\n} from './searchParams'\nimport { getProductsFromSavedIds } from './product'\nimport { CheckoutExtraFields } from '../hooks/useProject'\nimport { revealRewards } from '../hooks/useRevealedRewards'\nimport { INITIAL_STATE } from '../hooks/useCart'\n\ntype HydrationResult = {\n messages: services.message.Message[]\n cart: services.cart.CartState\n initialConfiguration: InitialConfiguration\n}\n\ntype InitialConfiguration = {\n donationBasedProject: boolean\n membershipProject: boolean\n preFilledTip?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n }\n}\n\nfunction isSelectionRoute(): boolean {\n const urlWithoutQueryParams = `${document.location.origin}${document.location.pathname}`\n return /checkout\\/$/.test(urlWithoutQueryParams)\n}\n\nexport async function hydrate(\n project: api.Project,\n store: ReturnType,\n): Promise {\n const isDonationBasedProject = models.project.isDonationBased(project)\n const isMembershipProject = models.project.isMembership(project)\n\n document.title = `${\n project.type === api.ProjectType.Membership ? t('Subscribe') : t('Contribute')\n } - ${models.project.name(project)} - Ulule`\n\n // First, let's see if we can extract a variant from search params. Variants need to be preloaded from\n // the API, so we start by checking the need for said preload and apply it.\n const { quantity, rewardId, variant: variantFromSearch } = await extractVariantFromSearchParams()\n\n // Now, let's try and get a potentially existing cart from local storage. Same reason as above,\n // if there are variants within, we will need to preload them before proceeding.\n const savedCartState = cartService.getCartFromLocalStorage(project.id)\n let projectWithVariants: api.Project = project\n\n // If there was indeed a preloaded variant for search params, we inject it within the project to allow\n // seamlessly resolving products further down the execution flow.\n variantFromSearch && injectSearchParamsVariant()\n\n // Just as we did for the search param variant, we preload and inject possible local storage variants\n // to allow resolving products later.\n await preloadAndInjectLocalStorageVariants()\n\n const { cartState, error } = loadCartFromLocalStorage(projectWithVariants)\n\n const prefilledDonation = isSelectionRoute()\n ? extractDonationFromSearchParams({\n monthliesAllowed: project.donations_monthly_allowed ?? false,\n singleAllowed: project.donations_single_allowed ?? false,\n }) || {}\n : undefined\n\n const membershipCart =\n prefilledDonation && prefilledDonation.amount\n ? {\n ...INITIAL_STATE,\n tip: {\n amount: prefilledDonation.amount,\n },\n }\n : INITIAL_STATE\n\n let initialCartState = models.project.isMembership(project) ? membershipCart : cartState\n\n if (isSelectionRoute()) {\n const productFromSearchParams = variantFromSearch\n ? getProductsFromSavedIds([{ reward_id: variantFromSearch.id, quantity: quantity }], projectWithVariants)[0][0]\n : getProductFromSearchParams(projectWithVariants)\n\n const productIsAlreadyInCart =\n initialCartState.products.findIndex((cartProduct) => cartProduct.id === productFromSearchParams?.id) !== -1\n\n if (productIsAlreadyInCart) {\n cleanSearchParams()\n } else {\n initialCartState = updateCartBasedOnProduct(\n productFromSearchParams,\n initialCartState,\n projectWithVariants,\n prefilledDonation,\n )\n\n cleanSearchParams()\n }\n\n if (!isDonationBasedProject && !isMembershipProject && initialCartState.shipping.mode === undefined) {\n initialCartState.shipping.mode = 'home_delivery'\n }\n\n revealRewards(store, initialCartState, productFromSearchParams, project)\n }\n\n return {\n messages: error ? [error] : [],\n cart: initialCartState,\n initialConfiguration: {\n donationBasedProject: isDonationBasedProject,\n membershipProject: isMembershipProject,\n preFilledTip: prefilledDonation,\n },\n }\n\n async function preloadAndInjectLocalStorageVariants() {\n for await (const product of savedCartState?.products || []) {\n if (Boolean(product.parentId) && Boolean(product.valuesIds?.length)) {\n const response = await services.project.rewardVariants(\n product.parentId!,\n product.valuesIds!.map((valueId) => valueId.toString()),\n )\n const resolvedVariant = response.next((success) => success.variants[0]).unwrap()\n\n if ('rewards' in project) {\n const rewards = project.rewards as api.Reward[]\n const rewardIndex = rewards.findIndex((reward) => reward.id === product.parentId)\n if (rewardIndex > -1) {\n const mutatedRewards = [...rewards]\n if (\n mutatedRewards[rewardIndex].variants &&\n mutatedRewards[rewardIndex].variants.findIndex((variant) => variant.id === resolvedVariant.id) === -1\n ) {\n mutatedRewards[rewardIndex].variants!.push(resolvedVariant)\n } else {\n mutatedRewards[rewardIndex].variants = [resolvedVariant]\n }\n projectWithVariants = { ...project, rewards: mutatedRewards }\n }\n }\n }\n }\n }\n\n function injectSearchParamsVariant() {\n if (rewardId && variantFromSearch) {\n if ('rewards' in project) {\n const rewards = project.rewards as api.Reward[]\n const rewardIndex = rewards.findIndex((reward) => reward.id === rewardId)\n if (rewardIndex > -1) {\n const mutatedRewards = [...rewards]\n if (mutatedRewards[rewardIndex].variants) {\n mutatedRewards[rewardIndex].variants!.push(variantFromSearch)\n } else {\n mutatedRewards[rewardIndex].variants = [variantFromSearch]\n }\n projectWithVariants = { ...project, rewards: mutatedRewards }\n }\n }\n }\n }\n}\n", "import type * as api from '@owl-nest/api-client/latest'\nimport * as models from '@owl-nest/models'\n\nimport * as cartService from '@owl-nest/services/src/cart'\nimport * as projectService from '@owl-nest/services/src/project'\n\nimport * as productModel from '../models/product'\nimport * as productUtils from './product'\nimport { formatCartProducts } from '../hooks/useCart'\n\ntype ProductFromSearchParams = {\n quantity: number\n reward_id: number\n}\n\nexport function cleanSearchParams(): void {\n const location = document.location\n const params = new URLSearchParams(document.location.search)\n params.delete('frequency')\n params.delete('quantity')\n params.delete('reward')\n params.delete('tip')\n params.delete('valuesIds')\n const remainingParameters = params.toString() ? `?${params.toString()}` : ''\n window.history.replaceState('', '', `${location.origin}${location.pathname}${remainingParameters}`)\n}\n\nexport function extractDonationFromSearchParams(configuration: {\n monthliesAllowed: boolean\n singleAllowed: boolean\n}): { amount?: number; frequency?: models.project.DonationFrequency } | undefined {\n const params = new URLSearchParams(document.location.search)\n\n const amount = params.get('tip') || ''\n const frequency = params.get('frequency') || ''\n\n if (!amount && !frequency) {\n return undefined\n }\n\n return {\n ...(amount && { amount: parseFloat(amount) }),\n ...(frequency && isValidFrequency(frequency) && { frequency }),\n }\n\n function isValidFrequency(value: string): value is models.project.DonationFrequency {\n if (!['monthly', 'one-time'].includes(value as models.project.DonationFrequency)) {\n return false\n }\n\n return (\n (value === 'one-time' && configuration.singleAllowed) || (value === 'monthly' && configuration.monthliesAllowed)\n )\n }\n}\n\nexport function updateCartBasedOnProduct(\n product: productModel.Product | undefined,\n cart: cartService.CartState,\n project: api.Project,\n preFilledDonation?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n },\n): cartService.CartState {\n const donationAmount = preFilledDonation?.amount ?? cart.tip.amount\n\n if (!product) {\n return {\n ...cart,\n tip: {\n amount: donationAmount,\n frequency: preFilledDonation?.frequency,\n },\n }\n }\n\n const productsInCart = formatCartProducts(cart)\n\n const hasSelectedProducts = productsInCart.length > 0\n const payloadProducts = [...(cart.products ?? [])]\n\n if (hasSelectedProducts) {\n // Try to find the product extracted from search params among existing selection (loaded from local storage).\n // If found, overwrite quantity with value from search params.\n const productIndex = productUtils.findProductIndexById(productsInCart, product.id)\n const productInCart = productsInCart[productIndex]\n\n if (productIndex >= 0) {\n // TODO: FIXME: Falling back to 0 for quantity incrementation is clumsy\n if (product.quantity === 0 && productModel.isSelectable(productInCart)) {\n payloadProducts[productIndex] = { ...payloadProducts[productIndex], quantity: productInCart.quantity + 1 }\n } else if (product.quantity > 0) {\n payloadProducts[productIndex] = { ...payloadProducts[productIndex], quantity: product.quantity }\n }\n return {\n ...cart,\n products: payloadProducts,\n tip: {\n amount: donationAmount,\n frequency: preFilledDonation?.frequency,\n },\n }\n }\n }\n\n // If there was no existing selection, simply add the product extracted from search params.\n // TODO: FIXME: Falling back to 0 for quantity incrementation is clumsy\n if (!productModel.hasVariants(product)) {\n payloadProducts.push({\n id: product.id,\n quantity: product.quantity > 0 ? product.quantity : 1,\n })\n }\n return {\n ...cart,\n products: payloadProducts,\n tip: {\n amount: donationAmount,\n frequency: preFilledDonation?.frequency,\n },\n }\n}\n\nexport async function extractVariantFromSearchParams(): Promise<{\n quantity: number\n rewardId: number\n variant?: api.Variant\n}> {\n const params = new URLSearchParams(document.location.search)\n const quantity = parseInt(params.get('quantity') || '1', 10)\n const rewardId = parseInt(params.get('reward') || '', 10)\n const valuesIds = params.get('valuesIds')\n\n if (rewardId && valuesIds) {\n const optionValuesIds = valuesIds.split(',')\n const response = await projectService.rewardVariants(rewardId, optionValuesIds)\n return {\n quantity,\n rewardId,\n variant: response.next((success) => success.variants[0]).unwrap(),\n }\n }\n\n return { quantity, rewardId }\n}\n\nfunction extractProductFromSearchParams(): ProductFromSearchParams | undefined {\n const params = new URLSearchParams(document.location.search)\n const quantity = parseInt(params.get('quantity') || '1', 10)\n const rewardId = parseInt(params.get('reward') || '', 10)\n\n if (Number.isNaN(rewardId)) return\n\n return {\n quantity,\n reward_id: rewardId,\n }\n}\n\nexport function getProductFromSearchParams(project: api.Project): productModel.Product | undefined {\n const productFromParams = extractProductFromSearchParams()\n if (!productFromParams) return\n\n const [[product]] = productUtils.getProductsFromSavedIds([productFromParams], project)\n return product\n}\n", "import * as jotai from 'jotai'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as services from '@owl-nest/services'\n\nimport * as productModel from '../models/product'\nimport * as productUtils from '../utils/product'\n\nconst REVEALED_REWARDS_ATOM = jotai.atom([])\n\nexport function revealRewards(\n store: ReturnType,\n cart: services.cart.CartState,\n productFromSearchParams: productModel.Product | undefined,\n project: api.Project<'delivery' | 'rewards' | 'partnerships'>,\n): void {\n let revealedRewards: number[] = []\n\n if (cart.products) {\n // get IDs of hidden rewards which need to be revealed\n revealedRewards = cart.products.reduce((revealedRewardsIds: number[], cartProduct) => {\n if (productFromSearchParams?.id === cartProduct.id) {\n return [...revealedRewardsIds, cartProduct.id]\n }\n\n const [[product]] = productUtils.getProductsFromSavedIds(\n [{ reward_id: cartProduct.id, quantity: cartProduct.quantity }],\n project,\n )\n\n if (product?.reward.is_hidden) {\n return [...revealedRewardsIds, cartProduct.id]\n }\n return revealedRewardsIds\n }, [])\n\n // Also reveal rewards with variants so that they can be selected from the list of rewards.\n if (productFromSearchParams && productModel.hasVariants(productFromSearchParams)) {\n const productFromSearchParamsId = productFromSearchParams?.id\n revealedRewards = [...revealedRewards, productFromSearchParamsId]\n }\n }\n\n store.set(REVEALED_REWARDS_ATOM, revealedRewards)\n}\n\nexport function useRevealedRewards() {\n return jotai.useAtomValue(REVEALED_REWARDS_ATOM)\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\n\ntype PaymentDisturbanceModalProps = {\n className?: string\n projectUrl: string\n}\n\nfunction PaymentDisturbanceModalComponent({ className, projectUrl }: PaymentDisturbanceModalProps): React.ReactElement {\n return (\n }\n svgScale={0.88}\n buttons={{\n type: 'link',\n props: {\n kind: 'secondary',\n href: projectUrl,\n children: t('Back to project'),\n },\n }}\n >\n {t('Payment temporarily unavailable')}\n \n {t(\n 'Due to a technical maintenance of our payment provider, we are obliged to suspend all payments tonight on our platform.',\n )}\n \n \n {t('You will be able to contribute to this project again from 7am (Paris time).')}\n \n \n {t('We invite you to subscribe to the project to receive posts and back it later.')}\n \n \n )\n}\n\nexport const PaymentDisturbanceModal = styled(PaymentDisturbanceModalComponent)`\n ${plume.styles.modal.Body} {\n display: flex;\n flex-direction: column;\n }\n\n ${plume.styles.heading.S} {\n text-align: left;\n margin: 15px 0;\n }\n\n ${plume.styles.copy.M} {\n text-align: left;\n margin-bottom: 25px;\n }\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n ${plume.styles.modal.Wrapper} {\n max-width: 390px;\n }\n }\n`\n", "import React from 'react'\nimport styled from 'styled-components'\n\nimport { BREAKPOINTS, COLORS, glyphs, styles as S } from '@ulule/owl-kit-components/next'\n\nimport { t } from '@owl-nest/localize'\n\nconst HeaderWrapper = styled.div`\n padding-top: 57px;\n`\n\nconst HeaderNav = styled.div`\n align-items: center;\n background-color: ${COLORS.PRIMARY_WHITE};\n display: flex;\n height: 57px;\n justify-content: center;\n width: 100%;\n position: fixed;\n left: 0px;\n top: 0px;\n z-index: 5;\n`\n\nconst Logo = styled.div``\n\nconst HeaderInfoRight = styled.div`\n position: absolute;\n right: 0px;\n margin-right: 10px;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ${COLORS.GREY_SHADE_3};\n\n @media screen and ${BREAKPOINTS.TABLET} {\n margin-right: 20px;\n }\n`\n\nconst HeaderInfoRightText = styled(S.heading.XXXXXS)`\n display: none;\n color: inherit;\n margin-right: 8px;\n\n @media screen and ${BREAKPOINTS.TABLET} {\n display: block;\n }\n`\n\nexport const Header = () => {\n return (\n \n \n \n \n Ulule\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {t('Secure payment')}\n \n \n \n \n )\n}\n", "import * as React from 'react'\nimport { Navigate, Route, Routes } from 'react-router-dom'\n\nimport { t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as service from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport { Spinner } from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nimport { AddressView } from './views/address'\nimport { Item } from './components/Item'\nimport { Layout } from './components/Layout'\n\nimport { DonationView } from './views/donation'\nimport { LoginView } from './views/login'\nimport { PaymentView } from './views/payment'\nimport { PickupView } from './views/pickup'\nimport { RenewView } from './views/renew'\nimport { SelectionView } from './views/selection'\nimport { MondialRelayView } from './views/mondialRelay'\nimport { NavigationContext, useNavigation } from './hooks/useNavigation'\nimport { RewardTaxDeductionModal } from './components/Modals/RewardTaxDeductionModal'\nimport { useCart } from './hooks/useCart'\nimport { useProject } from './hooks/useProject'\nimport { Connect } from '@owl-nest/connect'\nimport { EndfunnelRouter } from './views/endfunnel/EndfunnelRouter'\nimport { getFilterFromUrlParams } from './utils/filter'\n\ntype RouterProps = {\n configuration: {\n donationBasedProject: boolean\n membershipProject: boolean\n preFilledTip?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n }\n }\n}\n\nexport function Router({ configuration }: RouterProps): React.ReactElement {\n const { project } = useProject()\n\n return (\n \n }>\n \n \n \n {project?.tax_deductible && }\n \n }\n />\n } />\n } />\n } />\n } />\n } />\n } />\n\n } />\n\n } />\n \n \n \n )\n}\n\nfunction Selection({\n donationBasedProject = false,\n membershipProject = false,\n preFilledTip,\n}: {\n donationBasedProject: boolean\n membershipProject: boolean\n preFilledTip?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n }\n}): React.ReactElement<{ preFilledTip?: number }> {\n const tracking = shadow.useTracking()\n const cart = useCart()\n const { project } = useProject()\n\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.CHECKOUT,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction:\n donationBasedProject || membershipProject ? 'ReachingPickDonationAmount' : 'ReachingPickAmountAndReward',\n })\n\n const { clearMessages } = service.message.useMessage()\n const a = useNavigation({ redirectToLegalPage: true })\n\n React.useEffect(() => {\n if (!a.isCurrentLegal) {\n tracking.ecommerce.track('begin_checkout', {\n currency: project.currency,\n value: cart.subTotal,\n items: [\n ...cart.products.map((product) => ({\n item_id: String(product.reward.id),\n item_name: models.reward.title(product.reward) ?? '',\n item_brand: models.project.name(project),\n item_variant: product.variant && String(product.variant.id),\n price: product.reward.price,\n quantity: product.quantity,\n })),\n ...(cart.tip.amount !== 0\n ? [\n {\n item_id: 'tip',\n item_name: 'tip',\n item_brand: models.project.name(project),\n price: cart.tip.amount,\n quantity: 1,\n },\n ]\n : []),\n ],\n })\n }\n }, [a.isCurrentLegal])\n\n const filter = getFilterFromUrlParams()\n\n React.useEffect(() => {\n clearMessages('payment')\n return () => clearMessages('selection')\n }, [])\n\n return (\n \n {donationBasedProject || (membershipProject && filter.type === 'donation') ? (\n \n ) : (\n \n )}\n \n )\n}\n\nfunction Login(): React.ReactElement {\n const navigation = useNavigation({ redirectToLegalPage: true })\n const tracking = shadow.useTracking()\n\n React.useEffect(() => {\n if (navigation.isCurrentLegal) {\n return\n }\n\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.CHECKOUT,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction: 'ReachingLogin',\n })\n }, [navigation.isCurrentLegal])\n\n return (\n \n \n \n )\n}\n\nfunction Pickup(): React.ReactElement {\n const navigation = useNavigation({ redirectToLegalPage: true })\n const tracking = shadow.useTracking()\n const auth = service.user.useAuth()\n\n React.useEffect(() => {\n if (!navigation.isCurrentLegal) {\n return\n }\n\n if (auth.type === 'loggedin') {\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.CHECKOUT,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction: 'ReachingSetAddress',\n })\n }\n }, [auth.type, navigation.isCurrentLegal])\n\n return (\n \n \n \n )\n}\n\nfunction MondialRelay(): React.ReactElement {\n const navigation = useNavigation({ redirectToLegalPage: true })\n const tracking = shadow.useTracking()\n const auth = service.user.useAuth()\n\n React.useEffect(() => {\n if (!navigation.isCurrentLegal) {\n return\n }\n\n if (auth.type === 'loggedin') {\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.CHECKOUT,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction: 'ReachingSetAddress',\n })\n }\n }, [auth.type, navigation.isCurrentLegal])\n\n return (\n \n \n \n )\n}\n\nfunction Address(): React.ReactElement {\n const navigation = useNavigation({ redirectToLegalPage: true })\n const tracking = shadow.useTracking()\n const auth = service.user.useAuth()\n\n React.useEffect(() => {\n if (!navigation.isCurrentLegal) {\n return\n }\n\n if (auth.type === 'loggedin') {\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.CHECKOUT,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction: 'ReachingSetAddress',\n })\n }\n }, [auth.type, navigation.isCurrentLegal])\n\n return (\n \n \n \n )\n}\n\nfunction Payment(): React.ReactElement {\n const tracking = shadow.useTracking()\n const auth = service.user.useAuth()\n const { clearMessages } = service.message.useMessage()\n const navigation = useNavigation({ redirectToLegalPage: true })\n\n React.useEffect(() => {\n return () => clearMessages('payment')\n }, [])\n\n React.useEffect(() => {\n if (!navigation.isCurrentLegal) {\n return\n }\n\n if (auth.type === 'loggedin') {\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.CHECKOUT,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction: 'ReachingPickPaymentMethod',\n })\n }\n }, [auth.type, navigation.isCurrentLegal])\n\n return (\n \n \n \n )\n}\n\nfunction Renew(): React.ReactElement {\n const auth = service.user.useAuth()\n const [orderId, setOrderId] = React.useState()\n\n React.useEffect(() => {\n if (auth.type === 'loggedin') {\n const params = new URLSearchParams(document.location.search)\n const orderId = params.get('order')\n if (orderId) {\n const id = parseInt(orderId, 10)\n\n if (id) {\n setOrderId(id)\n }\n }\n }\n }, [auth.type])\n\n return (\n \n <>\n {auth.type !== 'loggedin' && auth.type !== 'initial' && (\n \n }>\n \n \n \n )}\n {auth.type === 'loggedin' && orderId !== undefined && }\n \n \n )\n}\n\nfunction Endfunnel(): React.ReactElement {\n const auth = service.user.useAuth()\n\n React.useEffect(() => {\n if (auth.type !== 'loggedin' && auth.type !== 'initial') {\n window.location.replace(env.SIGNIN_URL + '?next=' + window.location.href)\n }\n }, [auth.type])\n\n return \n}\n", "import * as React from 'react'\n\nimport { t } from '@owl-nest/localize'\nimport { Spinner } from '@ulule/owl-kit-components/next'\nimport * as services from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport * as models from '@owl-nest/models'\n\nimport { scrollToCurrentItem } from '../../utils/scrollTo'\nimport { PAGES, useNavigation } from '../../hooks/useNavigation'\nimport { FutureItem } from '../../components/FutureItem'\nimport { IdentityItem } from '../../components/IdentityItem'\nimport { Item } from '../../components/Item'\nimport { CartSummary } from '../../components/selection'\nimport { MondialRelayItem, PickupItem } from '../../components/ShippingItem'\nimport { useCart } from '../../hooks/useCart'\nimport { PickupAddressItem } from './PickupAddressItem'\nimport { DropoffAddressItem } from './DropoffAddressItem'\nimport { ContactAddressItem } from './ContactAddressItem'\nimport { HomeDeliveryAddressItem } from './HomeDeliveryAddress'\nimport { useProject } from '../../hooks/useProject'\nimport { MembershipDeliveryAddressItem } from './MembershipDeliveryAddress'\n\nexport function AddressView(): React.ReactElement | null {\n const navigation = useNavigation()\n const cart = useCart()\n const { project } = useProject()\n\n const onlyTip = cart.products.length === 0 && cart.tip.amount > 0\n const countryFilter: string[] =\n cart.addressType === 'shipping' && cart.selectedShippingMode === 'home_delivery' && cart.selectedCountry\n ? [cart.selectedCountry?.code]\n : []\n const phoneRequired =\n ((cart.addressType === 'shipping' && cart.selectedShippingMode !== 'mondial_relay') ||\n cart.addressType === 'contact' ||\n cart.addressType === 'soft-shipping') &&\n cart.needPhone\n\n const auth = services.user.useAuth()\n\n const refShippings = React.useRef(null)\n React.useEffect(() => {\n scrollToCurrentItem(refShippings.current)\n }, [])\n\n const tracking = shadow.useTracking()\n\n return (\n <>\n navigation.navigate(PAGES.SELECTION),\n text: t('Edit'),\n }\n : undefined\n }\n >\n navigation.navigate(PAGES.SELECTION, { forceStep: true })} />\n \n\n \n\n {cart.addressType === 'shipping' && cart.selectedShippingMode === 'pickup_point' && (\n navigation.navigate(PAGES.ADDRESS)}\n goToPickup={() => navigation.navigate(PAGES.PICKUP)}\n />\n )}\n\n {cart.addressType === 'shipping' && cart.selectedShippingMode === 'mondial_relay' && (\n navigation.navigate(PAGES.ADDRESS)}\n goToPickup={() => navigation.navigate(PAGES.PICKUP)}\n />\n )}\n\n {auth.type !== 'loggedin' || cart.addressType === undefined ? (\n \n \n \n ) : cart.addressType === 'shipping' && cart.selectedShippingMode === 'pickup_point' ? (\n \n ) : cart.addressType === 'shipping' && cart.selectedShippingMode === 'mondial_relay' ? (\n \n ) : cart.addressType === 'shipping' && cart.selectedShippingMode === 'home_delivery' ? (\n \n ) : cart.addressType === 'soft-shipping' ? (\n \n ) : cart.addressType === 'contact' ? (\n \n ) : (\n <>\n )}\n\n \n \n )\n\n function handleContinue() {\n // track only home_delivery or soft-shipping. Mondial relay and pickyp are\n // tracked in there respective steps.\n if (\n (cart.addressType === 'shipping' && cart.selectedShippingMode === 'home_delivery') ||\n cart.addressType === 'soft-shipping'\n ) {\n tracking.ecommerce.track('add_shipping_info', {\n value: cart.subTotal,\n currency: project.currency,\n shipping_tier: cart.addressType === 'soft-shipping' ? 'membership_delivery' : 'home_delivery',\n items: [\n ...cart.products.map((product) => ({\n item_id: String(product.reward.id),\n item_name: models.reward.title(product.reward) ?? '',\n item_brand: models.project.name(project),\n item_variant: product.variant && String(product.variant.id),\n price: product.reward.price,\n quantity: product.quantity,\n })),\n ...(cart.tip.amount !== 0\n ? [\n {\n item_id: 'tip',\n item_name: 'tip',\n item_brand: models.project.name(project),\n price: cart.tip.amount,\n quantity: 1,\n },\n ]\n : []),\n ],\n })\n }\n\n navigation.navigate(navigation.nextLegalPage)\n }\n}\n", "import { scroll } from '@owl-nest/utils'\n\nexport const getOffsetTop = element => {\n let offsetTop = 0\n while (element) {\n offsetTop += element.offsetTop\n element = element.offsetParent\n }\n offsetTop -= 70\n return offsetTop\n}\n\nexport const scrollToCurrentItem = step => {\n const top = getOffsetTop(step)\n scroll.animatedScrollTo(top, 150)\n}\n\nexport function scrollToTop() {\n scroll.animatedScrollTo(0, 150)\n}\n", "import * as React from 'react'\nimport * as routerDOM from 'react-router-dom'\n\nimport * as models from '@owl-nest/models'\nimport * as services from '@owl-nest/services'\n\nimport { useCart } from './useCart'\n\nexport const PAGES = {\n SELECTION: '/',\n LOGIN: '/login/',\n ADDRESS: '/address/',\n MONDIAL_RELAY: '/mondialrelay/',\n PICKUP: '/pickup/',\n PAYMENT: '/payment/',\n} as const\n\ntype NavigationContext = {\n configuration: {\n donationBasedProject: boolean\n membershipProject: boolean\n preFilledTip?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n }\n }\n}\n\nconst navigationContext = React.createContext(undefined)\n\nexport const NavigationContext = navigationContext.Provider\n\ntype UseNavigationProps = {\n redirectToLegalPage?: boolean\n}\n\nexport function useNavigation({ redirectToLegalPage = false }: UseNavigationProps = {}) {\n const navContext = React.useContext(navigationContext)\n if (navContext === undefined) {\n throw Error('useNavigation outside a NavigationContext')\n }\n const { donationBasedProject, membershipProject, preFilledTip } = navContext.configuration\n\n const routerNavigate = routerDOM.useNavigate()\n const location = routerDOM.useLocation()\n const state = location.state as { forceStep?: boolean }\n const cart = useCart()\n const auth = services.user.useAuth()\n\n React.useEffect(() => {\n const currentLegal = getCurrentLegalPage()\n if (getCurrentPage() !== currentLegal && currentLegal !== undefined && redirectToLegalPage) {\n navigate(currentLegal, { replace: true })\n }\n }, [cart, auth, location])\n\n return { isCurrentLegal: getCurrentPage() === getCurrentLegalPage(), nextLegalPage: getNextLegalPage(), navigate }\n\n function navigate(pathname?: string, options: { replace?: boolean; forceStep?: boolean } = {}): void {\n if (pathname === undefined) {\n return\n }\n routerNavigate(\n { pathname, search: document.location.search },\n { replace: options.replace, state: { forceStep: options.forceStep } },\n )\n }\n\n function getCurrentPage() {\n return Object.values(PAGES).find((path) => path === location.pathname)\n }\n\n function getCurrentLegalPage() {\n const currentPage = getCurrentPage()\n\n switch (currentPage) {\n case PAGES.SELECTION: {\n if ((membershipProject || donationBasedProject) && preFilledTip?.amount && !state?.forceStep) {\n return PAGES.LOGIN\n }\n break\n }\n\n case PAGES.LOGIN: {\n if (cart.isEmpty) {\n return PAGES.SELECTION\n }\n\n if (auth.type === 'loggedin') {\n return getNextLegalPage()\n }\n break\n }\n\n case PAGES.PICKUP: {\n if (cart.isEmpty) {\n return PAGES.SELECTION\n }\n if (auth.type !== 'loggedin' && auth.type !== 'initial') {\n return PAGES.LOGIN\n }\n if (auth.type === 'loggedin' && cart.addressType === 'soft-shipping') {\n return PAGES.ADDRESS\n }\n if (auth.type === 'loggedin' && cart.addressType === 'shipping') {\n if (cart.selectedShippingMode === 'home_delivery') {\n return PAGES.ADDRESS\n } else if (cart.selectedShippingMode === 'mondial_relay') {\n return PAGES.MONDIAL_RELAY\n }\n }\n break\n }\n\n case PAGES.MONDIAL_RELAY: {\n if (cart.isEmpty) {\n return PAGES.SELECTION\n }\n if (auth.type !== 'loggedin' && auth.type !== 'initial') {\n return PAGES.LOGIN\n }\n if (auth.type === 'loggedin' && cart.addressType === 'soft-shipping') {\n return PAGES.ADDRESS\n }\n if (auth.type === 'loggedin' && cart.addressType === 'shipping') {\n if (cart.selectedShippingMode === 'home_delivery') {\n return PAGES.ADDRESS\n } else if (cart.selectedShippingMode === 'pickup_point') {\n return PAGES.PICKUP\n }\n }\n break\n }\n\n case PAGES.ADDRESS: {\n if (cart.isEmpty) {\n return PAGES.SELECTION\n }\n if (auth.type !== 'loggedin' && auth.type !== 'initial') {\n return PAGES.LOGIN\n }\n\n if (auth.type === 'loggedin' && cart.addressType !== undefined) {\n if (cart.addressType === 'none') {\n return getNextLegalPage()\n }\n if (cart.addressType === 'shipping') {\n if (cart.selectedShippingMode === 'pickup_point') {\n if (cart.selectedPickupPoint == undefined) {\n return PAGES.PICKUP\n }\n } else if (cart.selectedShippingMode === 'mondial_relay') {\n if (cart.selectedMondialRelay === undefined) {\n return PAGES.MONDIAL_RELAY\n }\n }\n }\n }\n break\n }\n\n case PAGES.PAYMENT: {\n if (cart.isEmpty) {\n return PAGES.SELECTION\n }\n if (auth.type !== 'loggedin' && auth.type !== 'initial') {\n return PAGES.LOGIN\n }\n if (auth.type === 'loggedin') {\n if (cart.addressType === 'soft-shipping' && cart.needAddress && cart.shippingAddress === undefined) {\n return PAGES.ADDRESS\n }\n\n if (cart.addressType === 'shipping' && cart.needAddress) {\n if (cart.selectedShippingMode === 'home_delivery' && cart.shippingAddress === undefined) {\n return PAGES.ADDRESS\n }\n if (cart.selectedShippingMode === 'pickup_point' && cart.selectedPickupPoint === undefined) {\n return PAGES.PICKUP\n }\n if (cart.selectedShippingMode === 'mondial_relay' && cart.selectedMondialRelay === undefined) {\n return PAGES.MONDIAL_RELAY\n }\n }\n\n if (cart.addressType === 'contact' && cart.contactAddress === undefined) {\n return PAGES.ADDRESS\n }\n }\n\n break\n }\n }\n\n return currentPage\n }\n\n function getNextLegalPage() {\n const currentPage = getCurrentPage()\n\n switch (currentPage) {\n case PAGES.SELECTION: {\n return PAGES.LOGIN\n }\n\n case PAGES.LOGIN: {\n if (cart.addressType === 'shipping' && cart.selectedShippingMode === 'pickup_point') {\n return PAGES.PICKUP\n } else if (cart.addressType === 'shipping' && cart.selectedShippingMode === 'mondial_relay') {\n return PAGES.MONDIAL_RELAY\n } else {\n return PAGES.ADDRESS\n }\n }\n\n case PAGES.PICKUP: {\n return PAGES.ADDRESS\n }\n\n case PAGES.MONDIAL_RELAY: {\n return PAGES.ADDRESS\n }\n\n case PAGES.ADDRESS: {\n return PAGES.PAYMENT\n }\n\n case PAGES.PAYMENT: {\n return undefined\n }\n }\n }\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { Item, Title, ItemProps } from './Item'\n\nconst StyledItem = styled(Item)`\n align-items: center;\n display: flex;\n min-height: 112px;\n\n ${Title} {\n color: ${plume.COLORS.GREY_SHADE_7};\n margin-bottom: 0;\n }\n`\n\nexport function FutureItem({ title, action }: ItemProps): React.ReactElement {\n return \n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { CenterWrapper } from '../style'\n\nconst ItemWrapper = styled(CenterWrapper)`\n background-color: ${plume.COLORS.PRIMARY_WHITE};\n padding: 10px;\n margin-bottom: 20px;\n box-shadow: ${plume.EFFECTS.SHADOW_1};\n box-sizing: border-box;\n\n @media screen and ${plume.BREAKPOINTS.MOBILE_M} {\n padding: 20px;\n }\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n border-radius: 6px;\n padding: 25px 33px;\n margin-bottom: 20px;\n }\n`\n\nconst ItemHeader = styled.div`\n display: flex;\n justify-content: space-between;\n`\n\nexport const Title = styled(plume.styles.heading.XXS)`\n display: block;\n margin-bottom: 20px;\n width: 100%;\n`\n\nexport type ItemProps = {\n title?: React.ReactNode\n action?: {\n handler: (event: React.MouseEvent) => void\n text: string\n }\n children?: React.ReactNode\n className?: string\n}\n\nexport const Item = React.forwardRef(({ title, action, children, className }, ref) => {\n return (\n \n \n {title && {title}}\n {action && (\n \n \n {action.text}\n \n \n )}\n \n {children}\n \n )\n})\n\nItem.displayName = 'Item'\n", "import styled from 'styled-components'\nimport { BREAKPOINTS, COLORS } from '@ulule/owl-kit-components/next'\n\nexport const CenterWrapper = styled.div`\n width: 100%;\n\n @media screen and ${BREAKPOINTS.TABLET} {\n width: 590px;\n margin: 0 auto;\n }\n`\n\nexport const LoadingCard = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n background-color: rgba(255, 255, 255, 0.8);\n z-index: 1;\n display: flex;\n justify-content: center;\n`\n\nexport const Highlighted = styled.span`\n background-color: ${COLORS.BLUE_SHADE_1};\n color: ${COLORS.BLUE_SHADE_2};\n padding: 0 3px;\n`\n", "import * as React from 'react'\n\nimport { Spinner } from '@ulule/owl-kit-components/next'\n\nimport { Item } from './Item'\n\nimport { Connect } from '@owl-nest/connect'\n\nexport function IdentityItem(): React.ReactElement<{}> | null {\n return (\n \n }>\n \n \n \n )\n}\n", "import { CartSummary } from './CartSummary'\nexport { CartSummary }\n", "import * as React from 'react'\nimport styled, { css, ThemeProvider } from 'styled-components'\n\nimport { t, tc, tf } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as hooks from '@owl-nest/hooks'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nimport * as productModel from '../../models/product'\n\nimport { MoneyConverter, MoneyDisplayer } from '../money'\nimport { SelectedShipping } from './SelectedShipping'\n\nimport * as S from './style'\nimport { useCart } from '../../hooks/useCart'\nimport { useProject } from '../../hooks/useProject'\n\ntype CartSummaryProps = {\n onModify: () => void\n}\n\ntype Theme = {\n colors: {\n accent: string\n background: string\n hover: string\n primary: string\n }\n}\n\nexport function CartSummary({ onModify }: CartSummaryProps): React.ReactElement {\n const { project } = useProject()\n const cart = useCart()\n const userConfig = env.useUserEnv()\n\n const amount = cart.total\n\n const showTotal =\n (cart.products.length > 0 && cart.tip.amount > 0) ||\n (cart.products.length > 0 && (cart.addressType === 'shipping' || cart.addressType === 'soft-shipping')) ||\n cart.products.length > 1 ||\n (cart.products.length === 1 && Boolean(cart.products[0].variant?.total_additional_cost))\n\n const projectCurrency = project.currency\n const userCurrency = userConfig.currency\n const isDifferentCurrency = projectCurrency !== userCurrency\n const setIsRewardTaxDeductionModalOpen = hooks.useSetModal('RewardTaxDeductionInfo')\n\n const tip = cart.tip\n const selectedProducts = cart.products\n\n const isMembership = models.project.isMembership(project)\n const isDonationBased = models.project.isDonationBased(project)\n\n const title = isDonationBased\n ? tip.frequency === 'monthly'\n ? tc('[amount] monthly donation', {\n amount: ,\n })\n : tc('[amount] one-time donation', {\n amount: ,\n })\n : isMembership\n ? tc('[amount] one-time donation', {\n amount: ,\n })\n : tc('[tip] Donation (without reward)', {\n tip: ,\n })\n\n const projectColor = models.project.backgroundColor(project) ?? plume.COLORS.BRAND_INDIGO\n const theme: Theme = {\n colors: {\n accent: `color-mix(in srgb, ${projectColor} 20%, white);`,\n background: `color-mix(in srgb, ${projectColor} 10%, white);`,\n hover: `color-mix(in srgb, ${projectColor} 70%, black);`,\n primary: projectColor,\n },\n }\n\n return (\n \n {tip.amount > 0 && selectedProducts.length <= 0 ? (\n \n \n \n {title}\n {isDifferentCurrency && (\n \n \n \n )}\n {cart.taxDeductible && (\n setIsRewardTaxDeductionModalOpen(true)}\n >\n \n {t('%(price)s after tax reduction', {\n price: plume.accounting.localeMoney(cart.taxDeductibleTotal, {\n currency: project.currency,\n lang: userConfig.lang,\n }),\n })}\n \n )}\n \n\n \n {t('Edit')}\n \n\n {models.project.isMembership(project) && (\n \n {t(\n 'This donation does not give you access to paid posts. If you wish to have access to paid posts, you must subscribe.',\n )}\n \n )}\n \n \n ) : (\n <>\n \n \n {tip.amount > 0 && (\n \n \n {t('Donation')}\n \n \n \n \n \n \n \n )}\n\n {selectedProducts.length > 0 &&\n selectedProducts.map((selectedProduct) => {\n const additionalCost = selectedProduct.variant && selectedProduct.variant.additional_cost\n const description = productModel.getTruncatedDescription(selectedProduct)\n const image = selectedProduct.variant\n ? models.variant.image(selectedProduct.variant)\n : productModel.getImage(selectedProduct)\n\n const productIsLegacy = productModel.isLegacy(selectedProduct)\n const title = productIsLegacy ? description : productModel.getTruncatedTitle(selectedProduct)\n\n return (\n \n \n {image && }\n
\n {title && }\n {description && selectedProduct.variant && !productIsLegacy && (\n \n )}\n
\n
\n\n \n \n {selectedProduct.quantity > 1 && (\n {selectedProduct.quantity} x\n )}\n {isMembership ? (\n tc('[amount] / month', {\n amount: ,\n })\n ) : (\n \n )}\n \n {additionalCost && (\n <>\n \n +{'\\u00A0'}\n {selectedProduct.quantity > 1 && (\n {selectedProduct.quantity} x\n )}\n {isDifferentCurrency ? (\n \n ) : (\n \n )}\n \n \n )}\n \n
\n )\n })}\n \n
\n\n {cart.addressType === 'shipping' && }\n\n {showTotal && (\n <>\n \n {t('Total')}\n \n {isMembership ? (\n tc('[amount] / month', {\n amount: ,\n })\n ) : (\n \n )}\n \n {isDifferentCurrency && (\n \n \n \n )}\n \n \n )}\n\n {cart.taxDeductible && (\n setIsRewardTaxDeductionModalOpen(true)}>\n \n {t('%(price)s after tax reduction', {\n price: plume.accounting.localeMoney(cart.taxDeductibleTotal, {\n currency: project.currency,\n lang: userConfig.lang,\n }),\n })}\n \n )}\n \n )}\n
\n )\n}\n\nconst TaxInfo = styled(plume.LinkAsButton)<{ alignRight?: boolean }>`\n display: block;\n margin-top: 5px;\n padding: 0;\n\n ${({ alignRight = true }) => {\n if (alignRight) {\n return css`\n width: 100%;\n text-align: right;\n `\n }\n }};\n\n ${plume.glyphs.stroke.Percent} {\n color: ${plume.COLORS.PRIMARY_SAND_500};\n margin-right: 6px;\n margin-top: -1px;\n }\n`\n\nconst Callout = styled(plume.Callout)`\n margin-top: 16px;\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { LocaleMoneyDisplayer } from '@ulule/owl-kit-components'\nimport { glyphs, Link, styles as S } from '@ulule/owl-kit-components/next'\nimport { Project } from '@owl-nest/api-client/latest'\nimport { t, tc } from '@owl-nest/localize'\nimport * as env from '@owl-nest/config'\nimport * as hooks from '@owl-nest/hooks'\n\n// TODO: FIXME: Prefix\nimport { MoneyConverterWrapper } from '../../views/selection/style'\nimport { useProject } from '../../hooks/useProject'\n\nconst ConversionDisclaimerWrapper = styled.div`\n display: flex;\n margin-top: 19px;\n`\n\nconst GlyphWrapper = styled.div`\n margin-right: 6px;\n`\n\ntype ConversionDisclaimerProps = {\n readonly project: Project\n}\n\ntype CurrencyGlyphProps = {\n currency: string\n size?: number\n}\n\ntype GlyphName = {\n [key: string]: string\n}\n\nconst glyphNameBySymbol: GlyphName = {\n AUD: 'Dolls',\n CAD: 'Dolls',\n CHF: 'Chf',\n DKK: 'Kr',\n EUR: 'Eur',\n GBP: 'Pound',\n NOK: 'Kr',\n NZD: 'Dolls',\n SEK: 'Kr',\n USD: 'Dolls',\n}\n\nexport const CurrencyGlyph = ({ currency, size }: CurrencyGlyphProps): React.ReactElement => {\n return (glyphs as any)['currencies'][`${glyphNameBySymbol[currency]}`]({ size })\n}\n\nexport const ConversionDisclaimer = ({\n project,\n}: ConversionDisclaimerProps): React.ReactElement => {\n const projectCurrency = project.currency\n const userConfig = env.useUserEnv()\n const userCurrency = userConfig.currency\n\n return (\n \n \n \n \n <>\n \n {tc(\n '[strong: This project is set in %(projectCurrency)s.] If you choose to pay in %(userCurrency)s, a conversion rate and possible additional fees will be applied by your card issuer.',\n {\n projectCurrency,\n strong: ,\n userCurrency,\n },\n )}\n
\n \n {t('Learn more')}\n \n
\n \n
\n )\n}\n\ntype MoneyConverterProps = {\n readonly absolutePosition?: boolean\n readonly amount: number\n readonly biggerFont?: boolean\n readonly bottomPosition?: number\n readonly precision?: number\n}\n\n// TODO: Use as this basically adds a wrapper and a different `targetCurrency`\nexport const MoneyConverter = ({\n absolutePosition = true,\n amount,\n biggerFont = false,\n bottomPosition,\n precision,\n}: MoneyConverterProps): React.ReactElement => {\n const { project } = useProject()\n\n const userConfig = env.useUserEnv()\n\n const currency = project.currency\n const currentCurrency = userConfig.currency\n\n const userLanguage = userConfig.lang\n\n return (\n \n \n \n )\n}\n\ntype MoneyDisplayerProps = {\n readonly amount: number\n readonly precision?: number\n}\n\nexport const MoneyDisplayer = ({ amount, precision }: MoneyDisplayerProps): React.ReactElement => {\n const { project } = useProject()\n const userConfig = env.useUserEnv()\n\n const currency = project.currency\n const userLanguage = userConfig.lang\n\n return (\n \n )\n}\n", "import styled, { css } from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport {\n BREAKPOINTS,\n COLORS,\n Dropdown,\n LinkAsButton,\n Option,\n RadioField,\n glyphs,\n styles as S,\n} from '@ulule/owl-kit-components/next'\nimport { styles } from '@owl-nest/utils'\n\n// TODO: FIXME: We shouldn't have to do this... This is misleading.\nexport * from '../../components/selection/style'\n\nimport { Item } from '../../components/Item'\n\nexport const OrderedItem = styled(Item)<{ displayFirst: boolean }>`\n order: ${({ displayFirst }) => (displayFirst ? 1 : 2)};\n`\n\n//TODO: FIX Dropdown in DS (error status, drawer margin-top and horizontal alignment) instead of hacks done here\nexport const StyledDropdown = styled(Dropdown)<{ active?: boolean; visible?: boolean }>`\n z-index: ${({ active }) => (active ? 2 : 1)};\n\n ${S.select.ScrollList} {\n min-width: 200px;\n max-width: 300px;\n z-index: ${({ active }) => (active ? 2 : 1)};\n }\n\n ${S.select.Button} {\n align-self: flex-start;\n border: ${({ status }) => (status === 'error' ? `1px dashed ${COLORS.PRIMARY_RED}` : 'none')};\n padding: ${({ status }) => (status === 'error' ? '3px' : '0px')};\n max-width: 100%;\n }\n\n ${S.select.Label} {\n display: block;\n }\n\n ${S.select.CaretDown} {\n flex: 0 0 10px;\n }\n\n ${S.select.Drawer} {\n margin-top: 0px;\n min-width: 200px;\n }\n`\n\nexport const OneLineOption = styled(Option)``\n\nexport const Rate = styled(S.copy.S)`\n font-weight: 600; // HACK: Irregular font manipulation. We'll be adding copy.M.semiBold, so this is just by anticipation.\n`\n\nexport const StyledRadioField = styled(RadioField)<{ hideDescriptionContent?: boolean }>`\n position: relative;\n\n ${S.field.Description} {\n visibility: ${({ hideDescriptionContent }) => (hideDescriptionContent ? `hidden` : 'visible')};\n width: 70%;\n\n @media screen and ${plume.BREAKPOINTS.MOBILE_L} {\n width: 80%;\n }\n }\n\n ${plume.StyledRadioField} {\n min-height: 70px !important;\n }\n\n ${Rate} {\n position: absolute;\n right: 20px;\n top: 50%;\n transform: translateY(-50%);\n }\n\n ${Dropdown} {\n position: absolute;\n left: 40px;\n bottom: 20%;\n }\n`\n\nexport const TipInformations = styled.td`\n @media screen and ${BREAKPOINTS.TABLET} {\n width: 325px;\n }\n`\n\nexport const TipActions = styled.td`\n text-align: right;\n`\n\nexport const SelectionError = styled(S.copy.S)<{ error: boolean }>`\n color: ${COLORS.PRIMARY_RED};\n position: absolute;\n right: 0;\n bottom: -2px;\n display: ${({ error }) => (error ? 'block' : 'none')};\n`\n\nexport const Error = styled(S.copy.S)<{ error: boolean }>`\n color: ${COLORS.PRIMARY_RED};\n display: ${({ error }) => (error ? 'block' : 'none')};\n margin-bottom: 10px;\n text-align: right;\n`\n\nexport const AddMoreRewards = styled(LinkAsButton)`\n cursor: pointer;\n margin-top: 11px;\n margin-bottom: 16px;\n width: 100%;\n\n ${glyphs.stroke.Plus} {\n color: ${COLORS.GREY_SHADE_4};\n margin-right: 8px;\n }\n`\n\nexport const SelectionShippingLabel = styled(S.copy.S)`\n font-size: ${styles.rem(15)};\n font-weight: 500;\n line-height: 22px;\n`\n", "import styled, { css } from 'styled-components'\n\nimport { styles } from '@owl-nest/utils'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nexport const SelectionCard = styled.div`\n position: relative;\n\n ${({ theme }) => {\n if (theme?.colors !== undefined) {\n return css`\n ${plume.Callout} {\n background-color: ${theme?.colors?.background};\n\n ${plume.glyphs.Icon} {\n color: ${theme?.colors?.primary};\n }\n }\n `\n }\n }}\n`\n\nexport const TipSummaryInformations = styled.div`\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n\n ${plume.Callout} {\n ${({ theme }) => {\n if (theme?.colors !== undefined) {\n return css`\n background-color: ${theme?.colors?.background};\n\n ${plume.glyphs.Icon} {\n color: ${theme?.colors?.primary};\n }\n `\n }\n }}\n }\n`\n\nexport const TipSummary = styled(plume.styles.copy.S)`\n font-size: ${styles.rem(18)}; // HACK: Irregular font manipulation\n font-weight: 500;\n line-height: 24px;\n`\n\nexport const TipSummaryConversion = styled(plume.styles.copy.S)`\n color: ${plume.COLORS.GREY_SHADE_3};\n font-size: ${styles.rem(12)}; // HACK: Irregular font manipulation\n margin-left: 7px;\n`\n\nexport const TipLink = styled(plume.Link)`\n font-size: ${styles.rem(13)}; // HACK: Irregular font manipulation\n line-height: 23px;\n`\n\nexport const StyledTable = styled.table`\n width: 100%;\n`\n\nexport const SelectionWrapper = styled.div`\n display: flex;\n flex-direction: column;\n`\n\nexport const SelectionItem = styled.tr<{ hasAdditionalCost?: boolean }>`\n position: relative;\n\n td {\n padding-bottom: 12px;\n padding-top: 12px;\n vertical-align: middle;\n /* width: 205px; */\n }\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n td {\n padding-bottom: 15px;\n padding-top: 15px;\n }\n\n ${({ hasAdditionalCost = false }) => {\n if (hasAdditionalCost) {\n return css`\n td:last-of-type {\n padding-top: 18px;\n }\n `\n }\n }};\n }\n`\n\nexport const SelectionItemInformations = styled.td`\n display: flex;\n align-items: center;\n width: 180px;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n width: 325px;\n }\n`\n/*\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n width: 340px;\n max-width: 340px;\n }*/\n\nexport const SelectionTitle = styled(plume.styles.copy.S)`\n font-size: ${styles.rem(14)}; // HACK: Irregular font manipulation\n display: block;\n`\n/*\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n max-width: 100%;\n }*/\n\nexport const SelectionCurrencyWrapper = styled.td`\n text-align: right;\n min-width: 42px;\n position: relative;\n`\n\nexport const SelectionCurrency = styled(plume.styles.copy.M)`\n font-weight: 600; /* HACK: Irregular font manipulation. We'll be adding copy.M.semiBold, so this is just by anticipation. */\n`\n\nexport const SmallSelectionCurrency = styled(plume.styles.copy.S)`\n font-weight: 600; /* HACK: Irregular font manipulation. We'll be adding copy.S.semiBold, so this is just by anticipation. */\n`\n\nexport const MoneyConverterWrapper = styled(plume.styles.copy.S)<{\n absolutePosition?: boolean\n biggerFont?: boolean\n bottomPosition?: number\n}>`\n display: ${(props) => (props.absolutePosition ? 'block' : 'inline-block')};\n color: ${plume.COLORS.GREY_SHADE_3};\n font-size: ${styles.rem(10)};\n font-size: ${(props) => (props.biggerFont ? `${styles.rem(14)}` : `${styles.rem(10)}`)};\n position: ${(props) => (props.absolutePosition ? 'absolute' : 'relative')};\n right: 0;\n bottom: ${(props) => (props.bottomPosition ? `${props.bottomPosition}px` : '')};\n`\n\nexport const SelectionAction = styled.div<{ marginTop?: boolean }>`\n margin-top: ${(props) => (props.marginTop ? '50px' : '24px')};\n`\n\nconst baseRewardThumbnail = (isSmall?: boolean): any => css`\n width: 70px;\n margin-right: 14px;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n width: ${isSmall ? '70px' : '132px'};\n }\n`\n\nexport const RewardSelectionPlaceholder = styled(plume.DefaultRewardImage)<{ isSmall?: boolean }>`\n ${({ isSmall }) => baseRewardThumbnail(isSmall)}\n\n max-height: 54px;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n max-height: 82px;\n }\n`\n\nexport const RewardSelectionImage = styled.img<{ isSmall?: boolean }>`\n ${({ isSmall }) => baseRewardThumbnail(isSmall)}\n`\n\nexport const SelectionVariantTitle = styled(plume.styles.copy.S)`\n color: ${plume.COLORS.GREY_SHADE_3};\n`\n\nexport const QuantityResume = styled.span`\n font-family: ${plume.FONTS.PRIMARY_FONT};\n font-size: ${styles.rem(13)}; // HACK: Irregular font manipulation\n font-style: italic;\n line-height: 20px;\n text-align: right;\n color: ${plume.COLORS.GREY_SHADE_3};\n margin-right: 10px;\n`\n\nexport const SelectionSection = styled.div<{ isSmall?: boolean }>`\n display: flex;\n align-items: center;\n justify-content: ${(props) => (props.isSmall ? 'flex-end' : 'space-between')};\n margin: 20px 0;\n`\n\nexport const SelectionSectionTitle = styled(plume.styles.copy.S)<{ isSmall?: boolean }>`\n font-size: ${styles.rem(10)}; // HACK: Irregular font manipulation\n font-weight: 500;\n line-height: 16px;\n text-transform: uppercase;\n color: ${plume.COLORS.GREY_SHADE_3};\n margin-right: ${(props) => (props.isSmall ? '20px' : '0px')};\n white-space: pre;\n`\n\nexport const ColumnSelectionSection = styled.div<{ isSmall?: boolean }>`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: ${(props) => (props.isSmall ? 'flex-end' : 'space-between')};\n margin: 20px 0px;\n\n ${SelectionSectionTitle} {\n margin-bottom: 11px;\n }\n`\n\nexport const TotalPrice = styled(plume.styles.copy.S)`\n font-size: ${styles.rem(18)}; // HACK: Irregular font manipulation\n font-weight: 500;\n line-height: 24px;\n text-align: right;\n color: ${plume.COLORS.PRIMARY_BLACK};\n`\n\nexport const ShippingSelection = styled.div`\n text-align: right;\n margin-right: 10px;\n`\n\nexport const SelectedCountry = styled(QuantityResume)`\n margin-right: 0px;\n`\n\nexport const SelectionShipping = styled.div`\n display: flex;\n align-items: baseline;\n justify-content: flex-end;\n`\n\nexport const SelectionShippingCurrencyWrapper = styled.div``\n\nexport const SelectedTotal = styled.div<{ marginBottom?: boolean }>`\n display: flex;\n justify-content: flex-end;\n align-items: baseline;\n margin-top: 17px;\n margin-bottom: ${(props) => (props.marginBottom ? '20px' : '0px')};\n`\n\nexport const SelectedConvertedCurrency = styled.div`\n text-align: right;\n`\n\nexport const CalloutText = styled(plume.styles.copy.S)`\n font-size: ${styles.rem(15)}; // HACK: Irregular font manipulation\n font-weight: 300;\n line-height: 22px;\n display: block;\n color: ${plume.COLORS.PRIMARY_BLACK};\n`\n\nexport const CalloutTextStrong = styled(CalloutText)`\n font-weight: 500;\n`\n", "import * as React from 'react'\n\nimport { t, tp } from '@owl-nest/localize'\nimport * as env from '@owl-nest/config'\n\nimport { ShippingCart } from '../../hooks/useCart'\nimport { MoneyDisplayer } from '../money'\n\nimport * as S from './style'\n\ntype SelectedShippingProps = {\n cart: ShippingCart\n}\n\nexport function SelectedShipping({ cart }: SelectedShippingProps) {\n const cartHasFreeShipping =\n cart.selectedShippingMode === 'pickup_point' ||\n (cart.selectedCountry?.code && cart.getRate(cart.selectedCountry.code) === 0)\n const shippingRate = cart.selectedCountry?.code && cart.getRate(cart.selectedCountry.code)\n\n return (\n <>\n \n \n \n {cart.selectedShippingMode === 'pickup_point'\n ? t('Pick-up')\n : t('+ %(country)s Delivery', {\n country: env.COUNTRIES.find((country) => country.code === cart.selectedCountry?.code)!.label(),\n })}\n \n \n \n \n {cartHasFreeShipping ? (\n <>{cart.selectedShippingMode === 'pickup_point' ? tp('Free', 'pickup') : tp('Free', 'address')}\n ) : (\n shippingRate && \n )}\n \n \n \n \n )\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t, tp } from '@owl-nest/localize'\nimport { pickup as pickupModel } from '@owl-nest/models'\nimport * as services from '@owl-nest/services'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport * as env from '@owl-nest/config'\n\nimport { Item } from './Item'\nimport { useCart } from '../hooks/useCart'\n\ntype ShippingItemProps = {\n goToPickup: () => void\n goToAddress: () => void\n}\n\nexport const ContactItem = React.forwardRef(function ShippingItem(\n { goToAddress },\n ref,\n) {\n const cart = useCart()\n const countries = env.COUNTRIES\n\n const user = services.user.useAuthenticatedUser()\n const { response } = services.user.address.useAddress(user?.id, { fetchOnMount: 'force' })\n const addresses = response.data?.addresses\n\n if (cart.addressType !== 'contact' || addresses === undefined) {\n return <>\n }\n\n const contactAddress = addresses.find((address) => address.id === cart.contactAddress)\n if (contactAddress !== undefined) {\n return (\n \n {addressModel.format(contactAddress, countries)}\n \n )\n }\n return null\n})\n\nexport const BillingAddress = React.forwardRef(function ShippingItem(\n { goToAddress },\n ref,\n) {\n const cart = useCart()\n const countries = env.COUNTRIES\n\n const user = services.user.useAuthenticatedUser()\n const { response } = services.user.address.useAddress(user?.id, { fetchOnMount: 'force' })\n const addresses = response.data?.addresses\n\n if (\n !(\n cart.addressType === 'shipping' &&\n (cart.selectedShippingMode === 'pickup_point' || cart.selectedShippingMode === 'mondial_relay')\n ) ||\n addresses === undefined\n ) {\n return <>\n }\n\n const billingAddress = addresses.find((address) => address.id === cart.billingAddress)\n if (billingAddress !== undefined) {\n return (\n \n {addressModel.format(billingAddress, countries)}\n \n )\n }\n return null\n})\n\nexport const AddressItem = React.forwardRef(function ShippingItem(\n { goToAddress },\n ref,\n) {\n const cart = useCart()\n const countries = env.COUNTRIES\n\n const user = services.user.useAuthenticatedUser()\n const { response } = services.user.address.useAddress(user?.id, { fetchOnMount: 'force' })\n const addresses = response.data?.addresses\n\n if ((cart.addressType !== 'shipping' && cart.addressType !== 'soft-shipping') || addresses === undefined) {\n return <>\n }\n\n const deliveryAddress = addresses.find((address) => address.id === cart.shippingAddress)\n if (deliveryAddress !== undefined) {\n if (cart.addressType === 'soft-shipping') {\n return (\n \n {addressModel.format(deliveryAddress, countries)}\n \n )\n }\n\n return (\n \n {addressModel.format(deliveryAddress, countries)}\n \n )\n }\n return null\n})\n\nexport const MondialRelayItem = React.forwardRef(function ShippingItem(\n { goToPickup },\n ref,\n) {\n const cart = useCart()\n\n if (cart.addressType !== 'shipping') {\n return <>\n }\n\n if (cart.selectedMondialRelay !== undefined) {\n return (\n \n \n \n {t('Recipient')}\n \n {cart.selectedMondialRelay.firstName} {cart.selectedMondialRelay.lastName}\n \n {cart.selectedMondialRelay.phoneNumber}\n \n \n {t('Drop-off point')}\n {cart.selectedMondialRelay.dropoff?.name}\n {cart.selectedMondialRelay.dropoff?.address}\n \n {cart.selectedMondialRelay.dropoff?.postal_code} {cart.selectedMondialRelay.dropoff?.city}\n \n \n {env.COUNTRIES.find((country) => country.code === cart.selectedCountry?.code)?.label()}\n \n \n \n \n )\n }\n\n return null\n})\n\nconst MondialRelayDetail = styled.div`\n display: flex;\n`\n\nconst MondialRelayColumn = styled.div`\n margin: 0 24px 0 0;\n\n ${plume.styles.heading.XXXXXS} {\n margin-bottom: 4px;\n color: ${plume.COLORS.PRIMARY_SAND_700};\n }\n`\n\nexport const PickupItem = React.forwardRef(function ShippingItem(\n { goToPickup },\n ref,\n) {\n const cart = useCart()\n\n if (cart.addressType !== 'shipping') {\n return <>\n }\n\n if (cart.selectedPickupPoint !== undefined) {\n return (\n \n \n \n \n \n {pickupModel.city(cart.selectedPickupPoint)}\n \n {pickupModel.address(cart.selectedPickupPoint)}\n \n \n {pickupModel.description(cart.selectedPickupPoint)}\n \n \n \n )\n }\n\n return null\n})\n\nconst AddressDisplay = styled.div`\n white-space: pre;\n font-family: ${plume.FONTS.PRIMARY_FONT};\n font-weight: 200;\n font-size: 15px;\n line-height: 22px;\n`\n\nconst PickupDisplay = styled.div`\n display: flex;\n flex-direction: column;\n\n ${plume.glyphs.stroke.MapCursor} {\n color: ${plume.COLORS.GREY_SHADE_4};\n margin-right: 4px;\n }\n\n ${plume.styles.field.Title} {\n margin-right: 8px;\n color: ${plume.COLORS.PRIMARY_BLACK} !important;\n\n ${plume.styles.heading.XXXS} {\n display: inline;\n }\n }\n`\n", "import * as React from 'react'\n\nimport * as services from '@owl-nest/services'\nimport * as api from '@owl-nest/api-client/next'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\n\nimport { AddressManager } from './components/AddressManager'\nimport { useCart } from '../../hooks/useCart'\nimport { Item } from '../../components/Item'\n\ntype PickupAddressItemProps = {\n user: api.AuthenticatedUser\n countryFilter: string[]\n onContinue: () => void\n}\n\nexport const PickupAddressItem = React.forwardRef(function PickupAddressItem(\n { user, countryFilter, onContinue },\n ref,\n) {\n const userAddressService = services.user.address.useAddress(user.id, {\n extraFields: ['has_shippings'],\n fetchOnMount: true,\n })\n\n const userAddresses = userAddressService.response.data?.addresses ?? []\n const addresses = services.user.address.filter(userAddresses, countryFilter)\n\n const cart = useCart()\n\n const selectedAddressInCart = addresses.find(\n (address) => address.id === (cart.addressType === 'shipping' && cart.billingAddress),\n )\n const selectedAddress: addressModel.Model =\n selectedAddressInCart === undefined ? emptyAddress() : selectedAddressInCart\n\n return (\n \n {userAddressService.response.data === undefined ? (\n \n ) : (\n {\n cart.setAddress({ billing: primary.id })\n onContinue()\n }}\n onRemove={(address) => {\n if (cart.addressType === 'shipping' && cart.billingAddress === address.id) {\n cart.setAddress({ billing: undefined })\n }\n }}\n primary={{\n title: t('Billing'),\n countryFilter: countryFilter,\n address: selectedAddress,\n allowCountrySelection: false,\n disableCountry: false,\n phoneRequired: true,\n schema: addressModel.schema(true),\n }}\n />\n )}\n \n )\n\n function emptyAddress() {\n return {\n ...addressModel.empty(),\n first_name: user.first_name ?? '',\n last_name: user.last_name ?? '',\n }\n }\n})\n", "import * as React from 'react'\nimport * as formik from 'formik'\n\nimport * as services from '@owl-nest/services'\nimport * as api from '@owl-nest/api-client/next'\nimport * as addressModel from '@owl-nest/address/src/model'\n\nimport { DetailAddress } from './DetailAddress'\nimport { ListAddress } from './ListAddress'\nimport { Either } from '@owl-nest/monad'\n\ntype AddressManagerProps = {\n userId: number\n addresses: api.Address<'has_shippings'>[]\n onRemove: (address: Omit & { id: number }) => void\n callout?: React.ReactNode\n emptyAddress: () => addressModel.Model\n} & (\n | {\n onChange: (value: { primary: Omit & { id: number }; secondary?: undefined }) => void\n primary: {\n title: string\n address?: addressModel.Model\n allowCountrySelection?: boolean\n disableCountry?: boolean\n phoneRequired: boolean\n countryFilter: string[]\n schema: any\n }\n secondary?: undefined\n }\n | {\n onChange: (value: {\n primary: Omit & { id: number }\n secondary?: Omit & { id: number }\n }) => void\n primary: {\n title: string\n address?: addressModel.Model\n allowCountrySelection?: boolean\n disableCountry?: boolean\n phoneRequired: boolean\n countryFilter: string[]\n schema: any\n }\n secondary: {\n title: string\n checkbox: { label: React.ReactNode; description?: string }\n address?: addressModel.Model\n allowCountrySelection?: boolean\n disableCountry?: boolean\n phoneRequired: boolean\n schema: any\n countryFilter?: undefined\n }\n }\n)\n\nexport function AddressManager({ userId, addresses, onRemove, callout, emptyAddress, ...rest }: AddressManagerProps) {\n const userAddressService = services.user.address.useAddress(userId, {\n extraFields: ['has_shippings'],\n fetchOnMount: false,\n })\n\n const primaryFilteredAddresses = services.user.address.filter(addresses, rest.primary.countryFilter)\n\n const [state, setState] = React.useState<\n {\n primary: addressModel.Model\n secondary: addressModel.Model\n errors?: formik.FormikErrors\n reason?: string\n } & ({ mode: 'list'; target?: undefined } | { mode: 'detail'; target: 'primary' | 'secondary' })\n >({\n mode: 'list',\n primary:\n rest.primary.address === undefined && primaryFilteredAddresses.length === 1\n ? primaryFilteredAddresses[0]\n : rest.primary.address ?? emptyAddress(),\n secondary:\n rest.secondary?.address === undefined && addresses.length === 1\n ? addresses[0]\n : rest.secondary?.address ?? emptyAddress(),\n errors: {},\n reason: undefined,\n })\n\n if (state.mode === 'detail') {\n const countryFilter = rest[state.target]?.countryFilter ?? []\n const address = state[state.target]\n const target = state.target\n return (\n {\n setState((state) => ({\n ...state,\n errors: {},\n reason: undefined,\n mode: 'list',\n target: undefined,\n }))\n }}\n onSubmit={async (address) => {\n if (address.id === undefined) {\n const result = await userAddressService.create(addressModel.address(address))\n result?.next((address) => {\n if (target === 'primary') {\n rest.onChange({ primary: address })\n } else {\n setState((state) => {\n return {\n ...state,\n errors: {},\n reason: undefined,\n mode: 'list',\n target: undefined,\n secondary: address,\n }\n })\n }\n })\n } else {\n const result = await userAddressService.update(address.id, addressModel.address(address))\n result?.next(({ addresses }) => {\n const updatedAddress = addresses.find((updatedAddress) => updatedAddress.id === address.id)\n\n if (!updatedAddress) {\n return\n }\n\n if (target === 'primary') {\n rest.onChange({ primary: updatedAddress })\n } else {\n setState((state) => {\n return {\n ...state,\n errors: {},\n reason: undefined,\n mode: 'list',\n target: undefined,\n secondary: updatedAddress,\n }\n })\n }\n })\n }\n }}\n />\n )\n }\n\n return (\n \n setState((state) => {\n return {\n ...state,\n mode: 'detail',\n target,\n primary: primary ?? state.primary,\n secondary: secondary ?? state.secondary,\n [target]: (target === 'primary' ? primary : secondary) ?? emptyAddress(),\n errors,\n reason,\n }\n })\n }\n onRemove={async (address) => {\n onRemove(address)\n const result = await userAddressService.remove(address.id)\n result?.next(({ addresses }) => {\n const primaryFilteredAddresses = services.user.address.filter(addresses, rest.primary.countryFilter)\n\n setState((state) => {\n return {\n ...state,\n primary:\n primaryFilteredAddresses.length === 0 || state.primary.id === address.id\n ? emptyAddress()\n : state.primary,\n secondary: addresses.length === 0 || state.secondary.id === address.id ? emptyAddress() : state.secondary,\n }\n })\n })\n }}\n emptyAddress={emptyAddress}\n callout={callout}\n primary={{\n title: rest.primary.title,\n initialAddress: state.primary,\n allowCountrySelection: rest.primary.allowCountrySelection,\n disableCountry: rest.primary.disableCountry,\n phoneRequired: rest.primary.phoneRequired,\n countryFilter: rest.primary.countryFilter,\n schema: rest.primary.schema,\n }}\n secondary={\n rest.secondary\n ? {\n title: rest.secondary.title,\n initialAddress: state.secondary,\n allowCountrySelection: rest.secondary.allowCountrySelection,\n disableCountry: rest.secondary.disableCountry,\n phoneRequired: rest.secondary.phoneRequired,\n schema: rest.secondary.schema,\n checkbox: rest.secondary.checkbox,\n }\n : undefined\n }\n onSubmit={async (value) => {\n if (rest.secondary === undefined || value.ignoreSecondary) {\n if (value.primary.id === undefined) {\n const result = await userAddressService.create(addressModel.address(value.primary))\n result?.next((address) => rest.onChange({ primary: address }))\n } else {\n rest.onChange({ primary: value.primary as Omit & { id: number } })\n }\n } else {\n const result = await (\n await Either.right(undefined).nextAsync(async () => {\n if (value.primary.id === undefined) {\n return await userAddressService.create(addressModel.address(value.primary))\n }\n return value.primary as Omit & { id: number }\n })\n ).nextAsync(async (primary) => {\n if (value.secondary === undefined) {\n return { primary }\n }\n if (value.secondary.id === undefined) {\n return (await userAddressService.create(addressModel.address(value.secondary)))?.next((secondary) => ({\n primary,\n secondary,\n }))\n }\n return { primary, secondary: value.secondary as Omit & { id: number } }\n })\n\n result?.next((content) => {\n rest.onChange({ primary: content?.primary!, secondary: content?.secondary })\n })\n }\n }}\n />\n )\n}\n", "import * as React from 'react'\nimport * as formik from 'formik'\nimport styled from 'styled-components'\n\nimport * as addressModel from '@owl-nest/address/src/model'\nimport { t } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nimport { NewAddressSubForm } from '../NewAddressSubForm'\nimport { Title } from '../../../../components/Item'\n\ntype DetailAddressProps = {\n initialAddress: addressModel.Model\n reason?: string\n schema: any\n errors: formik.FormikErrors\n allowCountrySelection?: boolean\n disableCountry?: boolean\n phoneRequired: boolean\n countryFilter: string[]\n onCancel: () => void\n onSubmit: (address: addressModel.Model) => Promise\n hideState?: boolean\n}\n\nexport function DetailAddress({\n initialAddress,\n reason,\n schema,\n errors,\n allowCountrySelection,\n disableCountry,\n phoneRequired,\n countryFilter,\n onCancel,\n onSubmit,\n hideState,\n}: DetailAddressProps) {\n const mode = initialAddress.id === undefined ? 'create' : 'edit'\n\n const defaultPhoneCountry =\n env.COUNTRIES.find((country) => country.code === countryFilter[0]) ||\n env.COUNTRIES.find((country) => country.code === env.USER_COUNTRY) ||\n env.COUNTRIES[0]\n\n const isInitialEmpty =\n initialAddress === undefined ||\n initialAddress.address1 === '' ||\n initialAddress.city === '' ||\n initialAddress.postal_code === '' ||\n initialAddress.city === ''\n\n const [found, setFound] = React.useState(!isInitialEmpty)\n\n const wrapperRef = React.useRef(null)\n\n return (\n \n {mode === 'create' ? t('Add a new address') : t('Edit an address')}\n\n {reason && {reason}}\n\n \n {(formikBag) => {\n React.useEffect(() => {\n if (wrapperRef.current !== null && !formikBag.isValid) {\n wrapperRef.current.scrollIntoView()\n }\n }, [formikBag.submitCount, formikBag.isValid])\n\n return (\n
\n formikBag.setValues(address)}\n onFound={() => setFound(true)}\n phoneRequired={phoneRequired}\n touched={formikBag.touched}\n value={formikBag.values}\n />\n\n \n {!found ? t('Awaiting address') : t('Save')}\n \n\n \n \n {t('Back')}\n \n \n \n )\n }}\n \n
\n )\n}\n\nconst Wrapper = styled.div`\n ${plume.styles.button.Button} {\n width: 100%;\n margin: 30px 0 18px;\n }\n\n ${plume.styles.copy.S} {\n display: block;\n text-align: center;\n margin: 18px 0 20px;\n }\n`\n", "import * as React from 'react'\nimport * as formik from 'formik'\nimport styled from 'styled-components'\n\nimport { AutocompleteSubForm } from '@owl-nest/address/src/AutocompleteSubForm'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport * as api from '@owl-nest/api-client/next'\nimport * as hooks from '@owl-nest/hooks'\nimport { t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nimport { useProject } from '../../../hooks/useProject'\nimport { ShippingCart, useCart } from '../../../hooks/useCart'\n\ntype NewAddressSubFormProps = {\n allowCountrySelection?: boolean\n hideCountrySelection?: boolean\n initialCountryFilter: string[]\n defaultPhoneCountry: env.Country\n disableCountry?: boolean\n errors: formik.FormikErrors\n hideState?: boolean\n initialEmpty: boolean\n onChange: (model: addressModel.Model) => void\n onFound: () => void\n phoneRequired: boolean\n touched: formik.FormikTouched\n value: addressModel.Model\n}\n\nexport function NewAddressSubForm({\n allowCountrySelection = false,\n hideCountrySelection = false,\n initialCountryFilter,\n defaultPhoneCountry,\n disableCountry = false,\n errors,\n hideState = false,\n initialEmpty,\n onChange,\n onFound,\n phoneRequired,\n touched,\n value,\n}: NewAddressSubFormProps): React.ReactElement {\n const countries = env.COUNTRIES\n const baseAddress: api.BaseAddress = {\n address1: value.address1,\n address2: value.address2,\n city: value.city,\n country: value.country,\n postal_code: value.postal_code,\n state: value.state,\n }\n\n const [lockCountrySelect, setLockCountrySelect] = React.useState(false)\n const [countryFilter, setCountryFilter] = React.useState(initialCountryFilter)\n const [phoneCountryCode, setPhoneCountryCode] = React.useState(undefined)\n\n const cart = useCart()\n const { project } = useProject()\n const isDonationBasedProject = models.project.isDonationBased(project)\n const isRewardBasedProject = models.project.isRewardBased(project)\n\n const countryOptions =\n cart.addressType === 'shipping'\n ? Object.keys(cart.rates.homeDelivery)\n .map((countryCode) => {\n return { label: getCountryLabel(cart, countryCode, project), code: countryCode }\n })\n // unknown country will have an undefined label. We filter them out.\n .filter((option) => option.label !== undefined)\n : countries.map((country) => ({ label: country.label(), code: country.code }))\n\n const previousCountryLockState = hooks.usePrevious(lockCountrySelect)\n React.useEffect(() => {\n if (!lockCountrySelect && previousCountryLockState) {\n // HACK: To hell with the ref drilling, we try and keep it simple here.\n const $shippingCountrySelector = document.getElementById('shipping-country-selector')\n if ($shippingCountrySelector) {\n $shippingCountrySelector.click()\n }\n }\n }, [lockCountrySelect])\n\n return (\n <>\n \n ) => onChange({ ...value, first_name: evt.target.value })}\n error={touched.first_name && errors.first_name}\n />\n ) => onChange({ ...value, last_name: evt.target.value })}\n error={touched.last_name && errors.last_name}\n />\n \n\n \n onChange({ ...value, type: 'personal' } as any)}\n />\n onChange({ ...value, type: 'association' } as any)}\n />\n onChange({ ...value, type: 'business' } as any)}\n />\n \n\n {value.type !== 'personal' && (\n ) => onChange({ ...value, entity_name: evt.target.value })}\n error={touched.entity_name && errors.entity_name}\n />\n )}\n\n {phoneRequired && (\n {\n setPhoneCountryCode(phone.country)\n onChange({ ...value, phone_number: phone.number })\n }}\n label={t('Phone number')}\n context={isRewardBasedProject ? t('to facilitate delivery') : null}\n error={touched.phone_number && errors.phone_number}\n />\n )}\n\n {allowCountrySelection && !hideCountrySelection && (\n \n {\n const selectedCountry = selected[0].code\n setCountryFilter(selected.map((country) => country.code))\n cart.setSelectedCountry(selectedCountry)\n if (!value.phone_number) {\n setPhoneCountryCode(selectedCountry)\n }\n onChange({ ...value, country: selectedCountry })\n }}\n >\n {countryOptions.map((option) => {\n return (\n \n {option.label}\n \n )\n })}\n \n {lockCountrySelect && (\n {\n setLockCountrySelect(false)\n }}\n >\n {t('Edit')}\n \n )}\n \n )}\n\n {\n delete baseAddress.latitude\n delete baseAddress.longitude\n\n if (!lockCountrySelect) {\n setLockCountrySelect(true)\n }\n onFound()\n onChange({ ...value, ...baseAddress })\n }}\n touched={touched}\n />\n \n )\n}\n\nfunction getCountryLabel(cart: ShippingCart, countryCode: string, project: api.Project): string | undefined {\n const rate = cart.getRate(countryCode, 'home_delivery')\n const country = env.COUNTRIES.find((country) => country.code === countryCode)\n\n // the list of countries API side might be out of sync with the liste of\n // country in the front.\n if (country === undefined) {\n return undefined\n }\n\n return rate === 0 || rate === undefined\n ? t('%(label)s (included)', { label: country.label() })\n : `${country.label()} (+\\xa0${t('%(currency)s%(amount)s', {\n amount: rate,\n currency: models.project.currencySymbol(project),\n })})`\n}\n\nconst ShippingCountryModifier = styled.button`\n ${plume.styles.copy._baseStyle};\n background: transparent;\n border: none;\n cursor: pointer;\n font-size: 13px; // HACK: Irregular font manipulation\n font-weight: 500; // HACK: Irregular font manipulation\n position: absolute;\n right: 23px;\n top: 55%;\n z-index: 2;\n`\n\nexport const IdentityGroup = styled(plume.styles.controls.Group)`\n margin: 20px 0 20px;\n\n ${plume.TextField} {\n flex: 1;\n\n &:first-child {\n margin-right: 10px;\n }\n }\n`\n\nconst SelectWrapper = styled.div`\n position: relative;\n`\n\nconst StyledAutocompleteSubForm = styled(AutocompleteSubForm)`\n margin: 20px 0 20px;\n`\n\nconst StyledPhoneField = styled(plume.PhoneField)`\n margin: 30px 0 20px;\n`\n\nconst StyledSelectField = styled(plume.SelectField)`\n margin: 20px 0 20px;\n position: relative;\n z-index: 2;\n\n ${plume.styles.select.Button}:disabled {\n ${plume.glyphs.fill.CaretDown} {\n display: none;\n }\n }\n`\n\nexport const Type = styled(plume.RadioGroupField)`\n display: flex;\n margin: 20px 0 30px;\n`\n", "import * as React from 'react'\nimport * as formik from 'formik'\nimport styled from 'styled-components'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport { t } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as yup from '@owl-nest/validators'\nimport * as services from '@owl-nest/services'\nimport * as env from '@owl-nest/config'\n\nimport { ExistingAddressSubForm } from '../ExistingAddressSubForm'\nimport { NewAddressSubForm } from '../NewAddressSubForm'\nimport { Title } from '../../../../components/Item'\n\ntype ListAddressProps = {\n addresses: api.Address<'has_shippings'>[]\n toDetail(options: {\n target: 'primary' | 'secondary'\n primary?: addressModel.Model\n secondary?: addressModel.Model\n errors?: formik.FormikErrors\n reason?: string\n }): void\n callout?: React.ReactNode\n onRemove: (address: api.Address<'has_shippings'>) => void\n emptyAddress: () => addressModel.Model\n onSubmit: (value: {\n primary: addressModel.Model\n secondary?: addressModel.Model\n ignoreSecondary: boolean\n }) => Promise\n} & (\n | {\n primary: {\n title: string\n initialAddress: addressModel.Model\n allowCountrySelection?: boolean\n disableCountry?: boolean\n phoneRequired: boolean\n countryFilter: string[]\n schema: any\n }\n secondary?: undefined\n }\n | {\n primary: {\n title: string\n initialAddress: addressModel.Model\n allowCountrySelection?: boolean\n disableCountry?: boolean\n phoneRequired: boolean\n countryFilter: string[]\n schema: any\n }\n secondary: {\n checkbox: { label: React.ReactNode; description?: string }\n title: string\n initialAddress: addressModel.Model\n allowCountrySelection?: boolean\n disableCountry?: boolean\n phoneRequired: boolean\n schema: any\n }\n }\n)\n\nexport function ListAddress({\n toDetail,\n emptyAddress,\n addresses,\n callout,\n onRemove,\n onSubmit,\n primary,\n secondary,\n}: ListAddressProps) {\n const wrapperRef = React.useRef(null)\n\n const defaultPhoneCountry =\n env.COUNTRIES.find((country) => country.code === primary.countryFilter[0]) ||\n env.COUNTRIES.find((country) => country.code === env.USER_COUNTRY) ||\n env.COUNTRIES[0]\n\n const primaryFilteredAddresses = services.user.address.filter(addresses, primary.countryFilter)\n\n const isPrimaryEmpty = primaryFilteredAddresses.length === 0\n const isSecondaryEmpty = addresses.length === 0\n\n const [found, setFound] = React.useState(primary.initialAddress?.id !== undefined)\n\n return (\n // The key on the is used to force unmount/remount if\n // initialAddress changes.\n //\n // There is a `enableReinitialize` that provide this functionality\n // (reinitialize the form if `initialValues` changes), but with a caveat :\n // the first render will have the old `initialValues` and then a rerender\n // will be triggered with the new `initalValues`\u00A0and the form cleard. The\n // issue comes from the `PhoneInput` that uses an uncontrolled input with\n // `defaultValue`. So the first value passed when mounting the component\n // will be displayed until the user interact with the input.\n //\n // In our case, the first value passed comes from the old `initialValues`\n // that contain stale informations. This stale information is displayed on\n // the phone input and is not updated when formik rerenders with the fresh\n // information.\n //\n // We use our own ghetto reinitialisation with the `key` that will change if\n // the address changes, forcing a remount of the `` with updated\n // `initialValues`. The first render will be done with the fresh\n // `initialValues` and the phone number will display fresh information.\n \n {\n onSubmit({ primary: values.primary, secondary: values.secondary, ignoreSecondary: values.ignoreSecondary })\n }}\n validationSchema={yup.lazy((value) =>\n yup.object({\n primary: primary.schema,\n secondary: value.ignoreSecondary ? yup.mixed() : secondary?.schema,\n ignoreSecondary: yup.mixed(),\n }),\n )}\n >\n {(formikBag) => {\n // if there were some validation errors after selecting an address in\n // list mode, switch to detail view to fix the errors\n React.useEffect(() => {\n if (!isPrimaryEmpty && Object.keys(formikBag.errors.primary ?? {}).length !== 0) {\n toDetail({\n target: 'primary',\n primary: formikBag.values.primary,\n secondary: formikBag.values.secondary,\n errors: formikBag.errors.primary,\n reason:\n formikBag.errors?.primary?.phone_number !== undefined\n ? t('Your phone number is missing and necessary for the delivery of the rewards of this project')\n : t('Some fields are missing from this address'),\n })\n\n return\n }\n }, [formikBag.submitCount, formikBag.isSubmitting])\n\n React.useEffect(() => {\n if (wrapperRef.current !== null && !formikBag.isValid) {\n wrapperRef.current.scrollIntoView()\n }\n }, [formikBag.submitCount, formikBag.isValid])\n\n return (\n
\n {primary.title}\n\n {callout && {callout}}\n\n {isPrimaryEmpty ? (\n setFound(true)}\n onChange={(address) => formikBag.setFieldValue('primary', address)}\n />\n ) : (\n {\n formikBag.setFieldValue('primary', address)\n setFound(true)\n }}\n onCreate={() =>\n toDetail({\n target: 'primary',\n secondary: formikBag.values.secondary,\n })\n }\n onEdit={(address) =>\n toDetail({\n target: 'primary',\n primary: address,\n secondary: formikBag.values.secondary,\n })\n }\n onRemove={onRemove}\n />\n )}\n\n {secondary && (\n <>\n ) => {\n formikBag.setFieldValue('ignoreSecondary', evt.target.checked)\n }}\n disabled={!found}\n />\n\n {!formikBag.values.ignoreSecondary && (\n <>\n {secondary.title}\n {isSecondaryEmpty ? (\n {}}\n onChange={(address) => formikBag.setFieldValue('secondary', address)}\n />\n ) : (\n {\n formikBag.setFieldValue('secondary', address)\n }}\n onCreate={() =>\n toDetail({\n target: 'secondary',\n primary: formikBag.values.primary,\n })\n }\n onEdit={(address) =>\n toDetail({\n target: 'secondary',\n secondary: address,\n primary: formikBag.values.primary,\n })\n }\n onRemove={onRemove}\n />\n )}\n \n )}\n \n )}\n\n \n {!found ? t('Awaiting address') : t('Continue')}\n \n \n )\n }}\n \n
\n )\n}\n\nconst Center = styled.div`\n text-align: center;\n`\n\nconst Wrapper = styled.div`\n ${plume.Callout} {\n margin: 20px 0 25px;\n }\n\n ${plume.CheckboxField} {\n margin: 28px 0 22px;\n }\n\n ${plume.styles.button.Button} {\n width: 100%;\n }\n\n ${Title}:not(:first-child) {\n margin: 30px 0 16px;\n }\n\n ${Center} {\n margin: 20px 0 0;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { Address } from '@owl-nest/api-client/latest'\nimport { t } from '@owl-nest/localize'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport {\n COLORS,\n Field,\n glyphs,\n Link,\n RadioField,\n RadioGroupField,\n styles as S,\n //@ts-ignore\n} from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nconst Wrapper = styled.div`\n ${Link} {\n margin: 10px 0 25px;\n }\n\n ${RadioField} {\n ${S.field.Title} {\n white-space: pre;\n }\n\n ${S.input.HiddenFocusableInput}:checked + ${Field} {\n ${S.field.Title} {\n color: ${COLORS.PRIMARY_BLACK};\n }\n }\n }\n\n ${RadioGroupField} {\n margin: 20px 0 10px;\n }\n`\n\nconst Actions = styled(S.copy.S)`\n display: flex;\n flex-direction: row;\n\n ${Link} {\n margin: 0 6px;\n }\n`\n\nconst RadioWrapper = styled.div`\n position: relative;\n\n ${Actions} {\n position: absolute;\n z-index: 1;\n bottom: 10px;\n right: 8px;\n }\n`\n\ntype ExistingAddressSubFormProps = {\n addresses: Address<'has_shippings'>[]\n selectedAddress: addressModel.Model\n onChange: (model: addressModel.Model) => void\n onCreate: () => void\n onEdit: (address: Address<'has_shippings'>) => void\n onRemove: (address: Address<'has_shippings'>) => void\n}\n\nexport function ExistingAddressSubForm({\n addresses,\n selectedAddress,\n onChange,\n onCreate,\n onEdit,\n onRemove,\n}: ExistingAddressSubFormProps): React.ReactElement {\n const countries = env.COUNTRIES\n return (\n \n \n {addresses.map((address, index) => {\n const model = address\n return (\n \n {\n onChange(model)\n }}\n />\n \n onEdit(address)}>\n {t('Edit')}\n \n onRemove(address)}>\n {t('Delete')}\n \n \n \n )\n })}\n \n \n \n {t('Add a new address')}\n \n \n \n )\n}\n", "import * as React from 'react'\n\nimport * as services from '@owl-nest/services'\nimport * as api from '@owl-nest/api-client/next'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\n\nimport { AddressManager } from './components/AddressManager'\nimport { useCart } from '../../hooks/useCart'\nimport { Item } from '../../components/Item'\n\ntype DropoffAddressItemProps = {\n user: api.AuthenticatedUser\n countryFilter: string[]\n onContinue: () => void\n}\n\nexport const DropoffAddressItem = React.forwardRef(function DropoffAddressItem(\n { user, countryFilter, onContinue },\n ref,\n) {\n const userAddressService = services.user.address.useAddress(user.id, {\n extraFields: ['has_shippings'],\n fetchOnMount: true,\n })\n\n const userAddresses = userAddressService.response.data?.addresses ?? []\n const addresses = services.user.address.filter(userAddresses, countryFilter)\n\n const cart = useCart()\n\n const selectedAddressInCart = addresses.find(\n (address) => address.id === (cart.addressType === 'shipping' && cart.billingAddress),\n )\n const selectedAddress: addressModel.Model =\n selectedAddressInCart === undefined ? emptyAddress() : selectedAddressInCart\n\n return (\n \n {userAddressService.response.data === undefined ? (\n \n ) : (\n {\n if (cart.addressType === 'shipping' && cart.billingAddress) {\n cart.billingAddress === address.id\n cart.setAddress({ billing: undefined })\n }\n }}\n onChange={({ primary }) => {\n cart.setAddress({ billing: primary.id })\n onContinue()\n }}\n primary={{\n title: t('Billing'),\n countryFilter: countryFilter,\n address: selectedAddress,\n allowCountrySelection: false,\n disableCountry: false,\n phoneRequired: false,\n schema: addressModel.schema(false),\n }}\n />\n )}\n \n )\n\n function emptyAddress() {\n return {\n ...addressModel.empty(),\n first_name:\n cart.addressType === 'shipping' && cart.selectedMondialRelay?.firstName\n ? cart.selectedMondialRelay?.firstName\n : user.first_name ?? '',\n last_name:\n cart.addressType === 'shipping' && cart.selectedMondialRelay?.lastName\n ? cart.selectedMondialRelay?.lastName\n : user.last_name ?? '',\n }\n }\n})\n", "import * as React from 'react'\n\nimport * as services from '@owl-nest/services'\nimport * as api from '@owl-nest/api-client/next'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\n\nimport { AddressManager } from './components/AddressManager'\nimport { useCart } from '../../hooks/useCart'\nimport { Item } from '../../components/Item'\n\ntype ContactAddressItemProps = {\n user: api.AuthenticatedUser\n countryFilter: string[]\n onContinue: () => void\n}\n\nexport const ContactAddressItem = React.forwardRef(function ContactAddressItem(\n { user, countryFilter, onContinue },\n ref,\n) {\n const userAddressService = services.user.address.useAddress(user.id, {\n extraFields: ['has_shippings'],\n fetchOnMount: true,\n })\n\n const userAddresses = userAddressService.response.data?.addresses ?? []\n const addresses = services.user.address.filter(userAddresses, countryFilter)\n\n const cart = useCart()\n\n const selectedAddressInCart = addresses.find(\n (address) => address.id === (cart.addressType === 'shipping' && cart.billingAddress),\n )\n const selectedAddress: addressModel.Model =\n selectedAddressInCart === undefined ? emptyAddress() : selectedAddressInCart\n\n return (\n \n {userAddressService.response.data === undefined ? (\n \n ) : (\n {\n if (cart.addressType === 'shipping' && cart.billingAddress) {\n cart.billingAddress === address.id\n cart.setAddress({ billing: undefined })\n }\n }}\n onChange={({ primary }) => {\n cart.setAddress({ billing: primary.id })\n onContinue()\n }}\n primary={{\n title: t('Contact details'),\n countryFilter: countryFilter,\n address: selectedAddress,\n allowCountrySelection: false,\n disableCountry: false,\n phoneRequired: false,\n schema: addressModel.schema(false),\n }}\n />\n )}\n \n )\n\n function emptyAddress() {\n return {\n ...addressModel.empty(),\n first_name: user.first_name ?? '',\n last_name: user.last_name ?? '',\n }\n }\n})\n", "import * as React from 'react'\n\nimport * as services from '@owl-nest/services'\nimport * as api from '@owl-nest/api-client/next'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\nimport * as yup from '@owl-nest/validators'\nimport { parse, format } from '@owl-nest/date'\n\nimport { AddressManager } from './components/AddressManager'\nimport { useCart } from '../../hooks/useCart'\nimport { Item } from '../../components/Item'\n\ntype HomeDeliveryAddressItemProps = {\n user: api.AuthenticatedUser\n countryFilter: string[]\n phoneRequired: boolean\n onContinue: () => void\n}\n\nexport const HomeDeliveryAddressItem = React.forwardRef(\n function HomeDeliveryAddressItem({ user, countryFilter, onContinue, phoneRequired }, ref) {\n const userAddressService = services.user.address.useAddress(user.id, {\n extraFields: ['has_shippings'],\n fetchOnMount: true,\n })\n\n const addresses = userAddressService.response.data?.addresses ?? []\n\n const cart = useCart()\n\n const selectedShippingAddress = addresses.find(\n (address) => address.id === (cart.addressType === 'shipping' && cart.shippingAddress),\n )\n const selectedBilingAddress = addresses.find(\n (address) => address.id === (cart.addressType === 'shipping' && cart.billingAddress),\n )\n\n return (\n \n {userAddressService.response.data === undefined ? (\n \n ) : (\n {\n if (cart.addressType === 'shipping' && cart.billingAddress) {\n cart.billingAddress === address.id\n cart.setAddress({ billing: undefined })\n }\n }}\n onChange={(value: any) => {\n const delivery = value.primary.id\n const billing =\n value.secondary === undefined\n ? cart.addressType === 'shipping' && cart.billingAddressRequired\n ? delivery\n : undefined\n : value.secondary.id\n cart.setAddress({ delivery, billing })\n onContinue()\n }}\n callout={\n cart.addressType === 'shipping' &&\n t('Estimated delivery date for rewards: %(delivery_dates)s. You can edit your home address later.', {\n delivery_dates: cart.deliveryDates.map(formatDeliveryDate).join(', '),\n })\n }\n primary={{\n title: t('Home delivery'),\n countryFilter: countryFilter,\n address: selectedShippingAddress,\n allowCountrySelection: true,\n disableCountry: true,\n phoneRequired: phoneRequired,\n schema: addressModel.schema(phoneRequired),\n }}\n secondary={{\n title: t('Billing'),\n checkbox: {\n label: t('My billing address is the same as my delivery address'),\n description:\n cart.addressType === 'shipping' &&\n cart.isTax &&\n t('The billing address is used for the tax receipt.'),\n },\n address: selectedBilingAddress,\n allowCountrySelection: false,\n disableCountry: false,\n phoneRequired: false,\n schema: addressModel.schema(false),\n }}\n />\n )}\n \n )\n\n function emptyAddress() {\n return {\n ...addressModel.empty(),\n first_name: user.first_name ?? '',\n last_name: user.last_name ?? '',\n }\n }\n },\n)\n\nfunction formatDeliveryDate(deliveryDate: string): string {\n return format(parse(deliveryDate, 'yyyy-MM', new Date()), 'MMMM yyyy')\n}\n", "import * as React from 'react'\n\nimport * as services from '@owl-nest/services'\nimport * as api from '@owl-nest/api-client/next'\nimport * as addressModel from '@owl-nest/address/src/model'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\n\nimport { AddressManager } from './components/AddressManager'\nimport { useCart } from '../../hooks/useCart'\nimport { Item } from '../../components/Item'\n\ntype MembershipDeliveryAddressItemProps = {\n user: api.AuthenticatedUser\n countryFilter: string[]\n phoneRequired: boolean\n onContinue: () => void\n}\n\nexport const MembershipDeliveryAddressItem = React.forwardRef(\n function MembershipDeliveryAddressItem({ user, countryFilter, onContinue, phoneRequired }, ref) {\n const userAddressService = services.user.address.useAddress(user.id, {\n extraFields: ['has_shippings'],\n fetchOnMount: true,\n })\n\n const addresses = userAddressService.response.data?.addresses ?? []\n\n const cart = useCart()\n\n const selectedShippingAddress = addresses.find(\n (address) => address.id === (cart.addressType === 'shipping' && cart.shippingAddress),\n )\n const selectedBilingAddress = addresses.find(\n (address) => address.id === (cart.addressType === 'shipping' && cart.billingAddress),\n )\n\n return (\n \n {userAddressService.response.data === undefined ? (\n \n ) : (\n {\n if (cart.addressType === 'shipping' && cart.billingAddress) {\n cart.billingAddress === address.id\n cart.setAddress({ billing: undefined })\n }\n }}\n onChange={(value: any) => {\n const delivery = value.primary.id\n const billing =\n value.secondary === undefined\n ? cart.addressType === 'shipping' && cart.billingAddressRequired\n ? delivery\n : undefined\n : value.secondary.id\n cart.setAddress({ delivery, billing })\n onContinue()\n }}\n primary={{\n title: t('Contact details'),\n countryFilter: countryFilter,\n address: selectedShippingAddress,\n allowCountrySelection: true,\n disableCountry: true,\n phoneRequired: phoneRequired,\n schema: addressModel.schema(phoneRequired),\n }}\n secondary={{\n title: t('Billing'),\n checkbox: {\n label: t('My billing address is the same as my delivery address'),\n description:\n cart.addressType === 'shipping' &&\n cart.isTax &&\n t('The billing address is used for the tax receipt.'),\n },\n address: selectedBilingAddress,\n allowCountrySelection: false,\n disableCountry: false,\n phoneRequired: false,\n schema: addressModel.schema(false),\n }}\n />\n )}\n \n )\n\n function emptyAddress() {\n return {\n ...addressModel.empty(),\n first_name: user.first_name ?? '',\n last_name: user.last_name ?? '',\n }\n }\n },\n)\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { BREAKPOINTS, COLORS, styles as S } from '@ulule/owl-kit-components/next'\nimport * as models from '@owl-nest/models'\nimport { message } from '@owl-nest/services'\n\nimport { useProject } from '../hooks/useProject'\nimport { MembershipHero } from './MembershipHero'\nimport { ProgressBar } from './ProgressBar'\nimport { Title } from './Title'\n\ntype LayoutProps = {\n children: React.ReactNode\n progress: number\n}\n\nexport function Layout({ children, progress }: LayoutProps): React.ReactElement {\n const { project } = useProject()\n\n const isMembershipProject = models.project.isMembership(project)\n\n const projectColor = models.project.backgroundColor(project) ?? COLORS.BRAND_INDIGO\n\n const theme = models.project.isMembership(project)\n ? {\n colors: {\n primary: projectColor,\n background: `color-mix(in srgb, ${projectColor} 5%, white);`,\n },\n }\n : undefined\n\n return (\n
\n \n \n {isMembershipProject ? : }\n\n <CheckoutStepWrapper negativeMarginTop={isMembershipProject}>\n <CalloutWrapper>\n <message.Callout contexts={['selection', 'address', 'payment']}>\n <CalloutExtra />\n </message.Callout>\n </CalloutWrapper>\n {children}\n </CheckoutStepWrapper>\n </Main>\n )\n}\n\ntype CalloutExtraProps = { action?: any; message?: any }\n\nfunction CalloutExtra({ action, message }: CalloutExtraProps): React.ReactElement | null {\n if (!message) return null\n\n return (\n <CalloutExtraWrapper>\n <S.copy.M>{message}</S.copy.M>\n {action && <S.button.CallToAction>{action.label}</S.button.CallToAction>}\n </CalloutExtraWrapper>\n )\n}\n\nconst Main = styled.div<{ theme: any }>`\n padding-bottom: 25px;\n background-color: ${({ theme }) => theme?.colors?.background ?? COLORS.PRIMARY_SAND_100};\n min-height: calc(100vh - 85px);\n`\n\nconst CheckoutStepWrapper = styled.section<{ negativeMarginTop: boolean }>`\n position: relative;\n\n @media screen and ${BREAKPOINTS.TABLET} {\n margin-top: ${({ negativeMarginTop }) => {\n return negativeMarginTop ? '-25px' : '90px'\n }};\n }\n`\n\nconst FixedBanner = styled(message.Banner)``\n\nconst CalloutWrapper = styled.section`\n margin-bottom: 10px;\n width: 100%;\n\n &:empty {\n display: none;\n }\n\n @media screen and ${BREAKPOINTS.TABLET} {\n width: 590px;\n margin: 0 auto 24px;\n }\n`\n\nconst CalloutExtraWrapper = styled.div`\n background-color: ${COLORS.PRIMARY_GREY_000};\n padding: 10px;\n\n @media screen and ${BREAKPOINTS.MOBILE_M} {\n padding: 20px;\n }\n\n @media screen and ${BREAKPOINTS.TABLET} {\n padding: 25px 33px;\n }\n`\n", "import * as React from 'react'\nimport styled, { css, ThemeProvider } from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as duvet from '@ulule/duvet'\nimport * as env from '@owl-nest/config'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as models from '@owl-nest/models'\n\ntype MembershipHeroProps = {\n project: api.Project\n}\n\ntype Theme = {\n colors: {\n accent: string\n background: string\n hover: string\n primary: string\n }\n}\n\nexport function MembershipHero({ project }: MembershipHeroProps): React.ReactElement {\n const mainImage = models.project.mainImage(project, 'full')\n\n const projectColor = models.project.backgroundColor(project) ?? plume.COLORS.BRAND_INDIGO\n const theme: Theme = {\n colors: {\n accent: `color-mix(in srgb, ${projectColor} 20%, white);`,\n background: `color-mix(in srgb, ${projectColor} 10%, white);`,\n hover: `color-mix(in srgb, ${projectColor} 70%, black);`,\n primary: projectColor,\n },\n }\n const userConfig = env.useUserEnv()\n\n return (\n <ThemeProvider theme={theme}>\n <Wrapper>\n <User>\n <plume.Link href={project.absolute_url}>\n <plume.styles.image.Avatar\n src={models.project.avatarImage(project, userConfig.lang, '40x40') ?? ''}\n type=\"medium\"\n />\n <plume.styles.heading.XXXS asDesktop=\"M\">{models.project.name(project)}</plume.styles.heading.XXXS>\n </plume.Link>\n </User>\n <Banner backgroundImage={mainImage} />\n </Wrapper>\n </ThemeProvider>\n )\n}\n\nconst Banner = styled.div<{ backgroundImage?: string }>`\n height: 166px;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ${plume.ZINDEX.NEUTRAL};\n\n ${({ backgroundImage, theme }) => {\n if (backgroundImage) {\n return css`\n background-image: url('${backgroundImage}');\n background-position: center;\n background-size: cover;\n\n ${plume.styles.heading.Base} {\n color: ${plume.COLORS.PRIMARY_GREY_000};\n }\n\n &::before {\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 120%);\n content: '';\n display: block;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n `\n } else {\n return css`\n background-image: url('${plume.utils.svg.toDataUrl(duvet.MembershipDefaultBanner, { theme })}');\n `\n }\n }};\n`\n\nconst Wrapper = styled.div`\n background-position: center;\n background-size: cover;\n overflow: hidden;\n position: relative;\n width: 100%;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n height: 166px;\n }\n`\n\nconst User = styled.div`\n position: relative;\n z-index: ${plume.ZINDEX.ABOVE};\n display: flex;\n align-items: center;\n width: fit-content;\n margin: auto;\n padding: 24px 0;\n\n ${plume.Link} {\n display: flex;\n align-items: center;\n height: fit-content;\n }\n\n ${plume.styles.image.Avatar} {\n margin-right: 15px;\n }\n\n ${plume.styles.heading.XXXS} {\n color: ${plume.COLORS.PRIMARY_GREY_000};\n }\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n height: 100%;\n padding: 0;\n }\n`\n", "import React from 'react'\nimport PropTypes from 'prop-types'\nimport styled from 'styled-components'\n\nimport { COLORS } from '@ulule/owl-kit-components/next'\n\nexport const ProgressBarStyled = styled.div`\n height: 3px;\n width: 100%;\n background-color: ${COLORS.GREY_SHADE_5};\n position: fixed;\n top: 57px;\n left: 0px;\n z-index: 5;\n\n &::after {\n content: '';\n display: block;\n width: ${(props) => props.percent}%;\n height: 3px;\n background-color: ${COLORS.PRIMARY_BLUE};\n transition: 0.3s ease;\n }\n`\n\nexport const ProgressBar = ({ percent }) => {\n return <ProgressBarStyled percent={percent} />\n}\n\nProgressBar.propTypes = {\n percent: PropTypes.number.isRequired,\n}\n", "import * as React from 'react'\nimport * as PropTypes from 'prop-types'\nimport styled from 'styled-components'\n\nimport * as model from '@owl-nest/models'\nimport { usePartnershipTracker } from '@owl-nest/shadow'\nimport { BREAKPOINTS, COLORS, Link, styles as S } from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\n\nimport { CenterWrapper } from '../style'\n\nconst TitleWrapper = styled.div`\n padding-top: 25px;\n padding-bottom: 25px;\n background-image: url(${(props) => (props.backgroundImage ? props.backgroundImage : '')});\n background-color: ${(props) => (props.backgroundColor ? props.backgroundColor : '')};\n background-size: cover;\n background-position: center;\n position: relative;\n\n ${S.heading.XXXS} {\n color: ${(props) => (props.backgroundImage ? COLORS.PRIMARY_WHITE : COLORS.PRIMARY_BLACK)};\n }\n\n ${S.heading.S} {\n text-align: center;\n }\n\n &::before {\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 120%);\n content: '';\n display: ${(props) => (props.backgroundImage ? 'block' : 'none')};\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n @media screen and ${BREAKPOINTS.TABLET} {\n height: 215px;\n margin-bottom: -126px;\n padding-top: 30px;\n position: relative;\n padding-bottom: 0px;\n\n &::before {\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);\n }\n }\n`\n\nconst Content = styled(CenterWrapper)`\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n`\n\nconst Owner = styled.div`\n display: flex;\n align-items: center;\n margin-top: 7px;\n`\n\nconst OwnerLogo = styled(S.image.Avatar)`\n margin-right: 10px;\n`\n\nconst PartnershipBanner = styled.img`\n position: absolute;\n right: 0;\n top: 0;\n width: 120px;\n`\n\nexport const Title = ({ project }) => {\n const ribbonRef = React.useRef(null)\n const userConfig = env.useUserEnv()\n const userLocale = userConfig.lang\n const owner = project.owner\n const projectHasBackgroundImage = Boolean(project.background_image?.[userLocale]?.url)\n const ribbon = project.partnerships && model.project.getRibbonData(project)\n\n usePartnershipTracker(ribbon && ribbon.partnerOwnerId, ribbonRef, {\n click: {\n enabled: false,\n },\n impression: {\n enabled: true,\n once: true,\n },\n })\n\n return (\n <>\n {owner && project && (\n <TitleWrapper\n backgroundColor={project.background_color?.[userLocale]}\n backgroundImage={project.background_image?.[userLocale]?.url}\n >\n {ribbon && <PartnershipBanner ref={ribbonRef} src={ribbon.ribbonImage} />}\n <Content>\n <S.heading.S>\n <Link\n href={project.absolute_url}\n kind={projectHasBackgroundImage ? 'inverted' : 'primary'}\n target=\"_blank\"\n rel=\"nooponer noreferrer\"\n >\n {model.project.name(project)}\n </Link>\n </S.heading.S>\n <Owner>\n <OwnerLogo border src={model.user.avatar(project.owner, '40x40')} size={36} />\n <S.heading.XXXS>{model.user.username(project.owner)}</S.heading.XXXS>\n </Owner>\n </Content>\n </TitleWrapper>\n )}\n </>\n )\n}\n\nTitle.propTypes = {\n project: PropTypes.shape({\n absolute_url: PropTypes.string,\n background_color: PropTypes.shape({}),\n background_image: PropTypes.shape({}),\n lang: PropTypes.string,\n owner: PropTypes.shape({\n avatar: PropTypes.shape({\n 40: PropTypes.string,\n }),\n username: PropTypes.string,\n }),\n partnerships: PropTypes.array,\n }),\n}\n", "import * as React from 'react'\nimport styled, { ThemeProvider, css } from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { t, tf } from '@owl-nest/localize'\nimport * as tip from '@owl-nest/tip'\nimport * as models from '@owl-nest/models'\n\nimport { useNavigation } from '../../hooks/useNavigation'\n\nimport { Item } from '../../components/Item'\nimport { FutureItem } from '../../components/FutureItem'\nimport { useCart } from '../../hooks/useCart'\nimport { useProject } from '../../hooks/useProject'\n\ntype DonationViewProps = {\n preFilledTip?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n }\n}\n\ntype Theme = {\n colors: {\n accent: string\n background: string\n hover: string\n primary: string\n }\n}\n\nexport function DonationView({ preFilledTip }: DonationViewProps): React.ReactElement<DonationViewProps> {\n const navigation = useNavigation()\n const cart = useCart()\n\n const { project } = useProject()\n\n const isDonationBasedProject = models.project.isDonationBased(project)\n const allowedFrequency = models.project.allowedDonationFrequency(project)\n\n const hasContactStep = cart.addressType === 'contact'\n\n const projectColor = models.project.backgroundColor(project) ?? plume.COLORS.BRAND_INDIGO\n const theme: Theme = {\n colors: {\n accent: `color-mix(in srgb, ${projectColor} 20%, white);`,\n background: `color-mix(in srgb, ${projectColor} 10%, white);`,\n hover: `color-mix(in srgb, ${projectColor} 70%, black);`,\n primary: projectColor,\n },\n }\n\n return (\n <>\n <ThemeProvider theme={models.project.isMembership(project) ? theme : {}}>\n <div className=\"tip-view-tip-component\">\n {/* // FIXME: when we pass styled component to v6\n we have to refacto tip to include directly the title in it */}\n <Item\n title={\n isDonationBasedProject ? (\n <>\n {allowedFrequency === 'all' ? (\n <span className=\"tip-title-tip-component\">{t('Donate')}</span>\n ) : (\n t('Donate')\n )}\n </>\n ) : (\n t('Support with a donation')\n )\n }\n >\n <tip.Tip\n frequency={cart.tip.frequency}\n handleFormSubmit={(tipForm: { frequency?: string; donation: number; inputValue?: string }) => {\n const newTip =\n tipForm.inputValue !== '' && tipForm.inputValue !== undefined\n ? Number(tipForm.inputValue)\n : tipForm.donation\n cart.setDonation(newTip, tipForm.frequency as any)\n navigation.navigate(navigation.nextLegalPage)\n }}\n preFilledTip={preFilledTip}\n project={project}\n withDisclaimer\n withPresets\n callout={\n <>\n {models.project.isMembership(project) ? (\n <Callout type=\"info\">\n {t(\n 'This donation does not give you access to paid posts. If you wish to have access to paid posts, you must subscribe.',\n )}\n </Callout>\n ) : undefined}\n </>\n }\n />\n </Item>\n </div>\n </ThemeProvider>\n <FutureItem title={t('Login')} />\n {hasContactStep && <FutureItem title={t('Contact details')} />}\n <FutureItem title={t('Payment')} />\n {project && <tip.TaxDeductionModal project={project} />}\n </>\n )\n}\n\nconst Callout = styled(plume.Callout)`\n margin-top: 16px;\n\n ${plume.Callout} {\n ${({ theme }) => {\n if (theme?.colors !== undefined) {\n return css`\n background-color: ${theme?.colors?.background};\n\n ${plume.glyphs.Icon} {\n color: ${theme?.colors?.primary};\n }\n `\n }\n }}\n }\n`\n", "import * as React from 'react'\n\nimport { t } from '@owl-nest/localize'\nimport * as services from '@owl-nest/services'\nimport { Spinner } from '@ulule/owl-kit-components/next'\n\nimport { useNavigation, PAGES } from '../../hooks/useNavigation'\nimport { scrollToCurrentItem } from '../../utils/scrollTo'\n\nimport { FutureItem } from '../../components/FutureItem'\nimport { Item } from '../../components/Item'\nimport { CartSummary } from '../../components/selection'\nimport { useCart } from '../../hooks/useCart'\nimport { Connect } from '@owl-nest/connect'\n\nexport function LoginView(): React.ReactElement {\n const navigation = useNavigation()\n const refLogin = React.useRef(null)\n React.useEffect(() => {\n scrollToCurrentItem(refLogin.current)\n }, [])\n\n const auth = services.user.useAuth()\n\n const cart = useCart()\n const onlyTip = cart.tip.amount > 0 && cart.products.length === 0\n const hasPickupStep = cart.addressType === 'shipping' && cart.selectedShippingMode === 'pickup_point'\n\n return (\n <>\n <Item\n title={!onlyTip ? t('Your selection') : undefined}\n action={\n !onlyTip\n ? {\n handler: () => {\n navigation.navigate(PAGES.SELECTION)\n },\n text: t('Edit'),\n }\n : undefined\n }\n >\n <CartSummary\n onModify={() => {\n navigation.navigate(PAGES.SELECTION, { forceStep: true })\n }}\n />\n </Item>\n <Item ref={refLogin} title={auth.type === 'known' ? t('Welcome back') : t('Login')}>\n <React.Suspense fallback={<Spinner />}>\n <Connect />\n </React.Suspense>\n </Item>\n {hasPickupStep && <FutureItem title={t('Pick-up locations')} />}\n {cart.addressType === 'contact' && <FutureItem title={t('Contact details')} />}\n {cart.addressType === 'shipping' && cart.selectedShippingMode === 'home_delivery' && (\n <FutureItem title={t('Home delivery')} />\n )}\n <FutureItem title={t('Payment')} />\n </>\n )\n}\n", "import * as React from 'react'\n\nimport { t } from '@owl-nest/localize'\nimport * as services from '@owl-nest/services'\nimport { Spinner } from '@ulule/owl-kit-components/next'\n\nimport { PAGES, useNavigation } from '../../hooks/useNavigation'\nimport { scrollToCurrentItem } from '../../utils/scrollTo'\nimport { Item } from '../../components/Item'\nimport { CartSummary } from '../../components/selection'\nimport { IdentityItem } from '../../components/IdentityItem'\nimport { PickupItem, ContactItem, AddressItem, BillingAddress, MondialRelayItem } from '../../components/ShippingItem'\nimport { useCart } from '../../hooks/useCart'\nimport { PaymentSection } from './PaymentSection'\n\nexport function PaymentView(): React.ReactElement<unknown> | null {\n const paymentBoxRef = React.useRef(null)\n const shippingBoxRef = React.useRef(null)\n\n const cart = useCart()\n const navigation = useNavigation()\n\n const cartHasTipOnly = cart.products.length === 0 && cart.tip.amount > 0\n\n React.useEffect(() => {\n if (\n cart.addressType === 'shipping' &&\n (cart.selectedShippingMode === 'pickup_point' || cart.billingAddress || cart.shippingAddress)\n ) {\n if (shippingBoxRef.current) {\n scrollToCurrentItem(shippingBoxRef.current)\n }\n } else {\n scrollToCurrentItem(paymentBoxRef.current)\n }\n }, [shippingBoxRef.current])\n\n const auth = services.user.useAuth()\n\n const hasAddressStep =\n (cart.addressType === 'shipping' && cart.selectedShippingMode === 'home_delivery') ||\n cart.addressType === 'soft-shipping'\n const hasPickupStep = cart.addressType === 'shipping' && cart.selectedShippingMode === 'pickup_point'\n const hasMondialRelayStep = cart.addressType === 'shipping' && cart.selectedShippingMode === 'mondial_relay'\n const hasContactStep = cart.addressType === 'contact'\n\n return (\n <>\n <Item\n title={!cartHasTipOnly ? t('Your selection') : undefined}\n action={\n !cartHasTipOnly\n ? {\n handler: () => {\n navigation.navigate(PAGES.SELECTION)\n },\n text: t('Edit'),\n }\n : undefined\n }\n >\n <CartSummary\n onModify={() => {\n navigation.navigate(PAGES.SELECTION, { forceStep: true })\n }}\n />\n </Item>\n\n <IdentityItem />\n\n {hasPickupStep && (\n <PickupItem\n ref={shippingBoxRef}\n goToAddress={() => {\n navigation.navigate(PAGES.ADDRESS)\n }}\n goToPickup={() => {\n navigation.navigate(PAGES.PICKUP)\n }}\n />\n )}\n\n {hasMondialRelayStep && (\n <MondialRelayItem\n ref={shippingBoxRef}\n goToAddress={() => {\n navigation.navigate(PAGES.ADDRESS)\n }}\n goToPickup={() => {\n navigation.navigate(PAGES.PICKUP)\n }}\n />\n )}\n\n {hasContactStep && (\n <ContactItem\n ref={shippingBoxRef}\n goToAddress={() => {\n navigation.navigate(PAGES.ADDRESS)\n }}\n goToPickup={() => {\n navigation.navigate(PAGES.PICKUP)\n }}\n />\n )}\n\n {(hasPickupStep || hasMondialRelayStep) && (\n <BillingAddress\n ref={shippingBoxRef}\n goToAddress={() => {\n navigation.navigate(PAGES.ADDRESS)\n }}\n goToPickup={() => {\n if (hasPickupStep) {\n navigation.navigate(PAGES.PICKUP)\n }\n if (hasMondialRelayStep) {\n navigation.navigate(PAGES.MONDIAL_RELAY)\n }\n }}\n />\n )}\n\n {hasAddressStep && (\n <AddressItem\n ref={shippingBoxRef}\n goToAddress={() => {\n navigation.navigate(PAGES.ADDRESS)\n }}\n goToPickup={() => {\n navigation.navigate(PAGES.PICKUP)\n }}\n />\n )}\n\n <Item ref={paymentBoxRef} title={t('Payment')}>\n <React.Suspense fallback={<Spinner />}>\n {auth.type !== 'loggedin' ? <Spinner /> : <PaymentSection />}\n </React.Suspense>\n </Item>\n </>\n )\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as api from '@owl-nest/api-client/latest'\nimport { tc, t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as logger from '@owl-nest/logger'\nimport * as services from '@owl-nest/services'\nimport * as hooks from '@owl-nest/hooks'\nimport * as shadow from '@owl-nest/shadow'\nimport { COLORS, Spinner, styles as S } from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nimport { useOrderError } from './hooks/useOrderError'\nimport { usePayment } from './hooks/usePayment'\nimport * as projectModel from '../../models/project'\nimport { hasCompletedProfile, isPersonalIdRequired } from '../../models/user'\nimport * as UFE from '../../utils/UFE'\n\nimport * as AppStyle from '../../style'\nimport { ModalIncompleteProfile } from './components/ModalIncompleteProfile'\nimport { MoneyDisplayer } from '../../components/money'\nimport { PaymentDisclaimers } from '../../components/Payment/PaymentDisclaimers'\nimport { PaymentMethodView, SecondaryPaymentMethodView } from '../../components/Payment/PaymentMethod'\nimport { useCart, Cart } from '../../hooks/useCart'\nimport { useProject } from '../../hooks/useProject'\n\n// TODO: Always show 'Check' payment for staff (as per existing behavior)\nexport function PaymentSection(): React.ReactElement<unknown> {\n const [activeMethod, setActiveMethod] = React.useState(null)\n\n const cart = useCart()\n const { project } = useProject()\n\n const totalCost = cart.total\n const orderPayload = getOrderPayload(cart, project)\n\n const tracking = shadow.useTracking()\n\n const primaryPaymentMethod = models.project.getPrimaryPaymentMethod(project, UFE.FLAGS.paypal_enabled)\n const secondaryPaymentMethods = models.project\n .getSecondaryPaymentMethods(project, UFE.FLAGS.paypal_enabled)\n .reduce((accumulator: any, method: any, index: number) => {\n if (method.id === 'bankwire' && totalCost < 400) {\n return accumulator\n }\n if (method.id === 'paypal' && !UFE.FLAGS.paypal_enabled) {\n return accumulator\n }\n if (method.id === 'check') {\n return accumulator\n }\n accumulator.push(method)\n return accumulator\n }, [])\n\n const { createPayment, createMonthlyPayment, paymentState } = usePayment(project.id)\n useOrderError(paymentState.status, paymentState.failure, orderPayload)\n\n React.useEffect(() => {\n if (paymentState.status === hooks.QueryStatus.SUCCESS && paymentState.paymentUrl) {\n tracking.ecommerce.track('add_payment_info', {\n value: cart.subTotal,\n currency: project.currency,\n payment_type: paymentState.paymentMethod ?? '',\n items: [\n ...cart.products.map((product) => ({\n item_id: String(product.reward.id),\n item_name: models.reward.title(product.reward) ?? '',\n item_brand: models.project.name(project),\n item_variant: product.variant && String(product.variant.id),\n price: product.reward.price,\n quantity: product.quantity,\n })),\n ...(cart.tip.amount !== 0\n ? [\n {\n item_id: 'tip',\n item_name: 'tip',\n item_brand: models.project.name(project),\n price: cart.tip.amount,\n quantity: 1,\n },\n ]\n : []),\n ],\n })\n // Usually kolkt redirects the user to the endfunnel with a query param\n // ?order_id=XXX. But in some odd cases the device of the user strips the\n // query param before arriving to the endfunnel. The endfunnel has no\n // order_id to verify the status of the order, and the user is stuck on a\n // never ending loop in the processing step of the endfunnel. For those\n // rare cases, we save the id of the newly created order in local storage.\n // That way, when arriving on the endfunnel, if the query param is absent\n // we can rely on the localstorage to rebuild the correct url.\n if (paymentState.id) {\n localStorage.setItem(`endfunnel_${project.id}_order`, String(paymentState.id))\n }\n window.location.href = paymentState.paymentUrl\n } else if (!paymentState.paymentUrl) {\n // logger.err('Received payment data w/o payment URL', {\n // paymentState,\n // project,\n // })\n }\n }, [paymentState.status])\n\n const user = services.user.useAuthenticatedUser()\n const config = env.useUserEnv()\n\n const projectCurrencyCode = project.currency\n const userCountry = env.USER_COUNTRY\n const userCurrencyCode = config.currency\n\n if (user === undefined) {\n return <></>\n }\n\n const isPersonalIdNumberRequired = isPersonalIdRequired(\n user,\n projectModel.isPersonalIdNumberRequired(project),\n cart.addressType === 'shipping' ? cart.selectedCountry?.code : undefined,\n userCountry,\n )\n const userIsCompleted = hasCompletedProfile(user, isPersonalIdNumberRequired)\n\n const isMembership = models.project.isMembership(project)\n\n return (\n <>\n {!userIsCompleted && (\n <ModalIncompleteProfile\n userIsCompleted={userIsCompleted}\n user={user}\n isPersonalIdNumberRequired={isPersonalIdNumberRequired}\n />\n )}\n <PaymentSectionWrapper>\n {/* Note: Success state means redirection to Kolkt is ongoing,\n ** we want to express that through the loading state. */}\n {paymentState.status === hooks.QueryStatus.PENDING ||\n (paymentState.status === hooks.QueryStatus.SUCCESS && (\n <AppStyle.LoadingCard>\n <Spinner />\n </AppStyle.LoadingCard>\n ))}\n\n <PaymentMethodView\n conversion={{\n sourceAmount: totalCost,\n sourceCurrency: projectCurrencyCode,\n targetCurrency: userCurrencyCode || projectCurrencyCode,\n }}\n ctaText={\n cart.tip.frequency === 'monthly'\n ? tc('Pay [amount] / month', {\n amount: <MoneyDisplayer amount={totalCost} />,\n })\n : tc(isMembership && !cart.tip ? 'Pay [amount] / month' : 'Pay [amount]', {\n amount: <MoneyDisplayer amount={totalCost} />,\n })\n }\n onCtaClick={() => pay(cart, primaryPaymentMethod.id as api.PaymentMethod)}\n paymentMethod={primaryPaymentMethod}\n />\n\n {!!secondaryPaymentMethods.length && (\n <>\n <OrSeparation>\n <S.copy.S>{t('or')}</S.copy.S>\n </OrSeparation>\n <SecondaryPaymentMethodList>\n {/* TODO: define `method` */}\n {secondaryPaymentMethods.map((method: any, index: number) => {\n return (\n <SecondaryPaymentMethodView\n key={index}\n activeMethod={activeMethod}\n paymentMethod={method}\n onCtaClick={() => pay(cart, method.id)}\n ctaText={t('Pay with %(method)s', { method: method.name })}\n onMethodClick={() => setActiveMethod(activeMethod === method.id ? null : method.id)}\n />\n )\n })}\n </SecondaryPaymentMethodList>\n </>\n )}\n\n <PaymentDisclaimers />\n </PaymentSectionWrapper>\n </>\n )\n\n async function pay(cart: Cart, paymentMethod: api.PaymentMethod): Promise<void> {\n if (cart.tip.frequency === 'monthly') {\n const payload = getSubscriptionPayload(cart, project)\n return await createMonthlyPayment({\n ...payload,\n payment_method: paymentMethod,\n })\n } else if (project.type === api.ProjectType.Membership && cart.products.length !== 0) {\n const payload = getMembershipSubscriptionPayload(cart, project)\n return await createMonthlyPayment({\n ...payload,\n payment_method: paymentMethod,\n })\n }\n\n try {\n await createPayment({\n ...orderPayload,\n country: undefined,\n return_url: endFunnelUrl(project),\n payment_method: paymentMethod,\n } as any)\n } catch (exception) {\n logger.err(\"[checkout] Couldn't proceed to payment\", {\n exception,\n orderPayload,\n })\n }\n }\n}\n\nfunction getOrderPayload(cart: Cart, project: api.Project): Omit<api.CreateOrder, 'payment_method'> {\n const trackingCookie = UFE.TRACKING\n let trackingJSON\n if (trackingCookie) {\n try {\n trackingJSON = JSON.parse(trackingCookie)\n } catch (exception) {\n logger.err('Failed to parse order tracking cookie', {\n exception,\n trackingCookie,\n })\n }\n }\n\n return {\n ...cart.getPayload(),\n return_url: endFunnelUrl(project),\n ...(trackingJSON && { tracking: trackingJSON }),\n }\n}\n\nfunction getSubscriptionPayload(cart: Cart, project: api.Project): Omit<api.CreateSubscription, 'payment_method'> {\n const payload = cart.getPayload()\n\n // FIXME: Payload is missing `tracking` property on API side\n return {\n billing_address_id: payload.billing_address_id,\n return_url: endFunnelUrl(project),\n total: payload.tip ?? 0,\n }\n}\n\nfunction getMembershipSubscriptionPayload(\n cart: Cart,\n project: api.Project,\n): Omit<api.CreateSubscription, 'payment_method'> {\n const payload = cart.getPayload()\n\n const endfunnelURL = new URL(endFunnelUrl(project), window.location.href)\n const returnURL = new URLSearchParams(location.search).get('return_url')\n if (returnURL) {\n endfunnelURL.searchParams.set('return_url', returnURL)\n }\n\n // FIXME: Payload is missing `tracking` property on API side\n return {\n reward_id: cart.products[0].id,\n shipping_address_id: payload.shipping_address_id,\n billing_address_id: payload.billing_address_id,\n return_url: endfunnelURL.toString(),\n }\n}\n\nfunction endFunnelUrl(project: api.Project) {\n return new URL(`/projects/${project.id}/checkout/endfunnel/done/`, window.location.href).href\n}\n\n// GLOBAL LAYOUT\nexport const PaymentSectionWrapper = styled.section`\n position: relative;\n`\n\n// SECONDARY PAYMENT METHODS\nconst OrSeparation = styled.span`\n align-items: center;\n display: flex;\n justify-content: center;\n padding: 20px;\n\n ${S.copy.S} {\n color: ${COLORS.GREY_SHADE_3};\n }\n`\n\nconst SecondaryPaymentMethodList = styled.ul`\n margin: 0 0 20px;\n padding: 0;\n`\n", "import * as React from 'react'\n\nimport { RequestFailure } from '@owl-nest/api-client'\nimport { ApiError, CreateOrder } from '@owl-nest/api-client/latest'\nimport { t, tn } from '@owl-nest/localize'\nimport * as logger from '@owl-nest/logger'\nimport * as hooks from '@owl-nest/hooks'\nimport * as services from '@owl-nest/services'\n\nimport { PAGES, useNavigation } from '../../../hooks/useNavigation'\nimport * as productModel from '../../../models/product'\nimport * as errorUtils from '../../../utils/error'\nimport * as productUtils from '../../../utils/product'\nimport { useProject } from '../../../hooks/useProject'\nimport { useCart } from '../../../hooks/useCart'\n\n// TODO: List and eventually display more possible API errors\nexport function useOrderError(\n status: hooks.QueryStatus,\n failure?: RequestFailure,\n orderPayload?: Omit<CreateOrder, 'payment_method'>,\n): void {\n const apiErrors = failure?.body as ApiError\n\n const dispatch = services.message.useDispatch()\n const cart = useCart()\n const { project, refreshRewards } = useProject()\n const [refreshRewardDone, setRefreshRewardDone] = React.useState(false)\n const navigation = useNavigation()\n\n const productsInCart = cart.products\n const preSerializedProducts = React.useMemo(() => productUtils.preSerialize(productsInCart), [productsInCart])\n\n React.useEffect(() => {\n if (status === hooks.QueryStatus.FAILURE) {\n if (!Array.isArray) return genericError()\n\n const valueErrors =\n apiErrors && Array.isArray(apiErrors) ? apiErrors.filter((error) => error.classification === 'ValueError') : []\n\n if (valueErrors.length === 0) {\n logger.err(`Failed to create order \u2014 Code ${failure?.status}`, {\n errors: apiErrors,\n payload: orderPayload,\n })\n return genericError()\n }\n\n if (failure && Array.isArray(failure.body)) {\n for (const item of failure.body) {\n if ('fieldNames' in item && Array.isArray(item.fieldNames)) {\n if (item.fieldNames.includes('shipping_address') || item.fieldNames.includes('shipping_address_id')) {\n navigation.navigate(PAGES.ADDRESS)\n }\n }\n }\n }\n\n refreshRewards().then(() => {\n setRefreshRewardDone(true)\n })\n }\n }, [status])\n\n React.useEffect(() => {\n if (refreshRewardDone) {\n const [_, limitedProducts, expiredProducts] = productUtils.getProductsFromSavedIds(preSerializedProducts, project)\n\n if (expiredProducts.length === 0 && limitedProducts.length === 0) {\n logger.err(`Failed to create order - Code ${failure?.status}`, { errors: apiErrors, payload: orderPayload })\n return genericError()\n }\n\n if (limitedProducts.length > 0) {\n return unavailableQuantityError(limitedProducts)\n }\n\n if (expiredProducts.length === preSerializedProducts.length && cart.tip.amount === 0) {\n return allSelectedProductsAreExpiredError()\n }\n\n someSelectedProductsAreExpiredError(expiredProducts)\n }\n }, [project, refreshRewardDone])\n\n const BASE_ERROR = { context: 'payment', focus: true }\n\n function allSelectedProductsAreExpiredError(): void {\n dispatch(\n services.message.error(\n tn('Reward out of stock!', 'Rewards out of stock!', productsInCart.length),\n errorUtils.allSelectedProductsAreExpiredError('selection', productsInCart.length),\n ),\n )\n cart.resetProducts()\n navigation.navigate(PAGES.SELECTION, { replace: true })\n }\n\n function genericError(): void {\n dispatch(\n services.message.error(\n t('Oops... An error has occurred while processing your order. Please check your selection before trying again'),\n { ...BASE_ERROR },\n ),\n )\n }\n\n function someSelectedProductsAreExpiredError(expiredProducts: productModel.Product[]): void {\n dispatch(\n services.message.error(\n tn('Reward out of stock!', 'Rewards out of stock!', expiredProducts.length),\n errorUtils.someSelectedProductsAreExpiredError('payment', expiredProducts, () => {\n navigation.navigate(PAGES.SELECTION)\n }),\n ),\n )\n\n cart.setProducts(expiredProducts.map((product) => ({ id: product.id, quantity: 0 })))\n }\n\n function unavailableQuantityError(limitedProducts: productModel.Product[]): void {\n dispatch(\n services.message.error(\n t('Unavailable quantity'),\n errorUtils.unavailableQuantityError('selection', limitedProducts),\n ),\n )\n cart.setProducts(\n limitedProducts.map((product) => ({\n id: product.id,\n quantity: productModel.stock(product).available ?? 0,\n })),\n { createIfNotFound: true },\n )\n\n navigation.navigate(PAGES.SELECTION, { replace: true })\n }\n}\n", "import * as React from 'react'\n\nimport * as api from '@owl-nest/api-client/latest'\nimport * as services from '@owl-nest/services'\nimport { QueryStatus } from '@owl-nest/hooks'\n\ntype PaymentState = {\n failure?: api.RequestFailure\n paymentUrl?: string\n paymentMethod?: api.PaymentMethod\n status: QueryStatus\n} & (\n | {\n status: QueryStatus.FAILURE | QueryStatus.PENDING | QueryStatus.PRISTINE\n }\n | {\n status: QueryStatus.SUCCESS\n id: number\n }\n)\n\ntype UsePayment = {\n createPayment: (payload: api.CreateOrder) => Promise<void>\n createMonthlyPayment: (payload: api.CreateSubscription) => Promise<void>\n paymentState: PaymentState\n}\n\nexport function usePayment(projectId: number): UsePayment {\n const [paymentState, setState] = React.useState<PaymentState>({\n status: QueryStatus.PRISTINE,\n })\n\n async function createPayment(payload: api.CreateOrder): Promise<void> {\n const response = await services.order.create(projectId, payload)\n\n response\n .next((order) => {\n setState({\n // TODO: failure\n paymentUrl: order.payment_url,\n status: QueryStatus.SUCCESS,\n id: order.id,\n paymentMethod: order.payment_method,\n })\n })\n .doThrow()\n }\n\n async function createMonthlyPayment(payload: api.CreateSubscription): Promise<void> {\n const response = await services.subscription.create(projectId, payload)\n\n response.next((subscription) => {\n setState({\n // TODO: failure\n paymentUrl: subscription.payment_url,\n status: QueryStatus.SUCCESS,\n id: subscription.id,\n paymentMethod: subscription.payment_method,\n })\n })\n }\n\n return { createPayment, createMonthlyPayment, paymentState }\n}\n", "import { Project } from '@owl-nest/api-client/latest'\n\nexport function isPersonalIdNumberRequired(project: Project): boolean {\n return project.required_personal_id_number === true\n}\n", "import * as yup from 'yup'\nimport { t } from '@owl-nest/localize'\nimport { AuthenticatedUser } from '@owl-nest/api-client/latest'\n\nexport const userSchema = (user: AuthenticatedUser, isPersonalIdRequired: boolean): object => {\n return yup.object({\n email: user.email ? yup.mixed() : yup.string().email().required(t('This field is required')),\n personal_id_number: !isPersonalIdRequired\n ? yup.mixed()\n : yup\n .string()\n .matches(\n /^([a-z0-9]{16}|[0-9]{11})$/i,\n t(\n 'Italian fiscal code is either 16 caracters for natural persons or 11 caracters for legal persons. Please enter a valid fiscal code.',\n ),\n )\n .required(t('This field is required')),\n })\n}\n\n/**\n * @param user\n * @return boolean\n */\nexport function hasCompletedProfile(user: AuthenticatedUser, isPersonalIdRequired: boolean): boolean {\n const { email } = user\n\n if (!email) {\n return false\n }\n\n if (isPersonalIdRequired) {\n return false\n }\n\n return true\n}\n\nexport function isPersonalIdRequired(\n user: AuthenticatedUser,\n requirePersonalIdNumber: boolean,\n shippingCountry: string | undefined,\n userCountry: string,\n): boolean {\n const { personal_id_number: personalIdNumber } = user\n\n return requirePersonalIdNumber && !personalIdNumber && (userCountry === 'IT' || shippingCountry === 'IT')\n}\n", "import * as React from 'react'\nimport { Formik, Form } from 'formik'\nimport styled from 'styled-components'\n\nimport { t } from '@owl-nest/localize'\nimport * as services from '@owl-nest/services'\nimport { AuthenticatedUser } from '@owl-nest/api-client/latest'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { isAlreadyExistsError } from '@owl-nest/auth'\nimport { userSchema } from '../../../models/user'\n\ntype ModalProps = {\n isPersonalIdNumberRequired: boolean\n userIsCompleted: boolean\n user: AuthenticatedUser\n}\n\nconst StyledRegularText = styled(plume.styles.copy.S)`\n display: block;\n margin: 15px 0;\n`\n\nconst LinkContainer = styled(plume.styles.copy.S)`\n display: block;\n margin-top: 10px;\n text-align: center;\n`\n\nconst FormFieldContainer = styled.div`\n margin: 15px 0;\n`\n\nexport const ModalIncompleteProfile = ({\n isPersonalIdNumberRequired,\n userIsCompleted,\n user,\n}: ModalProps): React.ReactElement<ModalProps> => {\n const auth = services.user.useSafeAuth()\n const apiError = auth.failure && auth.failure.body.length > 0 ? isAlreadyExistsError(auth.failure) : null\n\n const [open, setOpen] = React.useState(!userIsCompleted)\n\n return (\n // Modal is closable only if the user.email exists\n // Buttons are in the form so we can't pass them to the buttons props\n <plume.Modal open={open} closable={!!user.email} onClose={() => setOpen(false)}>\n <plume.styles.heading.S>{t('Update your information to pay')}</plume.styles.heading.S>\n\n <StyledRegularText>\n {t(\n 'You must update first your information to choose a payment method and click on the green button. Those additionnal information are required by our payment provider, you will be able to select your payment method after.',\n )}\n </StyledRegularText>\n\n <Formik\n initialValues={{\n email: user?.email || '',\n personal_id_number: user?.personal_id_number || '',\n }}\n validationSchema={userSchema(user, isPersonalIdNumberRequired)}\n validateOnBlur={false}\n validateOnChange={false}\n onSubmit={(values) => {\n const userPayload = {\n ...(!user?.email && { email: values.email }),\n ...(isPersonalIdNumberRequired && { personal_id_number: values.personal_id_number }),\n }\n const userId = user.id\n auth.update(userId, userPayload)\n }}\n >\n {({ values, errors, setFieldValue, submitForm }) => {\n const emailError = apiError ? t('This email is already taken.') : undefined\n return (\n <Form>\n {/* EMAIL FIELD */}\n {!user?.email && (\n <FormFieldContainer>\n <plume.TextField\n label={t('Email')}\n type=\"email\"\n value={values.email}\n error={errors.email || emailError}\n required={true}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n setFieldValue('email', event.target.value)\n }}\n />\n </FormFieldContainer>\n )}\n\n {/* FIELD personalIdNumberValidator */}\n {!user?.personal_id_number && isPersonalIdNumberRequired && (\n <FormFieldContainer>\n <plume.TextField\n label={t('Italian fiscal code')}\n value={values.personal_id_number}\n error={errors.personal_id_number}\n required={false}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n setFieldValue('personal_id_number', event.target.value)\n }}\n />\n </FormFieldContainer>\n )}\n\n {/* SUBMIT */}\n <plume.styles.button.CallToAction onClick={submitForm}>\n {t('Update my information')}\n </plume.styles.button.CallToAction>\n\n {!user?.personal_id_number && isPersonalIdNumberRequired && (\n <LinkContainer>\n <plume.Link\n href=\"#\"\n kind=\"secondary\"\n onClick={(event) => {\n event.preventDefault()\n setOpen(false)\n }}\n >\n {t(\"I don't have an Italian tax code\")}\n </plume.Link>\n </LinkContainer>\n )}\n </Form>\n )\n }}\n </Formik>\n </plume.Modal>\n )\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { t, tc } from '@owl-nest/localize'\nimport { COLORS, Link, styles as S } from '@ulule/owl-kit-components/next'\nimport * as UFE from '../../utils/UFE'\n\nconst PaymentDisclaimersSection = styled.section`\n margin-top: 20px;\n\n ${S.copy.XS} {\n font-size: 10px;\n line-height: 17px;\n color: ${COLORS.GREY_SHADE_3};\n }\n\n ${Link} {\n text-decoration: underline;\n }\n`\n\nconst PaymentDisclaimersTitle = styled(S.copy.S)`\n color: ${COLORS.GREY_SHADE_3};\n display: block;\n text-align: center;\n`\n\nconst PaymentPartnersLogoSection = styled.div`\n display: flex;\n flex-wrap: wrap;\n justify-content: space-around;\n margin: 0 auto;\n margin-bottom: 13px;\n margin-top: 15px;\n max-width: 204px;\n\n img {\n height: 1.8rem;\n margin-bottom: 10px;\n width: 25%;\n }\n`\n\nexport const PaymentDisclaimers = (): React.ReactElement<{}> => {\n const assets = UFE.CHECKOUT_ASSETS\n\n return (\n <PaymentDisclaimersSection>\n <PaymentDisclaimersTitle>{t('Secure payment')}</PaymentDisclaimersTitle>\n {/* TODO: Fix image imports... */}\n <PaymentPartnersLogoSection>\n <img alt=\"SSL\" src={assets.payment_partners_logos.ssl} />\n <img alt=\"Verified by Visa\" src={assets.payment_partners_logos.visa} />\n <img alt=\"Mastercard SecureCode\" src={assets.payment_partners_logos.mastercard} />\n {/* To be added later in v2 <img alt=\"Mangopay\" src={assets.payment_partners_logos.mangopay} /> */}\n </PaymentPartnersLogoSection>\n <S.copy.XS>\n {tc(\n 'By placing your order you agree to our [termsLink:Terms & Conditions] and [privacyLink: privacy policies]. You also consent to some of your data being stored by Ulule, which may be used to make future shopping experiences better for you.',\n {\n termsLink: <Link href=\"/about/terms\" />,\n privacyLink: <Link href=\"/about/privacy\" />,\n },\n )}\n </S.copy.XS>\n </PaymentDisclaimersSection>\n )\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { t } from '@owl-nest/localize'\nimport { money, styles, payment } from '@owl-nest/utils'\nimport * as env from '@owl-nest/config'\nimport * as hooks from '@owl-nest/hooks'\n// @ts-ignore\nimport { BREAKPOINTS, COLORS, styles as S, glyphs } from '@ulule/owl-kit-components/next'\n\nimport { CurrencyGlyph } from '../../components/money'\n\n// PRIMARY PAYMENT METHOD\n\nexport const PaymentCallToAction = styled(S.button.CallToAction)``\n\nconst PaymentButton = styled(S.button.Button)`\n /* TODO: FIXME: Respect ODS transform? Check with product team */\n text-transform: initial;\n`\n\nconst PaymentMethod = styled.div`\n box-sizing: border-box;\n border: 1px solid ${COLORS.GREY_SHADE_5};\n border-radius: 3px;\n padding: 20px;\n width: 100%;\n`\n\nconst PaymentMethodDescription = styled(S.copy.S)`\n color: ${COLORS.PRIMARY_BLACK};\n display: block;\n font-size: ${styles.rem(13)};\n font-weight: 300;\n line-height: 20px;\n margin-bottom: 15px;\n margin-top: 11px;\n text-align: center;\n`\n\nconst PaymentMethodName = styled(S.copy.S)`\n align-items: center;\n display: flex;\n font-size: ${styles.rem(15)};\n font-weight: 500;\n justify-content: center;\n line-height: 21px;\n\n svg {\n margin-right: 2px;\n width: 42px;\n\n @media screen and ${BREAKPOINTS.MOBILE_M} {\n margin-right: 10px;\n width: initial;\n }\n }\n`\n\n// SECONDARY PAYMENT METHODS\n\nconst SecondaryPaymentMethod = styled(PaymentMethod)`\n align-items: center;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-bottom: 10px;\n overflow: hidden;\n padding: 13px 20px;\n\n &:last-child {\n margin: 0px;\n }\n`\n\ntype CollapsibleSectionProps = {\n readonly collapsed: boolean\n}\n\nconst PaymentMethodCollapsibleSection = styled.section<CollapsibleSectionProps>`\n max-height: ${({ collapsed }) => (collapsed ? 0 : '100vh')};\n text-align: center;\n transition: max-height 0.3s ease-in-out;\n`\n\n// CONVERSION HINT\n\nconst ConversionHint = styled(S.copy.S)`\n margin-left: 9px;\n`\n\nconst ConversionHintWrapper = styled.span`\n align-items: center;\n display: flex;\n justify-content: center;\n padding-top: 10px;\n`\n\n//\n\ntype PaymentMethodViewProps = {\n conversion?: {\n sourceAmount: number\n sourceCurrency: string\n targetCurrency: string\n }\n ctaText: React.ReactNode\n onCtaClick: () => void\n paymentMethod: payment.PaymentMethod\n}\n\ntype SecondaryPaymentMethodViewProps = {\n activeMethod: string | null\n ctaText: React.ReactNode\n onCtaClick: () => void\n onMethodClick: () => void\n paymentMethod: payment.PaymentMethod\n}\n\nexport const PaymentMethodView = ({\n conversion,\n ctaText,\n onCtaClick,\n paymentMethod,\n}: PaymentMethodViewProps): React.ReactElement<unknown> => {\n const PaymentMethodIcon = (glyphs as any).paymentMethods[paymentMethod.icon]\n\n return (\n <PaymentMethod>\n <PaymentMethodName>\n <PaymentMethodIcon />\n <S.copy.S>{paymentMethod.name}</S.copy.S>\n </PaymentMethodName>\n <PaymentMethodDescription>{paymentMethod.description}</PaymentMethodDescription>\n <PaymentCallToAction\n color=\"blue\"\n onClick={(event: React.MouseEvent<HTMLElement>): void => {\n event.preventDefault()\n onCtaClick()\n }}\n size=\"medium\"\n >\n {ctaText}\n </PaymentCallToAction>\n\n {conversion !== undefined && conversion.sourceCurrency !== conversion.targetCurrency && env.CURRENCIES_RATES && (\n <ConversionHintWrapper>\n <CurrencyGlyph currency={conversion.sourceCurrency} size={17} />\n <ConversionHint>\n {t('Approximately %(amount)s at current exchange rates', {\n amount: t('%(currency)s%(amount)s', {\n amount: money.convert(\n conversion.sourceAmount,\n conversion.sourceCurrency,\n conversion.targetCurrency,\n env.CURRENCIES_RATES,\n ),\n currency: conversion.targetCurrency,\n }),\n })}\n </ConversionHint>\n </ConversionHintWrapper>\n )}\n </PaymentMethod>\n )\n}\n\nexport const SecondaryPaymentMethodView = ({\n activeMethod,\n ctaText,\n onMethodClick,\n onCtaClick,\n paymentMethod,\n}: SecondaryPaymentMethodViewProps): React.ReactElement<unknown> => {\n const PaymentMethodIcon = (glyphs as any).paymentMethods[paymentMethod.icon]\n return (\n <SecondaryPaymentMethod\n as=\"li\"\n key={paymentMethod.id}\n onClick={(event: React.MouseEvent<HTMLElement>): void => {\n event.preventDefault()\n onMethodClick()\n }}\n >\n <PaymentMethodName>\n <PaymentMethodIcon />\n {paymentMethod.name}\n </PaymentMethodName>\n <PaymentMethodCollapsibleSection collapsed={activeMethod !== paymentMethod.id}>\n <PaymentMethodDescription>{paymentMethod.description}</PaymentMethodDescription>\n <PaymentButton\n onClick={(event: React.MouseEvent<HTMLElement>): void => {\n event.preventDefault()\n onCtaClick()\n }}\n >\n {ctaText}\n </PaymentButton>\n </PaymentMethodCollapsibleSection>\n </SecondaryPaymentMethod>\n )\n}\n", "import * as React from 'react'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\nimport * as services from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport * as models from '@owl-nest/models'\n\nimport { Item } from '../../components/Item'\nimport { FutureItem } from '../../components/FutureItem'\nimport { CartSummary } from '../../components/selection'\nimport { IdentityItem } from '../../components/IdentityItem'\nimport { scrollToCurrentItem } from '../../utils/scrollTo'\nimport { PAGES, useNavigation } from '../../hooks/useNavigation'\nimport { PickupItem } from './PickupItem'\nimport { useCart } from '../../hooks/useCart'\nimport { useProject } from '../../hooks/useProject'\n\nexport function PickupView(): React.ReactElement<unknown> | null {\n const navigation = useNavigation()\n const cart = useCart()\n const onlyTip = cart.products.length === 0 && cart.tip.amount > 0\n const { project } = useProject()\n\n const auth = services.user.useAuth()\n\n const refShippings = React.useRef(null)\n React.useEffect(() => {\n scrollToCurrentItem(refShippings.current)\n }, [])\n\n const tracking = shadow.useTracking()\n\n if (cart.addressType !== 'shipping') {\n return <></>\n }\n\n return (\n <>\n <Item\n title={!onlyTip ? t('Your selection') : undefined}\n action={\n !onlyTip\n ? {\n handler: () => navigation.navigate(PAGES.SELECTION),\n text: t('Edit'),\n }\n : undefined\n }\n >\n <CartSummary onModify={() => navigation.navigate(PAGES.SELECTION, { forceStep: true })} />\n </Item>\n\n <IdentityItem />\n\n {auth.type !== 'loggedin' ? (\n <Item title={t('Delivery at-home')}>\n <plume.Spinner />\n </Item>\n ) : (\n <PickupItem ref={refShippings} cart={cart} onContinue={handleContinue} />\n )}\n\n {cart.needAddress && <FutureItem title={t('Contact details')} />}\n <FutureItem title={t('Payment')} />\n </>\n )\n\n function handleContinue() {\n tracking.ecommerce.track('add_shipping_info', {\n value: cart.subTotal,\n currency: project.currency,\n shipping_tier: 'pickup_point',\n items: [\n ...cart.products.map((product) => ({\n item_id: String(product.reward.id),\n item_name: models.reward.title(product.reward) ?? '',\n item_brand: models.project.name(project),\n item_variant: product.variant && String(product.variant.id),\n price: product.reward.price,\n quantity: product.quantity,\n })),\n ...(cart.tip.amount !== 0\n ? [\n {\n item_id: 'tip',\n item_name: 'tip',\n item_brand: models.project.name(project),\n price: cart.tip.amount,\n quantity: 1,\n },\n ]\n : []),\n ],\n })\n\n navigation.navigate(navigation.nextLegalPage)\n }\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as api from '@owl-nest/api-client/latest'\nimport { t } from '@owl-nest/localize'\nimport * as model from '@owl-nest/models'\nimport {\n Callout,\n BREAKPOINTS,\n COLORS,\n glyphs,\n Link,\n RadioField,\n RadioGroupField,\n styles as S,\n} from '@ulule/owl-kit-components/next'\n\nimport { Item } from '../../components/Item'\nimport { CartMethods, ShippingCart } from '../../hooks/useCart'\nimport { PAGES, useNavigation } from '../../hooks/useNavigation'\n\ntype PickupItemProps = {\n cart: ShippingCart & CartMethods\n className?: string\n onContinue: () => void\n}\n\nconst Center = styled.div`\n text-align: center;\n`\n\nconst PickupItemComponent = React.forwardRef<HTMLDivElement, PickupItemProps>(function PickupItemComponent(\n { cart, className, onContinue },\n ref,\n) {\n const navigation = useNavigation()\n\n return (\n <Item title={t('Pick-up locations')} ref={ref} className={className}>\n <Callout type=\"info\">\n {t(\n 'Creator is offering pick-up locations instead of postal delivery, a cheaper option and an opportunity to meet them!',\n )}\n </Callout>\n <RadioGroupField>\n {cart.pickupPoints.map((pickupPoint, i) => {\n return (\n <RadioField\n key={i}\n onChange={() => cart.setPickupPoint(pickupPoint.id)}\n checked={cart.selectedPickupPoint?.id === pickupPoint.id}\n label={<S.heading.XXXS>{model.pickup.city(pickupPoint)}</S.heading.XXXS>}\n context={model.pickup.address(pickupPoint)}\n description={model.pickup.description(pickupPoint)}\n />\n )\n })}\n </RadioGroupField>\n\n <S.button.Button onClick={onContinue}>{t('Continue')}</S.button.Button>\n\n <Center>\n <S.copy.S>{t(\"Can't find a pick-up location?\")}</S.copy.S>\n <S.copy.S>\n <Link\n kind=\"secondary\"\n onClick={() => {\n navigation.navigate(PAGES.SELECTION)\n }}\n >\n {t('Change delivery method')}\n </Link>\n </S.copy.S>\n </Center>\n </Item>\n )\n})\n\nexport const PickupItem = styled(PickupItemComponent)`\n ${RadioGroupField} {\n margin: 20px 0;\n }\n\n ${RadioField} {\n ${glyphs.stroke.MapCursor} {\n color: ${COLORS.GREY_SHADE_4};\n margin-right: 4px;\n }\n\n ${S.field.Title} {\n margin-right: 8px;\n color: ${COLORS.PRIMARY_BLACK} !important;\n\n ${S.heading.XXXS} {\n display: inline;\n }\n }\n\n ${S.field.Context} {\n white-space: pre-wrap;\n }\n\n @media screen and ${BREAKPOINTS.TABLET} {\n ${S.field.Context} {\n margin-left: 15px;\n }\n }\n }\n\n ${S.button.Button} {\n width: 100%;\n }\n\n ${Center} {\n margin: 20px 0 0;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { Callout, Spinner, styles as S } from '@ulule/owl-kit-components/next'\nimport { t, tc } from '@owl-nest/localize'\nimport * as services from '@owl-nest/services'\n\nimport * as model from '@owl-nest/models'\n\nimport { Item } from '../../components/Item'\nimport { PaymentMethodView } from '../../components/Payment/PaymentMethod'\nimport * as UFE from '../../utils/UFE'\n\nimport { PaymentSectionWrapper } from '../payment/PaymentSection'\nimport { PaymentDisclaimers } from '../../components/Payment/PaymentDisclaimers'\nimport { MoneyDisplayer } from '../../components/money'\nimport { useProject } from '../../hooks/useProject'\n\nconst PaymentSection = styled(PaymentSectionWrapper)`\n margin-top: 30px;\n`\n\ntype RenewViewProps = {\n orderId: number\n}\n\nexport function RenewView({ orderId }: RenewViewProps): React.ReactElement<RenewViewProps> | null {\n const { project } = useProject()\n const { renew, response } = services.order.useOrder(orderId)\n\n const primaryPaymentMethod = model.project.getPrimaryPaymentMethod(project, UFE.FLAGS.paypal_enabled)\n const renewBoxRef = React.useRef(null)\n\n return (\n <>\n {response.data === undefined ? (\n <Spinner />\n ) : (\n <Item ref={renewBoxRef} title={t('Payment')}>\n <Callout type=\"info\">\n {t(\n \"We can't validate your previous payment, you can renew your contribution by providing a new payment method\",\n )}\n </Callout>\n <PaymentSection>\n <PaymentMethodView\n paymentMethod={primaryPaymentMethod}\n onCtaClick={() => {\n // TODO : investigate inconsistencies between `primaryPaymentMethod.id` type and `payment_method` type\n renew({ payment_method: primaryPaymentMethod.id as any }).then((result) => {\n result?.next((response) => {\n if (response.payment_url) {\n window.location.href = response.payment_url\n }\n })\n })\n }}\n ctaText={tc('Pay [amount]', {\n amount: <MoneyDisplayer amount={response.data?.order_total} />,\n })}\n />\n </PaymentSection>\n\n <PaymentDisclaimers />\n </Item>\n )}\n </>\n )\n}\n", "import * as React from 'react'\n\nimport * as api from '@owl-nest/api-client/latest'\nimport { t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as services from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\n\nimport { useNavigation } from '../../hooks/useNavigation'\nimport * as productUtils from '../../utils/product'\nimport { scrollToCurrentItem } from '../../utils/scrollTo'\n\nimport { Cart } from './Cart'\nimport { Item } from '../../components/Item'\nimport { RewardList } from './RewardList'\nimport { ItemTip } from './ItemTip'\nimport * as ComponentStyle from './style'\nimport { useProject } from '../../hooks/useProject'\nimport { useRevealedRewards } from '../../hooks/useRevealedRewards'\nimport { useCart } from '../../hooks/useCart'\n\ntype SelectionViewProps = {\n preFilledTip?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n }\n}\n\nexport function SelectionView({ preFilledTip }: SelectionViewProps): React.ReactElement<SelectionViewProps> {\n const cart = useCart()\n const { project } = useProject()\n\n const isPresaleProject = (project && models.project.isPresaleType(project)) || false\n const isMembershipProject = models.project.isMembership(project)\n\n const { clearMessages } = services.message.useMessage()\n const navigation = useNavigation()\n const rewards = useRewards()\n\n const cartRef = React.useRef<HTMLDivElement>(null)\n const rewardsRef = React.useRef(null)\n const tipSelectionRef = React.useRef(null)\n const tracking = shadow.useTracking()\n\n React.useEffect(() => {\n cart.resetAddresses()\n scrollToCurrentItem(cartRef.current)\n }, [])\n\n return (\n <ComponentStyle.SelectionWrapper>\n {!cart.isEmpty && (\n <Item ref={cartRef} title={t('Your selection')}>\n <Cart\n scrollToRewards={() => scrollToCurrentItem(tipSelectionRef.current)}\n onValidate={() => {\n tracking.ecommerce.track('begin_checkout', {\n currency: project.currency,\n value: cart.subTotal,\n items: [\n ...cart.products.map((product) => ({\n item_id: String(product.reward.id),\n item_name: models.reward.title(product.reward) ?? '',\n item_brand: models.project.name(project),\n item_variant: product.variant && String(product.variant.id),\n price: product.reward.price,\n quantity: product.quantity,\n })),\n ...(cart.tip.amount !== 0\n ? [\n {\n item_id: 'tip',\n item_name: 'tip',\n item_brand: models.project.name(project),\n price: cart.tip.amount,\n quantity: 1,\n },\n ]\n : []),\n ],\n })\n navigation.navigate(navigation.nextLegalPage)\n }}\n />\n </Item>\n )}\n {project.type !== api.ProjectType.Membership && (\n <ComponentStyle.OrderedItem\n ref={tipSelectionRef}\n title={t('Support with a donation')}\n displayFirst={!isPresaleProject}\n >\n <ItemTip preFilledTip={preFilledTip} scrollToCart={() => scrollToCurrentItem(cartRef.current)} />\n </ComponentStyle.OrderedItem>\n )}\n <ComponentStyle.OrderedItem\n ref={rewardsRef}\n title={\n cart.isEmpty\n ? isMembershipProject\n ? t('Choose your membership')\n : t('Choose your rewards')\n : isMembershipProject\n ? t('Choose another membership')\n : t('You can add another reward')\n }\n displayFirst={isPresaleProject}\n >\n <RewardList rewards={rewards} scrollToCart={() => scrollToCurrentItem(cartRef.current)} />\n </ComponentStyle.OrderedItem>\n </ComponentStyle.SelectionWrapper>\n )\n}\n\nfunction useRewards(): models.reward.Reward[] {\n const { project } = useProject()\n const revealedRewards = useRevealedRewards()\n\n function isRevealedReward(reward: api.Reward): boolean {\n return revealedRewards.some((revealedRewardId: number) => {\n if (reward.variants?.length) {\n return reward.variants?.some((variant) => variant.id === revealedRewardId) || revealedRewardId === reward.id\n }\n return revealedRewardId === reward.id\n })\n }\n\n function getModeledRewards(): models.reward.Reward[] {\n const rewards =\n project === undefined || project.rewards === null || project.rewards === undefined\n ? []\n : project.rewards.reduce<models.reward.Reward<any>[]>((rewards, reward) => {\n if (reward.is_hidden) {\n if (!isRevealedReward(reward)) return rewards\n }\n rewards.push(models.reward.Reward(reward, project))\n return rewards\n }, [])\n\n return rewards\n }\n\n const rewards = getModeledRewards()\n return productUtils.orderRewardsAvailableFirst(rewards)\n}\n", "import * as React from 'react'\nimport styled, { ThemeProvider } from 'styled-components'\n\nimport { t, tc } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as hooks from '@owl-nest/hooks'\nimport * as models from '@owl-nest/models'\nimport * as env from '@owl-nest/config'\n\nimport { ConversionDisclaimer } from '../../components/money'\nimport { SelectionItem } from './components/cart/SelectionItem'\nimport { SelectionShipping } from './components/cart/SelectionShipping'\nimport { SelectionTip } from './components/cart/SelectionTip'\nimport { SelectionTotal } from './components/cart/SelectionTotal'\n\nimport * as ComponentStyle from './style'\nimport * as AppStyle from '../../style'\nimport { useProject } from '../../hooks/useProject'\nimport { useCart } from '../../hooks/useCart'\n\ntype Theme = {\n colors: {\n accent: string\n background: string\n hover: string\n primary: string\n }\n}\n\ntype CartProps = {\n onValidate: () => void\n scrollToRewards: () => void\n}\n\nexport function Cart({ onValidate, scrollToRewards }: CartProps) {\n const cart = useCart()\n\n const { project } = useProject()\n\n const cartHasSelectedProducts = cart.products.length > 0\n const cartHasTip = cart.tip.amount > 0\n const cartHasTipOnly = cartHasTip && cart.products.length === 0\n\n const showTotal =\n (cart.products.length > 0 && cart.tip.amount > 0) ||\n (cart.products.length > 0 && cart.addressType === 'shipping') ||\n cart.products.length > 1 ||\n (cart.products.length === 1 && Boolean(cart.products[0].variant?.total_additional_cost))\n\n const setIsRewardTaxDeductionModalOpen = hooks.useSetModal('RewardTaxDeductionInfo')\n\n const userConfig = env.useUserEnv()\n\n const projectCurrency = project.currency\n const userCurrency = userConfig.currency\n const isDifferentCurrency = projectCurrency != userCurrency\n\n const projectColor = models.project.backgroundColor(project) ?? plume.COLORS.BRAND_INDIGO\n const theme: Theme = {\n colors: {\n accent: `color-mix(in srgb, ${projectColor} 20%, white);`,\n background: `color-mix(in srgb, ${projectColor} 10%, white);`,\n hover: `color-mix(in srgb, ${projectColor} 70%, black);`,\n primary: projectColor,\n },\n }\n\n return (\n <ThemeProvider theme={models.project.isMembership(project) ? theme : {}}>\n <ComponentStyle.SelectionCard>\n {cart.isLoading && (\n <AppStyle.LoadingCard>\n <plume.Spinner />\n </AppStyle.LoadingCard>\n )}\n\n <ComponentStyle.StyledTable>\n <tbody>\n {cart.tip.amount > 0 && (\n <SelectionTip\n isDifferentCurrency={isDifferentCurrency}\n tip={cart.tip.amount}\n scrollTo={scrollToRewards}\n />\n )}\n\n {cart.products.length > 0 &&\n cart.products.map((product) => {\n return <SelectionItem product={product} key={product.id} />\n })}\n </tbody>\n </ComponentStyle.StyledTable>\n\n {cart.addressType === 'shipping' && <SelectionShipping />}\n\n {showTotal && <SelectionTotal isDifferentCurrency={isDifferentCurrency} />}\n\n {cart.taxDeductibleTotal > 0 && (\n <TaxInfo kind=\"primary\" tinted type=\"button\" onClick={() => setIsRewardTaxDeductionModalOpen(true)}>\n <plume.glyphs.stroke.Percent size={18} />\n {t('%(price)s after tax reduction', {\n price: plume.accounting.localeMoney(cart.taxDeductibleTotal, {\n currency: project.currency,\n lang: userConfig.lang,\n }),\n })}\n </TaxInfo>\n )}\n\n {models.project.isMembership(project) && (\n <>\n {cart.products.length !== 0 && (\n <plume.Callout type=\"info\" customIcon={plume.glyphs.stroke.Reroll}>\n {tc(\n '[bold: Monthly membership]: first payment today, then every month on this date. No commitment, you can stop whenever you want.',\n { bold: <strong /> },\n )}\n </plume.Callout>\n )}\n </>\n )}\n\n <ComponentStyle.SelectionAction marginTop={isDifferentCurrency && showTotal}>\n <plume.styles.button.CallToAction onClick={goToNextStep}>{t('Continue')}</plume.styles.button.CallToAction>\n </ComponentStyle.SelectionAction>\n\n {!models.project.isMembership(project) && (\n <>\n <ComponentStyle.AddMoreRewards onClick={scrollToRewards} kind=\"secondary\">\n <plume.glyphs.stroke.Plus size={13} />\n {'\\xa0'}\n {t('Add a reward')}\n </ComponentStyle.AddMoreRewards>\n\n <plume.styles.copy.S>\n {tc(\n \"[strong: Ulule is not an e-commerce website.] You are backing a project to contribute to its success. Ulule doesn't guarantee that the creator will succeed and isn't responsible for the creator's engagements towards its backers.\",\n { strong: <strong /> },\n )}\n </plume.styles.copy.S>\n </>\n )}\n {isDifferentCurrency && <ConversionDisclaimer project={project} />}\n </ComponentStyle.SelectionCard>\n </ThemeProvider>\n )\n\n function goToNextStep() {\n if (cartHasSelectedProducts) {\n const error =\n cart.addressType === 'shipping' &&\n ((cart.selectedShippingMode === 'home_delivery' && cart.selectedCountry === undefined) ||\n (cart.selectedShippingMode === 'pickup_point' && cart.selectedPickupPoint === undefined))\n\n cart.setShippingError(error)\n\n if (!error) {\n onValidate()\n }\n } else if (cartHasTipOnly) {\n onValidate()\n }\n }\n}\n\nconst TaxInfo = styled(plume.LinkAsButton)`\n display: flex;\n margin-bottom: 24px;\n margin-left: auto;\n padding: 0;\n width: fit-content;\n\n ${plume.glyphs.stroke.Percent} {\n color: ${plume.COLORS.GREY_SHADE_7};\n margin-right: 6px;\n margin-top: -1px;\n }\n`\n", "import * as React from 'react'\n\nimport { t, tc } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as env from '@owl-nest/config'\n\nimport * as productModel from '../../../../models/product'\nimport { MoneyConverter, MoneyDisplayer } from '../../../../components/money'\nimport { RemoveModal } from '../../../../components/Modals/RemoveModal'\nimport { SelectionQuantity } from '../../../../components/Form/SelectionQuantity'\n\nimport * as S from '../../style'\nimport { useProject } from '../../../../hooks/useProject'\nimport { useCart } from '../../../../hooks/useCart'\n\ntype SelectionItemProps = {\n product: productModel.Product\n}\n\nexport function SelectionItem({ product }: SelectionItemProps): React.ReactElement {\n const [removalModalIsOpen, setRemovalModalIsOpen] = React.useState(false)\n const { project } = useProject()\n const cart = useCart()\n const userConfig = env.useUserEnv()\n const userCurrency = userConfig.currency\n const isDifferentCurrency = userCurrency !== project.currency\n const isMembership = models.project.isMembership(project)\n\n const additionalCost =\n product.variant && product.variant.total_additional_cost\n ? product.variant.total_additional_cost * product.quantity\n : null\n const amount = product.reward.price * product.quantity\n const description = productModel.getTruncatedDescription(product)\n const image = product.variant ? models.variant.image(product.variant) : productModel.getImage(product)\n const productIsAvailable = productModel.quantityDoesNotExceedStock(product)\n const productIsLegacy = productModel.isLegacy(product)\n const title = productIsLegacy ? description : productModel.getTruncatedTitle(product)\n\n return (\n <S.SelectionItem hasAdditionalCost={Boolean(additionalCost)}>\n {/* INFORMATION */}\n <S.SelectionItemInformations>\n {image ? <S.RewardSelectionImage src={image} alt={''} /> : isMembership && <S.RewardSelectionPlaceholder />}\n <div>\n {title && <S.SelectionTitle dangerouslySetInnerHTML={{ __html: title }}></S.SelectionTitle>}\n {description && product.variant && !productIsLegacy && (\n <S.SelectionVariantTitle dangerouslySetInnerHTML={{ __html: description }}></S.SelectionVariantTitle>\n )}\n </div>\n </S.SelectionItemInformations>\n\n {/* QUANTITY */}\n {!isMembership && <SelectionQuantity product={product} setRemovalModalIsOpen={setRemovalModalIsOpen} />}\n\n {/* CURRENCY */}\n <S.SelectionCurrencyWrapper>\n <S.SelectionCurrency>\n {isMembership ? (\n tc('[amount] / month', {\n amount: <MoneyDisplayer amount={amount} />,\n })\n ) : (\n <MoneyDisplayer amount={amount} />\n )}\n </S.SelectionCurrency>\n {isDifferentCurrency && <MoneyConverter amount={amount} absolutePosition={!additionalCost} />}\n {additionalCost && (\n <>\n <S.SmallSelectionCurrency>\n +{'\\u00A0'}\n <MoneyDisplayer amount={additionalCost} />\n </S.SmallSelectionCurrency>\n {isDifferentCurrency && <MoneyConverter amount={additionalCost} />}\n </>\n )}\n </S.SelectionCurrencyWrapper>\n\n {/* ERRORS */}\n <S.SelectionError error={!productIsAvailable}>\n {t('This reward stock is limited to %(limit)s', { limit: productModel.stock(product).available })}\n </S.SelectionError>\n\n {/* MODAL */}\n <RemoveModal\n removeSelection={() => {\n setRemovalModalIsOpen(false)\n cart.setProduct(product.id, 0)\n }}\n removalModalIsOpen={removalModalIsOpen}\n closeModal={() => {\n setRemovalModalIsOpen(false)\n }}\n />\n </S.SelectionItem>\n )\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { t } from '@owl-nest/localize'\n\ntype RemoveModalProps = {\n removalModalIsOpen: boolean\n removeSelection: () => void\n closeModal: () => void\n}\nexport const RemoveModal = ({ removalModalIsOpen, removeSelection, closeModal }: RemoveModalProps) => {\n return (\n <plume.Modal\n open={removalModalIsOpen}\n onClose={closeModal}\n buttons={[\n {\n type: 'button',\n props: {\n onClick: removeSelection,\n children: t('Yes, remove'),\n },\n },\n {\n type: 'linkAsButton',\n props: {\n kind: 'secondary',\n onClick: closeModal,\n children: t('No, keep it'),\n },\n },\n ]}\n >\n <RemoveModalTitle>{t('Please confirm you wish to remove this reward.')}</RemoveModalTitle>\n </plume.Modal>\n )\n}\n\nconst RemoveModalTitle = styled(plume.styles.heading.S)`\n text-align: center;\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { BREAKPOINTS, COLORS, FONTS, Tooltip, glyphs, styles as S } from '@ulule/owl-kit-components/next'\nimport { styles } from '@owl-nest/utils'\nimport { t } from '@owl-nest/localize'\n\nimport * as productModel from '../../models/product'\nimport { useCart } from '../../hooks/useCart'\n\ntype SelectionQuantityProps = {\n product: productModel.Product\n setRemovalModalIsOpen: (isOpen: boolean) => void\n}\n\nexport function SelectionQuantity({ product, setRemovalModalIsOpen }: SelectionQuantityProps) {\n const cart = useCart()\n const productHasUnlimitedStock = !productModel.hasLimitedStock(product)\n const productIsSelectable = productModel.isSelectable(product)\n const productIsAvailable = productHasUnlimitedStock || productIsSelectable\n\n const [isOpenTooltip, setIsOpenTooltip] = React.useState(false)\n\n return (\n <SelectionItemQuantity>\n <Flex>\n <ButtonQuantity\n onClick={() => {\n if (product.quantity === 1) {\n setRemovalModalIsOpen(true)\n } else {\n cart.setProduct(product.id, (quantity) => quantity - 1)\n }\n }}\n active={true}\n >\n <glyphs.stroke.Minus size={11} />\n </ButtonQuantity>\n <Quantity>{product.quantity}</Quantity>\n <ButtonQuantity\n onClick={() => {\n if (productIsAvailable) {\n cart.setProduct(product.id, (quantity) => quantity + 1)\n }\n }}\n onMouseEnter={() => {\n if (!productIsAvailable) {\n setIsOpenTooltip(true)\n }\n }}\n onMouseLeave={() => {\n if (!productIsAvailable) {\n setIsOpenTooltip(false)\n }\n }}\n active={productIsAvailable}\n >\n <glyphs.stroke.Plus size={11} />\n <StyledTooltip open={isOpenTooltip} position=\"bottom\">\n <S.copy.S>{t('No more quantity available for this reward')}</S.copy.S>\n </StyledTooltip>\n </ButtonQuantity>\n </Flex>\n </SelectionItemQuantity>\n )\n}\n\nexport const SelectionItemQuantity = styled.td`\n text-align: right;\n`\n\nexport const ButtonQuantity = styled.button<{ active?: boolean }>`\n background-color: transparent;\n border-radius: 100%;\n border: 1px solid ${(props) => (props.active ? `${COLORS.GREY_SHADE_7}` : `${COLORS.GREY_SHADE_5}`)};\n color: ${(props) => (props.active ? `${COLORS.GREY_SHADE_7}` : `${COLORS.GREY_SHADE_5}`)};\n cursor: pointer;\n font-size: ${styles.rem(17)};\n height: 19px;\n line-height: 0px;\n margin: 0px 4px;\n padding: 0px;\n position: relative;\n text-align: center;\n transition: 0.3s ease;\n width: 19px;\n\n &:hover {\n border: 1px solid ${(props) => (props.active ? `${COLORS.GREY_SHADE_2}` : `${COLORS.GREY_SHADE_5}`)};\n color: ${(props) => (props.active ? `${COLORS.GREY_SHADE_2}` : `${COLORS.GREY_SHADE_5}`)};\n outline: none;\n }\n\n &:focus,\n &:active {\n border: 1px solid ${(props) => (props.active ? `${COLORS.GREY_SHADE_7}` : `${COLORS.GREY_SHADE_5}`)};\n color: ${(props) => (props.active ? `${COLORS.GREY_SHADE_7}` : `${COLORS.GREY_SHADE_5}`)};\n outline: none;\n }\n\n @media screen and ${BREAKPOINTS.MOBILE_L} {\n margin: 0px 12px;\n }\n`\n\nconst Flex = styled.div`\n display: flex;\n justify-content: flex-end;\n`\n\nexport const Quantity = styled.span`\n color: ${COLORS.PRIMARY_BLACK};\n cursor: default;\n font-family: ${FONTS.PRIMARY_FONT};\n font-size: ${styles.rem(15)};\n line-height: 18px;\n text-align: center;\n`\n\nconst StyledTooltip = styled(Tooltip)`\n top: 30px;\n width: 133px;\n\n @media screen and ${BREAKPOINTS.TABLET} {\n width: 183px;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as api from '@owl-nest/api-client/next'\nimport { t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as money from '@owl-nest/money'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nimport * as S from '../../style'\nimport { ShippingCart, useCart } from '../../../../hooks/useCart'\nimport { useProject } from '../../../../hooks/useProject'\nimport { CountrySelect } from './CountrySelect'\nimport { SingleCountryAndShippingModeLabel } from './SingleCountryAndShippingModeLabel'\n\nexport function SelectionShipping() {\n const cart = useCart()\n const { project } = useProject()\n const userConfig = env.useUserEnv()\n\n if (cart.addressType !== 'shipping') {\n return <></>\n }\n const userCountryIsSupported =\n cart.availableCountries.length === 0 || cart.availableCountries.includes(env.USER_COUNTRY)\n\n const supportedCountries = cart.availableCountries\n .map((code) => ({\n label: getCountryLabel(code),\n code,\n })) // unknown country will have an undefined label. We filter them out.\n .filter((option): option is { label: string; code: string } => option.label !== undefined)\n .sort((a, b) => a.label.localeCompare(b.label))\n\n return (\n <Wrapper>\n {cart.selectedCountry?.forced && (\n <plume.Callout type=\"info\" wrapWithCopy={false}>\n <S.CalloutTextStrong>\n {t(\n \"Shipping to one or more selected countries has been cancelled since a reward you chose can't be shipped to those countries.\",\n )}\n </S.CalloutTextStrong>\n </plume.Callout>\n )}\n\n {cart.shippingModes.length === 1 && supportedCountries.length === 1 ? (\n <SingleCountryAndShippingModeLabel\n countries={supportedCountries}\n rate={getRate(cart.shippingModes[0], cart, project, userConfig.lang)}\n />\n ) : (\n <CountrySelect countries={supportedCountries} />\n )}\n\n <>\n {cart.shippingModes.length === 1 &&\n supportedCountries.length >= 1 &&\n cart.selectedShippingMode === 'pickup_point' && (\n <SingleMethod\n label={\n <plume.styles.heading.XXXS>\n {`${t('Pick-up')}${\n cart.pickupPoints.length === 1 ? ' - ' + models.pickup.city(cart.pickupPoints[0]) : ''\n }`}\n </plume.styles.heading.XXXS>\n }\n >\n <>\n {cart.pickupPoints.length > 1 && (\n <PickupPointDropdown\n selected={cart.selectedPickupPoint}\n error={cart.selectedShippingMode === 'pickup_point' && cart.shippingError}\n options={cart.pickupPoints.map((pickupPoint) => ({\n value: pickupPoint.id,\n label: models.pickup.city(pickupPoint),\n }))}\n onChange={cart.setPickupPoint}\n active={cart.selectedShippingMode === 'pickup_point'}\n />\n )}\n <S.Rate>{t('included')}</S.Rate>\n </>\n </SingleMethod>\n )}\n {cart.shippingModes.length === 1 &&\n supportedCountries.length > 1 &&\n cart.selectedShippingMode !== 'pickup_point' && (\n <SingleMethod\n label={\n <plume.styles.heading.XXXS>\n {cart.shippingModes[0] === 'home_delivery'\n ? t('Home delivery')\n : cart.shippingModes[0] === 'pickup_point'\n ? t('Pick-up')\n : cart.shippingModes[0] === 'mondial_relay'\n ? t('Mondial relay')\n : ''}\n </plume.styles.heading.XXXS>\n }\n >\n <S.Rate>{getRate(cart.shippingModes[0], cart, project, userConfig.lang)}</S.Rate>\n </SingleMethod>\n )}\n {cart.shippingModes.length > 1 && (\n <S.ColumnSelectionSection>\n <plume.RadioGroupField>\n {cart.shippingModes.includes('home_delivery') && (\n <S.StyledRadioField\n label={t('Home delivery')}\n checked={cart.selectedShippingMode === 'home_delivery'}\n onChange={() => {\n cart.setShippingMode('home_delivery')\n }}\n >\n <S.Rate>{getRate('home_delivery', cart, project, userConfig.lang)}</S.Rate>\n </S.StyledRadioField>\n )}\n {cart.shippingModes.includes('mondial_relay') && (\n <S.StyledRadioField\n label={\n <>\n {t('Mondial relay')}\n <plume.glyphs.thirdParty.MondialRelay size={20} />\n </>\n }\n checked={cart.selectedShippingMode === 'mondial_relay'}\n onChange={() => {\n cart.setShippingMode('mondial_relay')\n }}\n >\n <S.Rate>{getRate('mondial_relay', cart, project, userConfig.lang)}</S.Rate>\n </S.StyledRadioField>\n )}\n {/* We have to set a fake description that will be hidden to have 2 lines so that the dropdown /*}\n {/* is displayed instead of the second 'empty' line */}\n {cart.shippingModes.includes('pickup_point') && (\n <S.StyledRadioField\n label={t('Pick-up')}\n description={cart.pickupPoints.length > 1 ? 'fake text' : models.pickup.city(cart.pickupPoints[0])}\n checked={cart.selectedShippingMode === 'pickup_point'}\n onChange={() => {\n cart.setShippingMode('pickup_point')\n }}\n hideDescriptionContent={cart.pickupPoints.length > 1}\n >\n {cart.pickupPoints.length > 1 && (\n <PickupPointDropdown\n selected={cart.selectedPickupPoint}\n error={cart.selectedShippingMode === 'pickup_point' && cart.shippingError}\n options={cart.pickupPoints.map((pickupPoint) => ({\n value: pickupPoint.id,\n label: models.pickup.city(pickupPoint),\n }))}\n onChange={cart.setPickupPoint}\n active={cart.selectedShippingMode === 'pickup_point'}\n />\n )}\n <S.Rate>{t('included')}</S.Rate>\n </S.StyledRadioField>\n )}\n </plume.RadioGroupField>\n </S.ColumnSelectionSection>\n )}\n </>\n\n {!userCountryIsSupported && (\n <plume.Callout type=\"alert\" wrapWithCopy={false}>\n <S.CalloutText>\n {t('In %(country)s? Project creator doesn\u2019t ship to this country.', {\n country: env.COUNTRIES.find((country) => country.code === env.USER_COUNTRY)!.label(),\n })}\n </S.CalloutText>\n </plume.Callout>\n )}\n </Wrapper>\n )\n}\n\ntype PickupPointDropdownProps = {\n selected: api.PickupPoint | undefined\n error?: boolean\n options: { label: string; value: any }[]\n onChange: (value: any) => void\n active: boolean\n}\n\nfunction PickupPointDropdown({ selected, error, options, onChange, active }: PickupPointDropdownProps) {\n return (\n <>\n <S.StyledDropdown\n active={active}\n selected={selected ? [selected.id] : []}\n placeholder={t('Choose a pickup point')}\n height={200}\n status={error ? 'error' : 'default'}\n onChange={(selected) => {\n onChange(selected[0].value)\n }}\n filterable={options.length > 12}\n filterPlaceholder={t('Search')}\n >\n {options.map((option) => {\n return (\n <S.OneLineOption key={option.value} label={option.label} value={option.value}>\n {option.label}\n </S.OneLineOption>\n )\n })}\n </S.StyledDropdown>\n </>\n )\n}\n\nfunction getRate(mode: api.ShippingMode, cart: ShippingCart, project: api.Project, lang: api.Lang) {\n if (cart.selectedCountry === undefined) {\n return undefined\n }\n\n const rate = cart.getRate(cart.selectedCountry.code, mode)\n\n return rate === 0 || rate === undefined\n ? t('included')\n : `+\\u00A0${money.format(rate, {\n currency: project.currency,\n locale: lang ?? env.DEFAULT_LOCALE,\n })}`\n}\n\nfunction getCountryLabel(countryCode: string) {\n const country = env.COUNTRIES.find((country) => country.code === countryCode)\n\n // the list of countries API side might be out of sync with the liste of\n // country in the front.\n if (country === undefined) {\n return undefined\n }\n\n return country.label()\n}\n\nconst SingleMethod = styled(plume.StyledRadioField)`\n padding-left: 20px;\n min-height: 50px;\n\n ${S.Rate} {\n position: absolute;\n right: 20px;\n top: 50%;\n transform: translateY(-50%);\n }\n`\n\nconst Wrapper = styled.div`\n ${CountrySelect} {\n margin: 20px 0 16px;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { t } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { useCart } from '../../../../hooks/useCart'\n\ntype CountrySelectProps = {\n countries: { code: string; label: string }[]\n className?: string\n}\n\nfunction CountrySelectComponent({ className, countries }: CountrySelectProps) {\n const cart = useCart()\n\n if (cart.addressType !== 'shipping' || countries.length === 0) {\n return <></>\n }\n\n if (countries.length === 1) {\n if (cart.shippingModes.length === 1) return <></>\n\n return (\n <plume.styles.heading.XXXS className={className}>\n {t('Delivery')} {countries[0].label}{' '}\n </plume.styles.heading.XXXS>\n )\n }\n\n return (\n <plume.SelectField\n className={className}\n height={250}\n label={<plume.styles.heading.XXXS>{t('Delivery')}</plume.styles.heading.XXXS>}\n selected={[cart.selectedCountry?.code]}\n placeholder={t('Select a country')}\n error={cart.selectedShippingMode === 'home_delivery' && cart.shippingError && t('Please select a country')}\n filterable={countries.length > 12}\n filterPlaceholder={t('Search')}\n onChange={(selected) => {\n cart.setSelectedCountry(selected[0].value)\n }}\n selectLabel={(selectedOptions) => {\n // @ts-expect-error selectedOptions[0]?.value is not typed\n return <>{countries.find((country) => country.code === selectedOptions[0]?.value)?.label}</>\n }}\n >\n {countries.map(({ label, code }) => {\n return <plume.Option key={code} value={code} label={label} />\n })}\n </plume.SelectField>\n )\n}\n\nexport const CountrySelect = styled(CountrySelectComponent)`\n flex-direction: row;\n justify-content: space-between;\n\n ${plume.Select} {\n z-index: 3;\n position: relative;\n width: 200px;\n }\n`\n", "import * as React from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { t } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { useCart } from '../../../../hooks/useCart'\n\ntype SingleCountryAndShippingModeLabelProps = {\n countries: { code: string; label: string }[]\n rate: string | undefined\n className?: string\n}\n\nexport function SingleCountryAndShippingModeLabel({\n className,\n countries,\n rate,\n}: SingleCountryAndShippingModeLabelProps): React.ReactElement {\n const cart = useCart()\n\n if (cart.addressType !== 'shipping') {\n return <></>\n }\n\n return (\n <plume.styles.heading.XXXS className={className}>\n <SingleMethodContainer>\n <div>\n {t('Delivery')} {countries[0].label}{' '}\n <SingleMethodSubLabel forceLowerCase={cart.shippingModes[0] === 'home_delivery'}>\n {cart.shippingModes[0] === 'home_delivery' ? (\n t('At home')\n ) : cart.shippingModes[0] === 'pickup_point' ? (\n `- ${t('Pickup point')}`\n ) : cart.shippingModes[0] === 'mondial_relay' ? (\n <>\n {`- ${t('Mondial Relay')}`}\n <plume.glyphs.thirdParty.MondialRelay size={20} />\n </>\n ) : (\n ''\n )}\n </SingleMethodSubLabel>\n </div>\n <span>{rate}</span>\n </SingleMethodContainer>\n </plume.styles.heading.XXXS>\n )\n}\n\nconst SingleMethodSubLabel = styled.span<{ forceLowerCase: boolean }>`\n ${({ forceLowerCase }) =>\n forceLowerCase &&\n css`\n text-transform: lowercase;\n `}\n\n svg {\n vertical-align: bottom;\n }\n`\n\nconst SingleMethodContainer = styled.div`\n display: flex;\n justify-content: space-between;\n\n span {\n text-align: right;\n }\n`\n", "import * as React from 'react'\n\nimport { t } from '@owl-nest/localize'\n\nimport { MoneyConverter, MoneyDisplayer } from '../../../../components/money'\nimport * as S from '../../style'\n\ntype SelectionTipProps = {\n isDifferentCurrency: boolean\n scrollTo: () => void\n tip: number\n}\n\nexport function SelectionTip({ isDifferentCurrency, scrollTo, tip }: SelectionTipProps) {\n return (\n <S.SelectionItem>\n <S.TipInformations>\n <S.SelectionTitle>{t('Donation')}</S.SelectionTitle>\n </S.TipInformations>\n <S.TipActions>\n <S.TipLink kind=\"secondary\" onClick={scrollTo}>\n {t('Edit')}\n </S.TipLink>\n </S.TipActions>\n <S.SelectionCurrencyWrapper>\n <S.SelectionCurrency>\n <MoneyDisplayer amount={tip} />\n </S.SelectionCurrency>\n {isDifferentCurrency && <MoneyConverter bottomPosition={1} amount={tip} />}\n </S.SelectionCurrencyWrapper>\n </S.SelectionItem>\n )\n}\n", "import * as React from 'react'\n\nimport { t } from '@owl-nest/localize'\n\nimport { MoneyConverter, MoneyDisplayer } from '../../../../components/money'\nimport * as S from '../../style'\nimport { useCart } from '../../../../hooks/useCart'\n\ntype SelectionTotalProps = {\n isDifferentCurrency: boolean\n}\n\nexport function SelectionTotal({ isDifferentCurrency }: SelectionTotalProps) {\n const cart = useCart()\n\n return (\n <S.SelectionSection>\n <S.SelectionSectionTitle>{t('Total')}</S.SelectionSectionTitle>\n\n <S.TotalPrice>\n <MoneyDisplayer amount={cart.total} />\n {isDifferentCurrency && <MoneyConverter amount={cart.total} biggerFont />}\n </S.TotalPrice>\n </S.SelectionSection>\n )\n}\n", "import * as React from 'react'\nimport styled, { ThemeProvider } from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport * as models from '@owl-nest/models'\nimport * as api from '@owl-nest/api-client/next'\nimport { useTracking } from '@owl-nest/shadow'\n\nimport { Reward } from './components/rewards/Reward'\nimport { useCart } from '../../hooks/useCart'\nimport { useProject } from '../../hooks/useProject'\nimport { matchFilter } from '../../utils/filter'\n\ntype Theme = {\n colors: {\n accent: string\n background: string\n hover: string\n primary: string\n }\n}\n\ntype RewardListProps = {\n rewards: models.reward.Reward[]\n scrollToCart: () => void\n}\n\nexport function RewardList({ rewards, scrollToCart }: RewardListProps) {\n const { project } = useProject()\n\n const cart = useCart()\n\n const tracking = useTracking()\n\n const featuredReward = rewards.find((reward) => reward.is_featured && matchFilter(reward.id))\n\n const projectColor = models.project.backgroundColor(project) ?? plume.COLORS.BRAND_INDIGO\n const theme: Theme = {\n colors: {\n accent: `color-mix(in srgb, ${projectColor} 20%, white);`,\n background: `color-mix(in srgb, ${projectColor} 10%, white);`,\n hover: `color-mix(in srgb, ${projectColor} 70%, black);`,\n primary: projectColor,\n },\n }\n\n return (\n <List>\n <ThemeProvider theme={models.project.isMembership(project) ? theme : {}}>\n {featuredReward && (\n <Reward\n handleRemoveSelectReward={handleRemoveSelectReward}\n handleSelectReward={handleSelectReward}\n reward={featuredReward}\n trackView\n />\n )}\n {getListRewards()}\n </ThemeProvider>\n </List>\n )\n\n function handleSelectReward(\n reward: models.reward.Reward,\n variant?: models.variant.Variant,\n optionValuesIds?: number[],\n ) {\n if (models.project.isMembership(reward.project)) {\n cart.resetProducts()\n }\n const cartProduct = cart.products.find((product) => product.id === variant?.id || product.id === reward.id)\n const quantity = cartProduct?.quantity\n\n cart.setProduct(\n variant?.id ?? reward.id,\n quantity ?? 1,\n { createIfNotFound: true, withDelay: true },\n optionValuesIds ? reward.id : undefined,\n optionValuesIds,\n )\n tracking.ecommerce.track('add_to_cart', {\n currency: project.currency,\n value: reward.price,\n items: [\n {\n item_id: String(reward.id),\n item_name: models.reward.title(reward) ?? '',\n item_brand: models.project.name(project),\n item_variant: variant && String(variant.id),\n price: reward.price,\n quantity: quantity ?? 1,\n },\n ],\n })\n\n scrollToCart()\n }\n\n function handleRemoveSelectReward(reward: models.reward.Reward, variant?: models.variant.Variant) {\n cart.setProduct(variant?.id ?? reward.id, 0)\n }\n\n function getListRewards() {\n return rewards\n .filter(\n (reward) =>\n !reward.is_featured &&\n !(reward.project.type === api.ProjectType.Membership && reward.is_free) &&\n matchFilter(reward.id),\n )\n .map((reward, index) => {\n return (\n <div key={index}>\n <Reward\n handleRemoveSelectReward={handleRemoveSelectReward}\n handleSelectReward={handleSelectReward}\n reward={reward}\n trackView\n />\n </div>\n )\n })\n }\n}\n\nconst List = styled.div`\n display: grid;\n grid-row-gap: 24px;\n grid-template-columns: 1fr;\n margin-top: 6px;\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\nimport { useInView } from 'react-intersection-observer'\n\nimport { t, tn, tc, tf } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as models from '@owl-nest/models'\nimport * as api from '@owl-nest/api-client/next'\nimport * as duvet from '@ulule/duvet'\nimport { useTracking } from '@owl-nest/shadow'\nimport * as env from '@owl-nest/config'\n\nimport { useProject } from '../../../../hooks/useProject'\nimport { useCart } from '../../../../hooks/useCart'\n\ntype RewardProps = {\n handleRemoveSelectReward: (reward: models.reward.Reward, variant?: models.variant.Variant) => void\n handleSelectReward: (\n reward: models.reward.Reward,\n variant?: models.variant.Variant,\n optionValuesIds?: number[],\n ) => void\n mode?: 'checkout' | 'popup' | 'preview' | 'project'\n reward: models.reward.Reward\n trackView?: boolean\n}\n\nexport function Reward({\n handleRemoveSelectReward,\n handleSelectReward,\n reward,\n trackView = false,\n}: RewardProps): React.ReactElement {\n const { fetchVariants, project } = useProject()\n const cart = useCart()\n\n const currency = project.currency\n const rewardIsInCart = cart.products.some((product) => product.id === reward.id)\n const userConfig = env.useUserEnv()\n let userCurrency: string | undefined = userConfig.currency\n userCurrency = userCurrency != currency ? userCurrency : undefined // if currency is the same, change to undefined (hides conversion)\n const pictureSrc = models.reward.image(reward, 'full')\n\n const tracking = useTracking()\n const { ref, inView } = useInView({\n triggerOnce: true,\n })\n\n React.useEffect(() => {\n if (inView && trackView) {\n tracking.ecommerce.track('view_item', {\n items: [\n {\n item_id: String(reward.id),\n item_name: models.reward.title(reward) ?? '',\n item_brand: models.project.name(reward.project),\n price: reward.price,\n },\n ],\n })\n }\n }, [inView])\n\n if (reward.project.type === api.ProjectType.Membership) {\n const isSelected = cart.products.some((product) => product.reward.id === reward.id)\n\n return (\n <InViewDetector ref={ref}>\n <MembershipStyled\n membership={{\n description: { __html: models.reward.description(reward) },\n img: pictureSrc,\n title: models.reward.title(reward)!,\n isFree: reward.is_free ?? false,\n isFeatured: reward.is_featured,\n stock: { available: reward.stock_available ?? undefined, taken: reward.stock_taken },\n }}\n fullWidth\n maxHeight={100}\n selected={isSelected}\n showPlaceholderImage\n showSubscriptionsCount={project.show_subscriptions_count}\n cta={{\n type: 'button',\n props: {\n onClick: () => {\n handleSelectReward(reward)\n },\n },\n }}\n translations={{\n members: ({ taken }) => tn('%(count)d member', '%(count)d members', taken, { count: taken }),\n showMore: tf('Afficher plus'),\n showLess: tf('Afficher moins'),\n soldOut: t('Sold out'),\n soonSoldOut: t('Soon sold out'),\n stockAvailable: ({ available }) => {\n return t('%(amount)d remaining', { amount: available })\n },\n cta: isSelected ? (\n <>\n <plume.glyphs.fill.CheckCircle size={16} />\n {t('Selected')}\n </>\n ) : (\n tc('Subscribe for [price] / month', {\n price: (\n <plume.LocaleMoneyDisplayer\n rates={env.CURRENCIES_RATES}\n amount={reward.price}\n currency={project.currency}\n targetCurrency={project.currency}\n localeFormat={project.lang}\n />\n ),\n })\n ),\n featuredTag: t('Featured'),\n discord: reward.socials ? duvet.DiscordRoleList(reward.socials) : undefined,\n }}\n />\n </InViewDetector>\n )\n }\n\n const stockOffsets = cart.products.reduce((previousValue, currentValue) => {\n return {\n ...previousValue,\n [currentValue.id]: currentValue.quantity,\n }\n }, {})\n\n return (\n <InViewDetector ref={ref}>\n <RewardStyled\n reward={reward}\n selected={rewardIsInCart}\n stockOffsets={stockOffsets}\n fullWidth\n onSelect={{\n reward: () => {\n if (rewardIsInCart) {\n handleRemoveSelectReward(reward)\n } else {\n handleSelectReward(reward)\n }\n },\n variant: async (rewardId, optionValuesIds, resolvedVariantId) => {\n if (optionValuesIds && optionValuesIds.length >= 1) {\n if (project.rewards) {\n await fetchVariants(rewardId, optionValuesIds)\n const freshReward = project.rewards.find((freshReward) => freshReward.id === reward.id)\n if (freshReward) {\n const modeledReward = models.reward.Reward(freshReward, project)\n const resolvedVariant = modeledReward.variants.find(\n (variant) => variant.id === Number(resolvedVariantId),\n )\n handleSelectReward(\n modeledReward,\n resolvedVariant,\n optionValuesIds.map((valueId) => Number(valueId)),\n )\n return\n }\n }\n } else {\n handleSelectReward(\n reward,\n reward.variants.find((variant) => variant.id === Number(rewardId)),\n )\n }\n },\n }}\n />\n </InViewDetector>\n )\n}\n\nexport const RewardStyled = styled(duvet.rewardCard.RewardCard)``\n\n// HACK: This wrapper is only here to avoid using forwardRef. When moving to\n// React 19, please remove it and pass `className` and `ref` as props.\n// Come on, don't pretend you didn't see this comment, telling yourself\n// someone else will do it later. Be that person, now is the time to shine.\n// Thank you!\nconst InViewDetector = styled.div`\n max-width: 374px;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n max-width: 524px;\n }\n`\n\nexport const MembershipStyled = styled(plume.MembershipRewardCard)`\n max-width: none;\n`\n", "export function getFilterFromUrlParams(): { type: 'reward'; rewards: number[] } | { type: 'donation' } {\n const filter = new URLSearchParams(location.search).get('filter')\n\n if (filter === null) {\n return { type: 'reward', rewards: [] }\n }\n\n if (filter === 'donation') {\n return { type: 'donation' }\n }\n\n return {\n type: 'reward',\n rewards: filter\n .split(',')\n .map((id) => Number(id.trim()))\n .filter((id) => !Number.isNaN(id)),\n }\n}\n\nexport function matchFilter(id: number) {\n const filter = getFilterFromUrlParams()\n\n if (filter.type === 'donation') {\n return false\n }\n\n if (filter.rewards.length === 0) {\n return true\n }\n\n return filter.rewards.some((whitelistId) => whitelistId === id)\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport { Tip, TipContainerWrapper, InputRadioWrapper, RemoveButton } from '@owl-nest/tip'\nimport { BREAKPOINTS, styles as S } from '@ulule/owl-kit-components/next'\nimport * as shadow from '@owl-nest/shadow'\n\nimport { useProject } from '../../hooks/useProject'\nimport { useCart } from '../../hooks/useCart'\n\ntype ItemTipProps = {\n preFilledTip?: {\n amount?: number\n frequency?: models.project.DonationFrequency\n }\n scrollToCart: () => void\n}\n\nexport function ItemTip({ preFilledTip, scrollToCart }: ItemTipProps): React.ReactElement<ItemTipProps> {\n const { project } = useProject()\n const cart = useCart()\n\n const tip = cart.tip ?? preFilledTip?.amount ?? 0\n const tracking = shadow.useTracking()\n\n return (\n <Wrapper className=\"tip-view-tip-component\">\n <S.copy.M>{t('Just a donation to contribute to the success of the project!')}</S.copy.M>\n <StyledTip\n handleFormSubmit={(values) => {\n\n cart.setTip(values.donation ? Number(values.donation) : 0, { withDelay: tip.amount !== values.donation })\n scrollToCart()\n }}\n project={project}\n preFilledTip={{\n amount: tip.amount,\n }}\n translations={{\n submit: tip.amount > 0 ? t('Edit') : t('Add'),\n placeholder: t('5, 10, 25, 50, whatever you want!'),\n }}\n removable={tip.amount > 0}\n />\n </Wrapper>\n )\n}\n\nconst StyledTip = styled(Tip)`\n padding-left: 0px;\n padding-right: 0px;\n\n ${TipContainerWrapper} {\n flex-wrap: wrap;\n justify-content: center;\n }\n\n @media screen and ${BREAKPOINTS.TABLET} {\n ${TipContainerWrapper} {\n justify-content: space-between;\n }\n\n ${InputRadioWrapper} {\n width: calc(20% - 10px);\n }\n\n ${RemoveButton} {\n margin-top: 0;\n padding: 0px;\n width: auto;\n position: absolute;\n right: 0px;\n top: -41px;\n }\n }\n`\n\nconst Wrapper = styled.div`\n position: relative;\n\n ${S.copy.M} {\n margin-bottom: 10px;\n }\n`\n", "import * as React from 'react'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\nimport * as services from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport * as models from '@owl-nest/models'\n\nimport { Item } from '../../components/Item'\nimport { FutureItem } from '../../components/FutureItem'\nimport { CartSummary } from '../../components/selection'\nimport { IdentityItem } from '../../components/IdentityItem'\nimport { scrollToCurrentItem } from '../../utils/scrollTo'\nimport { PAGES, useNavigation } from '../../hooks/useNavigation'\nimport { MondialRelayItem } from './MondialRelayItem'\nimport { useProject } from '../../hooks/useProject'\nimport { useCart } from '../../hooks/useCart'\n\nexport function MondialRelayView(): React.ReactElement<unknown> | null {\n const navigation = useNavigation()\n const cart = useCart()\n const { project } = useProject()\n const onlyTip = cart.products.length === 0 && cart.tip.amount > 0\n\n const auth = services.user.useAuth()\n\n const refShippings = React.useRef(null)\n React.useEffect(() => {\n scrollToCurrentItem(refShippings.current)\n }, [])\n\n const tracking = shadow.useTracking()\n\n if (cart.addressType !== 'shipping') {\n return <></>\n }\n\n return (\n <>\n <Item\n title={!onlyTip ? t('Your selection') : undefined}\n action={\n !onlyTip\n ? {\n handler: () => navigation.navigate(PAGES.SELECTION),\n text: t('Edit'),\n }\n : undefined\n }\n >\n <CartSummary onModify={() => navigation.navigate(PAGES.SELECTION, { forceStep: true })} />\n </Item>\n\n <IdentityItem />\n\n {auth.type !== 'loggedin' ? (\n <Item title={t('Mondial Relay delivery')}>\n <plume.Spinner />\n </Item>\n ) : (\n <MondialRelayItem ref={refShippings} cart={cart} project={project} onContinue={handleContinue} />\n )}\n\n {<FutureItem title={t('Contact details')} />}\n <FutureItem title={t('Payment')} />\n </>\n )\n\n function handleContinue() {\n tracking.ecommerce.track('add_shipping_info', {\n value: cart.subTotal,\n currency: project.currency,\n shipping_tier: 'mondial_relay',\n items: [\n ...cart.products.map((product) => ({\n item_id: String(product.reward.id),\n item_name: models.reward.title(product.reward) ?? '',\n item_brand: models.project.name(project),\n item_variant: product.variant && String(product.variant.id),\n price: product.reward.price,\n quantity: product.quantity,\n })),\n ...(cart.tip.amount !== 0\n ? [\n {\n item_id: 'tip',\n item_name: 'tip',\n item_brand: models.project.name(project),\n price: cart.tip.amount,\n quantity: 1,\n },\n ]\n : []),\n ],\n })\n\n navigation.navigate(navigation.nextLegalPage)\n }\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\nimport * as formik from 'formik'\n\nimport * as api from '@owl-nest/api-client/latest'\nimport { t } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as yup from '@owl-nest/validators'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { Item } from '../../components/Item'\nimport { CartMethods, ShippingCart } from '../../hooks/useCart'\nimport { PAGES, useNavigation } from '../../hooks/useNavigation'\nimport { MondialRelayStep1 } from './MondialRelayStep1'\nimport { MondialRelayStep2 } from './MondialRelayStep2'\n\ntype MondialRelayItemProps = {\n cart: ShippingCart & CartMethods\n project: api.Project\n className?: string\n onContinue: () => void\n}\n\nconst Center = styled.div`\n text-align: center;\n`\n\nconst MondialRelayItemComponent = React.forwardRef<HTMLDivElement, MondialRelayItemProps>(function PickupItemComponent(\n { cart, project, className, onContinue },\n ref,\n) {\n const navigation = useNavigation()\n\n return (\n <Item title={t('Mondial Relay delivery')} ref={ref} className={className}>\n {project.date_delivery && (\n <plume.Callout type=\"info\">\n {t(\n 'The project owner estimates delivering rewards around %(date)s. You can always change your drop-off point later if you need to.',\n {\n date: models.project.getShippingFormattedDate(project),\n },\n )}\n </plume.Callout>\n )}\n\n <formik.Formik\n initialValues={{\n firstName: cart.selectedMondialRelay?.firstName ?? '',\n lastName: cart.selectedMondialRelay?.firstName ?? '',\n phoneNumber: cart.selectedMondialRelay?.phoneNumber ?? '',\n country: cart.selectedCountry?.code,\n dropoff: cart.selectedMondialRelay?.dropoff ?? undefined,\n }}\n onSubmit={(values) => {\n cart.setMondialRelay({\n firstName: values.firstName,\n lastName: values.lastName,\n phoneNumber: values.phoneNumber,\n dropoff: values.dropoff,\n })\n onContinue()\n }}\n validationSchema={yup.object({\n firstName: yup.string().required(),\n lastName: yup.string().required(),\n phoneNumber: yup.string().required(),\n country: yup.string().required(),\n dropoff: yup.mixed().required(),\n })}\n >\n {(formikBag) => {\n return (\n <form noValidate onSubmit={formikBag.handleSubmit}>\n <MondialRelayStep1 cart={cart} />\n <MondialRelayStep2 cart={cart} />\n\n <plume.styles.button.Button>{t('Continue')}</plume.styles.button.Button>\n </form>\n )\n }}\n </formik.Formik>\n <Center>\n <plume.styles.copy.S>\n <plume.Link\n kind=\"secondary\"\n onClick={() => {\n navigation.navigate(PAGES.SELECTION)\n }}\n >\n {t('Change delivery method')}\n </plume.Link>\n </plume.styles.copy.S>\n </Center>\n </Item>\n )\n})\n\nexport const MondialRelayItem = styled(MondialRelayItemComponent)`\n ${plume.RadioGroupField} {\n margin: 20px 0;\n }\n\n ${plume.RadioField} {\n ${plume.glyphs.stroke.MapCursor} {\n color: ${plume.COLORS.GREY_SHADE_4};\n margin-right: 4px;\n }\n\n ${plume.styles.field.Title} {\n margin-right: 8px;\n color: ${plume.COLORS.PRIMARY_BLACK} !important;\n\n ${plume.styles.heading.XXXS} {\n display: inline;\n }\n }\n\n ${plume.styles.field.Context} {\n white-space: pre-wrap;\n }\n }\n\n ${plume.styles.button.Button} {\n width: 100%;\n margin-top: 24px;\n }\n\n ${Center} {\n margin: 20px 0 0;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\nimport * as formik from 'formik'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\nimport * as utils from '@owl-nest/utils'\nimport * as models from '@owl-nest/models'\nimport * as env from '@owl-nest/config'\n\nimport { StepTitle } from './StepTitle'\nimport { CartMethods, ShippingCart } from '../../hooks/useCart'\nimport { useProject } from '../../hooks/useProject'\n\ntype MondialRelayStep1Props = {\n cart: ShippingCart & CartMethods\n}\n\nexport function MondialRelayStep1({ cart }: MondialRelayStep1Props) {\n const [phoneCountryCode, setPhoneCountryCode] = React.useState<string | undefined>(undefined)\n const defaultPhoneCountry = env.COUNTRIES.find((country) => country.code === env.USER_COUNTRY) || env.COUNTRIES[0]\n const { project } = useProject()\n\n const deliveryCountries = Object.entries(cart.rates.mondialRelay)\n .reduce(\n (countries, [code, rate]) => {\n const country = env.COUNTRIES.find((country) => country.code === code)\n if (country === undefined) {\n return countries\n }\n\n countries.push({\n label: utils.shipping.getShippingOptionLabel(country.label(), rate, models.project.currencySymbol(project)),\n code: code,\n })\n\n return countries\n },\n [] as { label: string; code: string }[],\n )\n .sort((a, b) => a.label.localeCompare(b.label))\n\n return (\n <Wrapper>\n <StepTitle index={1}>{t('Enter your contact details')}</StepTitle>\n\n <IdentityGroup>\n <formik.Field name=\"firstName\">\n {({ field, meta }: formik.FieldProps<string>) => {\n return (\n <plume.TextField\n label={t('First name')}\n value={field.value}\n name={field.name}\n onChange={field.onChange}\n onBlur={field.onBlur}\n error={meta.touched && meta.error}\n />\n )\n }}\n </formik.Field>\n\n <formik.Field name=\"lastName\">\n {({ field, meta }: formik.FieldProps<string>) => {\n return (\n <plume.TextField\n label={t('Last name')}\n value={field.value}\n name={field.name}\n onChange={field.onChange}\n onBlur={field.onBlur}\n error={meta.touched && meta.error}\n />\n )\n }}\n </formik.Field>\n </IdentityGroup>\n\n <formik.Field name=\"phoneNumber\">\n {({ field, meta, form }: formik.FieldProps<string>) => {\n return (\n <plume.PhoneField\n countries={env.COUNTRIES}\n defaultCountry={defaultPhoneCountry.code}\n label={t('Phone number')}\n context={t('to facilitate delivery')}\n value={{ number: field.value, country: phoneCountryCode }}\n name={field.name}\n onChange={(phone: { number: string; country?: string }) => {\n setPhoneCountryCode(phone.country)\n form.setFieldValue(field.name, phone.number)\n }}\n onBlur={field.onBlur}\n error={meta.touched && meta.error}\n />\n )\n }}\n </formik.Field>\n\n <plume.SelectField\n label={t('Shipping country')}\n selected={cart.selectedCountry ? [cart.selectedCountry?.code] : undefined}\n onChange={(selected) => {\n cart.setSelectedCountry(selected[0])\n }}\n disabled={deliveryCountries.length === 1}\n >\n {deliveryCountries.map((option) => {\n return <plume.Option key={option.code} value={option.code} label={option.label} />\n })}\n </plume.SelectField>\n </Wrapper>\n )\n}\n\nconst Wrapper = styled.div`\n ${plume.Select} {\n z-index: 3;\n }\n\n ${plume.PhoneField} {\n margin-bottom: 24px;\n }\n`\n\nexport const IdentityGroup = styled(plume.styles.controls.Group)`\n margin: 20px 0 20px;\n\n ${plume.TextField} {\n flex: 1;\n\n &:first-child {\n margin-right: 10px;\n }\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\n\ntype StepTitleProps = {\n index: number\n className?: string\n children: React.ReactNode\n}\n\nfunction StepTitleComponent({ index, children, className }: StepTitleProps) {\n return (\n <div className={className}>\n <BackgroundCircle>\n <plume.styles.copy.S>{index}</plume.styles.copy.S>\n </BackgroundCircle>\n <plume.styles.copy.M>{children}</plume.styles.copy.M>\n </div>\n )\n}\n\nexport const StepTitle = styled(StepTitleComponent)`\n display: flex;\n margin: 24px 0;\n\n ${plume.styles.copy.M} {\n font-weight: 600; /* HACK: Irregular font manipulation. We'll be adding copy.M.semiBold, so this is just by anticipation. */\n }\n`\n\nconst BackgroundCircle = styled.div`\n width: 27px;\n height: 27px;\n background-color: ${plume.COLORS.PRIMARY_SAND_100};\n border-radius: 28px;\n color: ${plume.COLORS.PRIMARY_SAND_700};\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 8px;\n\n ${plume.styles.copy.S} {\n margin-bottom: 2px;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\nimport * as formik from 'formik'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { t } from '@owl-nest/localize'\nimport * as env from '@owl-nest/config'\n\nimport { StepTitle } from './StepTitle'\nimport { CartMethods, ShippingCart } from '../../hooks/useCart'\nimport { useProject } from '../../hooks/useProject'\nimport * as duvet from '@ulule/duvet'\n\ntype MondialRelayStep1Props = {\n cart: ShippingCart & CartMethods\n}\n\nexport function MondialRelayStep2({ cart }: MondialRelayStep1Props) {\n const { project } = useProject()\n\n return (\n <Wrapper>\n <StepTitle index={2}>{t('Find a drop-off point')}</StepTitle>\n\n <formik.Field name=\"dropoff\">\n {({ field, meta, form }: formik.FieldProps<duvet.Location>) => {\n return (\n <>\n <duvet.DropoffPicker\n selected={field.value?.id}\n onSelect={(location) => {\n form.setFieldValue(field.name, location)\n }}\n addressQuery={cart.selectedMondialRelay?.address}\n onAddressChange={(address) =>\n cart.setMondialRelay({\n address,\n })\n }\n projectId={project.id}\n countries={env.COUNTRIES}\n mapboxApiKey={env.MAPBOX_API_KEY}\n countryFilter={['DE', 'AT', 'BE', 'ES', 'IT', 'LU', 'NL', 'PT', 'FR']}\n />\n <plume.styles.field.Message type=\"error\">{meta.touched && meta.error}</plume.styles.field.Message>\n </>\n )\n }}\n </formik.Field>\n </Wrapper>\n )\n}\n\nconst Wrapper = styled.div`\n ${plume.AutocompleteField} {\n z-index: 3;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as api from '@owl-nest/api-client/latest'\nimport * as hooks from '@owl-nest/hooks'\nimport { t, tc } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { useCart } from '../../hooks/useCart'\n\ntype TipTaxReceiptInfoProps = {\n project: api.Project\n}\n\nexport function RewardTaxDeductionModal({ project }: TipTaxReceiptInfoProps): React.ReactElement {\n const cart = useCart()\n const [isTaxReceiptModalOpen, setIsTaxReceiptModalOpen] = hooks.useModal('RewardTaxDeductionInfo')\n\n const cartRewards = cart.products.map((product) => (product.variant ? product.reward.id : product.id))\n const taxDeductibleRate = Number(project?.tax_deductible_rate ?? 66)\n\n const filteredRewards = project.rewards\n ? project.rewards.filter((reward) => cartRewards.includes(reward.id) && reward.tax_deductible)\n : undefined\n\n return (\n <ModalWithIcon\n open={isTaxReceiptModalOpen}\n closable\n onClose={() => setIsTaxReceiptModalOpen(false)}\n buttons={[\n {\n type: 'button',\n props: {\n kind: 'primary',\n type: 'button',\n onClick: () => setIsTaxReceiptModalOpen(false),\n children: t('Close'),\n },\n },\n ]}\n icon={<plume.illustrations.twoToned.SecurePaymentMedium size={127} />}\n svgScale={0.9}\n >\n <plume.styles.heading.S>\n {t('The following items are %(rate)s tax-deductible:', {\n rate: `${taxDeductibleRate}%`,\n })}\n </plume.styles.heading.S>\n <ul>\n {cart.tip.amount !== 0 && (\n <li>\n <plume.styles.copy.M>{t('Donation (without reward)')}</plume.styles.copy.M>\n </li>\n )}\n {filteredRewards &&\n filteredRewards.map((reward) => {\n return (\n <li key={reward.id}>\n <plume.styles.copy.M>{models.reward.title(models.reward.Reward(reward, project))}</plume.styles.copy.M>\n </li>\n )\n })}\n </ul>\n\n {project.tax_receipt_enabled ? (\n <plume.styles.copy.M>\n {tc(\n 'The owner of this fundraiser declares itself to be an organization of general interest or recognized public utility. [br][br] Following payment, you will receive by email a tax receipt that can give rise to an income tax reduction of up to %(rate)s, within the limit of %(maximumRate)s of your taxable income (only if you are taxed on income in France).',\n {\n br: <br />,\n rate: `${taxDeductibleRate}%`,\n maximumRate: '20%',\n },\n )}\n </plume.styles.copy.M>\n ) : (\n <plume.styles.copy.M>\n {tc(\n 'The owner of this fundraiser declares themself as an organization of general interest or recognized public utility.[br][br]They will provide you with a tax receipt that can allow you up to a %(rate)s income tax reduction for a maximum of %(maximumRate)s of your taxable income (only if you are taxed on income in France).',\n {\n br: <br />,\n rate: `${taxDeductibleRate}%`,\n maximumRate: '20%',\n },\n )}\n </plume.styles.copy.M>\n )}\n </ModalWithIcon>\n )\n}\n\nconst ModalWithIcon = styled(plume.ModalWithIcon)`\n ${plume.ModalIconWrapper} {\n margin-bottom: 10px;\n }\n\n ${plume.styles.heading.S} {\n margin-bottom: 10px;\n }\n`\n", "import * as React from 'react'\nimport styled, { createGlobalStyle } from 'styled-components'\nimport { Route, Routes, Outlet, useLocation, useNavigate } from 'react-router-dom'\n\nimport * as services from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport * as logger from '@owl-nest/logger'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { Comment } from './Comment'\nimport { Processing } from './Processing'\nimport { Aborted } from './Aborted'\nimport { Canceled } from './Canceled'\nimport { Share } from './Share'\nimport { End } from './End'\nimport { MembershipThanks } from './MembershipThanks'\nimport { useProject } from '../../hooks/useProject'\nimport { PAGES } from './PAGES'\n\nexport function EndfunnelRouter(): React.ReactElement {\n const searchQuery = new URLSearchParams(document.location.search)\n const { project } = useProject()\n const navigate = useNavigate()\n\n // Usually kolkt redirects the user to the endfunnel with a query param\n // ?order_id=XXX. But in some odd cases the device of the user strips the\n // query param before arriving to the endfunnel. The endfunnel has no\n // order_id to verify the status of the order, and the user is stuck on a\n // never ending loop in the processing step of the endfunnel. For those\n // rare cases, we save the id of the newly created order in local storage.\n // That way, when arriving on the endfunnel, if the query param is absent\n // we can rely on the localstorage to rebuild the correct url.\n React.useEffect(() => {\n const orderId = localStorage.getItem(`endfunnel_${project.id}_order`)\n if (orderId !== null) {\n localStorage.removeItem(`endfunnel_${project.id}_order`)\n }\n\n if (orderId !== null && searchQuery.get('order_id') === null) {\n navigate(\n {\n pathname: PAGES.PROCESSING,\n search: new URLSearchParams({ order_id: String(orderId) }).toString(),\n },\n { replace: true },\n )\n }\n }, [])\n\n if (searchQuery.get('order_id') === null) {\n logger.log('[endfunnel] undefined orderId - post fix')\n return <></>\n }\n\n return <Router />\n}\n\nfunction Router(): React.ReactElement {\n const searchQuery = new URLSearchParams(document.location.search)\n\n const orderId = Number(searchQuery.get('order_id'))\n const returnUrlParam = searchQuery.get('return_url')\n const returnUrl = returnUrlParam ? decodeURIComponent(returnUrlParam) : undefined\n\n const tracking = shadow.useTracking()\n\n const auth = services.user.useAuth()\n const orderService = services.order.useOrder(orderId, { fetchOnMount: false })\n const order = orderService.response.data\n\n const location = useLocation()\n\n React.useEffect(() => {\n if (auth.type === 'loggedin') {\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.CHECKOUT,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction: 'ReachEndfunnel',\n })\n }\n }, [auth.type])\n\n return (\n <>\n <GlobalStyle />\n <Routes>\n <Route path={'/done'} element={<Processing orderId={orderId} returnUrl={returnUrl} />} />\n <Route path={'/processing'} element={<Processing orderId={orderId} returnUrl={returnUrl} />} />\n {order ? (\n <>\n <Route path={'/aborted'} element={<Aborted order={order} />} />\n <Route path={'/cancelled'} element={<Canceled />} />\n\n {auth.type === 'loggedin' && (\n <Route path={'/done'} element={<DoneLayout />}>\n <Route path={'/done/comment'} element={<Comment order={order} />} />\n <Route path={'/done/share'} element={<Share order={order} user={auth.user} />} />\n <Route path={'/done/end'} element={<End order={order} />} />\n <Route path={'/done/thanks'} element={<MembershipThanks order={order} />} />\n </Route>\n )}\n </>\n ) : (\n <Route path={'/*'} element={<Processing orderId={orderId} returnUrl={location.pathname} />} />\n )}\n </Routes>\n </>\n )\n}\n\nfunction DoneLayout(): React.ReactElement {\n return (\n <Main>\n <Outlet />\n </Main>\n )\n}\n\nconst GlobalStyle = createGlobalStyle`\n *,\n :after,\n :before {\n box-sizing: border-box\n }\n\n body {\n background-color: ${plume.COLORS.PRIMARY_SAND};\n }\n`\n\nconst Main = styled.div`\n padding-bottom: 20px;\n`\n", "import * as React from 'react'\nimport { Formik, Form, Field, ErrorMessage, FieldProps, type FormikProps } from 'formik'\nimport styled, { css } from 'styled-components'\nimport * as yup from 'yup'\nimport { useNavigate } from 'react-router-dom'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as date from '@owl-nest/date'\nimport { t, tc } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as services from '@owl-nest/services'\nimport { message } from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport * as hooks from '@owl-nest/hooks'\nimport * as env from '@owl-nest/config'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { useProject } from '../../hooks/useProject'\nimport { Sponsorships } from './components/Sponsorships'\nimport { Title } from './components/Title'\nimport { PAGES } from './PAGES'\nimport { Headline, PullingContainer, SkipLink } from './style'\n\ntype CommentProps = {\n order: api.Order<true, ''>\n}\n\nexport function Comment({ order }: CommentProps) {\n const { project } = useProject()\n const tracking = shadow.useTracking()\n const [commentStatus, comment] = useComment()\n const userConfig = env.useUserEnv()\n\n const DEFAULT_MESSAGES = [\n t('Congratulations for this great project \uD83D\uDC4F'),\n t(\"We're behind you!\"),\n t('Congrats, with all my support!'),\n t(\"Let's do this!\"),\n t('Sky is the limit \uD83D\uDC4D'),\n ]\n\n const navigate = useNavigate()\n\n const isProcessingComment = commentStatus === hooks.QueryStatus.SUCCESS\n\n React.useEffect(() => {\n if (commentStatus === hooks.QueryStatus.SUCCESS) {\n tracking.project.trackOnce({\n eventCategory: shadow.CATEGORY.SOCIAL,\n pageCategory: 'project',\n siteCategory: shadow.SITE.CHECKOUT,\n eventAction: 'comment on project page from checkout endfunnel',\n })\n navigate({\n pathname: PAGES.DONE_SHARE,\n search: new URLSearchParams({ order_id: String(order.id) }).toString(),\n })\n }\n }, [commentStatus])\n\n const isDonationBasedProject = models.project.isDonationBased(project)\n const projectName = models.project.name(project)\n const userTransactionsURL = `/users/${order?.user?.id}/settings/transactions/` || `/settings/transactions/`\n\n const headlineGettextArguments = {\n amount: plume.accounting.localeMoney(order?.order_total, {\n currency: order.project.currency,\n lang: userConfig.lang,\n }),\n projectName,\n strong: <strong />,\n }\n\n return (\n <>\n {project?.sponsorships_count > 0 && order && (\n <Sponsorships sponsorships={project.sponsorships ?? []} order={order} />\n )}\n <Title />\n\n <BannerComment contexts={['error_create_comment']} />\n <PullingContainer>\n {project.thanks_note !== undefined && (models.i18n.get(project.thanks_note) ?? '')?.length > 0 && (\n <Thanks>\n <plume.styles.image.Avatar\n type=\"medium\"\n src={models.project.avatarImage(project, userConfig.lang, '90x90')}\n />\n\n <WysiwygContent dangerouslySetInnerHTML={{ __html: models.i18n.get(project.thanks_note)! }} />\n </Thanks>\n )}\n <Headline>\n {order !== undefined ? (\n order?.type === 'monthly' ? (\n tc(\n 'Your [strong: monthly donation of %(amount)s to %(projectName)s] has been processed. You will receive an email in a few moments.',\n headlineGettextArguments,\n )\n ) : (\n <>\n {isDonationBasedProject\n ? tc(\n 'Your [strong: %(amount)s donation to %(projectName)s] has been processed. You will receive an email in a few moments.',\n headlineGettextArguments,\n )\n : tc(\n 'Your [strong: %(amount)s contribution to %(projectName)s] has been processed. You will receive an email in a few moments.',\n headlineGettextArguments,\n )}\n </>\n )\n ) : (\n <plume.Spinner />\n )}\n </Headline>\n\n {order?.type === 'monthly' && (\n <MonthlyDonationCallout customIcon={plume.glyphs.stroke.Reroll} type=\"info\">\n {order?.subscription?.next_payment_expected_at ? (\n <>\n {tc(\n `[strong: Monthly donation:] your first payment was made today. The next payment is due on %(date)s. If you change your mind, you can edit or stop your monthly donation from [link: your Ulule account].`,\n {\n date: date.format(new Date(`${order.subscription.next_payment_expected_at} 00:00:00`), 'PPP'),\n link: <plume.Link href={userTransactionsURL} target=\"_blank\" underlined />,\n strong: <strong />,\n },\n )}\n </>\n ) : (\n <>\n {tc(\n `[strong: Monthly donation:] your first payment was made today. The next payment will automatically take place in one month. If you change your mind, you can edit or stop your monthly donation from [link: your Ulule account].`,\n {\n link: <plume.Link href={userTransactionsURL} target=\"_blank\" underlined />,\n strong: <strong />,\n },\n )}\n </>\n )}\n </MonthlyDonationCallout>\n )}\n\n {/* FIXME: Remove strong when implementing `tc` */}\n <Headline>\n <strong>{t('Congratulate the project team by leaving a public comment:')}</strong>\n </Headline>\n <Formik\n initialValues={{ comment: pickRandomly(DEFAULT_MESSAGES) }}\n onSubmit={(values) => {\n comment(values.comment)\n }}\n validateOnChange={false}\n validationSchema={commentSchema()}\n >\n {({ errors, touched, handleSubmit, setFieldValue }: FormikProps<{ comment: string }>) => (\n <Form>\n <Field name=\"comment\">\n {({ field }: FieldProps<any>) => (\n <plume.TextAreaField\n error={touched.comment && errors.comment}\n onChange={(event) => {\n setFieldValue(field.name, event.target.value)\n }}\n resizable={false}\n rows={4}\n value={field.value}\n />\n )}\n </Field>\n <ErrorMessage name=\"comment\" component={ErrorComment} />\n <Button onClick={() => !isProcessingComment && handleSubmit} $loading={isProcessingComment}>\n {isProcessingComment ? <plume.Spinner /> : t('Publish my comment')}\n </Button>\n </Form>\n )}\n </Formik>\n <SkipLink\n onClick={() => {\n navigate({\n pathname: PAGES.DONE_SHARE,\n search: new URLSearchParams({ order_id: String(order.id) }).toString(),\n })\n }}\n >\n <plume.styles.copy.S>{t('Skip')}</plume.styles.copy.S>\n </SkipLink>\n <PrivacyDisclaimer>\n {tc(\n 'IMPORTANT: comments and forum posts are public. Through the content of your publication you could therefore reveal information about you, sometimes sensitive or very personal (religious or philosophical beliefs, sexual orientation, political opinions, state of health, etc.). [strong: We invite you to be careful in writing your publications on the forum, to protect your privacy].',\n {\n strong: <strong />,\n },\n )}\n </PrivacyDisclaimer>\n </PullingContainer>\n </>\n )\n}\n\nconst WysiwygContent = styled(plume.WysiwygContent)`\n p:first-child {\n margin-top: 0;\n }\n p:last-child {\n margin-bottom: 0;\n }\n`\n\nconst Thanks = styled(plume.WysiwygContent)`\n align-items: start;\n background: ${plume.COLORS.PRIMARY_GREY_000};\n border-radius: 4px;\n box-shadow: ${plume.EFFECTS.SHADOW_5};\n display: flex;\n flex-direction: row;\n gap: 16px;\n margin-bottom: 20px;\n max-width: 534px;\n padding: 16px 16px 24px 16px;\n text-align: left;\n width: 100%;\n\n & > * {\n ${plume.styles.copy._smallStyle};\n }\n`\n\nconst Button = styled(plume.styles.button.Button)`\n margin: 20px auto 0;\n\n ${(props) =>\n props.$loading &&\n css`\n background-color: ${plume.COLORS.PRIMARY_BLUE_700};\n `};\n`\n\nconst BannerComment = styled(message.Banner)`\n position: relative;\n color: ${plume.COLORS.PRIMARY_GREY_000};\n`\n\nconst ErrorComment = styled(plume.styles.copy.S)`\n color: ${plume.COLORS.PRIMARY_RED_500};\n`\n\nconst MonthlyDonationCallout = styled(plume.Callout)`\n margin-bottom: 26px;\n text-align: left;\n\n ${plume.glyphs.stroke.Reroll} {\n color: ${plume.COLORS.PRIMARY_BLUE_700};\n }\n`\n\nconst PrivacyDisclaimer = styled(plume.styles.copy.XS)`\n color: ${plume.COLORS.PRIMARY_GREY_500};\n margin-top: 20px;\n`\n\nfunction commentSchema() {\n return yup.object().shape({\n comment: yup\n .string()\n .required(t('This field is required'))\n .max(500, t('This field must contain a maximum of %(max)d characters').replace('%(max)d', '${max}')),\n })\n}\n\nfunction useComment(): [hooks.QueryStatus, (comment: string) => Promise<void>] {\n const { project } = useProject()\n const [state, setState] = React.useState(hooks.QueryStatus.PRISTINE)\n const dispatch = services.message.useDispatch()\n\n return [state, comment]\n\n async function comment(comment: string) {\n setState(hooks.QueryStatus.PENDING)\n\n const response = await services.project.comment(project.id, comment)\n\n response.caseOf({\n left: () => {\n setState(hooks.QueryStatus.FAILURE)\n dispatch(\n services.message.alert(t('Oops... An error has occurred. Please retry in a few minutes.'), {\n focus: true,\n context: 'error_create_comment',\n }),\n )\n },\n right: () => {\n setState(hooks.QueryStatus.SUCCESS)\n },\n })\n }\n}\n\n/** Returns a number between min and max (included) */\nfunction getRandomInt(min: number, max: number) {\n return Math.floor(Math.random() * (max - min + 1)) + min\n}\n\n/** Returns an element of array randomly */\nfunction pickRandomly(array: any[]) {\n return array[getRandomInt(0, array.length - 1)]\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { t, tc } from '@owl-nest/localize'\nimport { MoneyDisplayer } from '@owl-nest/money'\nimport { Sponsor } from '@ulule/owl-kit-components'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as shadow from '@owl-nest/shadow'\nimport * as model from '@owl-nest/models'\nimport * as api from '@owl-nest/api-client/next'\n\ntype SponsorshipsProps = {\n sponsorships: api.Sponsorship[]\n order: api.Order<true, ''>\n}\n\nexport function Sponsorships({ sponsorships, order }: SponsorshipsProps) {\n let component\n const orderAmount = order.order_total\n const project = order.project\n\n if (sponsorships.length === 0) {\n return null\n } else if (sponsorships.length === 1 && !sponsorships[0].is_full && sponsorships[0].amount > 0) {\n component = <SponsorshipWithAmount sponsorship={sponsorships[0]} amount={orderAmount} project={project} />\n } else if (sponsorships.length === 1 && sponsorships[0].is_full && sponsorships[0].amount > 0) {\n component = <Sponsorship sponsorship={sponsorships[0]} project={project} />\n } else if (sponsorships.length === 1) {\n component = <SponsorshipWithoutAmount sponsorship={sponsorships[0]} />\n } else {\n component = <MultiSponsorships sponsorships={sponsorships} />\n }\n\n return (\n <Main>\n <Wrapper>{component}</Wrapper>\n </Main>\n )\n}\n\ntype MultiSponsorshipsProps = {\n sponsorships: api.Sponsorship[]\n}\n\nfunction MultiSponsorships({ sponsorships }: MultiSponsorshipsProps) {\n return (\n <>\n <Heading>{t('This project is supported by')}</Heading>\n <SponsorList>\n {sponsorships.map((sponsorship, key) => {\n return (\n <SponsorItem key={key}>\n <SponsorshipContainer sponsorship={sponsorship} position={`checkout-${key}`} />\n </SponsorItem>\n )\n })}\n </SponsorList>\n </>\n )\n}\n\ntype SponsorshipWithAmountProps = {\n sponsorship: api.Sponsorship\n project: api.Project\n amount: number\n}\n\nfunction SponsorshipWithAmount({ sponsorship, amount, project }: SponsorshipWithAmountProps) {\n const finalAmount = amount * sponsorship.coefficient\n\n return (\n <Heading>\n <SponsorshipContainer sponsorship={sponsorship} position=\"checkout-0\" />\n {tc('also match funded this project for an amount of [amount]', {\n amount: <MoneyDisplayer amount={finalAmount} project={project} />,\n })}\n </Heading>\n )\n}\n\ntype SponsorshipProps = {\n sponsorship: api.Sponsorship\n project: api.Project\n}\n\nfunction Sponsorship({ sponsorship, project }: SponsorshipProps) {\n return (\n <Heading>\n <SponsorshipContainer sponsorship={sponsorship} position=\"checkout-0\" />\n {tc('match funded your support for an amount of [amount]', {\n amount: <MoneyDisplayer amount={sponsorship.amount} project={project} />,\n })}\n </Heading>\n )\n}\n\ntype SponsorshipWithoutAmountProps = {\n sponsorship: api.Sponsorship\n}\n\nfunction SponsorshipWithoutAmount({ sponsorship }: SponsorshipWithoutAmountProps) {\n return (\n <Heading>\n <SponsorshipContainer sponsorship={sponsorship} position=\"checkout-0\" />\n {t('supports this project.')}\n </Heading>\n )\n}\n\ntype SponsorshipContainerProps = {\n sponsorship: api.Sponsorship\n position: string\n}\n\nfunction SponsorshipContainer({ sponsorship, position }: SponsorshipContainerProps) {\n const sponsorRef = React.useRef(null)\n\n shadow.usePartnershipTracker(sponsorship.sponsor.user.id, sponsorRef, {\n click: {\n enabled: true,\n },\n eventPosition: position,\n impression: {\n enabled: true,\n },\n })\n\n return (\n <span ref={sponsorRef}>\n <Sponsor\n avatarUrl={model.sponsorship.avatar(sponsorship, 'small')}\n name={sponsorship.sponsor.name}\n link={sponsorship.sponsor.link || sponsorship.sponsor.user.absolute_url}\n mainColor={sponsorship.main_color || undefined}\n />\n </span>\n )\n}\n\nconst Main = styled.div`\n border-top: 1px solid ${plume.COLORS.PRIMARY_SAND};\n background-color: ${plume.COLORS.PRIMARY_WHITE};\n padding: 10px 10px;\n text-align: center;\n width: 100%;\n`\n\nconst Heading = styled(plume.styles.copy.S)`\n align-items: center;\n color: ${plume.COLORS.GREY_SHADE_3};\n display: flex;\n flex-direction: row;\n line-height: 13px;\n\n @media not screen and ${plume.BREAKPOINTS.TABLET} {\n flex-direction: column;\n }\n`\n\nconst Wrapper = styled.div`\n width: 100%;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n\n ${Heading} > span {\n display: flex;\n align-items: center;\n\n & > a:first-child {\n margin-right: 5px;\n @media not screen and ${plume.BREAKPOINTS.TABLET} {\n width: 100%;\n }\n }\n\n & > span:first-child {\n margin-right: 5px;\n }\n }\n`\n\nconst SponsorList = styled.ul`\n margin: 0;\n padding: 5px 0 0;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n list-style-type: none;\n\n @media not screen and ${plume.BREAKPOINTS.TABLET} {\n flex-flow: row wrap;\n }\n`\n\nconst SponsorItem = styled.li`\n flex: 1 0 auto;\n margin: auto;\n padding: 0 5px;\n\n @media not screen and ${plume.BREAKPOINTS.TABLET} {\n padding: 5px 5px 0;\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { t } from '@owl-nest/localize'\nimport * as services from '@owl-nest/services'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nexport function Title() {\n const auth = services.user.useAuth()\n if (auth.type !== 'loggedin') {\n return null\n }\n\n return (\n <>\n <TitleBanner>\n <plume.illustrations.twoToned.HeartWithConfetti inverted noBackground size={70} />\n <plume.styles.heading.L>\n {t('Payment confirmed, thank you %(username)s!', {\n username: auth.user.name || '',\n })}\n </plume.styles.heading.L>\n </TitleBanner>\n </>\n )\n}\n\nconst TitleBanner = styled.div`\n align-items: center;\n background-color: ${plume.COLORS.BRAND_ACCENT_GREEN};\n display: flex;\n flex-direction: column;\n height: 210px;\n justify-content: center;\n padding: 10px 0 20px;\n text-align: center;\n\n ${plume.styles.heading.L} {\n color: ${plume.COLORS.PRIMARY_WHITE};\n margin-top: 18px;\n }\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n padding: 18px 0 60px;\n }\n`\n", "export const PAGES = {\n DONE_PROCESSING: '/endfunnel/done',\n PROCESSING: '/endfunnel/processing',\n CANCELED: '/endfunnel/cancelled',\n ABORTED: '/endfunnel/aborted',\n DONE_THANKS: '/endfunnel/done/thanks',\n DONE_COMMENT: '/endfunnel/done/comment',\n DONE_SHARE: '/endfunnel/done/share',\n DONE_END: '/endfunnel/done/end',\n} as const\n", "import styled from 'styled-components'\n\nimport * as plume from '@ulule/owl-kit-components/next'\nimport { styles } from '@owl-nest/utils'\n\nexport const Container = styled.div`\n margin: 20px auto;\n padding: 0 15px;\n max-width: 520px;\n text-align: center;\n box-sizing: content-box;\n\n @media (min-width: (520px + 30px)) {\n padding: 0 0;\n }\n`\n\nexport const Headline = styled(plume.styles.heading.XXS)`\n text-align: center;\n margin-bottom: 1.75em;\n`\n\nexport const PullingContainer = styled.div`\n background-color: ${plume.COLORS.PRIMARY_GREY_000};\n box-shadow: ${plume.EFFECTS.SHADOW_1};\n padding: 30px;\n text-align: center;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n border-radius: 6px;\n margin: -32px auto 0;\n max-width: 600px;\n }\n`\n\nexport const SkipLink = styled(plume.Link).attrs({ kind: 'secondary', underlined: true })`\n display: block;\n margin-top: 20px;\n\n ${plume.styles.copy.S} {\n color: ${plume.COLORS.TEXT_TERTIARY};\n }\n`\n\n// FIXME= Replace with a proper Plume title\nexport const Title = styled.div`\n font-color: ${plume.COLORS.TEXT_PRIMARY};\n font-size: ${styles.rem(24)}; // HACK: Irregular font manipulation\n font-weight: 700;\n font-family: ${plume.FONTS.SECONDARY_FONT};\n`\n\nexport const TextContainer = styled.div`\n text-align: center;\n margin-bottom: 20px;\n`\n\nexport const Banner = styled(plume.Banner)`\n position: relative;\n top: 0;\n`\n", "import * as React from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as consent from '@owl-nest/consent'\nimport * as date from '@owl-nest/date'\nimport { t, tc } from '@owl-nest/localize'\nimport * as models from '@owl-nest/models'\nimport * as services from '@owl-nest/services'\nimport * as shadow from '@owl-nest/shadow'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport * as UFE from '../../utils/UFE'\nimport { setTrackingOrderInLocalStorage, getTrackingOrderFromLocalStorage } from '../../utils/localStorage'\nimport { useProject } from '../../hooks/useProject'\nimport { PAGES } from './PAGES'\nimport { Banner, Container, TextContainer, Title } from './style'\n\nconst LOCALSTORAGE_LIFETIME = 1000 * 60 * 30 // 30 min\n\ntype ProcessingProps = {\n orderId: number\n returnUrl?: string\n}\n\nexport function Processing({ orderId, returnUrl }: ProcessingProps) {\n const orderService = services.order.useOrder(orderId, { fetchOnMount: false })\n const currentOrder = React.useRef(orderService.response.data)\n currentOrder.current = orderService.response.data\n\n const { project } = useProject()\n const tracking = shadow.useTracking()\n\n services.cart.removeCartFromLocalStorage(project.id)\n\n const navigate = useNavigate()\n\n React.useEffect(() => {\n document.title = `${t('Confirmed payment')} - ${models.project.name(project)}`\n }, [])\n\n React.useEffect(() => {\n const handle = setInterval(() => {\n if (currentOrder.current !== undefined && models.order.isCancelled(currentOrder.current)) {\n navigate({\n pathname: PAGES.CANCELED,\n search: new URLSearchParams({ order_id: String(orderId) }).toString(),\n })\n } else if (currentOrder.current !== undefined && models.order.isFailed(currentOrder.current)) {\n navigate({\n pathname: PAGES.ABORTED,\n search: new URLSearchParams({ order_id: String(orderId) }).toString(),\n })\n } else if (currentOrder.current !== undefined && models.order.isSucceeded(currentOrder.current)) {\n trackOrder(currentOrder.current, project, tracking)\n if (returnUrl) {\n const parsedReturnUrl = new URL(returnUrl, document.baseURI)\n const isExternal = !parsedReturnUrl.pathname.startsWith(`/projects/${project.id}/checkout`)\n if (isExternal) {\n window.location.href = returnUrl\n } else {\n navigate({\n pathname: returnUrl,\n search: new URLSearchParams({ order_id: String(orderId) }).toString(),\n })\n }\n } else {\n const canComment = project.comments_enabled !== api.ProjectCommentsPermission.NOONE\n const isMembership = models.project.isMembership(project)\n navigate({\n pathname: isMembership ? PAGES.DONE_THANKS : canComment ? PAGES.DONE_COMMENT : PAGES.DONE_SHARE,\n search: new URLSearchParams({ order_id: String(orderId) }).toString(),\n })\n }\n } else {\n orderService.query()\n }\n }, 1000)\n\n return () => clearInterval(handle)\n }, [])\n\n return (\n <>\n <Banner type=\"info\">\n <Title>{t('Your payment is processing')}\n \n\n \n \n \n {tc(\n 'Your payment is processing, if nothing happens, please contact the support. Do not hesitate to send an email to [link: %(support_email)s]',\n {\n link: ,\n support_email: UFE.SUPPORT_EMAIL,\n },\n )}\n \n \n \n \n \n )\n}\n\nfunction trackOrder(order: api.Order, project: api.Project, tracking: shadow.TrackingContext): void {\n consent.whenGivenFor(consent.Vendor.GOOGLE_ANALYTICS, {\n do: () => {\n const trackingOrder = getTrackingOrderFromLocalStorage(order.id)\n const orderTimestamp = date.parseISO(order.created_at).getTime()\n\n if (trackingOrder === undefined && +new Date() - orderTimestamp < LOCALSTORAGE_LIFETIME) {\n tracking.ecommerce.track('purchase', {\n value: order.order_subtotal,\n currency: project.currency,\n transaction_id: order.id.toString(),\n shipping: order.order_shipping_total,\n items: [\n ...(order.items?.map((product) => {\n const reward = models.orderItem.getReward(product, project)\n const variant = models.orderItem.getVariant(product, project)\n return {\n item_id: String(product.reward.id),\n item_name: (reward && models.reward.title(reward)) ?? '',\n item_brand: models.project.name(project),\n item_variant: String(variant?.id),\n price: product.unit_price,\n quantity: product.quantity,\n }\n }) || []),\n ...(order.tip !== 0\n ? [\n {\n item_id: 'tip',\n item_name: 'tip',\n item_brand: models.project.name(project),\n price: order.tip,\n quantity: 1,\n },\n ]\n : []),\n ],\n })\n\n setTrackingOrderInLocalStorage(order.id)\n }\n },\n })\n}\n", "import * as React from 'react'\n\nimport { t, tc } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as api from '@owl-nest/api-client/next'\n\nimport * as UFE from '../../utils/UFE'\nimport { useProject } from '../../hooks/useProject'\nimport { Container, Title, TextContainer, Banner } from './style'\nimport { BackButton, RetryButton } from './components/Buttons'\n\ntype AbortedProps = {\n order: api.Order\n}\n\nexport function Aborted({ order }: AbortedProps) {\n const { project } = useProject()\n\n React.useEffect(() => {\n document.title = t('Payment Aborted')\n }, [])\n\n return (\n <>\n \n {t('Oops... An error occurred while processing your payment.')}\n \n\n
\n \n \n {order?.error_code == 'no-stock-available' ? (\n \n {t('This transaction was cancelled due to a stock issue. No charges were made.')}\n \n ) : (\n {t('This transaction has been aborted. No charges were made.')}\n )}\n \n \n \n {tc(\n 'If you have questions about this project, you can contact the project owner [link: %(username)s] who will answer you.',\n {\n link: ,\n username: project.owner.username,\n },\n )}\n \n \n \n \n {tc('If you have questions about Ulule, do not hesitate to send an email to [link: %(support_email)s]', {\n link: ,\n support_email: UFE.SUPPORT_EMAIL,\n })}\n \n \n\n \n \n \n
\n \n )\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport { t } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as api from '@owl-nest/api-client/next'\n\ntype RetryButtonProps = { project: api.Project }\n\nexport function RetryButton({ project }: RetryButtonProps) {\n return (\n \n )\n}\n\ntype BackButtonProps = { project: api.Project }\n\nexport function BackButton({ project }: BackButtonProps) {\n return (\n \n )\n}\n\nconst Button = styled(plume.styles.button.CallToAction)`\n margin: 10px 0;\n`\n\nconst ButtonText = styled.span`\n padding: 10px;\n`\n\nconst ButtonIcon = styled.svg`\n display: inline-block;\n width: 1em;\n height: 1em;\n fill: currentColor;\n fill-rule: evenodd;\n`\n", "import * as React from 'react'\n\nimport { t, tc } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport * as UFE from '../../utils/UFE'\nimport { useProject } from '../../hooks/useProject'\nimport { Banner, Container, TextContainer, Title } from './style'\nimport { BackButton, RetryButton } from './components/Buttons'\n\nexport function Canceled() {\n const { project } = useProject()\n const projectOwner = project.owner\n const supportEmail = UFE.SUPPORT_EMAIL\n\n return (\n <>\n \n {t('Your contribution has been cancelled')}\n \n\n \n \n {t('That is a shame!')}\n \n \n \n {t('Is there a particular reason why you finally decided not to support this project?')}\n \n \n \n \n {tc(\n 'If you have questions about this project, you can contact the project owner [link: %(username)s] who will answer you.',\n {\n link: ,\n username: projectOwner.username,\n },\n )}\n \n \n \n \n {tc('If you have questions about Ulule, do not hesitate to send an email to [link: %(support_email)s]', {\n link: ,\n support_email: supportEmail,\n })}\n \n \n\n \n \n \n \n )\n}\n", "import * as React from 'react'\nimport styled from 'styled-components'\nimport { useNavigate } from 'react-router-dom'\n\nimport * as date from '@owl-nest/date'\nimport * as api from '@owl-nest/api-client/next'\nimport * as model from '@owl-nest/models'\nimport * as shadow from '@owl-nest/shadow'\nimport * as env from '@owl-nest/config'\nimport { tc, t } from '@owl-nest/localize'\n// FIXME: Migrate to the newest SocialButton\nimport { SocialButton } from '@ulule/owl-kit-components'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport { SocialPreview } from './components/SocialPreview'\n\nimport { useProject } from '../../hooks/useProject'\nimport { PAGES } from './PAGES'\nimport { Title } from './components/Title'\nimport { Sponsorships } from './components/Sponsorships'\nimport { Headline, PullingContainer, SkipLink } from './style'\n\ntype ShareProps = {\n order: api.Order\n user: api.AuthenticatedUser\n}\n\nexport function Share({ order, user }: ShareProps) {\n const tracking = shadow.useTracking()\n const navigate = useNavigate()\n const isMobile = !window.matchMedia(plume.BREAKPOINTS.LAPTOP).matches\n\n const { project } = useProject()\n\n return (\n <>\n \n {project?.sponsorships_count > 0 && order && (\n <Sponsorships sponsorships={project.sponsorships ?? []} order={order} />\n )}\n <PullingContainer>\n <Headline>\n {user &&\n tc('%(username)s, share this project with your friends:', {\n username: user.name,\n strong: <strong />,\n })}\n </Headline>\n <SocialButtonWrapper>\n <SocialButton platform=\"facebook\" label=\"Facebook\" onClick={handlePublishOnFacebook} />\n <SocialButton platform=\"twitter\" label=\"Twitter\" onClick={handleShareTweet} />\n <SocialButton platform=\"messenger\" label=\"Messenger\" onClick={handleSendWithMessenger} />\n </SocialButtonWrapper>\n <div>\n {order && (\n <SocialPreview\n picture={model.project.mainImage(order.project, 'full')}\n title={model.project.name(order.project)!}\n subtitle={model.project.subtitle(order.project)!}\n />\n )}\n </div>\n <SkipLink\n onClick={() => {\n navigate({\n pathname: PAGES.DONE_END,\n search: new URLSearchParams({ order_id: String(order.id) }).toString(),\n })\n }}\n >\n <plume.styles.copy.S>{t('Skip')}</plume.styles.copy.S>\n </SkipLink>\n </PullingContainer>\n </>\n )\n\n function handlePublishOnFacebook(event: MouseEvent) {\n event.preventDefault()\n const project = order.project\n const sharingUrl = getSharingUrl('Facebook')\n\n if (window.FB && sharingUrl) {\n window.FB.ui(\n {\n method: 'share',\n href: sharingUrl,\n },\n (response: any) => {\n if (response !== undefined) {\n tracking.social.track({\n socialNetwork: shadow.SOCIAL_NETWORK.FACEBOOK,\n socialAction: 'Share',\n socialTarget: project.absolute_url,\n ululeProjectId: project.id,\n })\n\n // redirect to next step\n navigate({\n pathname: PAGES.DONE_END,\n search: new URLSearchParams({ order_id: String(order.id) }).toString(),\n })\n }\n },\n )\n }\n }\n\n function handleShareTweet(event: MouseEvent) {\n event.preventDefault()\n const sharingUrl = getSharingUrl('Twitter')\n const hashtags = encodeURIComponent('ulule,crowdfunding')\n const link = `https://twitter.com/share?url=${sharingUrl}&hashtags=${hashtags}`\n\n // Open in the middle of window\n const height = 400\n const width = 550\n const left = window.outerWidth / 2 + (window.screenX || window.screenLeft || 0) - width / 2\n const top = window.outerHeight / 2 + (window.screenY || window.screenTop || 0) - height / 2\n\n const config: Record<string, string | number> = {\n height,\n width,\n left,\n top,\n location: 'no',\n toolbar: 'no',\n status: 'no',\n directories: 'no',\n menubar: 'no',\n scrollbars: 'yes',\n resizable: 'no',\n centerscreen: 'yes',\n chrome: 'yes',\n }\n\n // Open Twitter share popup\n const shareDialog = window.open(\n link,\n undefined,\n Object.keys(config)\n .map((key) => `${key}=${config[key]}`)\n .join(', '),\n )\n\n // Detect popup closing to redirect to the next step of endfunnel\n const interval = window.setInterval(() => {\n try {\n if (shareDialog === null || shareDialog.closed) {\n window.clearInterval(interval)\n navigate({\n pathname: PAGES.DONE_END,\n search: new URLSearchParams({ order_id: String(order.id) }).toString(),\n })\n }\n } catch (e) {\n console.error(e)\n }\n }, 1000)\n }\n\n function handleSendWithMessenger(event: MouseEvent) {\n event.preventDefault()\n\n const project = order.project\n const sharingUrl = getSharingUrl('Messenger')\n\n const trackInGTM = (actionName: string) => {\n tracking.social.track({\n socialNetwork: shadow.SOCIAL_NETWORK.MESSENGER,\n socialAction: actionName,\n socialTarget: project.absolute_url,\n ululeProjectId: project.id,\n })\n }\n\n if (sharingUrl && env.FACEBOOK_APP_ID) {\n if (isMobile) {\n trackInGTM('click: Share')\n window.open(`fb-messenger://share?link=${sharingUrl}&app_id=${encodeURIComponent(env.FACEBOOK_APP_ID)}`)\n return\n }\n\n if (window.FB) {\n window.FB.ui(\n {\n method: 'send',\n link: sharingUrl,\n },\n (response: any) => {\n if (response !== null && response !== undefined && response.success === true) {\n // redirect to next step\n navigate({\n pathname: PAGES.DONE_END,\n search: new URLSearchParams({ order_id: String(order.id) }).toString(),\n })\n\n // gtm track\n trackInGTM('Share')\n }\n },\n )\n }\n }\n }\n\n function getSharingUrl(platform: string) {\n const baseUrl = project.absolute_url\n const userId = user.id\n const today = date.format(+new Date(), 'yyyyMMddhhmm')\n // twitter will not be able to work with the link if it's not\n // URI encoded. And facebook will encode it anyway...\n const utm =\n platform === 'Twitter'\n ? encodeURIComponent(\n `utm_campaign=presale_${project.id}&utm_source=shared-from-Ulule-checkout-on-${platform}&utm_medium=uluid_${userId}-post-${today}`,\n )\n : `utm_campaign=presale_${project.id}&utm_source=shared-from-Ulule-checkout-on-${platform}&utm_medium=uluid_${userId}-post-${today}`\n\n return `${baseUrl}?${utm}`\n }\n}\n\nconst SocialButtonWrapper = styled.div`\n display: flex;\n flex-direction: column;\n margin: 0 -5px;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n flex-direction: row;\n margin: 0 -5px;\n }\n\n span {\n margin: 5px 5px;\n padding: 16px;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n margin: 0 5px;\n padding: 0;\n }\n\n flex-grow: 1;\n flex-basis: 0;\n }\n`\n", "import * as React from 'react'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport styled from 'styled-components'\nimport { styles } from '@owl-nest/utils'\n\ntype SocialPreviewProps = {\n picture?: string\n title: string\n subtitle: string\n}\n\nexport function SocialPreview({ picture, title, subtitle }: SocialPreviewProps) {\n return (\n <SocialPreviewWrapper>\n <div>\n <Image src={picture} />\n </div>\n <Body>\n <Title>{title}\n \n \n \n )\n}\n\nconst SocialPreviewWrapper = styled.div`\n margin-top: ${styles.rem(30)};\n text-align: left;\n`\nconst Image = styled.img`\n width: 100%;\n display: block;\n`\n\nconst Body = styled.div`\n background-color: ${plume.COLORS.PRIMARY_WHITE};\n padding: 15px 17px;\n border: 1px solid #e0e0e0;\n`\n\nconst Title = styled(plume.styles.heading.XXS)`\n margin-bottom: 6px;\n`\n\nconst Description = styled.div`\n font-size: ${styles.rem(15)};\n font-weight: 300;\n font-family: ${plume.FONTS.PRIMARY_FONT};\n`\n", "import * as React from 'react'\nimport styled, { createGlobalStyle, css } from 'styled-components'\n\nimport { t, tc } from '@owl-nest/localize'\nimport * as shadow from '@owl-nest/shadow'\nimport * as model from '@owl-nest/models'\nimport * as api from '@owl-nest/api-client/next'\nimport { styles } from '@owl-nest/utils'\nimport * as plume from '@ulule/owl-kit-components/next'\n\nimport * as UFE from '../../utils/UFE'\nimport { Container, SkipLink } from './style'\n\ntype EndProps = {\n order: api.Order\n}\n\nexport function End({ order }: EndProps) {\n const tracking = shadow.useTracking()\n const confetti = UFE.CHECKOUT_ASSETS.endfunnel.confetti\n\n React.useEffect(() => {\n if (window.FB) {\n window.FB.Event.subscribe('edge.create', trackLike)\n window.FB.Event.subscribe('edge.remove', trackUnLike)\n }\n if (window.FB && window.FB.XFBML) {\n window.FB.XFBML.parse()\n }\n\n return () => {\n if (window.FB) {\n window.FB.Event.unsubscribe('edge.create', trackLike)\n window.FB.Event.unsubscribe('edge.remove', trackUnLike)\n }\n }\n\n function trackLike() {\n tracking.social.track({\n socialNetwork: shadow.SOCIAL_NETWORK.FACEBOOK,\n socialAction: 'Like',\n socialTarget: 'https://www.facebook.com/ulule',\n })\n }\n\n function trackUnLike() {\n tracking.social.track({\n socialNetwork: shadow.SOCIAL_NETWORK.FACEBOOK,\n socialAction: 'Unlike',\n socialTarget: 'https://www.facebook.com/ulule',\n })\n }\n }, [])\n\n const mainTag = order.project.main_tag\n\n return (\n \n \n \n \uD83D\uDC4F\n \n
\n \n \n \n \n \n {tc('Want to discover [linebreak] more projects?', { linebreak:
})}\n
\n
\n {mainTag && (\n \n )}\n
\n\n \n {t('Back to project description')}\n \n \n
\n\n {new Date() >= new Date('11/06/2024') && new Date() <= new Date('12/08/2024') && (\n \n )}\n
\n )\n}\n\nconst GlobalStyle = createGlobalStyle<{ confetti: string }>`\n body {\n ${(props) =>\n props.confetti &&\n css`\n background-image: url('${props.confetti}');\n background-size: 273px 280px;\n `}\n }\n`\n\nconst EndContainer = styled.div`\n margin-top: 50px;\n margin-bottom: 40px;\n`\n\nconst Icon = styled.div`\n border: 5px solid ${plume.COLORS.PRIMARY_GREY_000};\n border-radius: 50%;\n margin-top: 100px;\n width: 123px;\n height: 123px;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: ${styles.rem(60)};\n position: relative;\n z-index: 1;\n background-color: ${plume.COLORS.SECONDARY_GREEN_800};\n`\n\nconst Body = styled.div`\n padding: 80px 10px 25px 10px;\n background-color: ${plume.COLORS.PRIMARY_GREY_000};\n box-shadow: ${plume.EFFECTS.SHADOW_4};\n margin-top: -73px;\n`\n\nconst Content = styled.div`\n display: block;\n font-family: 'indie-flower', cursive;\n font-size: ${styles.rem(24)};\n line-height: 23px;\n text-align: center;\n margin: 0 auto 15px auto;\n color: ${plume.COLORS.SECONDARY_GREEN_800};\n\n span {\n position: relative;\n display: inline-block;\n }\n`\n\nconst Decoration = styled.svg`\n display: inline-block;\n transform: scaleX(-1) rotate(35deg) translate(49%, 15%);\n width: 28px;\n height: 33px;\n fill: ${plume.COLORS.SECONDARY_GREEN_800};\n`\n\nconst Button = styled(plume.styles.button.CallToAction)`\n background-color: ${plume.COLORS.SECONDARY_GREEN_800};\n opacity: 1;\n\n &:hover {\n background-color: ${plume.COLORS.BRAND_ACCENT_GREEN_HOVER};\n opacity: 0.9;\n }\n`\n\nconst Contest = styled.a`\n background-image: url('${UFE.CHECKOUT_ASSETS.contest_mobile}');\n background-repeat: no-repeat;\n background-size: contain;\n display: block;\n height: 300px;\n margin: 0;\n max-width: 520px;\n padding: 0;\n position: relative;\n text-decoration: none;\n width: 100%;\n\n @media screen and ${plume.BREAKPOINTS.TABLET} {\n background-image: url('${UFE.CHECKOUT_ASSETS.contest}');\n }\n`\n", "import * as React from 'react'\nimport styled from 'styled-components'\n\nimport * as api from '@owl-nest/api-client/next'\nimport * as models from '@owl-nest/models'\nimport * as date from '@owl-nest/date'\nimport { t, tc } from '@owl-nest/localize'\nimport * as plume from '@ulule/owl-kit-components/next'\nimport * as env from '@owl-nest/config'\n\nimport { useProject } from '../../hooks/useProject'\nimport { Sponsorships } from './components/Sponsorships'\nimport { Title } from './components/Title'\nimport { PullingContainer } from './style'\n\ntype MembershipThanksProps = {\n order: api.Order\n}\n\nexport function MembershipThanks({ order }: MembershipThanksProps): React.ReactElement {\n const { project } = useProject()\n\n const userTransactionsURL = `/users/${order?.user?.id}/settings/transactions/` || `/settings/transactions/`\n const isDonation = order.tip !== undefined && order.tip !== null && order.tip > 0\n const userConfig = env.useUserEnv()\n\n return (\n <>\n {project?.sponsorships_count > 0 && order && (\n \n )}\n\n \n\n <PullingContainer>\n {order.thanks_note && (\n <Thanks>\n <plume.styles.image.Avatar\n type=\"medium\"\n src={models.project.avatarImage(project, userConfig.lang, '90x90')}\n />\n\n <WysiwygContent dangerouslySetInnerHTML={{ __html: models.i18n.get(order.thanks_note)! }} />\n </Thanks>\n )}\n\n <Headline>\n {order?.items?.[0]?.reward &&\n !isDonation &&\n tc(\n 'Your membership [strong: %(membership)s at %(amount)s / month] has been taken into account. You will receive an email shortly.',\n {\n amount: plume.accounting.localeMoney(order?.order_total, {\n currency: order.project.currency,\n lang: userConfig.lang,\n }),\n //@ts-expect-error type mismatch\n membership: models.reward.title(order.items[0].reward),\n strong: <Strong />,\n },\n )}\n </Headline>\n\n {(order?.type === api.OrderType.SINGLE || isDonation) && (\n <Information>\n {tc(\n `Your [strong: donation of %(amount)s to %(name)s] has been taken into account. You will receive an email shortly.`,\n {\n strong: <Strong />,\n amount: plume.accounting.localeMoney(order?.order_total, {\n currency: order.project.currency,\n lang: userConfig.lang,\n }),\n name: models.project.name(project),\n },\n )}\n </Information>\n )}\n\n <plume.ButtonAsLink href={order.project.absolute_url}>{t('See page')}</plume.ButtonAsLink>\n\n {order?.type === api.OrderType.MONTHLY && !isDonation && (\n <MonthlyDonationCallout customIcon={plume.glyphs.stroke.Reroll} type=\"info\">\n {order?.subscription?.next_payment_expected_at ? (\n <>\n {tc(\n `[strong: Monthly membership:] your first payment was made today. The next payment is due on %(date)s. If you change your mind, you can change or stop your membership from [link: your Ulule account].`,\n {\n date: date.format(new Date(`${order.subscription.next_payment_expected_at} 00:00:00`), 'PPP'),\n link: <plume.Link href={userTransactionsURL} target=\"_blank\" underlined />,\n strong: <Strong />,\n },\n )}\n </>\n ) : (\n <>\n {tc(\n `[strong: Monthly membership:] your first payment was made today. The next payment will automatically take place in one month. If you change your mind, you can change or stop your membership from [link: your Ulule account].`,\n {\n link: <plume.Link href={userTransactionsURL} target=\"_blank\" underlined />,\n strong: <Strong />,\n },\n )}\n </>\n )}\n </MonthlyDonationCallout>\n )}\n </PullingContainer>\n </>\n )\n}\n\nconst WysiwygContent = styled(plume.WysiwygContent)`\n p:first-child {\n margin-top: 0;\n }\n p:last-child {\n margin-bottom: 0;\n }\n`\n\nconst Information = styled(plume.styles.copy.M)`\n text-align: center;\n margin-bottom: 20px;\n`\n\nconst Thanks = styled(plume.WysiwygContent)`\n align-items: start;\n background: ${plume.COLORS.PRIMARY_GREY_000};\n border-radius: 4px;\n box-shadow: ${plume.EFFECTS.SHADOW_5};\n display: flex;\n flex-direction: row;\n gap: 16px;\n margin-bottom: 20px;\n max-width: 534px;\n padding: 16px 16px 24px 16px;\n text-align: left;\n width: 100%;\n\n & > * {\n ${plume.styles.copy._smallStyle};\n }\n`\n\nconst MonthlyDonationCallout = styled(plume.Callout)`\n margin-top: 20px;\n margin-bottom: 26px;\n text-align: left;\n\n ${plume.glyphs.stroke.Reroll} {\n color: ${plume.COLORS.PRIMARY_BLUE_700};\n }\n`\n\nconst Strong = styled.strong`\n font-weight: 700;\n`\n\nconst Headline = styled(plume.styles.copy.M)`\n text-align: center;\n margin-bottom: 20px;\n`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EAAsB,CAC/C,CACF,CACF,CACF,CACF,MACSX,GAAI,0BAA0B,CAEzC,CAEA,SAASqB,GAAoBY,EAA6D,CACxF,IAAIC,EAEJ,SAASC,GAAqB,CAC5B,IAAMC,EAAYxD,GAAW,IAAa8C,EAAK,SAAS,EACpDU,IAAcF,GAAgBE,EAAU,OAAS,aACnDF,EAAeE,EACfH,EAASC,EAAa,iBAAiB,EAE3C,CAEA,IAAMG,EAAczD,GAAW,IAAa8C,EAAK,UAAWS,CAAY,EACxE,OAAAA,EAAa,EACNE,CACT,CAEA,SAAStB,GAA+BX,EAAkC,CACxE,OAAOxB,GAAW,IAAIiC,GAAY,IAAM,CACtC,IAAMyB,EAAQ1D,GAAW,IAAIiC,EAAU,EACnCyB,EAAM,cACRC,GAAuBD,EAAOlC,EAAQ,EAAE,CAE5C,CAAC,CACH,CH1Kc,IAAOoC,GAAuB", "names": ["init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "n", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "React", "ReactDOM", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "getTruncatedDescription", "reward", "description", "reward_exports", "text_exports", "getTruncatedTitle", "title", "init_define_process_env", "init_sentry_release_injection_stub", "getTruncatedDescription", "variant", "description", "variant_exports", "text_exports", "Product", "reward", "optionValuesIds", "project", "variant", "quantity", "_a", "rewardModel", "reward_exports", "variantModel", "variant_exports", "getDeliveryDate", "product", "getImage", "image", "i18n_exports", "project_exports", "image_exports", "getTitle", "getTruncatedDescription", "getTruncatedTitle", "stock", "hasAvailableStock", "productStock", "hasLimitedStock", "hasVariants", "isLegacy", "isSelectable", "quantityDoesNotExceedStock", "requiresPhone", "findProductIndexById", "products", "productId", "selectedProduct", "getProductsFromSavedIds", "savedProducts", "project", "availableProducts", "limitedProducts", "soldOutProducts", "reward", "variant", "product", "findAndFormatProduct", "dispatchProduct", "warn", "availableStock", "stock", "hasAvailableStock", "parent", "savedProduct", "reward_exports", "variant_exports", "Product", "orderRewardsAvailableFirst", "rewardList", "firstReward", "secondReward", "preSerialize", "init_define_process_env", "init_sentry_release_injection_stub", "React", "allSelectedProductsAreExpiredError", "context", "productCount", "someSelectedProductsAreExpiredError", "products", "action", "Link", "product", "getTitle", "unavailableQuantityError", "firstProduct", "stock", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "windowLens", "lens", "CHECKOUT_ASSETS", "FLAGS", "GTM_KEY", "PROJECT_ID", "SUPPORT_EMAIL", "TRACKING", "CHECKOUT_EXTRA_FIELDS", "initializeProject", "store", "id", "PROJECT_ID", "project", "load", "setInitialProject", "getProject", "_a", "SHARED_PROJECT_CACHE", "useProject", "__spreadProps", "__spreadValues", "INITIAL_STATE", "reducer", "state", "action", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "__spreadProps", "__spreadValues", "nextProducts", "product", "currentProductIndex", "currentProduct", "nextQuantity", "products", "stateProduct", "billingAddress", "shippingAddress", "nextState", "cart", "formatCart", "supportedCountries", "hasOnlyOneStandardRate", "userCountryCode", "USER_COUNTRY", "preselectedCountry", "stateWithPreselectedCountry", "hasOnlyOnePickupPoint", "geolocalizedPickupPoint", "pickupPoint", "preselectedPickupPoint", "stateWithPreselectedPickup", "CART_STATE", "atomWithReducer", "IS_UPDATING_LOCK", "useCart", "project", "useProject", "dispatch", "useAtom", "updateDryRunResult", "stateHash", "setTip", "setProduct", "resetAddresses", "resetShippingError", "resetProducts", "setAddress", "setProducts", "setShippingError", "setSelectedCountry", "setPickupPoint", "setShippingMode", "setDonation", "setMondialRelay", "error", "addresses", "mode", "id", "countryCode", "forced", "mondialRelay", "tip", "options", "frequency", "quantity", "parentId", "valuesIds", "payload", "getPayload", "create", "failure", "errorToAction", "order", "body", "actualBody", "regExp", "_", "productId", "remainingStock", "_h", "_i", "_j", "_k", "_l", "_m", "_n", "_o", "_p", "tipAmount", "baseCart", "formatCartProducts", "needAddress", "homeDeliveryRates", "mondialRelayRates", "pickupPoints", "selectedPickupPoint", "shippingModes", "canHandlePickup", "canHandleHomeDelivery", "canHandleMondialRelay", "requiresPhone", "dates", "deliveryDate", "getDeliveryDate", "dryRunResult", "productReward", "productVariant", "items", "item", "Product", "LOCALSTORAGE_NAME_TRACKING", "isExpired", "expirable", "currentDate", "expirationDate", "cleanAllExpired", "_a", "carts", "getAllCarts", "cart", "projectId", "removeCartFromLocalStorage", "storage", "i", "key", "stored", "tracking", "getTrackingOrderFromLocalStorage", "orderId", "data", "setTrackingOrderInLocalStorage", "minutesFromNow", "saveCartToLocalStorage", "cartState", "daysFromNow", "serializableCartState", "__spreadValues", "setCartInLocalStorage", "loadCartFromLocalStorage", "project", "getCartFromLocalStorage", "INITIAL_STATE", "products", "limitedProducts", "soldOutProducts", "getProductsFromSavedIds", "product", "loadCartError", "errorLabel", "errorPayload", "unavailableQuantityError", "allSelectedProductsAreExpiredError", "someSelectedProductsAreExpiredError", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "cleanSearchParams", "location", "params", "remainingParameters", "extractDonationFromSearchParams", "configuration", "amount", "frequency", "__spreadValues", "isValidFrequency", "value", "updateCartBasedOnProduct", "product", "cart", "project", "preFilledDonation", "_a", "_b", "donationAmount", "__spreadProps", "productsInCart", "formatCartProducts", "hasSelectedProducts", "payloadProducts", "productIndex", "findProductIndexById", "productInCart", "isSelectable", "hasVariants", "extractVariantFromSearchParams", "quantity", "rewardId", "valuesIds", "optionValuesIds", "response", "rewardVariants", "success", "extractProductFromSearchParams", "getProductFromSearchParams", "productFromParams", "getProductsFromSavedIds", "init_define_process_env", "init_sentry_release_injection_stub", "REVEALED_REWARDS_ATOM", "atom", "revealRewards", "store", "cart", "productFromSearchParams", "project", "revealedRewards", "revealedRewardsIds", "cartProduct", "product", "getProductsFromSavedIds", "hasVariants", "productFromSearchParamsId", "useRevealedRewards", "useAtomValue", "isSelectionRoute", "urlWithoutQueryParams", "hydrate", "project", "store", "_a", "_b", "isDonationBasedProject", "project_exports", "isMembershipProject", "quantity", "rewardId", "variantFromSearch", "extractVariantFromSearchParams", "savedCartState", "getCartFromLocalStorage", "projectWithVariants", "injectSearchParamsVariant", "preloadAndInjectLocalStorageVariants", "cartState", "error", "loadCartFromLocalStorage", "prefilledDonation", "extractDonationFromSearchParams", "membershipCart", "__spreadProps", "__spreadValues", "INITIAL_STATE", "initialCartState", "productFromSearchParams", "getProductsFromSavedIds", "getProductFromSearchParams", "cartProduct", "cleanSearchParams", "updateCartBasedOnProduct", "revealRewards", "iter", "__forAwait", "more", "temp", "product", "resolvedVariant", "valueId", "success", "rewards", "rewardIndex", "reward", "mutatedRewards", "variant", "init_define_process_env", "init_sentry_release_injection_stub", "React", "PaymentDisturbanceModalComponent", "className", "projectUrl", "ModalWithIcon", "illustrations_exports", "styles_exports", "_a", "PaymentDisturbanceModal", "src_default", "__template", "breakpoints_exports", "init_define_process_env", "init_sentry_release_injection_stub", "import_react", "_a", "HeaderWrapper", "src_default", "__template", "_b", "HeaderNav", "colors_exports", "_c", "Logo", "_d", "HeaderInfoRight", "breakpoints_exports", "_e", "HeaderInfoRightText", "styles_exports", "Header", "React", "glyphs_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "getOffsetTop", "element", "offsetTop", "scrollToCurrentItem", "step", "top", "scroll_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "PAGES", "navigationContext", "NavigationContext", "useNavigation", "redirectToLegalPage", "navContext", "donationBasedProject", "membershipProject", "preFilledTip", "routerNavigate", "useNavigate", "location", "useLocation", "state", "cart", "useCart", "auth", "user_exports", "currentLegal", "getCurrentLegalPage", "getCurrentPage", "navigate", "getNextLegalPage", "pathname", "options", "path", "currentPage", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "_a", "CenterWrapper", "src_default", "__template", "breakpoints_exports", "_b", "LoadingCard", "_c", "Highlighted", "colors_exports", "_a", "ItemWrapper", "src_default", "CenterWrapper", "__template", "colors_exports", "effects_exports", "breakpoints_exports", "_b", "ItemHeader", "_c", "Title", "styles_exports", "Item", "title", "action", "children", "className", "ref", "Link", "_a", "StyledItem", "src_default", "Item", "__template", "Title", "colors_exports", "FutureItem", "title", "action", "init_define_process_env", "init_sentry_release_injection_stub", "React", "IdentityItem", "Item", "Spinner", "Connect", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "init_define_process_env", "init_sentry_release_injection_stub", "_a", "_b", "SelectionCard", "src_default", "__template", "theme", "css", "Callout", "glyphs_exports", "_c", "_d", "TipSummaryInformations", "_e", "TipSummary", "styles_exports", "_f", "TipSummaryConversion", "colors_exports", "_g", "TipLink", "Link", "_h", "StyledTable", "_i", "SelectionWrapper", "_j", "_k", "SelectionItem", "breakpoints_exports", "hasAdditionalCost", "_l", "SelectionItemInformations", "_m", "SelectionTitle", "_n", "SelectionCurrencyWrapper", "_o", "SelectionCurrency", "_p", "SmallSelectionCurrency", "_q", "MoneyConverterWrapper", "props", "_r", "SelectionAction", "_s", "baseRewardThumbnail", "isSmall", "_t", "RewardSelectionPlaceholder", "DefaultRewardImage", "_u", "RewardSelectionImage", "_v", "SelectionVariantTitle", "_w", "QuantityResume", "fonts_exports", "_x", "SelectionSection", "_y", "SelectionSectionTitle", "_z", "ColumnSelectionSection", "_A", "TotalPrice", "_B", "ShippingSelection", "_C", "SelectedCountry", "_D", "SelectionShipping", "_E", "SelectionShippingCurrencyWrapper", "_F", "SelectedTotal", "_G", "SelectedConvertedCurrency", "_H", "CalloutText", "_I", "CalloutTextStrong", "_a", "OrderedItem", "src_default", "Item", "__template", "displayFirst", "_b", "StyledDropdown", "Dropdown", "active", "styles_exports", "status", "colors_exports", "_c", "OneLineOption", "Option", "_d", "Rate", "_e", "StyledRadioField", "RadioField", "hideDescriptionContent", "breakpoints_exports", "_f", "TipInformations", "_g", "TipActions", "_h", "SelectionError", "error", "_i", "Error", "_j", "AddMoreRewards", "LinkAsButton", "glyphs_exports", "_k", "SelectionShippingLabel", "_a", "ConversionDisclaimerWrapper", "src_default", "__template", "_b", "GlyphWrapper", "glyphNameBySymbol", "CurrencyGlyph", "currency", "size", "glyphs_exports", "ConversionDisclaimer", "project", "projectCurrency", "userCurrency", "useUserEnv", "styles_exports", "Link", "MoneyConverter", "absolutePosition", "amount", "biggerFont", "bottomPosition", "precision", "useProject", "userConfig", "currentCurrency", "userLanguage", "MoneyConverterWrapper", "LocaleMoneyDisplayer", "CURRENCIES_RATES", "MoneyDisplayer", "init_define_process_env", "init_sentry_release_injection_stub", "React", "SelectedShipping", "cart", "_a", "_b", "cartHasFreeShipping", "shippingRate", "SelectionShipping", "ShippingSelection", "SelectedCountry", "COUNTRIES", "country", "SelectionShippingCurrencyWrapper", "SelectionCurrency", "MoneyDisplayer", "CartSummary", "onModify", "_a", "_b", "project", "useProject", "cart", "useCart", "userConfig", "useUserEnv", "amount", "showTotal", "projectCurrency", "userCurrency", "isDifferentCurrency", "setIsRewardTaxDeductionModalOpen", "useSetModal", "tip", "selectedProducts", "isMembership", "project_exports", "title", "MoneyDisplayer", "projectColor", "colors_exports", "theme", "SelectionCard", "ThemeProvider", "TipSummaryInformations", "TipSummary", "TipSummaryConversion", "MoneyConverter", "TaxInfo", "glyphs_exports", "accounting_exports", "TipLink", "Callout", "StyledTable", "SelectionItem", "SelectionItemInformations", "SelectionTitle", "SelectionCurrencyWrapper", "SelectionCurrency", "selectedProduct", "additionalCost", "description", "getTruncatedDescription", "image", "variant_exports", "getImage", "productIsLegacy", "isLegacy", "getTruncatedTitle", "RewardSelectionImage", "SelectionVariantTitle", "QuantityResume", "SmallSelectionCurrency", "SelectedShipping", "SelectedTotal", "SelectionSectionTitle", "TotalPrice", "SelectedConvertedCurrency", "src_default", "LinkAsButton", "__template", "alignRight", "css", "_c", "init_define_process_env", "init_sentry_release_injection_stub", "React", "ContactItem", "goToAddress", "ref", "_a", "cart", "useCart", "countries", "COUNTRIES", "user", "user_exports", "response", "addresses", "contactAddress", "address", "Item", "AddressDisplay", "format", "BillingAddress", "billingAddress", "AddressItem", "deliveryAddress", "MondialRelayItem", "goToPickup", "_b", "_c", "_d", "_e", "MondialRelayDetail", "MondialRelayColumn", "styles_exports", "country", "src_default", "__template", "colors_exports", "PickupItem", "PickupDisplay", "glyphs_exports", "pickup_exports", "fonts_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "NewAddressSubForm", "allowCountrySelection", "hideCountrySelection", "initialCountryFilter", "defaultPhoneCountry", "disableCountry", "errors", "hideState", "initialEmpty", "onChange", "onFound", "phoneRequired", "touched", "value", "_a", "countries", "COUNTRIES", "baseAddress", "lockCountrySelect", "setLockCountrySelect", "countryFilter", "setCountryFilter", "phoneCountryCode", "setPhoneCountryCode", "cart", "useCart", "project", "useProject", "isDonationBasedProject", "project_exports", "isRewardBasedProject", "countryOptions", "countryCode", "getCountryLabel", "option", "country", "previousCountryLockState", "usePrevious", "$shippingCountrySelector", "IdentityGroup", "TextField", "evt", "__spreadProps", "__spreadValues", "Type", "RadioField", "StyledPhoneField", "phone", "SelectWrapper", "StyledSelectField", "selected", "selectedCountry", "Option", "ShippingCountryModifier", "StyledAutocompleteSubForm", "rate", "src_default", "__template", "styles_exports", "_b", "_c", "_d", "AutocompleteSubForm", "_e", "PhoneField", "_f", "SelectField", "glyphs_exports", "_g", "RadioGroupField", "DetailAddress", "initialAddress", "reason", "schema", "errors", "allowCountrySelection", "disableCountry", "phoneRequired", "countryFilter", "onCancel", "onSubmit", "hideState", "mode", "defaultPhoneCountry", "COUNTRIES", "country", "USER_COUNTRY", "isInitialEmpty", "found", "setFound", "wrapperRef", "Wrapper", "Title", "Callout", "Formik", "formikBag", "NewAddressSubForm", "address", "styles_exports", "Link", "_a", "src_default", "__template", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "_a", "Wrapper", "src_default", "__template", "Link", "RadioField", "styles_exports", "Field", "colors_exports", "RadioGroupField", "_b", "Actions", "_c", "RadioWrapper", "ExistingAddressSubForm", "addresses", "selectedAddress", "onChange", "onCreate", "onEdit", "onRemove", "countries", "COUNTRIES", "address", "index", "model", "format", "glyphs_exports", "ListAddress", "toDetail", "emptyAddress", "addresses", "callout", "onRemove", "onSubmit", "primary", "secondary", "_a", "wrapperRef", "defaultPhoneCountry", "COUNTRIES", "country", "USER_COUNTRY", "primaryFilteredAddresses", "user_exports", "isPrimaryEmpty", "isSecondaryEmpty", "found", "setFound", "Wrapper", "formatLine", "Formik", "values", "create", "value", "create$3", "create$8", "formikBag", "_b", "_c", "_d", "_e", "_f", "_g", "Title", "Callout", "NewAddressSubForm", "address", "ExistingAddressSubForm", "CheckboxField", "evt", "styles_exports", "Center", "src_default", "__template", "AddressManager", "_a", "_b", "userId", "addresses", "onRemove", "callout", "emptyAddress", "rest", "__objRest", "_c", "_d", "_e", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_m", "userAddressService", "user_exports", "primaryFilteredAddresses", "state", "setState", "countryFilter", "address", "target", "DetailAddress", "__spreadProps", "__spreadValues", "result", "updatedAddress", "ListAddress", "primary", "secondary", "errors", "reason", "value", "Either", "content", "PickupAddressItem", "user", "countryFilter", "onContinue", "ref", "_a", "_b", "userAddressService", "user_exports", "userAddresses", "addresses", "cart", "useCart", "selectedAddressInCart", "address", "selectedAddress", "emptyAddress", "Item", "Spinner", "AddressManager", "primary", "schema", "__spreadProps", "__spreadValues", "empty", "init_define_process_env", "init_sentry_release_injection_stub", "React", "DropoffAddressItem", "user", "countryFilter", "onContinue", "ref", "_a", "_b", "userAddressService", "user_exports", "userAddresses", "addresses", "cart", "useCart", "selectedAddressInCart", "address", "selectedAddress", "emptyAddress", "Item", "Spinner", "AddressManager", "primary", "schema", "_c", "_d", "_e", "_f", "__spreadProps", "__spreadValues", "empty", "init_define_process_env", "init_sentry_release_injection_stub", "React", "ContactAddressItem", "user", "countryFilter", "onContinue", "ref", "_a", "_b", "userAddressService", "user_exports", "userAddresses", "addresses", "cart", "useCart", "selectedAddressInCart", "address", "selectedAddress", "emptyAddress", "Item", "Spinner", "AddressManager", "primary", "schema", "__spreadProps", "__spreadValues", "empty", "init_define_process_env", "init_sentry_release_injection_stub", "React", "HomeDeliveryAddressItem", "user", "countryFilter", "onContinue", "phoneRequired", "ref", "_a", "_b", "userAddressService", "user_exports", "addresses", "cart", "useCart", "selectedShippingAddress", "address", "selectedBilingAddress", "Item", "Spinner", "AddressManager", "emptyAddress", "value", "delivery", "billing", "formatDeliveryDate", "schema", "__spreadProps", "__spreadValues", "empty", "deliveryDate", "format", "init_define_process_env", "init_sentry_release_injection_stub", "React", "MembershipDeliveryAddressItem", "user", "countryFilter", "onContinue", "phoneRequired", "ref", "_a", "_b", "userAddressService", "user_exports", "addresses", "cart", "useCart", "selectedShippingAddress", "address", "selectedBilingAddress", "Item", "Spinner", "AddressManager", "emptyAddress", "value", "delivery", "billing", "schema", "__spreadProps", "__spreadValues", "empty", "AddressView", "_a", "navigation", "useNavigation", "cart", "useCart", "project", "useProject", "onlyTip", "countryFilter", "phoneRequired", "auth", "user_exports", "refShippings", "scrollToCurrentItem", "tracking", "useTracking", "Item", "PAGES", "CartSummary", "IdentityItem", "PickupItem", "MondialRelayItem", "Spinner", "PickupAddressItem", "handleContinue", "DropoffAddressItem", "HomeDeliveryAddressItem", "MembershipDeliveryAddressItem", "ContactAddressItem", "FutureItem", "product", "reward_exports", "project_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "MembershipHero", "project", "_a", "_b", "mainImage", "project_exports", "projectColor", "colors_exports", "theme", "userConfig", "useUserEnv", "ThemeProvider", "Wrapper", "User", "Link", "styles_exports", "Banner", "_c", "src_default", "__template", "zindex_exports", "backgroundImage", "css", "utils_exports", "MembershipDefaultBanner", "_d", "breakpoints_exports", "_e", "init_define_process_env", "init_sentry_release_injection_stub", "import_react", "import_prop_types", "_a", "ProgressBarStyled", "src_default", "__template", "colors_exports", "props", "ProgressBar", "percent", "React", "PropTypes", "init_define_process_env", "init_sentry_release_injection_stub", "React", "PropTypes", "_a", "TitleWrapper", "src_default", "__template", "props", "styles_exports", "colors_exports", "breakpoints_exports", "_b", "Content", "CenterWrapper", "_c", "Owner", "_d", "OwnerLogo", "_e", "PartnershipBanner", "Title", "project", "ribbonRef", "userLocale", "useUserEnv", "owner", "projectHasBackgroundImage", "ribbon", "project_exports", "usePartnershipTracker", "Link", "user_exports", "Layout", "children", "progress", "_a", "project", "useProject", "isMembershipProject", "project_exports", "projectColor", "colors_exports", "theme", "Main", "FixedBanner", "ProgressBar", "MembershipHero", "Title", "CheckoutStepWrapper", "CalloutWrapper", "message_exports", "CalloutExtra", "action", "message", "CalloutExtraWrapper", "styles_exports", "src_default", "__template", "_b", "breakpoints_exports", "negativeMarginTop", "_c", "_d", "_e", "init_define_process_env", "init_sentry_release_injection_stub", "React", "DonationView", "preFilledTip", "_a", "navigation", "useNavigation", "cart", "useCart", "project", "useProject", "isDonationBasedProject", "project_exports", "allowedFrequency", "hasContactStep", "projectColor", "colors_exports", "theme", "ThemeProvider", "Item", "Tip", "tipForm", "newTip", "Callout", "FutureItem", "TaxDeductionModal", "_b", "src_default", "__template", "css", "glyphs_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "LoginView", "navigation", "useNavigation", "refLogin", "scrollToCurrentItem", "auth", "user_exports", "cart", "useCart", "onlyTip", "hasPickupStep", "Item", "PAGES", "CartSummary", "Spinner", "Connect", "FutureItem", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "useOrderError", "status", "failure", "orderPayload", "apiErrors", "dispatch", "message_exports", "cart", "useCart", "project", "refreshRewards", "useProject", "refreshRewardDone", "setRefreshRewardDone", "navigation", "useNavigation", "productsInCart", "preSerializedProducts", "preSerialize", "genericError", "error", "err", "item", "PAGES", "_", "limitedProducts", "expiredProducts", "getProductsFromSavedIds", "unavailableQuantityError", "allSelectedProductsAreExpiredError", "someSelectedProductsAreExpiredError", "BASE_ERROR", "__spreadValues", "product", "_a", "stock", "init_define_process_env", "init_sentry_release_injection_stub", "React", "usePayment", "projectId", "paymentState", "setState", "createPayment", "payload", "order_exports", "order", "createMonthlyPayment", "subscription_exports", "subscription", "init_define_process_env", "init_sentry_release_injection_stub", "isPersonalIdNumberRequired", "project", "init_define_process_env", "init_sentry_release_injection_stub", "userSchema", "user", "isPersonalIdRequired", "create$3", "create$8", "create$6", "hasCompletedProfile", "email", "requirePersonalIdNumber", "shippingCountry", "userCountry", "personalIdNumber", "init_define_process_env", "init_sentry_release_injection_stub", "React", "_a", "StyledRegularText", "src_default", "styles_exports", "__template", "_b", "LinkContainer", "_c", "FormFieldContainer", "ModalIncompleteProfile", "isPersonalIdNumberRequired", "userIsCompleted", "user", "auth", "user_exports", "apiError", "isAlreadyExistsError", "open", "setOpen", "Modal", "Formik", "userSchema", "values", "userPayload", "__spreadValues", "userId", "errors", "setFieldValue", "submitForm", "emailError", "Form", "TextField", "event", "Link", "init_define_process_env", "init_sentry_release_injection_stub", "React", "_a", "PaymentDisclaimersSection", "src_default", "__template", "styles_exports", "colors_exports", "Link", "_b", "PaymentDisclaimersTitle", "_c", "PaymentPartnersLogoSection", "PaymentDisclaimers", "assets", "CHECKOUT_ASSETS", "init_define_process_env", "init_sentry_release_injection_stub", "React", "_a", "PaymentCallToAction", "src_default", "styles_exports", "__template", "_b", "PaymentButton", "_c", "PaymentMethod", "colors_exports", "_d", "PaymentMethodDescription", "_e", "PaymentMethodName", "breakpoints_exports", "_f", "SecondaryPaymentMethod", "_g", "PaymentMethodCollapsibleSection", "collapsed", "_h", "ConversionHint", "_i", "ConversionHintWrapper", "PaymentMethodView", "conversion", "ctaText", "onCtaClick", "paymentMethod", "PaymentMethodIcon", "glyphs_exports", "event", "CURRENCIES_RATES", "CurrencyGlyph", "money_exports", "SecondaryPaymentMethodView", "activeMethod", "onMethodClick", "PaymentSection", "_a", "activeMethod", "setActiveMethod", "cart", "useCart", "project", "useProject", "totalCost", "orderPayload", "getOrderPayload", "tracking", "useTracking", "primaryPaymentMethod", "project_exports", "FLAGS", "secondaryPaymentMethods", "accumulator", "method", "index", "createPayment", "createMonthlyPayment", "paymentState", "usePayment", "useOrderError", "product", "reward_exports", "user", "user_exports", "config", "useUserEnv", "projectCurrencyCode", "userCountry", "USER_COUNTRY", "userCurrencyCode", "isPersonalIdNumberRequired", "isPersonalIdRequired", "userIsCompleted", "hasCompletedProfile", "isMembership", "ModalIncompleteProfile", "PaymentSectionWrapper", "LoadingCard", "Spinner", "PaymentMethodView", "MoneyDisplayer", "pay", "OrSeparation", "styles_exports", "SecondaryPaymentMethodList", "SecondaryPaymentMethodView", "PaymentDisclaimers", "paymentMethod", "payload", "getSubscriptionPayload", "__spreadProps", "__spreadValues", "getMembershipSubscriptionPayload", "endFunnelUrl", "exception", "err", "trackingCookie", "TRACKING", "trackingJSON", "endfunnelURL", "returnURL", "src_default", "__template", "_b", "colors_exports", "_c", "PaymentView", "paymentBoxRef", "shippingBoxRef", "cart", "useCart", "navigation", "useNavigation", "cartHasTipOnly", "scrollToCurrentItem", "auth", "user_exports", "hasAddressStep", "hasPickupStep", "hasMondialRelayStep", "hasContactStep", "Item", "PAGES", "CartSummary", "IdentityItem", "PickupItem", "MondialRelayItem", "ContactItem", "BillingAddress", "AddressItem", "Spinner", "PaymentSection", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "_a", "Center", "src_default", "__template", "PickupItemComponent", "cart", "className", "onContinue", "ref", "navigation", "useNavigation", "Item", "Callout", "RadioGroupField", "pickupPoint", "i", "RadioField", "styles_exports", "pickup_exports", "Link", "PAGES", "_b", "PickupItem", "glyphs_exports", "colors_exports", "breakpoints_exports", "PickupView", "navigation", "useNavigation", "cart", "useCart", "onlyTip", "project", "useProject", "auth", "user_exports", "refShippings", "scrollToCurrentItem", "tracking", "useTracking", "Item", "PAGES", "CartSummary", "IdentityItem", "Spinner", "PickupItem", "handleContinue", "FutureItem", "product", "_a", "reward_exports", "project_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "_a", "PaymentSection", "src_default", "PaymentSectionWrapper", "__template", "RenewView", "orderId", "project", "useProject", "renew", "response", "order_exports", "primaryPaymentMethod", "project_exports", "FLAGS", "renewBoxRef", "Spinner", "Item", "Callout", "PaymentMethodView", "result", "MoneyDisplayer", "PaymentDisclaimers", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "RemoveModal", "removalModalIsOpen", "removeSelection", "closeModal", "Modal", "RemoveModalTitle", "_a", "src_default", "styles_exports", "__template", "init_define_process_env", "init_sentry_release_injection_stub", "React", "SelectionQuantity", "product", "setRemovalModalIsOpen", "cart", "useCart", "productHasUnlimitedStock", "hasLimitedStock", "productIsSelectable", "isSelectable", "productIsAvailable", "isOpenTooltip", "setIsOpenTooltip", "SelectionItemQuantity", "Flex", "ButtonQuantity", "quantity", "glyphs_exports", "Quantity", "StyledTooltip", "styles_exports", "_a", "src_default", "__template", "_b", "props", "colors_exports", "breakpoints_exports", "_c", "_d", "fonts_exports", "_e", "Tooltip", "SelectionItem", "product", "removalModalIsOpen", "setRemovalModalIsOpen", "project", "useProject", "cart", "useCart", "isDifferentCurrency", "useUserEnv", "isMembership", "project_exports", "additionalCost", "amount", "description", "getTruncatedDescription", "image", "variant_exports", "getImage", "productIsAvailable", "quantityDoesNotExceedStock", "productIsLegacy", "isLegacy", "title", "getTruncatedTitle", "SelectionItemInformations", "RewardSelectionImage", "RewardSelectionPlaceholder", "SelectionTitle", "SelectionVariantTitle", "SelectionQuantity", "SelectionCurrencyWrapper", "SelectionCurrency", "MoneyDisplayer", "MoneyConverter", "SmallSelectionCurrency", "SelectionError", "stock", "RemoveModal", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "CountrySelectComponent", "className", "countries", "_a", "cart", "useCart", "styles_exports", "SelectField", "selected", "selectedOptions", "country", "label", "code", "Option", "CountrySelect", "src_default", "__template", "Select", "init_define_process_env", "init_sentry_release_injection_stub", "React", "SingleCountryAndShippingModeLabel", "className", "countries", "rate", "cart", "useCart", "styles_exports", "SingleMethodContainer", "SingleMethodSubLabel", "glyphs_exports", "_a", "_b", "src_default", "__template", "forceLowerCase", "css", "_c", "SelectionShipping", "_a", "cart", "useCart", "project", "useProject", "userConfig", "useUserEnv", "userCountryIsSupported", "USER_COUNTRY", "supportedCountries", "code", "getCountryLabel", "option", "a", "b", "Wrapper", "Callout", "CalloutTextStrong", "SingleCountryAndShippingModeLabel", "getRate", "CountrySelect", "SingleMethod", "styles_exports", "pickup_exports", "PickupPointDropdown", "pickupPoint", "Rate", "ColumnSelectionSection", "RadioGroupField", "StyledRadioField", "glyphs_exports", "CalloutText", "COUNTRIES", "country", "selected", "error", "options", "onChange", "active", "StyledDropdown", "OneLineOption", "mode", "lang", "rate", "format", "DEFAULT_LOCALE", "countryCode", "src_default", "__template", "_b", "init_define_process_env", "init_sentry_release_injection_stub", "React", "SelectionTip", "isDifferentCurrency", "scrollTo", "tip", "SelectionItem", "TipInformations", "SelectionTitle", "TipActions", "TipLink", "SelectionCurrencyWrapper", "SelectionCurrency", "MoneyDisplayer", "MoneyConverter", "init_define_process_env", "init_sentry_release_injection_stub", "React", "SelectionTotal", "isDifferentCurrency", "cart", "useCart", "SelectionSection", "SelectionSectionTitle", "TotalPrice", "MoneyDisplayer", "MoneyConverter", "Cart", "onValidate", "scrollToRewards", "_a", "_b", "cart", "useCart", "project", "useProject", "cartHasSelectedProducts", "cartHasTipOnly", "showTotal", "setIsRewardTaxDeductionModalOpen", "useSetModal", "userConfig", "useUserEnv", "projectCurrency", "userCurrency", "isDifferentCurrency", "projectColor", "project_exports", "colors_exports", "theme", "ThemeProvider", "SelectionCard", "LoadingCard", "Spinner", "StyledTable", "SelectionTip", "product", "SelectionItem", "SelectionShipping", "SelectionTotal", "TaxInfo", "glyphs_exports", "accounting_exports", "Callout", "SelectionAction", "styles_exports", "goToNextStep", "AddMoreRewards", "ConversionDisclaimer", "error", "src_default", "LinkAsButton", "__template", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "Reward", "handleRemoveSelectReward", "handleSelectReward", "reward", "trackView", "_a", "_b", "fetchVariants", "project", "useProject", "cart", "useCart", "currency", "rewardIsInCart", "product", "userCurrency", "useUserEnv", "pictureSrc", "reward_exports", "tracking", "useTracking", "ref", "inView", "useInView", "project_exports", "isSelected", "InViewDetector", "MembershipStyled", "taken", "tf", "available", "glyphs_exports", "LocaleMoneyDisplayer", "CURRENCIES_RATES", "DiscordRoleList", "stockOffsets", "previousValue", "currentValue", "__spreadProps", "__spreadValues", "RewardStyled", "rewardId", "optionValuesIds", "resolvedVariantId", "freshReward", "modeledReward", "resolvedVariant", "variant", "valueId", "src_default", "RewardCard_exports", "__template", "breakpoints_exports", "_c", "MembershipRewardCard", "init_define_process_env", "init_sentry_release_injection_stub", "getFilterFromUrlParams", "filter", "id", "matchFilter", "whitelistId", "RewardList", "rewards", "scrollToCart", "_a", "project", "useProject", "cart", "useCart", "tracking", "useTracking", "featuredReward", "reward", "matchFilter", "projectColor", "project_exports", "colors_exports", "theme", "List", "ThemeProvider", "Reward", "handleRemoveSelectReward", "handleSelectReward", "getListRewards", "variant", "optionValuesIds", "_b", "cartProduct", "product", "quantity", "reward_exports", "index", "src_default", "__template", "init_define_process_env", "init_sentry_release_injection_stub", "React", "ItemTip", "preFilledTip", "scrollToCart", "_a", "_b", "project", "useProject", "cart", "useCart", "tip", "tracking", "useTracking", "Wrapper", "styles_exports", "StyledTip", "values", "src_default", "Tip", "__template", "TipContainerWrapper", "breakpoints_exports", "InputRadioWrapper", "RemoveButton", "SelectionView", "preFilledTip", "cart", "useCart", "project", "useProject", "isPresaleProject", "project_exports", "isMembershipProject", "clearMessages", "message_exports", "navigation", "useNavigation", "rewards", "useRewards", "cartRef", "rewardsRef", "tipSelectionRef", "tracking", "useTracking", "scrollToCurrentItem", "SelectionWrapper", "Item", "Cart", "product", "_a", "reward_exports", "OrderedItem", "ItemTip", "RewardList", "revealedRewards", "useRevealedRewards", "isRevealedReward", "reward", "revealedRewardId", "_b", "variant", "getModeledRewards", "orderRewardsAvailableFirst", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "StepTitleComponent", "index", "children", "className", "BackgroundCircle", "styles_exports", "_a", "StepTitle", "src_default", "__template", "_b", "colors_exports", "MondialRelayStep1", "cart", "_a", "phoneCountryCode", "setPhoneCountryCode", "defaultPhoneCountry", "COUNTRIES", "country", "USER_COUNTRY", "project", "useProject", "deliveryCountries", "countries", "code", "rate", "shipping_exports", "project_exports", "b", "Wrapper", "StepTitle", "IdentityGroup", "Field", "field", "meta", "TextField", "form", "PhoneField", "phone", "SelectField", "selected", "option", "Option", "src_default", "__template", "Select", "_b", "styles_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "MondialRelayStep2", "cart", "project", "useProject", "Wrapper", "StepTitle", "Field", "field", "meta", "form", "_a", "_b", "DropoffPicker", "location", "address", "COUNTRIES", "MAPBOX_API_KEY", "styles_exports", "src_default", "__template", "AutocompleteField", "_a", "Center", "src_default", "__template", "MondialRelayItemComponent", "cart", "project", "className", "onContinue", "ref", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "_i", "navigation", "useNavigation", "Item", "Callout", "project_exports", "Formik", "values", "create$3", "create$6", "create$8", "formikBag", "MondialRelayStep1", "MondialRelayStep2", "styles_exports", "Link", "PAGES", "MondialRelayItem", "RadioGroupField", "RadioField", "glyphs_exports", "colors_exports", "MondialRelayView", "navigation", "useNavigation", "cart", "useCart", "project", "useProject", "onlyTip", "auth", "user_exports", "refShippings", "scrollToCurrentItem", "tracking", "useTracking", "Item", "PAGES", "CartSummary", "IdentityItem", "Spinner", "MondialRelayItem", "handleContinue", "FutureItem", "product", "_a", "reward_exports", "project_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "RewardTaxDeductionModal", "project", "_a", "cart", "useCart", "isTaxReceiptModalOpen", "setIsTaxReceiptModalOpen", "useModal", "cartRewards", "product", "taxDeductibleRate", "filteredRewards", "reward", "ModalWithIcon", "illustrations_exports", "styles_exports", "reward_exports", "src_default", "__template", "ModalIconWrapper", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "Sponsorships", "sponsorships", "order", "component", "orderAmount", "project", "SponsorshipWithAmount", "Sponsorship", "SponsorshipWithoutAmount", "MultiSponsorships", "Main", "Wrapper", "Heading", "SponsorList", "sponsorship", "key", "SponsorItem", "SponsorshipContainer", "amount", "finalAmount", "MoneyDisplayer", "position", "sponsorRef", "usePartnershipTracker", "Sponsor_default", "sponsorship_exports", "_a", "src_default", "__template", "colors_exports", "_b", "styles_exports", "breakpoints_exports", "_c", "_d", "_e", "init_define_process_env", "init_sentry_release_injection_stub", "React", "Title", "auth", "user_exports", "TitleBanner", "illustrations_exports", "styles_exports", "_a", "src_default", "__template", "colors_exports", "breakpoints_exports", "init_define_process_env", "init_sentry_release_injection_stub", "PAGES", "init_define_process_env", "init_sentry_release_injection_stub", "_a", "Container", "src_default", "__template", "_b", "Headline", "styles_exports", "_c", "PullingContainer", "colors_exports", "effects_exports", "breakpoints_exports", "_d", "SkipLink", "Link", "_e", "Title", "fonts_exports", "_f", "TextContainer", "_g", "Banner", "Comment", "order", "_a", "_b", "_c", "_d", "_e", "project", "useProject", "tracking", "useTracking", "commentStatus", "comment", "useComment", "userConfig", "useUserEnv", "DEFAULT_MESSAGES", "navigate", "useNavigate", "isProcessingComment", "PAGES", "isDonationBasedProject", "project_exports", "projectName", "userTransactionsURL", "headlineGettextArguments", "accounting_exports", "Sponsorships", "Title", "BannerComment", "PullingContainer", "i18n_exports", "Thanks", "styles_exports", "WysiwygContent", "Headline", "Spinner", "MonthlyDonationCallout", "glyphs_exports", "format", "Link", "Formik", "pickRandomly", "values", "commentSchema", "errors", "touched", "handleSubmit", "setFieldValue", "Form", "Field", "field", "TextAreaField", "event", "ErrorMessage", "ErrorComment", "Button", "SkipLink", "PrivacyDisclaimer", "src_default", "__template", "colors_exports", "effects_exports", "props", "css", "message_exports", "_f", "_g", "Callout", "_h", "create$3", "create$6", "state", "setState", "dispatch", "getRandomInt", "min", "max", "array", "init_define_process_env", "init_sentry_release_injection_stub", "React", "LOCALSTORAGE_LIFETIME", "Processing", "orderId", "returnUrl", "orderService", "order_exports", "currentOrder", "project", "useProject", "tracking", "useTracking", "cart_exports", "navigate", "useNavigate", "project_exports", "handle", "PAGES", "trackOrder", "canComment", "isMembership", "Banner", "Title", "Container", "TextContainer", "styles_exports", "Link", "SUPPORT_EMAIL", "Spinner", "order", "whenGivenFor", "_a", "trackingOrder", "getTrackingOrderFromLocalStorage", "orderTimestamp", "product", "reward", "orderItem_exports", "variant", "reward_exports", "setTrackingOrderInLocalStorage", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "RetryButton", "project", "Button", "ButtonText", "ButtonIcon", "BackButton", "_a", "src_default", "styles_exports", "__template", "_b", "_c", "Aborted", "order", "project", "useProject", "Banner", "Title", "Container", "TextContainer", "styles_exports", "Link", "SUPPORT_EMAIL", "RetryButton", "BackButton", "init_define_process_env", "init_sentry_release_injection_stub", "React", "Canceled", "project", "useProject", "projectOwner", "supportEmail", "SUPPORT_EMAIL", "Banner", "Title", "Container", "TextContainer", "styles_exports", "Link", "RetryButton", "BackButton", "init_define_process_env", "init_sentry_release_injection_stub", "React", "init_define_process_env", "init_sentry_release_injection_stub", "React", "SocialPreview", "picture", "title", "subtitle", "SocialPreviewWrapper", "Image", "Body", "Title", "Description", "_a", "src_default", "__template", "styles_exports", "_b", "_c", "colors_exports", "_d", "_e", "fonts_exports", "Share", "order", "user", "_a", "tracking", "useTracking", "navigate", "useNavigate", "isMobile", "breakpoints_exports", "project", "useProject", "Title", "Sponsorships", "PullingContainer", "Headline", "SocialButtonWrapper", "SocialButton_default", "handlePublishOnFacebook", "handleShareTweet", "handleSendWithMessenger", "SocialPreview", "project_exports", "SkipLink", "PAGES", "styles_exports", "event", "sharingUrl", "getSharingUrl", "response", "hashtags", "link", "height", "width", "left", "top", "config", "shareDialog", "key", "interval", "e", "trackInGTM", "actionName", "FACEBOOK_APP_ID", "platform", "baseUrl", "userId", "today", "format", "utm", "src_default", "__template", "init_define_process_env", "init_sentry_release_injection_stub", "React", "End", "order", "_a", "tracking", "useTracking", "confetti", "CHECKOUT_ASSETS", "trackLike", "trackUnLike", "mainTag", "Container", "GlobalStyle", "EndContainer", "Icon", "Body", "Content", "Decoration", "Button", "project_exports", "SkipLink", "styles_exports", "Contest", "_b", "createGlobalStyle", "__template", "props", "css", "_c", "src_default", "_d", "colors_exports", "_e", "effects_exports", "_f", "_g", "_h", "_i", "breakpoints_exports", "init_define_process_env", "init_sentry_release_injection_stub", "React", "MembershipThanks", "order", "_a", "_b", "_c", "_d", "_e", "project", "useProject", "userTransactionsURL", "isDonation", "userConfig", "useUserEnv", "Sponsorships", "Title", "PullingContainer", "Thanks", "styles_exports", "project_exports", "WysiwygContent", "i18n_exports", "Headline", "accounting_exports", "reward_exports", "Strong", "Information", "ButtonAsLink", "MonthlyDonationCallout", "glyphs_exports", "format", "Link", "src_default", "__template", "colors_exports", "effects_exports", "Callout", "_f", "EndfunnelRouter", "searchQuery", "project", "useProject", "navigate", "useNavigate", "orderId", "PAGES", "log", "Router", "returnUrlParam", "returnUrl", "tracking", "useTracking", "auth", "user_exports", "order", "order_exports", "location", "useLocation", "GlobalStyle", "Routes", "Route", "Processing", "Aborted", "Canceled", "DoneLayout", "Comment", "Share", "End", "MembershipThanks", "Main", "Outlet", "_a", "createGlobalStyle", "__template", "colors_exports", "_b", "src_default", "Router", "configuration", "project", "useProject", "NavigationContext", "Spinner", "Routes", "Route", "Selection", "RewardTaxDeductionModal", "Login", "Address", "Pickup", "MondialRelay", "Payment", "Renew", "Endfunnel", "Navigate", "donationBasedProject", "membershipProject", "preFilledTip", "tracking", "useTracking", "cart", "useCart", "clearMessages", "message_exports", "useNavigation", "product", "_a", "reward_exports", "project_exports", "filter", "getFilterFromUrlParams", "Layout", "DonationView", "SelectionView", "navigation", "LoginView", "auth", "user_exports", "PickupView", "MondialRelayView", "AddressView", "PaymentView", "orderId", "setOrderId", "id", "Item", "Connect", "RenewView", "SIGNIN_URL", "EndfunnelRouter", "jotaiStore", "getDefaultStore", "init", "_a", "initUserConfig", "userConfig", "getUserConfig", "SENTRY_PUBLIC_DSN", "ENVIRONMENT", "USER_COUNTRY", "setTag", "FACEBOOK_APP_ID", "EXTENDED_LOCALES", "initializeLocalization", "LOCALE_FILES", "initializeProject", "renderHeader", "renderApp", "headerContainer", "Header", "err", "_b", "initialError", "appContainer", "project", "getProject", "response", "hydrate", "error", "renderCrashToast", "cart", "initialConfiguration", "messages", "CART_STATE", "message_exports", "saveCartToLocalStorageOnChange", "getCurrentScope", "event", "__spreadProps", "__spreadValues", "project_exports", "observeStoreForUser", "user", "setUser", "getUserId", "authState", "user_exports", "TrackingProvider", "GTM_KEY", "plausible_exports", "BrowserRouter", "PaymentDisturbanceModal", "Router", "onChange", "currentState", "handleChange", "nextState", "unsubscribe", "state", "saveCartToLocalStorage", "checkout_default"] }