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AAI,KACJC,GAAI,MAaKC,EAA2B,CAAC5T,EAAaE,GACzC2T,EAA0B,CAACX,EAAeC,GAY1CW,EAAsB,CAAC1T,KAAqBpJ,GAW5C+c,EAAe,O","sources":["webpack://touchweb/./src/apps/my-tradera/app/constants/list-types.ts","webpack://touchweb/./src/apps/nextweb/components/next-link.tsx","webpack://touchweb/./src/backend/utils/headers.ts","webpack://touchweb/./src/backend/utils/jwt.ts","webpack://touchweb/./src/backend/utils/cookies.ts","webpack://touchweb/./src/helpers/host.ts","webpack://touchweb/./src/components/alink/is-link-to-next-web.ts","webpack://touchweb/./src/components/alink/is-link-to-touchweb-in-next-web.ts","webpack://touchweb/./src/components/alink/navigation-type.ts","webpack://touchweb/./src/hooks/use-is-feature-enabled.ts","webpack://touchweb/./src/hooks/use-location.ts","webpack://touchweb/./src/hooks/use-navigation.ts","webpack://touchweb/./src/hooks/use-query.ts","webpack://touchweb/./src/lang/shared-config.ts","webpack://touchweb/./src/lang/helpers.ts","webpack://touchweb/./src/lang/boot-languages.js","webpack://touchweb/./src/lang/translations-context.tsx","webpack://touchweb/./src/legacy/static/packages/logger.ts","webpack://touchweb/./src/services/google-tagmanager/google-tagmanager-service.ts","webpack://touchweb/./src/services/google-tagmanager/google-tagmanager-snippet.js","webpack://touchweb/./src/services/toast-queue.js","webpack://touchweb/./src/state/environment/native-app-info-helper.ts","webpack://touchweb/./src/state/environment/actions.ts","webpack://touchweb/./src/utils/versions.js","webpack://touchweb/./src/state/environment/reducer.ts","webpack://touchweb/./src/state/environment/native-app-support.js","webpack://touchweb/./src/state/hooks.ts","webpack://touchweb/./src/utils/condition-check.ts","webpack://touchweb/./src/utils/gdpr-settings.js","webpack://touchweb/./src/utils/google-tagmanager.js","webpack://touchweb/./src/utils/nextjs.ts","webpack://touchweb/./src/utils/object.ts","webpack://touchweb/./src/utils/privacy-sandbox-iframes.ts","webpack://touchweb/./src/utils/safe-decode-uri-component.ts","webpack://touchweb/./src/lang/constants.mjs"],"sourcesContent":["export const LIST_VIEW_TYPES = {\n BASIC: 'Basic',\n NORMAL: 'Normal'\n} as const;\n\nexport const PAGE_LIST_TYPES = {\n BUYER_ACTIVE_ITEMS: 'BUYER_ACTIVE_ITEMS',\n BUYER_PURCHASES: 'BUYER_PURCHASES',\n BUYER_ITEMS_LOST: 'BUYER_ITEMS_LOST',\n SELLER_ACTIVE: 'SELLER_ACTIVE',\n SELLER_SOLD: 'SELLER_SOLD',\n SELLER_NOT_SOLD: 'SELLER_NOT_SOLD'\n} as const;\n\nexport const PAGE_BULK_ACTIONS = {\n ACTIVE_CANCEL: 'ActiveItems_Cancel',\n UNSOLD_RESTART: 'UnsoldItems_Restart',\n BUYER_MARK_PAID: 'Buyer_MarkPaid',\n BUYER_SHOW_ACTIVE: 'ShowActive',\n BUYER_HIDE_ACTIVE: 'HideActive',\n PURCHASES_SHOW: 'PurchasesShow'\n} as const;\n","'use client';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// This is a cleaned-up ES6 copy of the next/link component without prefetch from:\n// https://github.com/vercel/next.js/blob/v12.2.5/packages/next/client/link.tsx\n// This component was mainly copied to completely disable prefetch on link mouse-over\n// Update this component if needed when updating Next.js\n\nimport type { NextRouter } from 'next/dist/shared/lib/router/router';\n\nimport React from 'react';\nimport type { UrlObject } from 'url';\nimport { resolveHref } from 'next/dist/client/resolve-href';\nimport { isLocalURL } from 'next/dist/shared/lib/router/utils/is-local-url';\nimport { formatUrl } from 'next/dist/shared/lib/router/utils/format-url';\nimport { isAbsoluteUrl } from 'next/dist/shared/lib/utils';\nimport { addLocale } from 'next/dist/client/add-locale';\nimport { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime';\nimport { AppRouterContext } from 'next/dist/shared/lib/app-router-context.shared-runtime';\nimport type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime';\nimport { useIntersection } from 'next/dist/client/use-intersection';\nimport { getDomainLocale } from 'next/dist/client/get-domain-locale';\nimport { addBasePath } from 'next/dist/client/add-base-path';\n\ntype Url = string | UrlObject;\ntype RequiredKeys = {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n [K in keyof T]-?: {} extends Pick ? never : K;\n}[keyof T];\ntype OptionalKeys = {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n [K in keyof T]-?: {} extends Pick ? K : never;\n}[keyof T];\n\ntype InternalLinkProps = {\n /**\n * The path or URL to navigate to. It can also be an object.\n *\n * @example https://nextjs.org/docs/api-reference/next/link#with-url-object\n */\n href: Url;\n /**\n * Optional decorator for the path that will be shown in the browser URL bar. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes) to see how it worked. Note: when this path differs from the one provided in `href` the previous `href`/`as` behavior is used as shown in the [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes).\n */\n as?: Url;\n /**\n * Replace the current `history` state instead of adding a new url into the stack.\n *\n * @defaultValue `false`\n */\n replace?: boolean;\n /**\n * Whether to override the default scroll behavior\n *\n * @example https://nextjs.org/docs/api-reference/next/link#disable-scrolling-to-the-top-of-the-page\n *\n * @defaultValue `true`\n */\n scroll?: boolean;\n /**\n * Update the path of the current page without rerunning [`getStaticProps`](/docs/basic-features/data-fetching/get-static-props.md), [`getServerSideProps`](/docs/basic-features/data-fetching/get-server-side-props.md) or [`getInitialProps`](/docs/api-reference/data-fetching/get-initial-props.md).\n *\n * @defaultValue `false`\n */\n shallow?: boolean;\n /**\n * Forces `Link` to send the `href` property to its child.\n *\n * @defaultValue `false`\n */\n passHref?: boolean;\n /**\n * The active locale is automatically prepended. `locale` allows for providing a different locale.\n * When `false` `href` has to include the locale as the default behavior is disabled.\n */\n locale?: string | false;\n /**\n * Optional event handler for when the mouse pointer is moved onto Link\n */\n onMouseEnter?: React.MouseEventHandler;\n /**\n * Optional event handler for when Link is touched.\n */\n onTouchStart?: React.TouchEventHandler;\n /**\n * Optional event handler for when Link is clicked.\n */\n onClick?: React.MouseEventHandler;\n};\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when the webpack plugin runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps = InternalLinkProps;\ntype LinkPropsRequired = RequiredKeys;\ntype LinkPropsOptional = OptionalKeys;\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement;\n const target = eventTarget.getAttribute('target');\n return (\n (target && target !== '_self') ||\n event.metaKey || // open in new tab on macOS\n event.ctrlKey || // right-click on macOS, open in new tab on Windows\n event.shiftKey || // open in new window\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n );\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n router: NextRouter | AppRouterInstance,\n href: string,\n as: string,\n replace?: boolean,\n shallow?: boolean,\n scroll?: boolean,\n locale?: string | false,\n isAppRouter?: boolean\n): void {\n const { nodeName } = e.currentTarget;\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A';\n\n if (\n isAnchorNodeName &&\n (isModifiedEvent(e) ||\n // app-router supports external urls out of the box so it shouldn't short-circuit here as support for e.g. `replace` is added in the app-router.\n (!isAppRouter && !isLocalURL(href)))\n ) {\n // ignore click for browser’s default behavior\n return;\n }\n\n e.preventDefault();\n\n const navigate = () => {\n // If the router is an NextRouter instance it will have `beforePopState`\n const routerScroll = scroll ?? true;\n if ('beforePopState' in router) {\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n locale,\n scroll: routerScroll\n });\n } else {\n router[replace ? 'replace' : 'push'](as || href, {\n scroll: routerScroll\n });\n }\n };\n\n if (isAppRouter) {\n React.startTransition(navigate);\n } else {\n navigate();\n }\n}\n\ntype LinkPropsReal = React.PropsWithChildren<\n Omit, keyof LinkProps> &\n LinkProps\n>;\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString;\n }\n\n return formatUrl(urlObjOrString);\n}\n\nfunction createPropError(args: {\n key: string;\n expected: string;\n actual: string;\n}) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n );\n}\n\n/**\n * React Component that enables client-side transitions between routes.\n */\nconst Link = React.forwardRef(\n function LinkComponent(props, forwardedRef) {\n if (process.env.NODE_ENV !== 'production') {\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record = {\n href: true\n } as const;\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[];\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' &&\n typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual:\n props[key] === null ? 'null' : typeof props[key]\n });\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key;\n }\n });\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n locale: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true\n } as const;\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[];\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key];\n\n if (key === 'as') {\n if (\n props[key] &&\n valType !== 'string' &&\n valType !== 'object'\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType\n });\n }\n } else if (key === 'locale') {\n if (props[key] && valType !== 'string') {\n throw createPropError({\n key,\n expected: '`string`',\n actual: valType\n });\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType\n });\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType\n });\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key;\n }\n });\n }\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n passHref,\n replace,\n shallow,\n scroll,\n locale,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n ...restProps\n } = props;\n\n const children: React.ReactNode = childrenProp;\n\n const pagesRouter = React.useContext(RouterContext);\n const appRouter = React.useContext(AppRouterContext);\n const router = pagesRouter ?? appRouter;\n\n // We're in the app directory if there is no pages router.\n const isAppRouter = !pagesRouter;\n\n if (process.env.NODE_ENV !== 'production') {\n if (isAppRouter && !asProp) {\n let href: string | undefined;\n if (typeof hrefProp === 'string') {\n href = hrefProp;\n } else if (\n typeof hrefProp === 'object' &&\n typeof hrefProp.pathname === 'string'\n ) {\n href = hrefProp.pathname;\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some(\n (segment) =>\n segment.startsWith('[') && segment.endsWith(']')\n );\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n );\n }\n }\n }\n }\n\n const { href, as } = React.useMemo(() => {\n if (!pagesRouter) {\n const resolvedHref = formatStringOrUrl(hrefProp);\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref\n };\n }\n\n const [resolvedHref, resolvedAs] = resolveHref(\n pagesRouter,\n hrefProp,\n true\n );\n\n return {\n href: resolvedHref,\n as: asProp\n ? resolveHref(pagesRouter, asProp)\n : resolvedAs || resolvedHref\n };\n }, [pagesRouter, hrefProp, asProp]);\n\n const previousHref = React.useRef(href);\n const previousAs = React.useRef(as);\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any;\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid with child. Please remove .\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n );\n }\n }\n\n const childRef: any = forwardedRef;\n\n const [setIntersectionRef, , resetVisible] = useIntersection({\n rootMargin: '200px'\n });\n\n const setRef = React.useCallback(\n (el: Element) => {\n // Before the link getting observed, check if visible state need to be reset\n if (\n previousAs.current !== as ||\n previousHref.current !== href\n ) {\n resetVisible();\n previousAs.current = as;\n previousHref.current = href;\n }\n\n setIntersectionRef(el);\n if (childRef) {\n if (typeof childRef === 'function') childRef(el);\n else if (typeof childRef === 'object') {\n childRef.current = el;\n }\n }\n },\n [as, childRef, href, resetVisible, setIntersectionRef]\n );\n\n const childProps: {\n onTouchStart: React.TouchEventHandler;\n onMouseEnter: React.MouseEventHandler;\n onClick: React.MouseEventHandler;\n href?: string;\n ref?: any;\n } = {\n ref: setRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n );\n }\n }\n\n if (typeof onClick === 'function') {\n onClick(e);\n }\n\n if (!router) {\n return;\n }\n\n if (e.defaultPrevented) {\n return;\n }\n\n linkClicked(\n e,\n router,\n href,\n as,\n replace,\n shallow,\n scroll,\n locale,\n isAppRouter\n );\n },\n onMouseEnter(e) {\n if (typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e);\n }\n },\n onTouchStart(e) {\n if (typeof onTouchStartProp === 'function') {\n onTouchStartProp(e);\n }\n }\n };\n\n // If child is an tag and doesn't have a href attribute, or if the 'passHref' property is\n // defined, we specify the current 'href', so that repetition is not needed by the user.\n // If the url is absolute, we can bypass the logic to prepend the domain and locale.\n if (isAbsoluteUrl(as)) {\n childProps.href = as;\n } else if (\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n const curLocale =\n typeof locale !== 'undefined' ? locale : pagesRouter?.locale;\n\n // we only render domain locales if we are currently on a domain locale\n // so that locale links are still visitable in development/preview envs\n const localeDomain =\n pagesRouter?.isLocaleDomain &&\n getDomainLocale(\n as,\n curLocale,\n pagesRouter?.locales,\n pagesRouter?.domainLocales\n );\n\n childProps.href =\n localeDomain ||\n addBasePath(\n addLocale(as, curLocale, pagesRouter?.defaultLocale)\n );\n }\n\n return (\n \n {children}\n \n );\n }\n);\n\nexport { Link as NextLink };\n","import { dangerouslyParseJwtWithoutVerifyingSignature } from 'tradera/backend/utils/jwt';\n\nexport const getMemberIdFromAuthHeader = (req: {\n headers: NodeJS.Dict;\n}): number | undefined =>\n dangerouslyParseJwtWithoutVerifyingSignature(\n getFirstHeaderValueOrEmpty(req, 'authorization').substring(\n 'Bearer '.length\n )\n )?.mbr;\n\nexport const getFirstHeaderValueOrEmpty = (\n req: {\n headers: NodeJS.Dict;\n },\n headerName: string\n) => {\n const header = req.headers[headerName] || '';\n const headerValue = Array.isArray(header) ? header.shift() : header;\n return headerValue || '';\n};\n","// Note that this does not validate the signature of the token!\nexport const dangerouslyParseJwtWithoutVerifyingSignature = (\n token?: string\n) => {\n if (!token) {\n return null;\n }\n const base64Payload = token.split('.')[1];\n if (!base64Payload) {\n return null;\n }\n try {\n const payload = Buffer.from(base64Payload, 'base64');\n return JSON.parse(payload.toString());\n } catch (error) {\n return null;\n }\n};\n","import {\n getFirstHeaderValueOrEmpty,\n getMemberIdFromAuthHeader\n} from 'tradera/backend/utils/headers';\nimport { dangerouslyParseJwtWithoutVerifyingSignature } from 'tradera/backend/utils/jwt';\nimport { isProductionHost } from 'tradera/helpers/host';\nimport {\n type CookieSerializeOptions,\n serialize as serializeCookie\n} from 'cookie';\nimport type { Request, Response } from '../http/types/http';\nimport { CART_ID } from 'tradera/constants/cookies';\n\nexport const mightBeLoggedIn = (req: {\n cookies: Partial<{\n [key: string]: string;\n }>;\n headers: NodeJS.Dict;\n}) =>\n Boolean(req.cookies[getRefreshTokenCookieName(req)]) ||\n getMemberIdFromAuthHeader(req) ||\n getMemberIdFromAuthCookie(req);\n\nexport const getAccessTokenCookieDomain = (req: {\n cookies: Partial<{\n [key: string]: string;\n }>;\n headers: NodeJS.Dict;\n}) => {\n // The trd_at cookie is set for subdomains of tradera.com.\n // It is sent in requests to tradera.com, www.tradera.com, info.tradera.com etc.\n\n const host = getFirstHeaderValueOrEmpty(req, 'host').split(':')[0];\n const isIp = /^\\d+\\.\\d+\\.\\d+\\.\\d+$/.test(host);\n const canHaveSubdomain = !isIp && host.split('.').length > 1; // tradera.com, www.tradera.com\n const hasSubdomain = canHaveSubdomain && host.split('.').length > 2; // NOT tradera.com\n\n if (hasSubdomain) {\n return host.replace(/^[^.]+\\./, '.');\n }\n\n if (canHaveSubdomain) {\n return `.${host}`;\n }\n\n return undefined;\n};\n\nexport const getRefreshTokenCookieDomain = () => undefined;\n\nexport const getAccessTokenCookieName = (req: {\n headers: NodeJS.Dict;\n}) =>\n isProductionHost(getFirstHeaderValueOrEmpty(req, 'host'))\n ? 'trd_at'\n : 'trd_at_test';\n\nexport const getRefreshTokenCookieName = (req: {\n headers: NodeJS.Dict;\n}) =>\n isProductionHost(\n typeof req.headers.host === 'string' ? req.headers.host : ''\n )\n ? 'trd_rt'\n : 'trd_rt_test';\n\nexport const getPersistTokenCookieName = (req: {\n headers: NodeJS.Dict;\n}) =>\n isProductionHost(getFirstHeaderValueOrEmpty(req, 'host'))\n ? 'trd_rk'\n : 'trd_rk_test';\n\nexport const getMemberIdFromAuthCookie = (req: {\n cookies: Partial<{\n [key: string]: string;\n }>;\n headers: NodeJS.Dict;\n}) =>\n dangerouslyParseJwtWithoutVerifyingSignature(\n req.cookies?.[getAccessTokenCookieName(req)]\n )?.mbr;\n\nexport const getExpiryFromAuthCookie = (req: {\n cookies: Partial<{\n [key: string]: string;\n }>;\n headers: NodeJS.Dict;\n}) =>\n dangerouslyParseJwtWithoutVerifyingSignature(\n req.cookies?.[getAccessTokenCookieName(req)]\n )?.exp;\n\nexport const isImpersonation = (req: {\n cookies: Partial<{\n [key: string]: string;\n }>;\n headers: NodeJS.Dict;\n}) =>\n !!dangerouslyParseJwtWithoutVerifyingSignature(\n req.cookies?.[getAccessTokenCookieName(req)]\n )?.imp;\n\nexport const isTokenExpiringSoon = (token?: string) => {\n const parsedToken = dangerouslyParseJwtWithoutVerifyingSignature(token);\n const { exp: expiry = undefined } = parsedToken || {};\n if (!expiry) {\n return true;\n }\n const now = new Date();\n const expiryDate = new Date(\n // The new format is in Unix time. Legacy is a UTC-string.\n // We support both.\n Number.isInteger(expiry) ? expiry * 1000 : expiry\n );\n const expiresSoonDate = new Date(expiryDate.getTime() - 60 * 1000);\n const isExpired = expiresSoonDate <= now;\n return isExpired;\n};\n\nexport const addCookie = (\n res: {\n getHeader: (name: string) => string | number | string[] | undefined;\n setHeader: (\n name: string,\n value: string | number | readonly string[]\n ) => unknown;\n },\n cookie: string\n) => {\n const previouslySetCookies = res.getHeader('Set-Cookie');\n if (Array.isArray(previouslySetCookies)) {\n res.setHeader('Set-Cookie', [...previouslySetCookies, cookie]);\n } else if (previouslySetCookies) {\n res.setHeader('Set-Cookie', [`${previouslySetCookies}`, cookie]);\n } else {\n res.setHeader('Set-Cookie', cookie);\n }\n};\n\nconst DAY_IN_MILLISECONDS = 1000 * 60 * 60 * 24;\nconst YEAR_IN_MILLISECONDS = DAY_IN_MILLISECONDS * 365;\nconst MONTH_IN_MILLISECONDS = DAY_IN_MILLISECONDS * 30;\nconst CART_COOKIE_EXPIRATION_IN_MILLISECONDS = MONTH_IN_MILLISECONDS * 2;\n\nexport type CookieConfiguration = {\n name: string;\n value: string;\n options: CookieSerializeOptions;\n};\n\nexport const configureCookie = (\n req: Request,\n name: string,\n value: string,\n domain?: string,\n isPersistent?: boolean,\n isRemove?: boolean\n): CookieConfiguration => {\n const isSecureRequest = req.headers['x-forwarded-proto'] !== 'http';\n const options: CookieSerializeOptions = {\n httpOnly: true,\n domain,\n path: '/',\n secure: isSecureRequest,\n sameSite: 'lax'\n };\n if (isRemove) {\n options.expires = new Date(0);\n } else if (isPersistent) {\n options.expires = new Date(Date.now() + YEAR_IN_MILLISECONDS);\n }\n return {\n name,\n value,\n options\n };\n};\n\nexport const setCartIdCookie = (\n req: Request,\n res: Response,\n cartId: string\n) => {\n const options: CookieSerializeOptions = {\n httpOnly: false, // Is read by JavaScript in browser.\n domain: undefined, // Current domain only\n path: '/',\n secure: req.headers['x-forwarded-proto'] !== 'http',\n sameSite: false,\n expires: new Date(Date.now() + CART_COOKIE_EXPIRATION_IN_MILLISECONDS)\n };\n addCookie(res, serializeCookie(CART_ID, cartId, options));\n};\n\nexport const setCookies = (\n res: Response,\n cookieConfigurations: CookieConfiguration[]\n) => {\n cookieConfigurations.forEach(({ name, value, options }) =>\n addCookie(res, serializeCookie(name, String(value), options))\n );\n};\n","const isTraderaDevHostname = (hostname: string): boolean =>\n /\\.tradera\\.dev$/.test(hostname);\n\nconst isWwwProxyDevHostname = (hostname: string): boolean =>\n /^www-proxy\\..*\\.tradera\\.service$/.test(hostname); // www-proxy.dev-web.tradera.service\n\nexport const isDevHost = (host: string) =>\n isTraderaDevHostname(host) || isWwwProxyDevHostname(host);\n\nexport const isLocalHost = (host: string) =>\n [\n /webpack-internal:\\/\\//,\n /^local(host)?(:[0-9]+)*$/,\n /^(www\\.)tradera.local?(:[0-9]+)*$/,\n /^host\\.docker\\.internal(:[0-9]+)*$/,\n /127\\.0\\.0\\.1:\\d+/,\n /10\\.\\d+\\.\\d+\\.\\d+:\\d+/,\n /192\\.168.\\.\\d+\\.\\d+:\\d+/\n ].some((regex) => regex.test(host));\n\nexport const isProductionHost = (host: string) =>\n !isLocalHost(host) && !isDevHost(host);\n","import { URL_LANGUAGES } from 'tradera/lang/constants.mjs';\n\n// Add any new NextWeb routes to this array to enable SPA navigation.\n// This is the part of the path after the language prefix until the end.\nexport const NEXTWEB_SPA_REGEX_PATHS = [\n '/?$',\n '/item/[0-9]+(?:/[0-9]+)?',\n '/cause/',\n '/charity/',\n '/campaign/',\n '/shop/',\n '/top-lists/',\n '/brand/',\n '/category/([0-9]+)',\n '/profile/information/',\n '/profile/items/',\n '/profile/feedback/',\n '/causes$',\n '/causes/items$',\n '/brands$',\n '/categories$',\n '/how-to-buy$',\n '/how-to-sell$',\n '/my/overview$',\n '/my/overview2$',\n '/my/overview-seller$',\n '/my/wish-list$',\n '/my/listings$',\n '/my/sold$',\n '/my/purchases$',\n '/top-lists$',\n '/my/picklist$',\n '/search/detailed$',\n '/search/detailed/member$',\n '/search/detailed$',\n '/shopping/ordercheckout/[^/]+$',\n '/shopping/ordercheckout/confirmation/[^/]+$',\n '/resolution/feedback-removal$',\n '/my/shipping/complaint/',\n '/my/refundcheckout$',\n '/my/sold/picklist/print2$',\n '/ma/endless-recommendation',\n '/giftcards$',\n '/shopping/cart$',\n '/mode$',\n '/fashion$'\n];\n\nexport const NEXTWEB_SPA_REGEX_TOGGLES = {\n '/my/sold$': 'next-sold-list',\n '/my/sold2$': 'next-sold-list',\n '/dispute/klarna$': 'dispute-v2-add',\n '/dispute/paypal$': 'dispute-v2-add',\n '/dispute/no-bp$': 'dispute-v2-add',\n '/dispute/new/': 'dispute-v2-add',\n '/login': 'next-web-login'\n};\n\nconst PATH_PREFIX = `(/(${URL_LANGUAGES.join('|')}))?`;\n\nconst createPathRegex = (pathRegex: string) =>\n new RegExp(`^${PATH_PREFIX}${pathRegex}`);\n\nconst getToggledOnPathRegex = (toggles: Record) =>\n Object.entries(NEXTWEB_SPA_REGEX_TOGGLES)\n .filter(([, toggleName]) => toggles[toggleName])\n .map(([path]) => path);\n\nexport const isLinkToNextWeb = (\n absoluteUrl: URL,\n location: URL,\n toggles: Record\n) => {\n const pathname = absoluteUrl?.pathname;\n\n if (absoluteUrl.searchParams.get('next') === '1') {\n return true;\n }\n\n if (\n createPathRegex('/search$').test(pathname) &&\n !!absoluteUrl.searchParams.get('q')\n ) {\n return true;\n }\n\n const toggledOnRegexPaths = getToggledOnPathRegex(toggles);\n const nextwebRegexFullPaths =\n NEXTWEB_SPA_REGEX_PATHS.concat(toggledOnRegexPaths).map(\n createPathRegex\n );\n\n if (nextwebRegexFullPaths.some((regex) => regex.test(pathname))) {\n return true;\n }\n\n return false;\n};\n","import { URL_LANGUAGES } from 'tradera/lang/constants.mjs';\n\n// Add any new Touchweb in NextWeb hybrid routes to this array to enable SPA navigation.\n// This is the part of the path after the language prefix until the end.\nexport const TW_IN_NW_HYBRID_SPA_REGEX_PATHS = [\n '/verify/kyc-questionnaire$',\n '/verify/collect-vat-number$',\n '/verify/collect-tin$',\n '/report-item',\n '/favourite-sellers$'\n];\n\nexport const TW_IN_NW_HYBRID_SPA_REGEX_TOGGLES = {\n '/frakt': 'next-web-shipping',\n '/valuation$': 'next-web-valuation',\n '/messaging$': 'next-web-messaging',\n '/selling/templates$': 'next-web-syi-templates',\n '/selling/template': 'next-web-syi-templates',\n '/selling$': 'next-web-syi-drafts',\n '/selling/campaign/': 'next-web-syi-drafts',\n '/selling/draft/[0-9a-fA-F]+$': 'next-web-syi-drafts',\n '/selling/summary/[0-9a-fA-F]+$': 'next-web-syi-drafts',\n '/selling/draft/[0-9a-fA-F]+/edit/|a-zA-Z,]+$': 'next-web-syi-drafts',\n '/selling/new$': 'next-web-syi-drafts',\n '/selling/published/[0-9]+$': 'next-web-syi-drafts',\n '/selling/extra/[0-9a-fA-F]+$': 'next-web-syi-drafts',\n '/selling/features/[0-9]+$': 'next-web-syi-drafts'\n};\n\nconst PATH_PREFIX = `(/(${URL_LANGUAGES.join('|')}))?`;\n\nconst createPathRegex = (pathRegex: string) =>\n new RegExp(`^${PATH_PREFIX}${pathRegex}`);\n\nconst getToggledOnPathRegex = (toggles: Record) =>\n Object.entries(TW_IN_NW_HYBRID_SPA_REGEX_TOGGLES)\n .filter(([, toggleName]) => toggles[toggleName])\n .map(([path]) => path);\n\nexport const isLinkToTouchwebInNextWeb = (\n absoluteUrl: URL,\n toggles: Record\n) => {\n const pathname = absoluteUrl?.pathname;\n\n const toggledOnRegexPaths = getToggledOnPathRegex(toggles);\n const nextwebRegexFullPaths =\n TW_IN_NW_HYBRID_SPA_REGEX_PATHS.concat(toggledOnRegexPaths).map(\n createPathRegex\n );\n if (nextwebRegexFullPaths.some((regex) => regex.test(pathname))) {\n return true;\n }\n\n return false;\n};\n","import { isLinkToNextWeb } from 'tradera/components/alink/is-link-to-next-web';\nimport { isLinkToTouchwebInNextWeb } from 'tradera/components/alink/is-link-to-touchweb-in-next-web';\nimport { isNextJs, isTouchwebInNextweb } from 'tradera/utils/nextjs';\n\nexport enum NavigationType {\n WindowTopLocation = 'WindowTopLocation',\n WindowLocation = 'WindowLocation',\n NextSpaNavigation = 'NextSpaNavigation',\n TouchwebSpaNavigation = 'TouchwebSpaNavigation'\n}\n\ntype Target = 'top' | 'new' | 'self';\n\nexport const getNavigationType = ({\n fromUrl,\n toUrl,\n target = 'self',\n isTouchwebSpaLink,\n isNativeApp,\n toggles\n}: {\n fromUrl: URL;\n toUrl: URL;\n target?: Target;\n isTouchwebSpaLink?: boolean;\n isNativeApp: boolean;\n toggles: Record;\n}) => {\n if (isNativeApp || target === 'new') {\n return NavigationType.WindowLocation;\n } else if (target === 'top') {\n return NavigationType.WindowTopLocation;\n }\n\n // We have 3 types of routing in the app:\n // 1. react-router-dom routing mounted in a SSR NextJS routed page\n const fromNextWebTouchwebHybrid = isTouchwebInNextweb;\n const toNextWebTouchwebHybrid = isLinkToTouchwebInNextWeb(toUrl, toggles);\n\n // 2. NextJS routing using NextLink\n const fromNextWeb = isNextJs;\n const toNextWeb = isLinkToNextWeb(toUrl, fromUrl, toggles);\n\n // 3. react-router-dom routing\n const toTouchwebBySpaNavigation =\n !toNextWeb && !toNextWebTouchwebHybrid && isTouchwebSpaLink;\n\n if (fromNextWeb && toNextWeb) {\n const isCurrentPage =\n `${fromUrl.pathname}${fromUrl.search}` ===\n `${toUrl.pathname}${toUrl.search}`;\n\n // NextJS routing\n // SPA-navigation to the same page becomes a problem when a Redux slice is reset\n // and the data is not loaded because the URL is the same.\n // Reloading the whole page is the solution that fits all these edge cases.\n return isCurrentPage\n ? NavigationType.WindowLocation\n : NavigationType.NextSpaNavigation;\n } else if (\n (!fromNextWeb && toTouchwebBySpaNavigation) ||\n (fromNextWebTouchwebHybrid && toNextWebTouchwebHybrid)\n ) {\n // react-router-dom routing\n return NavigationType.TouchwebSpaNavigation;\n }\n\n // Anything that ends up here will result in a full page load instead of SPA navigation.\n // Remaining 5 out of 9 combinations of navigations that end up in this else block:\n return NavigationType.WindowLocation;\n};\n","import { useSelector } from 'react-redux';\nimport { selectIsFeatureEnabled } from 'tradera/state/environment/selectors';\n\nexport const useIsFeatureEnabled = (featureName: string) =>\n useSelector(selectIsFeatureEnabled(featureName));\n","import { useMemo } from 'react';\nimport { useAppSelector } from 'tradera/state/hooks';\nimport { isServer } from 'tradera/utils/nextjs';\n\nexport const useLocation = (fallback = '') => {\n const request = useAppSelector((state) => state.request);\n const location = isServer\n ? // During static site generation isServer will be true, but we do not\n // have access to a request object. In those cases the consumer can pass in a fallback.\n (request.location ?? fallback)\n : window.location.href;\n const url = useMemo(() => new URL(location), [location]);\n return url;\n};\n","import { useMemo } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { useRouter } from 'next/compat/router';\nimport { isNextJs, isServer, isTouchwebInNextweb } from 'tradera/utils/nextjs';\nimport { removePrivacySandboxIframes } from 'tradera/utils/privacy-sandbox-iframes';\nimport { useAppSelector } from 'tradera/state/hooks';\nimport {\n selectFeatureSwitches,\n selectIsNativeApp\n} from 'tradera/state/environment/selectors';\nimport {\n getNavigationType,\n NavigationType\n} from 'tradera/components/alink/navigation-type';\nimport { useLocation } from 'tradera/hooks/use-location';\n\nexport type PushConfig = {\n breakIframe?: boolean;\n};\n\nexport type PushLocation = {\n pathname?: string | number;\n search?: string;\n};\n\nconst hasPathname = (obj: unknown): obj is { pathname: string | number } =>\n obj !== null &&\n typeof obj === 'object' &&\n 'pathname' in obj &&\n typeof obj.pathname !== 'undefined';\n\nconst hasSearch = (obj: unknown): obj is { search: string } =>\n obj !== null &&\n typeof obj === 'object' &&\n 'search' in obj &&\n typeof obj.search !== 'undefined';\n\nexport const toUrlString = (location: PushLocation | string) => {\n if (typeof location === 'string') {\n return location;\n } else if (hasPathname(location) && hasSearch(location)) {\n return `${location.pathname}${location.search}`;\n } else if (hasPathname(location)) {\n return `${location.pathname}`;\n } else if (hasSearch(location)) {\n return `${location.search}`;\n }\n return '';\n};\n\nexport const useNavigation = (isNextDataFetchingDisabled?: boolean) => {\n const nextRouter = useRouter();\n const touchwebHistory = useHistory();\n const isNativeApp = useAppSelector(selectIsNativeApp);\n const toggles = useAppSelector(selectFeatureSwitches);\n const currentLocation = useLocation('https://www.tradera.com');\n\n return useMemo(\n () => ({\n push: (\n location: PushLocation | string,\n pushConfig?: PushConfig\n ) => {\n removePrivacySandboxIframes();\n\n const url = toUrlString(location);\n const urlObject = new URL(url, window.location.origin);\n const target =\n pushConfig?.breakIframe &&\n window.self !== window.top &&\n window.top !== null\n ? 'top'\n : 'self';\n\n const navigationType = getNavigationType({\n fromUrl: currentLocation,\n toUrl: urlObject,\n target,\n isTouchwebSpaLink: true,\n isNativeApp,\n toggles\n });\n\n switch (navigationType) {\n case NavigationType.WindowTopLocation:\n if (window.top !== null) {\n window.top.location.href = url.toString();\n } else {\n window.location.href = url.toString();\n }\n return;\n case NavigationType.WindowLocation:\n window.location.href = url.toString();\n return;\n case NavigationType.NextSpaNavigation:\n return nextRouter?.push(url, undefined, {\n shallow: isNextDataFetchingDisabled\n });\n case NavigationType.TouchwebSpaNavigation:\n return touchwebHistory.push(url);\n default:\n throw new Error(\n `Unknown navigation type in useNavigation hook: ${navigationType}`\n );\n }\n },\n replace: (location: PushLocation | string) => {\n const url = toUrlString(location);\n if (isNextJs && !isTouchwebInNextweb) {\n return nextRouter?.replace(url, undefined, {\n shallow: isNextDataFetchingDisabled\n });\n }\n return touchwebHistory.replace(url);\n },\n back: () => {\n if (isNativeApp) {\n window.history.back();\n return;\n } else if (isNextJs && !isTouchwebInNextweb) {\n return nextRouter?.back();\n }\n return touchwebHistory.goBack();\n },\n refresh: () => {\n if (isNextJs && !isTouchwebInNextweb) {\n // Trigger fetching data from getServerSideProps().\n return nextRouter?.replace(window.location, undefined, {\n shallow: isNextDataFetchingDisabled\n });\n }\n throw new Error('This is only for NextWeb!');\n },\n hasPagesInHistory: () => !isServer && window.history.length > 1\n }),\n [\n isNativeApp,\n nextRouter,\n isNextDataFetchingDisabled,\n touchwebHistory,\n currentLocation,\n toggles\n ]\n );\n};\n","import { useNavigation } from 'tradera/hooks/use-navigation';\nimport { useLocation } from 'tradera/hooks/use-location';\nimport { useCallback } from 'react';\nimport { isNullOrUndefined } from 'tradera/utils/condition-check';\n\nexport enum ROUTING_TYPE {\n URL = 'url',\n PUSH = 'push',\n REPLACE = 'replace'\n}\n\nexport type UpdateSearchParams = (\n value?: string | number | boolean | null | undefined,\n routing?: ROUTING_TYPE,\n locationParameter?: URL\n) => URL;\n\n// This is TS overloading, meaning that the function can be called in different ways.\n// If called with a parameter, if will return a string or null.\n// If called with a defaultValue parameter, it will return a string or the defaultValue.\n/**\n * @deprecated\n * This is deprecated - use src/apps/nextweb/hooks/use-query-param.ts instead in Next.js\n *\n * If a parameter is passed, it returns an array with the value of the parameter and a function to update the value.\n * By default, the update function will trigger a `navigation.push()` call, but that can be disabled by passing `false` as the second parameter.\n *\n * If not parameter is passed, it returns a URLSearchParams object.\n *\n * @example\n * const [pageQuery, setPageQuery] = useQuery('page', 1);\n * const [filterQuery, setFilterQuery] = useQuery('filter', 'all');\n *\n * const handleFilterChange = (newFilter) => {\n * const url = setPageQuery(null, false);\n * setFilterQuery(newFilter, true, url);\n * };\n */\nexport function useQuery(\n parameter: string,\n defaultValue: string | number | boolean\n): [string, UpdateSearchParams];\nexport function useQuery(\n parameter: string\n): [string | null, UpdateSearchParams];\nexport function useQuery(\n parameter: string,\n defaultValue?: string | number | boolean\n): [string | null, UpdateSearchParams] {\n const location = useLocation('https://example.com');\n const navigation = useNavigation(true);\n const searchParams = new URLSearchParams(location.search);\n\n /**\n * Updates the value of the parameter in the URL.\n * If no value is passed, it will remove the parameter from the URL.\n *\n * By default, it will trigger a `navigation.push()` call, but that can be disabled by passing `false` as the second parameter.\n * By default it will use the current location, but that can be overridden by passing a URL as the third parameter.\n */\n const updateSearchParam: UpdateSearchParams = useCallback(\n (value, routing = ROUTING_TYPE.PUSH, locationParameter) => {\n const url = new URL(locationParameter ?? location);\n if (!parameter) return url;\n\n if (\n typeof value !== 'undefined' &&\n value !== null &&\n value !== defaultValue\n ) {\n url.searchParams.set(parameter, value.toString());\n } else {\n url.searchParams.delete(parameter);\n }\n\n if (routing !== ROUTING_TYPE.URL) navigation[routing](url);\n\n return url;\n },\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [parameter]\n );\n\n return [\n searchParams.get(parameter) ?? toStringOrNull(defaultValue),\n updateSearchParam\n ];\n}\n\n// this is to avoid stringifying undefined to \"undefined\"\nconst toStringOrNull = (\n value: string | number | boolean | undefined | null\n): string | null => (isNullOrUndefined(value) ? null : value.toString());\n","import * as Sentry from '@sentry/nextjs';\nimport { isNextJs, isServer } from 'tradera/utils/nextjs';\nimport type { InitOptions } from 'i18next';\nimport { isAttributeStuffing } from 'tradera/lang/helpers';\n\nexport const missingKeyLoggingConfig = {\n saveMissing: true,\n saveMissingTo: 'current' as const,\n missingKeyHandler: (\n language,\n namespace,\n key,\n _fallbackValue,\n _updateMissing,\n options\n ) => {\n if (\n (!isNextJs ||\n isServer ||\n (isNextJs && !isServer && options.hasLoadedAllTranslations)) &&\n !isAttributeStuffing(key, namespace)\n ) {\n const errorMessage = `TranslationMissing (javascript) - Unable to find key ${key} (namespace ${namespace}) in language ${language}!`;\n Sentry.captureException(new Error(errorMessage));\n }\n },\n missingInterpolationHandler: (text, value) => {\n Sentry.captureException(\n new Error(\n `InterpolationFailure (javascript) - Unable to interpolate the text \"${text}\" fully. The following placeholder values were missing: ${JSON.stringify(\n value\n )}`\n )\n );\n return undefined;\n }\n};\n","/**\n * This is used to filter away errors that would otherwise be logged to Sentry and flood the logs.\n * It happens when people try to use the attributes to try to inject code or markup.\n */\nexport function isAttributeStuffing(key: string, namespace: string): boolean {\n if (namespace !== 'attributes') return false;\n return /[[\\]#<*()]+/.test(key);\n}\n","/* eslint-disable better-mutation/no-mutation */\n\nimport i18n from 'i18next';\nimport { logger } from 'packages/logger';\n// eslint-disable-next-line no-restricted-imports\nimport { initReactI18next } from 'react-i18next';\nimport LanguageDetector from 'i18next-browser-languagedetector';\nimport { toLocalizedUrl } from 'tradera/utils/url';\nimport { formatNumberWithSeparators } from 'tradera/utils/format';\nimport { missingKeyLoggingConfig } from 'tradera/lang/shared-config';\nimport {\n NS_TOUCHWEB,\n NS_ATTRIBUTES,\n DEFAULT_LANGUAGE\n} from 'tradera/lang/constants.mjs';\nimport 'dayjs/locale/sv';\nimport 'dayjs/locale/da';\nimport 'dayjs/locale/de';\nimport { isServer } from 'tradera/utils/nextjs';\n\nlet i18nInitialized;\n\n/**\n * Initialize function for i18next\n * Must be run before doing any translations\n * @param {Array} [translations]\n * @param {Object} [options]\n * @returns {Promise} - a promise to the i18next t function\n */\nexport const bootLanguages = (\n translations = window.touchwebTranslations,\n attributeTranslations = window.attributeTranslations\n) => {\n if (isServer) {\n // Do not remove this without also removing the disable of eslint better-mutation/no-mutation at top of file.\n throw new Error(\n 'This implementation is not compatible with SSR as global properties are shared between server instances'\n );\n }\n\n const translationResources = Object.entries(translations).map(\n ([key, value]) => ({\n key,\n value,\n namespace: 'touchWeb'\n })\n );\n const attributeResources = Object.entries(attributeTranslations).map(\n ([key, value]) => ({ key, value, namespace: 'attributes' })\n );\n\n const resources = translationResources\n .concat(attributeResources)\n .reduce((prev, { key, value, namespace }) => {\n const s = prev[key] || {};\n s[namespace] = value;\n return {\n ...prev,\n [key]: s\n };\n }, {});\n\n i18nInitialized = i18n\n .use(initReactI18next)\n .use(LanguageDetector)\n .init(initOptions(resources), (err) => {\n if (err) {\n logger('error when loading translations', err);\n }\n });\n\n return i18nInitialized;\n};\n\nexport const initOptions = (resources) => ({\n detection: {\n order: ['htmlTag'],\n htmlTag: document.html\n },\n defaultNS: [NS_TOUCHWEB],\n ns: [NS_ATTRIBUTES],\n fallbackLng: DEFAULT_LANGUAGE,\n resources,\n debug: false,\n keySeparator: false,\n nsSeparator: ':::',\n interpolation: {\n skipOnVariables: true,\n escapeValue: false,\n format: (value, format) => {\n if (format === 'formatNumber') {\n return formatNumberWithSeparators(value);\n }\n\n return value;\n }\n },\n react: {\n useSuspense: false // loading from file currently breaks if this is true\n },\n ...missingKeyLoggingConfig\n});\n\n/**\n * This function helps you make sure that i18next init has completed before continuing\n */\nexport const whenInitialized = () => {\n if (!i18nInitialized) {\n throw new Error(\n \"Can't call boot-languages whenInitialized before init!\"\n );\n }\n return i18nInitialized.then((t) => ({\n t,\n toLocalizedUrl: (url) => toLocalizedUrl(url, i18n.language)\n }));\n};\n\n/**\n * Only required for Storybook, do not use.\n */\nexport const changeLanguage = (language) => i18n.changeLanguage(language);\n\nexport const getCurrentLanguage = () => i18n.language;\n","import type { MutableRefObject } from 'react';\nimport { createContext, createRef, useCallback, useContext } from 'react';\nimport { NS_ATTRIBUTES, NS_TOUCHWEB } from 'tradera/lang/constants.mjs';\nimport { isServer } from 'tradera/utils/nextjs';\n\ntype TranslationKeyValue = Record;\ntype NamespaceTranslations = Record | null;\n\nconst initialState: NamespaceTranslations = {\n [NS_ATTRIBUTES]: {},\n [NS_TOUCHWEB]: {}\n};\n\nexport const TranslationContext = createContext<\n MutableRefObject\n>({ current: initialState });\n\nexport const TranslationProvider = ({\n children\n}: {\n children: React.ReactNode;\n}) => {\n const translationsRef: MutableRefObject =\n createRef();\n translationsRef.current = initialState;\n\n return (\n \n {children}\n \n );\n};\n\nexport const useTranslations = () => {\n const translationsRef = useContext(TranslationContext);\n\n return translationsRef;\n};\n\nexport type AddTranslation = (\n namespace: string,\n pluralizedKey: string,\n translation: string\n) => void;\n\nexport const useAddTranslation = (): AddTranslation => {\n const translationsRef = useContext(TranslationContext);\n\n return useCallback(\n (namespace, pluralizedKey, translation) => {\n if (!isServer) {\n return;\n }\n\n if (!translationsRef?.current) {\n return;\n }\n\n if (!translationsRef.current[namespace]) {\n translationsRef.current[namespace] = {};\n }\n translationsRef.current[namespace][pluralizedKey] = translation;\n },\n [translationsRef]\n );\n};\n","import * as Sentry from '@sentry/react';\nimport type { CaptureContext } from '@sentry/types';\nimport { AxiosError } from 'axios';\nimport { isClientNetworkError } from 'tradera/utils/api';\n\ntype SomeError = Error | string | object | unknown;\n\n/**\n * @param {object} error - takes an exception and logs to Sentry or the console in development\n * @param {object} [scope] - Sentry CaptureContext created with new Sentry.Scope() or plain object\n * @desc logger is designed for logging errors. It will accept an argument of any type and create a stacktrace containing a reference to the callee.\n * @TODO Migrate this functionality to a logging module that handles different levels of logs\n */\nexport const logger = (error: SomeError, scope?: CaptureContext) => {\n if (error instanceof AxiosError && isClientNetworkError(error)) {\n // Ignore client network API errors like aborts, timeouts etc.\n return;\n }\n\n let sentryException;\n if (error instanceof Error) {\n sentryException = error;\n } else if (typeof error === 'string') {\n sentryException = new Error(error);\n } else {\n sentryException = new Error(JSON.stringify(error));\n }\n if (scope) {\n Sentry.captureException(sentryException, scope);\n } else {\n Sentry.captureException(sentryException);\n }\n};\n","/* eslint-disable better-mutation/no-mutation */\n\n/**\n *\n * # track events:\n * import { GtmService } from 'tradera/services/google-tagmanager/google-tagmanager-service';\n * GtmService.trackGtmEvent(\"zorro\", { marvel: false, black: true })\n *\n *\n *\n */\n\nimport * as Sentry from '@sentry/react';\nimport initData from 'tradera/legacy/static/packages/init-data';\nimport { isServer, isNextJs, isTouchwebInNextweb } from 'tradera/utils/nextjs';\nimport { buildInitialGtmDataLayerFromInitData } from 'tradera/utils/google-tagmanager';\nimport { queueBackgroundTask } from 'tradera/utils/scheduler';\nimport { googleTagManagerSnippet } from 'tradera/services/google-tagmanager/google-tagmanager-snippet';\nimport type { SOURCE_SCREEN } from 'tradera/services/google-tagmanager/constants';\nimport type { ItemCardSearchResultOrigin } from 'tradera/state/services/types/webapi-discover-generated';\n\ndeclare global {\n interface Window {\n dataLayer: unknown[];\n legacyDataLayer: unknown[];\n logGaWebViewEvent?: (name: string, params: unknown) => void;\n setGaWebViewUserProperty?: (name: string, value: string) => void;\n AnalyticsWebInterface?: {\n logEvent: (name: string, params: string) => void;\n setUserProperty: (name: string, value: string) => void;\n };\n webkit?: {\n messageHandlers?: {\n firebase: {\n postMessage: (message: unknown) => void;\n };\n };\n };\n }\n}\n\n/**\n * SPA page view tracking becomes enabled after first\n * page view tracking which happens after the first\n * page is loaded from server.\n * This prevents reset of data layer after a SPA route has\n * changed (happens late after full page load) and prevents\n * duplicated trackPageView events.\n */\nlet spaPageViewTrackingEnabled = false;\n\nclass GoogleTagManagerService {\n isScriptLoaded: boolean;\n constructor() {\n this.isScriptLoaded = false;\n\n if (!isNextJs) this._setWebViewHelperFunctionsToWindow();\n }\n\n loadGtmScript() {\n if (!isNextJs || isTouchwebInNextweb) {\n this._newPageFromServer();\n }\n const accountId =\n (typeof process === 'object' &&\n process?.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ACCOUNT_ID) ||\n 'GTM-5TMB2D';\n googleTagManagerSnippet(accountId);\n this.isScriptLoaded = true;\n }\n\n push(payload: object) {\n if (isServer) {\n return;\n }\n\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(payload);\n }\n\n pushArguments(...args: unknown[]) {\n if (isServer) {\n return;\n }\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push(...args);\n }\n\n _getDatalayerObject(): Record {\n let output = {};\n if (window.dataLayer) {\n for (const entry of window.dataLayer) {\n output = { ...output, ...(entry as Record) };\n }\n }\n return output;\n }\n\n /**\n * destroy datalayer from previous loading. this is really only useful in spa pages, it's backwards compatible so it doesnt do any harm on old pages\n */\n _reset() {\n if (!window.dataLayer) {\n return;\n }\n\n const data = this._getDatalayerObject();\n for (const key of Object.keys(data)) {\n data[key] = undefined;\n }\n window.dataLayer.push({ ...data, event: 'reset' });\n }\n\n _hasPreviouslyTrackedPage = () =>\n !!window.dataLayer?.find(\n (item) => (item as { event: string }).event === 'trackPageview'\n );\n\n newPage(pageType: string, initialDataLayer: object) {\n if (this._hasPreviouslyTrackedPage()) {\n this._reset();\n }\n this._pushInitialDataLayer(initialDataLayer);\n // It is important that the \"Container loaded\" triggered by dataLayer.push({event: \"gtm.js\", ...})\n // happens after \"initialDataLayer\" otherwise variables for the GDPR banner may have the wrong\n // values in Tagmanager. For that reason the GTM script is loaded here after initialDatalayer is set.\n if (!this.isScriptLoaded) {\n this.loadGtmScript();\n }\n this.push({ event: 'pageType', 'page.pageType': pageType });\n }\n\n /**\n * Same as newPage but with logic for case in Touchweb where initial\n * datalayer was set on server and already tracked on landing page.\n * This function does nothing until after first call to trackPageView\n * (e.g. after a SPA-navigation away from the landing page).\n */\n newSpaPage(pageType: string, initialDataLayer: Record) {\n if (!spaPageViewTrackingEnabled) {\n return;\n }\n this.newPage(pageType, initialDataLayer);\n }\n\n _newPageFromServer() {\n const initialDataLayer = buildInitialGtmDataLayerFromInitData(initData);\n this._pushInitialDataLayer(initialDataLayer);\n // ------------------------------------------------\n // backwards compatibility\n // get old datalayer info and push it in\n if (window.legacyDataLayer) {\n for (const entry of window.legacyDataLayer) {\n window.dataLayer.push({\n event: 'tradera/legacyDataLayer',\n ...(entry as unknown[])\n });\n }\n }\n }\n\n _pushInitialDataLayer(initialDataLayer: object) {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n ...initialDataLayer,\n event: 'initialDataLayer'\n });\n }\n\n /**\n * Tracks a google analytics event asynchronously\n * Good for SEO, users and Web Vitals Interaction to Next Paint.\n * @param {string} category ga category\n * @param {string} action ga action what happens, ie: \"Filter box - open/close\"\n * @param {string} [label] ga label what the value of the action was, ie \"close\"\n * @param {integer} [value] ga interger value of the action\n * @param {boolean} [nonInteractive] if the action does not stems from a user interaction\n */\n trackAction(\n category: string,\n action: string,\n label?: string,\n value?: number,\n nonInteractive?: boolean\n ) {\n queueBackgroundTask(() =>\n this.trackActionSynchronously(\n category,\n action,\n label,\n value || 0,\n nonInteractive ?? false\n )\n );\n }\n\n /**\n * Tracks a google analytics event synchronously\n * @deprecated In 99% of cases, use `trackAction` instead. Using this can cause high Web Vitals INP.\n * @param {string} category ga category\n * @param {string} action ga action what happens, ie: \"Filter box - open/close\"\n * @param {string} [label] ga label what the value of the action was, ie \"close\"\n * @param {integer} [value] ga interger value of the action\n * @param {boolean} [nonInteractive] if the action does not stems from a user interaction\n */\n trackActionSynchronously(\n category: string,\n action: string,\n label?: string,\n value?: number,\n nonInteractive?: boolean\n ) {\n this.push({\n event: 'trackEvent',\n eventCategory: category || '',\n eventAction: action || '',\n eventLabel: label || '',\n eventValue: value || '0',\n eventNonInteractive: nonInteractive || false\n });\n\n Sentry.addBreadcrumb({\n type: 'default',\n level: 'info',\n category: nonInteractive ? 'tracking' : 'ui-action',\n message: 'Analytics Event',\n data: {\n category,\n action,\n label,\n value: value ?? 0\n }\n });\n }\n\n /**\n * google tag manager event. Note: if you want to send google analytics events use trackAction instead\n * @param {string} eventName\n * @param {object} [data] data\n */\n trackGtmEvent(eventName: string, data: object = {}) {\n this.push({\n event: eventName,\n ...data\n });\n }\n\n /**\n * Track a pageview. Use this script in SPA's to make sure that analytics gets pageview information.\n * This creates a virtual page view since google analytics by default doesn't track changes to url via\n * push state.\n */\n trackPageView() {\n this.trackGtmEvent('trackPageview');\n spaPageViewTrackingEnabled = true;\n }\n\n trackLinkClickAndCallback(\n category: string,\n action: string,\n label: string,\n callback: () => void,\n value: unknown = 0\n ) {\n this.push({\n event: 'trackEvent',\n eventCategory: category || '',\n eventAction: action || '',\n eventLabel: label || '',\n eventValue: value || '0',\n eventNonInteractive: false,\n eventCallback: callback // part of google tag manager api to execute code after all tags in datalayer have been executed\n });\n }\n\n trackLinkClickAndGotoUrl(\n category: string,\n action: string,\n label: string,\n url?: string,\n value = 0\n ) {\n const callback = () => {\n if (!url) return;\n location.href = url;\n };\n this.trackLinkClickAndCallback(\n category,\n action,\n label,\n callback,\n value\n );\n }\n\n /**\n * Set up helper functions which purpose is to post data to\n * either Android or iOS\n * These are accessed by Google Tag Manager\n *\n * https://firebase.google.com/docs/analytics/webview?platform=ios\n */\n _setWebViewHelperFunctionsToWindow() {\n window.logGaWebViewEvent = (name: string, params: unknown) => {\n if (!name) {\n return;\n }\n\n if (window.AnalyticsWebInterface) {\n // Call Android interface\n window.AnalyticsWebInterface.logEvent(\n name,\n JSON.stringify(params)\n );\n } else if (\n window.webkit &&\n window.webkit.messageHandlers &&\n window.webkit.messageHandlers.firebase\n ) {\n // Call iOS interface\n const message = {\n command: 'logEvent',\n name: name,\n parameters: params\n };\n window.webkit.messageHandlers.firebase.postMessage(message);\n }\n };\n\n window.setGaWebViewUserProperty = (name, value) => {\n if (!name || !value) {\n return;\n }\n\n if (window.AnalyticsWebInterface) {\n // Call Android interface\n window.AnalyticsWebInterface.setUserProperty(name, value);\n } else if (\n window.webkit &&\n window.webkit.messageHandlers &&\n window.webkit.messageHandlers.firebase\n ) {\n // Call iOS interface\n const message = {\n command: 'setUserProperty',\n name: name,\n value: value\n };\n window.webkit.messageHandlers.firebase.postMessage(message);\n }\n };\n }\n /**\n * Track event to GA4 via GTM.\n *\n * `timestamp` will always be attached.\n *\n * @example\n * GtmService.trackGA4('saved_search_deleted', {\n * saved_search_id: id\n * })\n */\n trackGA4(\n eventName: string,\n eventParams: EventParams = {},\n userData: UserData = {}\n ) {\n const payload = {\n event: 'track_ga4_event',\n eventName,\n eventParams: { timestamp: Date.now(), ...eventParams },\n userData\n };\n this.push(payload);\n }\n}\n\nexport const GtmService = new GoogleTagManagerService();\n\nexport enum FlowId {\n Unknown = 0,\n SYI = 1,\n VIP = 2\n}\n\nexport type GA4Item = {\n item_id: number;\n};\n\n// All new eventParams must be added to GTM\n// Mapped in \"GA4 - Track events\" and separate variable definitions\nexport type EventParams = {\n flow_id?: FlowId;\n boolean_value?: 1 | 0;\n item_id?: number;\n timestamp?: number;\n source_section?: string;\n items?: GA4Item[];\n source_screen?: SOURCE_SCREEN;\n\n // Wishlist specific params\n wishlist_type?: string;\n\n // Purchase offer specific params\n item_status?: 'active' | 'ended';\n\n // SYI specific params\n draft_id?: string;\n form_name?: 'syi_draft';\n syi_session_id?: string;\n attribute_name?: string;\n ai_title?: 1 | 0;\n ai_description?: 1 | 0;\n ai_images?: number;\n ai_processing_time?: number;\n\n // Item card specific params\n item_placement?: number;\n pagination?: number;\n\n // pagination specific params\n direction?: string;\n\n // search specific params\n search_type?: string;\n search_term?: string;\n search_category?: number;\n sort_type?: string;\n saved_search_type?: string;\n saved_search_id?: number;\n search_model?: ItemCardSearchResultOrigin;\n exact_search?: number;\n\n // scroll specific params\n scroll_percentage?: number;\n scroll_percentage_max?: number;\n};\n\ntype UserData = {\n member_id?: number;\n};\n","/* eslint-disable better-mutation/no-mutation */\n\nexport const googleTagManagerSnippet = (accountId) =>\n (function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js'\n });\n const f = d.getElementsByTagName(s)[0];\n const j = d.createElement(s);\n j.async = true;\n j.src = '//www.googletagmanager.com/gtm.js?id=' + i;\n f.parentNode?.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', accountId);\n","/**\n * A queue with a that handled max age (ttl) for messages.\n * @returns\n */\nexport const createQueue = () => {\n const items = [];\n const dayInMinutes = 60 * 24;\n const add = (item, ttlInMinutes = dayInMinutes) => {\n const timeStamp = Date.now();\n items.push({ item, ttlInMinutes, timeStamp });\n };\n const isAlive = ({ ttlInMinutes, timeStamp }) => {\n return timeStamp + ttlInMinutes * 60 * 1000 >= Date.now();\n };\n let inProgress = null;\n return {\n add,\n next: () => {\n let itemData = items.shift();\n while (itemData && !isAlive(itemData)) {\n itemData = items.shift();\n }\n // eslint-disable-next-line better-mutation/no-mutation\n inProgress = itemData?.item || null;\n return inProgress;\n },\n notifyDone: () => {\n // eslint-disable-next-line better-mutation/no-mutation\n inProgress = null;\n },\n isInProgress: () => inProgress !== null,\n getLength: () => items.length\n };\n};\n","import cookie from 'cookie';\nimport type { IncomingHttpHeaders } from 'http';\nimport { addCookie } from 'tradera-backend/utils/cookies';\nimport type { Request, Response } from 'tradera/backend/http/types/http';\nimport { NATIVE_APP_ENVIRONMENT } from 'tradera/constants/cookies';\nimport { safeDecodeURIComponent } from 'tradera/utils/safe-decode-uri-component';\n\nexport type NativeAppInfo = {\n osVersion?: string;\n appDevice?: string;\n appVersion?: string;\n appContext?: string;\n appLanguage?: string;\n appInstanceId?: string;\n};\n\ntype NativeAppCookieAndHeaderConfig = {\n [P in keyof NativeAppInfo]: {\n header: string;\n initDataName: string;\n };\n};\n\nconst NATIVE_APP_COOKIE_AND_HEADER_CONFIG: NativeAppCookieAndHeaderConfig = {\n osVersion: {\n header: 'x-tradera-app-os-version',\n initDataName: 'nativeAppOsVersion'\n },\n appDevice: {\n header: 'x-tradera-app-device',\n initDataName: 'nativeAppDevice'\n },\n appVersion: {\n header: 'x-tradera-app-version',\n initDataName: 'nativeAppVersion'\n },\n appContext: { header: 'x-tradera-app', initDataName: 'nativeAppContext' },\n appLanguage: {\n header: 'x-language',\n initDataName: 'nativeAppLanguage'\n },\n appInstanceId: {\n header: 'X-Tradera-App-GA-App-Instance-Id',\n initDataName: 'nativeAppInstanceId'\n }\n};\n\nconst createCookie = (name: string, value: string) => {\n const options = {\n httpOnly: false,\n path: '/'\n };\n return cookie.serialize(name, String(value), options);\n};\n\nconst isString = (s: unknown) => typeof s === 'string';\n\nexport const createNativeAppCookieValue = (\n nativeAppInfo: Record\n) => {\n const valueObject = Object.fromEntries(\n Object.entries(nativeAppInfo).filter(\n ([key, value]) =>\n key in NATIVE_APP_COOKIE_AND_HEADER_CONFIG && isString(value)\n )\n );\n return JSON.stringify(valueObject);\n};\n\nexport const createNativeAppCookie = (\n nativeAppInfo: Record\n) => {\n return createCookie(\n NATIVE_APP_ENVIRONMENT,\n createNativeAppCookieValue(nativeAppInfo)\n );\n};\n\n/**\n * Gets info about the native app if in native app context.\n * The function also updates a cookie with the same information\n * to be used for later calls to this function if the headers are\n * not present.\n *\n * @param {*} req\n * @param {*} res\n * @returns An object with these properties: {\n osVersion,\n appDevice,\n appVersion,\n appContext\n }\n */\nexport const getAndUpdateNativeAppInfo = (\n req: Request,\n res: Response\n): NativeAppInfo => {\n const nativeAppInfoFromHeaders = extractNativeAppInfoFromHeaders(\n req.headers\n );\n\n const hasAppHeaders =\n Object.values(nativeAppInfoFromHeaders).filter(Boolean).length > 0;\n if (hasAppHeaders) {\n const cookie = createNativeAppCookie(nativeAppInfoFromHeaders);\n addCookie(res, cookie);\n return nativeAppInfoFromHeaders;\n }\n\n const nativeAppInfoFromCookie = extractNativeAppInfoFromCookie(\n req.cookies[NATIVE_APP_ENVIRONMENT]\n );\n return nativeAppInfoFromCookie;\n};\n\nexport const extractNativeAppInfoFromCookie = (\n nativeAppCookieString: string | null | undefined\n): NativeAppInfo =>\n nativeAppCookieString\n ? Object.fromEntries(\n Object.entries(\n JSON.parse(safeDecodeURIComponent(nativeAppCookieString))\n ).filter(([key]) => key in NATIVE_APP_COOKIE_AND_HEADER_CONFIG)\n )\n : {};\n\nexport const extractNativeAppInfoFromHeaders = (\n headers: IncomingHttpHeaders\n) => {\n return Object.entries(NATIVE_APP_COOKIE_AND_HEADER_CONFIG).reduce(\n (obj: Record, [key, config]) => {\n const header = headers[config.header];\n const singleValue = Array.isArray(header) ? header[0] : header;\n obj[key] = singleValue || '';\n return obj;\n },\n {}\n );\n};\n\nexport const extractNativeAppInfoFromInitData = (\n initData: Record\n) => {\n return Object.entries(NATIVE_APP_COOKIE_AND_HEADER_CONFIG).reduce(\n (obj: Record, [key, config]) => {\n obj[key] = initData[config.initDataName] || '';\n return obj;\n },\n {}\n );\n};\n","import axios from 'axios';\nimport { selectPreferredLanguageCode } from 'tradera/state/language/selectors';\nimport { toLocalizedUrl } from 'tradera/utils/url';\nimport {\n setEnvironmentHash,\n setIsSpaNavigationEnabled,\n setGATrackingData,\n setNativeAppInfo,\n setVariables,\n setVersion,\n setFeatureSwitches,\n setSplitTestGroups,\n setEnvironment\n} from './reducer';\nimport { isNextJs } from 'tradera/utils/nextjs';\nimport { selectMemberId } from 'tradera/state/member/selectors';\nimport {\n createNativeAppCookieValue,\n extractNativeAppInfoFromCookie,\n extractNativeAppInfoFromInitData\n} from './native-app-info-helper';\nimport cookie from 'tradera/utils/cookie';\nimport { NATIVE_APP_ENVIRONMENT } from 'tradera/constants/cookies';\nimport { GtmService as gtm } from 'tradera/services/google-tagmanager/google-tagmanager-service';\nimport type { AppDispatch, GetState } from 'tradera/state/configure-store';\nimport {\n isAndroid,\n isMobile,\n isMobileSafari,\n isIOS,\n browserName\n} from 'react-device-detect';\n\nconst getVersionUrl = (getState: GetState) => {\n if (isNextJs) {\n const queryParameters = new URLSearchParams({ next: '1' });\n const memberId = selectMemberId(getState());\n if (memberId) {\n queryParameters.set('memberId', `${memberId}`);\n }\n return `/api/version?${queryParameters}`;\n }\n\n const preferredLanguageCode = selectPreferredLanguageCode(getState());\n\n return toLocalizedUrl('/ping', preferredLanguageCode);\n};\n\nexport const updateEnvironmentHash =\n () => async (dispatch: AppDispatch, getState: GetState) => {\n const url = getVersionUrl(getState);\n const response = await axios.get(url);\n const environmentHash = response.headers['x-tradera-environment'];\n const current = getState().environment.environmentHash;\n if (environmentHash !== current) {\n dispatch(setEnvironmentHash(environmentHash));\n dispatch(setIsSpaNavigationEnabled(false));\n }\n };\n\nconst getAndUpdateNativeAppInfo = (initData: Record) => {\n const nativeAppInfoFromInitData =\n extractNativeAppInfoFromInitData(initData);\n const hasAnyValidProperties =\n Object.values(nativeAppInfoFromInitData).filter(Boolean).length > 0;\n if (hasAnyValidProperties) {\n const nativeAppCookieValue = createNativeAppCookieValue(\n nativeAppInfoFromInitData\n );\n cookie.createCookie(NATIVE_APP_ENVIRONMENT, nativeAppCookieValue);\n return nativeAppInfoFromInitData;\n }\n\n const cookieValue = cookie.readCookie(NATIVE_APP_ENVIRONMENT);\n const nativeAppInfo = extractNativeAppInfoFromCookie(cookieValue);\n return nativeAppInfo;\n};\n\nexport const setupGATrackingData =\n () => (dispatch: AppDispatch, getState: GetState) => {\n const {\n environment: { variables }\n } = getState();\n const { PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID } = variables;\n\n if (PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID) {\n gtm.pushArguments(\n 'get',\n PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID,\n 'session_id',\n (sessionId: string) => {\n dispatch(setGATrackingData({ sessionId }));\n }\n );\n }\n };\n\nexport const initEnvironment =\n (initData: {\n environment: string;\n environmentHash: string;\n featureSwitches: Record;\n googleAnalyticsTrackingId: string;\n googleAnalyticsMeasurementId: string;\n geoPublicApiBaseUrl: string;\n isSinglePageApp: boolean;\n splitTests: Record;\n splitTestGroups: Record;\n version: string;\n webLiveUrl: string;\n }) =>\n async (dispatch: AppDispatch) => {\n const {\n environment,\n environmentHash,\n featureSwitches,\n googleAnalyticsTrackingId,\n googleAnalyticsMeasurementId,\n geoPublicApiBaseUrl,\n isSinglePageApp,\n splitTestGroups,\n version,\n webLiveUrl\n } = initData;\n\n const isSpaNavigationEnabled =\n isSinglePageApp && !window.frameElement ? true : false; // No SPA navigation in native apps or iFrame\n dispatch(setIsSpaNavigationEnabled(isSpaNavigationEnabled));\n dispatch(setEnvironment(environment));\n dispatch(setEnvironmentHash(environmentHash));\n dispatch(setFeatureSwitches(featureSwitches));\n dispatch(setSplitTestGroups(splitTestGroups));\n dispatch(setVersion(version));\n dispatch(\n setVariables({\n // Names must be the same as NextWeb's .env variables\n PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID: googleAnalyticsTrackingId,\n PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID:\n googleAnalyticsMeasurementId,\n PUBLIC_GEO_PUBLIC_API_BASE_URL: geoPublicApiBaseUrl,\n PUBLIC_WEB_LIVE_URL: webLiveUrl\n })\n );\n dispatch(\n setNativeAppInfo({\n ...getAndUpdateNativeAppInfo(initData),\n browserName,\n isMobileDevice: isMobile,\n isMobileSafari,\n isIOS,\n isAndroid\n })\n );\n\n dispatch(setupGATrackingData());\n };\n","export const parseAppVersion = (version) => {\n const [major = 0, minor = 0, patch = 0] = String(version)\n .split('.')\n .map(Number)\n .filter((number) => !Number.isNaN(number));\n return { major, minor, patch };\n};\n\nexport const isSupportedMinimumVersion = (\n appVersionString,\n minimumVersionString\n) => {\n const appVersion = parseAppVersion(appVersionString);\n const minimumVersion = parseAppVersion(minimumVersionString);\n if (appVersion.major > minimumVersion.major) {\n return true;\n }\n if (appVersion.major === minimumVersion.major) {\n if (appVersion.minor > minimumVersion.minor) {\n return true;\n }\n if (appVersion.minor === minimumVersion.minor) {\n if (appVersion.patch >= minimumVersion.patch) {\n return true;\n }\n }\n }\n\n return false;\n};\n","/* eslint-disable better-mutation/no-mutation */\n\nimport { type PayloadAction, createSlice } from '@reduxjs/toolkit';\nimport type { NativeAppInfo } from 'tradera/state/environment/native-app-info-helper';\nimport { getNativeAppSupport } from 'tradera/state/environment/native-app-support';\n\ntype EnvironmentSlice = {\n isSpaNavigationEnabled: boolean;\n featureSwitches: Record;\n splitTestGroups: Record;\n variables: Record;\n environmentHash: string | null;\n gaTrackingSessionId: string | null;\n isHybridAppContextForAndroid: boolean;\n isHybridAppContextForIos: boolean;\n isNativeAppWithApplyPaySupport: boolean;\n isNativeAppWithSwishCallbackSupport: boolean;\n isNativeAppWithKlarnaSupport: boolean;\n isNativeAppWithTrustlySupport: boolean;\n isNativeAppWithInternationalVerificationSupport: boolean;\n isHybridAppContext: boolean;\n appInstanceId: string | null;\n isIOS: boolean;\n isNativeAppContext?: boolean;\n isMobileDevice: boolean;\n isMobileSafari: boolean;\n version: string | null;\n browserName: string | null;\n appLanguage: string | null;\n appVersion: string | null;\n environment: string;\n};\n\nexport const initialState: EnvironmentSlice = {\n featureSwitches: {},\n splitTestGroups: {},\n variables: {},\n isSpaNavigationEnabled: true,\n environment: process.env.NODE_ENV,\n version: null,\n environmentHash: null,\n gaTrackingSessionId: null,\n isHybridAppContextForAndroid: false,\n isHybridAppContextForIos: false,\n isNativeAppWithApplyPaySupport: false,\n isNativeAppWithSwishCallbackSupport: false,\n isNativeAppWithKlarnaSupport: false,\n isNativeAppWithTrustlySupport: false,\n isNativeAppWithInternationalVerificationSupport: false,\n isHybridAppContext: false,\n isIOS: false,\n appInstanceId: null,\n isMobileDevice: false,\n isMobileSafari: false,\n browserName: null,\n appLanguage: null,\n appVersion: null\n};\n\nconst slice = createSlice({\n name: 'environment',\n initialState,\n reducers: {\n setEnvironmentHash: (state, { payload }) => {\n state.environmentHash = payload;\n },\n setEnvironment: (state, { payload }: PayloadAction) => {\n state.environment = payload;\n },\n setIsSpaNavigationEnabled: (state, { payload }) => {\n state.isSpaNavigationEnabled = payload;\n },\n setGATrackingData: (state, { payload }) => {\n state.gaTrackingSessionId = payload.sessionId;\n },\n setFeatureSwitches: (\n state,\n { payload }: PayloadAction>\n ) => {\n state.featureSwitches = payload;\n },\n setSplitTestGroups: (\n state,\n { payload }: PayloadAction>\n ) => {\n state.splitTestGroups = payload;\n },\n setVariables: (\n state,\n { payload }: PayloadAction>\n ) => {\n state.variables = payload;\n },\n setVersion: (state, { payload }: PayloadAction) => {\n state.version = payload;\n },\n setNativeAppInfo: (\n state,\n {\n payload: {\n appContext,\n appDevice,\n appInstanceId,\n appLanguage,\n appVersion,\n browserName,\n osVersion,\n isIOS,\n isAndroid,\n isMobileDevice,\n isMobileSafari\n }\n }: PayloadAction<\n NativeAppInfo & {\n browserName: string;\n isMobileDevice: boolean;\n isMobileSafari: boolean;\n isIOS: boolean;\n isAndroid: boolean;\n }\n >\n ) => {\n const isHybridAppContext = Boolean(appContext);\n const isNativeAppContext = appContext === 'Native';\n const nativeAppSupport = getNativeAppSupport({\n isNativeAppContext,\n isHybridAppContext,\n hybridAppDevice: appDevice,\n hybridAppVersion: appVersion,\n appOsVersion: osVersion,\n isIOS,\n isAndroid\n });\n\n state.isHybridAppContextForAndroid =\n nativeAppSupport.isHybridAppContextForAndroid;\n state.isHybridAppContextForIos =\n nativeAppSupport.isHybridAppContextForIos;\n state.isNativeAppWithApplyPaySupport =\n nativeAppSupport.isNativeAppWithApplyPaySupport;\n state.isNativeAppWithSwishCallbackSupport =\n nativeAppSupport.isNativeAppWithSwishCallbackSupport;\n state.isNativeAppWithKlarnaSupport =\n nativeAppSupport.isNativeAppWithKlarnaSupport;\n state.isNativeAppWithTrustlySupport =\n nativeAppSupport.isNativeAppWithTrustlySupport;\n state.isNativeAppWithInternationalVerificationSupport =\n nativeAppSupport.isNativeAppWithInternationalVerificationSupport;\n state.isHybridAppContext = isHybridAppContext;\n state.appInstanceId = appInstanceId || null;\n state.isIOS = isIOS;\n state.isMobileDevice = isMobileDevice;\n state.isMobileSafari = isMobileSafari;\n state.isNativeAppContext = isNativeAppContext;\n state.appLanguage = appLanguage || null;\n state.appVersion = appVersion || null;\n state.browserName = browserName;\n }\n }\n});\n\nexport const {\n setEnvironment,\n setEnvironmentHash,\n setIsSpaNavigationEnabled,\n setGATrackingData,\n setNativeAppInfo,\n setFeatureSwitches,\n setSplitTestGroups,\n setVariables,\n setVersion\n} = slice.actions;\nexport const reducer = slice.reducer;\n","import { isSupportedMinimumVersion } from 'tradera/utils/versions';\n\nexport const getNativeAppSupport = ({\n isNativeAppContext,\n isHybridAppContext,\n hybridAppDevice,\n hybridAppVersion,\n appOsVersion,\n isIOS,\n isAndroid\n}) => {\n const isHybridAppContextForAndroid = Boolean(\n isHybridAppContext &&\n (hybridAppDevice?.toLowerCase().includes('android') || isAndroid)\n );\n const isHybridAppContextForIos = Boolean(\n isHybridAppContext &&\n (hybridAppDevice?.toLowerCase().includes('iphone') ||\n hybridAppDevice?.toLowerCase().includes('ipad') ||\n isIOS)\n );\n const isIos13 =\n isNativeAppContext &&\n isHybridAppContextForIos &&\n isSupportedMinimumVersion(appOsVersion, '13');\n return {\n isHybridAppContextForAndroid,\n isHybridAppContextForIos,\n isNativeAppWithApplyPaySupport:\n isIos13 && isSupportedMinimumVersion(hybridAppVersion, '3.51'),\n isNativeAppWithSwishCallbackSupport:\n isIos13 && isSupportedMinimumVersion(hybridAppVersion, '3.57'),\n isNativeAppWithKlarnaSupport:\n isNativeAppContext &&\n ((isIOS && isSupportedMinimumVersion(hybridAppVersion, '3.68')) ||\n (isAndroid &&\n isSupportedMinimumVersion(hybridAppVersion, '3.58'))),\n isNativeAppWithTrustlySupport:\n isNativeAppContext &&\n ((isIOS && isSupportedMinimumVersion(hybridAppVersion, '3.123')) ||\n (isAndroid &&\n isSupportedMinimumVersion(hybridAppVersion, '3.87'))),\n isNativeAppWithInternationalVerificationSupport:\n isNativeAppContext &&\n ((isIOS && isSupportedMinimumVersion(hybridAppVersion, '3.156')) ||\n (isAndroid &&\n isSupportedMinimumVersion(hybridAppVersion, '3.999'))) // TODO: Update version when implemented\n };\n};\n","import { useSelector, useDispatch } from 'react-redux';\nimport type { TypedUseSelectorHook } from 'react-redux';\nimport type { RootState, AppDispatch } from './configure-store';\n\n// Use throughout our app instead of plain `useSelector` since this gets us typed state\nexport const useAppSelector: TypedUseSelectorHook = useSelector;\n// Use throughout our app instead of plain `useDispatch` since it includes the thunk middleware types etc\nexport const useAppDispatch: () => AppDispatch = useDispatch;\n","export function isNullOrUndefined(value: unknown): value is null | undefined {\n // For undeclared variables, typeof foo will return the string literal\n // \"undefined\", whereas the identity check foo === undefined would\n // trigger the error \"foo is not defined\".\n return value === null || typeof value === 'undefined';\n}\n\nexport function isNotNullOrUndefined(\n value: TValue | null | undefined\n): value is TValue {\n return value !== null && typeof value !== 'undefined';\n}\n\nexport function isUndefinedOrEmpty(value: string | undefined) {\n return value === undefined || (value as string).trim() === '';\n}\n","/***\n *\n * Keep track of users' GDPR settings.\n *\n */\nimport dayjs from 'dayjs';\nimport cookie from 'cookie';\n\nimport {\n GDPR_CONSENT_COOKIE,\n COOKIE_CATEGORIES\n} from 'tradera/constants/cookies';\nimport { getCookieFromBrowser, setCookieToBrowser } from './cookie-helpers';\n\nconst createCookie = (name, value, expires) => {\n const options = {\n expires,\n httpOnly: false,\n path: '/'\n };\n return cookie.serialize(name, String(value), options);\n};\n\nexport class GdprSettings {\n constructor(getCookie, setCookie) {\n if (!getCookie || !setCookie) {\n throw new Error('You must provide getCookie and setCookie');\n }\n this.getCookie = getCookie;\n this.setCookie = setCookie;\n }\n /**\n *\n * @param {int} cookieCategory use the constant COOKIE_CATEGORIES to get different values.\n */\n isCategoryEnabled(cookieCategory) {\n if (cookieCategory === COOKIE_CATEGORIES.Essential) {\n return true;\n }\n\n const encodedConsentCookie = this.getCookie(GDPR_CONSENT_COOKIE);\n const consentCookie = decodeURI(encodedConsentCookie);\n\n if (!consentCookie || consentCookie.length === 0) {\n return true;\n }\n\n const categoryPattern = new RegExp(`,${cookieCategory}:1`);\n return categoryPattern.test(consentCookie);\n }\n\n isPerformanceEnabled() {\n return this.isCategoryEnabled(COOKIE_CATEGORIES.Performance);\n }\n\n isFunctionalEnabled() {\n return this.isCategoryEnabled(COOKIE_CATEGORIES.Functional);\n }\n\n isMarketingEnabled() {\n return this.isCategoryEnabled(COOKIE_CATEGORIES.Marketing);\n }\n\n set(performance, functional, marketing) {\n const cookieValue = [\n `${COOKIE_CATEGORIES.Essential}:1`,\n `${COOKIE_CATEGORIES.Performance}:${performance ? '1' : '0'}`,\n `${COOKIE_CATEGORIES.Functional}:${functional ? '1' : '0'}`,\n `${COOKIE_CATEGORIES.Marketing}:${marketing ? '1' : '0'}`\n ];\n const cookieString = createCookie(\n GDPR_CONSENT_COOKIE,\n cookieValue.join(','),\n dayjs().add(1, 'years').toDate()\n );\n this.setCookie(cookieString);\n }\n}\n\nexport default new GdprSettings(getCookieFromBrowser, setCookieToBrowser);\n","export const buildInitialGtmDataLayerFromInitData = (initData) => {\n // ***** ATTENTION !!! *****\n // If you change anything here you must\n // also change in buildInitialGtmDataLayerFromState\n // so that they match. Otherwise values\n // between Touchweb and NextWeb don't match.\n const initialDataLayer = {\n memberId: initData.memberId || 0,\n userLanguage: initData.languageCodeIso2,\n memberEmail: initData.isLoggedIn ? initData.memberEmail : '',\n memberHashedEmail: initData.isLoggedIn\n ? initData.memberEmailSha256\n : '',\n 'criteo.hashedEmail': initData.isLoggedIn\n ? initData.memberEmailMd5\n : '',\n memberFirstName: initData.isLoggedIn ? initData.memberFirstName : '',\n memberLastName: initData.isLoggedIn ? initData.memberLastName : '',\n memberCountry: initData.isLoggedIn ? initData.memberCountry : '',\n loginState: initData.isLoggedIn ? 'logged in' : 'not logged in',\n isNotInIframe: window.self === window.top,\n 'blueshift.event-api-key': initData.blueshiftEventApiKey,\n 'blueshift.event-signature': initData.blueshiftEventSignature || '',\n 'blueshift.event-verification-key': initData.memberId || 0,\n isSinglePageApp: initData.isSinglePageApp,\n isNativeAppContext: initData.isNativeAppContext,\n isQuantcastConsentEnabled:\n initData.featureSwitches['quantcast-consent'],\n isTikTokPixelEnabled: initData.featureSwitches['tiktok-pixel'],\n isDigitalAudienceTrackingEnabled:\n initData.featureSwitches['digital-audience-tracking'],\n quantcastSite: initData.featureSwitches['use-beta-consent-property']\n ? 'beta.tradera.com'\n : 'www.tradera.com'\n };\n // add split tests to datalayer\n if (initData.splitTestGroups) {\n for (const [key, value] of Object.entries(initData.splitTestGroups)) {\n initialDataLayer[`splittest_${key}`] = value;\n }\n }\n return initialDataLayer;\n};\n\nexport const buildInitialGtmDataLayerFromState = (state) => {\n const { environment, language, member } = state;\n const { featureSwitches } = environment;\n const isQuantcastConsentEnabled = featureSwitches['quantcast-consent'];\n const isTikTokPixelEnabled = featureSwitches['tiktok-pixel'];\n const isDigitalAudienceTrackingEnabled =\n featureSwitches['digital-audience-tracking'];\n const quantcastSite = featureSwitches['use-beta-consent-property']\n ? 'beta.tradera.com'\n : 'www.tradera.com';\n const splitTestGroups = Object.entries(environment.splitTestGroups).reduce(\n (groups, [key, value]) => {\n return {\n ...groups,\n [`splittest_${key}`]: value\n };\n },\n {}\n );\n // ***** ATTENTION !!! *****\n // If you change anything here you must\n // also change in buildInitialGtmDataLayerFromInitData\n // so that they match. Otherwise values\n // between Touchweb and NextWeb don't match.\n return {\n memberId: member.memberId || 0,\n userLanguage: language.preferred.languageCodeIso2,\n memberEmail: member.memberEmail || '',\n memberHashedEmail: member.memberEmailSha256 || '',\n 'criteo.hashedEmail': member.memberEmailMd5 || '',\n memberFirstName: member.memberFirstName || '',\n memberLastName: member.memberLastName || '',\n memberCountry: member.memberCountry || '',\n loginState: member.isLoggedIn ? 'logged in' : 'not logged in',\n isNotInIframe: window.self === window.top,\n 'blueshift.event-api-key':\n environment.variables.PUBLIC_BLUESHIFT_EVENT_API_KEY,\n 'blueshift.event-signature': member.blueshiftEventSignature || '',\n 'blueshift.event-verification-key': member.memberId || 0,\n isSinglePageApp: true,\n isNativeAppContext: environment.isNativeAppContext,\n isQuantcastConsentEnabled,\n isDigitalAudienceTrackingEnabled,\n isTikTokPixelEnabled,\n quantcastSite,\n ...splitTestGroups\n };\n};\n","import type { Request } from 'tradera/backend/http/types/http';\n\nexport const isServer = typeof window === 'undefined';\nexport const isServerFunc = () => typeof window === 'undefined';\n\nexport const isTest = process.env.NODE_ENV === 'test';\n\nexport const isClientApiRequest = (req: Request) =>\n Boolean(req?.url?.startsWith('/_next/data'));\n\nexport const isTouchwebInNextweb =\n typeof document !== 'undefined' &&\n document.getElementById('__next') !== null &&\n document.getElementById('init-data') !== null;\n\nexport const isNextJs = isServer || document.getElementById('__next') !== null;\n","import omitBy from 'lodash/omitBy';\nimport mapObject from 'lodash/mapValues';\n\nexport const nullifyUndefinedProperties = >(\n obj: T\n): { [K in keyof T]: T[K] extends undefined ? null : T[K] } =>\n mapObject(obj, (value) =>\n typeof value === 'undefined' ? null : value\n ) as unknown as { [K in keyof T]: T[K] extends undefined ? null : T[K] };\n\ntype NonNullableProperties = {\n [K in keyof T]: Exclude;\n};\n\nexport function removePropertiesWithoutValue>(\n obj: T,\n removeEmptyString?: boolean\n): NonNullableProperties {\n return omitBy(\n obj,\n (value) =>\n value === null ||\n value === undefined ||\n (removeEmptyString && value === '')\n ) as NonNullableProperties;\n}\n","/**\n * This is a workaround to remove the following predefined GTM tag iframes on SPA navigation:\n * - Google Ads Remarketing\n * - Google Ads Conversion Tracking\n * - Floodlight Counter\n * - Floodlight Sales\n * - Criteo\n * Iframe are removed to prevent these iframes from duplicating the browser\n * back/forward-history entries, which seems to be a bug on Google's side:\n * https://support.google.com/tagmanager/thread/237899073/?hl=en\n *\n * This issue is likely originating from the introduction of the\n * Privacy Sandbox https://privacysandbox.com/\n */\n\nconst SANDBOX_IFRAME_SRC = [\n 'https://td.doubleclick.net/',\n 'https://fledge.eu.criteo.com/'\n];\n\nconst isSandboxOrigin = (node: HTMLIFrameElement) =>\n typeof node.src === 'string' &&\n SANDBOX_IFRAME_SRC.some((sandboxOrigins) =>\n node.src.startsWith(sandboxOrigins)\n );\n\nconst isPrivacySandbox = (node: HTMLIFrameElement) =>\n typeof node.allow === 'string' &&\n node.allow.includes('join-ad-interest-group');\n\nconst isGoogleAdsIframe = (node: Node): boolean =>\n node instanceof HTMLIFrameElement &&\n isSandboxOrigin(node) &&\n isPrivacySandbox(node);\n\nexport const removePrivacySandboxIframes = () =>\n Array.from(\n document.body.querySelectorAll(\n 'iframe[allow=\"join-ad-interest-group\"]'\n )\n )\n .filter(isGoogleAdsIframe)\n .forEach((iframe) => iframe.remove());\n","export const safeDecodeURIComponent = (uriComponent: string) => {\n if (!uriComponent) {\n return '';\n }\n try {\n return decodeURIComponent(uriComponent);\n } catch {\n return '';\n }\n};\n","export const DEFAULT_PAGE_TITLE_TRANSLATION_KEY = 'pageTitle_startPage';\n\nexport const NS_TOUCHWEB = 'touchWeb';\nexport const NS_ATTRIBUTES = 'attributes';\nexport const NS_CATEGORIES = 'categories';\nexport const NS_BACKEND = 'backend';\n\nexport const DEFAULT_LANGUAGE = 'sv';\nexport const URL_LANGUAGES = ['en', 'de', 'da', 'fr', 'nl'];\n\nexport const SUPPORT_SITE_DEFAULT_LANGUAGE = 'se';\nexport const SUPPORT_SITE_LANGUAGE_CODE_MAP = {\n sv: 'se',\n en: 'gb',\n da: 'dk',\n de: 'de',\n fr: 'fr',\n nl: 'nl'\n};\n\nexport const DEFAULT_LOCALE = 'sv-SE';\nexport const LANGUAGE_LOCALE = {\n sv: 'sv-SE',\n en: 'en-US',\n da: 'da-DK',\n de: 'de-DE',\n fr: 'fr-FR',\n nl: 'nl-NL'\n};\n\nexport const I18N_FRONTEND_NAMESPACES = [NS_TOUCHWEB, NS_ATTRIBUTES];\nexport const I18N_BACKEND_NAMESPACES = [NS_CATEGORIES, NS_BACKEND];\nexport const I18N_NAMESPACES = [\n ...I18N_FRONTEND_NAMESPACES,\n ...I18N_BACKEND_NAMESPACES\n];\nexport const NAMESPACE_PROJECTID = {\n [NS_TOUCHWEB]: '414441505e1db31fcaa776.55234720',\n [NS_ATTRIBUTES]: '9959867960be20fdc7d187.66761514',\n [NS_CATEGORIES]: '894792985d6665b8f079e1.31726015',\n [NS_BACKEND]: '916557165cc061c54ae7c8.44409330'\n};\n\nexport const SUPPORTED_LANGUAGES = [DEFAULT_LANGUAGE, ...URL_LANGUAGES];\nexport const SUPPORTED_CURRENCIES = [\n 'DKK',\n 'GBP',\n 'JPY',\n 'NOK',\n 'SEK',\n 'USD',\n 'EUR'\n];\n\nexport const TRANS_SUFFIX = 'Trans';\n\nexport const I18N_CACHE_MS = 2 * 60 * 1000;\n"],"names":["LIST_VIEW_TYPES","BASIC","NORMAL","PAGE_LIST_TYPES","BUYER_ACTIVE_ITEMS","BUYER_PURCHASES","BUYER_ITEMS_LOST","SELLER_ACTIVE","SELLER_SOLD","SELLER_NOT_SOLD","PAGE_BULK_ACTIONS","ACTIVE_CANCEL","UNSOLD_RESTART","BUYER_MARK_PAID","BUYER_SHOW_ACTIVE","BUYER_HIDE_ACTIVE","PURCHASES_SHOW","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","i","Symbol","toPrimitive","call","TypeError","String","Number","_toPrimitive","configurable","writable","_slicedToArray","arr","Array","isArray","_arrayWithHoles","l","iterator","n","u","a","f","next","done","return","_iterableToArrayLimit","minLen","_arrayLikeToArray","prototype","toString","slice","constructor","name","from","test","_unsupportedIterableToArray","_nonIterableRest","len","arr2","_objectWithoutProperties","source","excluded","target","hasOwnProperty","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","formatStringOrUrl","urlObjOrString","formatUrl","Link","React","props","forwardedRef","hrefProp","href","asProp","as","childrenProp","children","passHref","replace","shallow","scroll","locale","onClick","onMouseEnterProp","onMouseEnter","onTouchStartProp","onTouchStart","restProps","pagesRouter","RouterContext","appRouter","AppRouterContext","router","isAppRouter","_React$useMemo","resolvedHref","_resolveHref2","resolveHref","resolvedAs","previousHref","previousAs","child","childRef","_useIntersection2","useIntersection","rootMargin","setIntersectionRef","resetVisible","childProps","ref","el","current","defaultPrevented","currentTarget","nodeName","toUpperCase","event","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","isModifiedEvent","isLocalURL","preventDefault","navigate","routerScroll","linkClicked","isAbsoluteUrl","type","curLocale","localeDomain","isLocaleDomain","getDomainLocale","locales","domainLocales","addBasePath","addLocale","defaultLocale","_jsx","getFirstHeaderValueOrEmpty","req","headerName","header","headers","shift","dangerouslyParseJwtWithoutVerifyingSignature","token","base64Payload","split","payload","Buffer","JSON","parse","error","getAccessTokenCookieName","isProductionHost","host","some","regex","isLocalHost","isDevHost","getMemberIdFromAuthCookie","_dangerouslyParseJwtW","_req$cookies","cookies","mbr","getExpiryFromAuthCookie","_dangerouslyParseJwtW2","_req$cookies2","exp","NEXTWEB_SPA_REGEX_PATHS","NEXTWEB_SPA_REGEX_TOGGLES","PATH_PREFIX","URL_LANGUAGES","join","createPathRegex","pathRegex","RegExp","isLinkToNextWeb","absoluteUrl","location","toggles","pathname","searchParams","get","toggledOnRegexPaths","entries","_ref","toggleName","map","_ref3","getToggledOnPathRegex","concat","TW_IN_NW_HYBRID_SPA_REGEX_PATHS","TW_IN_NW_HYBRID_SPA_REGEX_TOGGLES","isLinkToTouchwebInNextWeb","NavigationType","getNavigationType","fromUrl","toUrl","_ref$target","isTouchwebSpaLink","isNativeApp","WindowLocation","WindowTopLocation","fromNextWebTouchwebHybrid","isTouchwebInNextweb","toNextWebTouchwebHybrid","fromNextWeb","isNextJs","toNextWeb","toTouchwebBySpaNavigation","search","NextSpaNavigation","TouchwebSpaNavigation","useIsFeatureEnabled","featureName","useSelector","selectIsFeatureEnabled","useLocation","_request$location","fallback","undefined","request","useAppSelector","state","isServer","window","useMemo","URL","hasPathname","hasSearch","toUrlString","useNavigation","isNextDataFetchingDisabled","nextRouter","useRouter","touchwebHistory","useHistory","selectIsNativeApp","selectFeatureSwitches","currentLocation","pushConfig","removePrivacySandboxIframes","url","urlObject","origin","breakIframe","self","top","navigationType","Error","back","goBack","history","refresh","hasPagesInHistory","ROUTING_TYPE","useQuery","parameter","defaultValue","_searchParams$get","navigation","URLSearchParams","updateSearchParam","useCallback","routing","PUSH","locationParameter","set","delete","toStringOrNull","isNullOrUndefined","missingKeyLoggingConfig","saveMissing","saveMissingTo","missingKeyHandler","language","namespace","_fallbackValue","_updateMissing","options","hasLoadedAllTranslations","isAttributeStuffing","errorMessage","Sentry","missingInterpolationHandler","text","stringify","i18nInitialized","bootLanguages","translations","touchwebTranslations","attributeTranslations","translationResources","_ref2","attributeResources","_ref4","resources","reduce","prev","_ref5","s","i18n","use","initReactI18next","LanguageDetector","init","initOptions","err","logger","detection","order","htmlTag","document","html","defaultNS","NS_TOUCHWEB","ns","NS_ATTRIBUTES","fallbackLng","DEFAULT_LANGUAGE","debug","keySeparator","nsSeparator","interpolation","skipOnVariables","escapeValue","format","formatNumberWithSeparators","react","useSuspense","initialState","TranslationContext","createContext","useAddTranslation","translationsRef","useContext","pluralizedKey","translation","scope","AxiosError","isClientNetworkError","sentryException","spaPageViewTrackingEnabled","GtmService","_hasPreviouslyTrackedPage","_window$dataLayer","dataLayer","find","item","this","isScriptLoaded","_setWebViewHelperFunctionsToWindow","loadGtmScript","_process","_newPageFromServer","accountId","w","d","_f$parentNode","Date","getTime","getElementsByTagName","j","createElement","async","src","parentNode","insertBefore","googleTagManagerSnippet","process","env","NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ACCOUNT_ID","pushArguments","_getDatalayerObject","output","entry","_reset","data","newPage","pageType","initialDataLayer","_pushInitialDataLayer","newSpaPage","buildInitialGtmDataLayerFromInitData","initData","legacyDataLayer","trackAction","category","action","label","nonInteractive","queueBackgroundTask","trackActionSynchronously","eventCategory","eventAction","eventLabel","eventValue","eventNonInteractive","level","message","trackGtmEvent","eventName","trackPageView","trackLinkClickAndCallback","callback","eventCallback","trackLinkClickAndGotoUrl","logGaWebViewEvent","params","AnalyticsWebInterface","logEvent","webkit","messageHandlers","firebase","command","parameters","postMessage","setGaWebViewUserProperty","setUserProperty","trackGA4","eventParams","userData","timestamp","now","FlowId","createQueue","items","isAlive","ttlInMinutes","timeStamp","inProgress","add","_itemData","itemData","notifyDone","isInProgress","getLength","NATIVE_APP_COOKIE_AND_HEADER_CONFIG","osVersion","initDataName","appDevice","appVersion","appContext","appLanguage","appInstanceId","createNativeAppCookieValue","nativeAppInfo","valueObject","fromEntries","extractNativeAppInfoFromCookie","nativeAppCookieString","safeDecodeURIComponent","getVersionUrl","getState","queryParameters","memberId","selectMemberId","preferredLanguageCode","selectPreferredLanguageCode","toLocalizedUrl","updateEnvironmentHash","dispatch","environmentHash","axios","environment","setEnvironmentHash","setIsSpaNavigationEnabled","getAndUpdateNativeAppInfo","nativeAppInfoFromInitData","_ref7","_ref8","config","extractNativeAppInfoFromInitData","values","Boolean","nativeAppCookieValue","cookie","createCookie","NATIVE_APP_ENVIRONMENT","cookieValue","readCookie","initEnvironment","featureSwitches","googleAnalyticsTrackingId","googleAnalyticsMeasurementId","geoPublicApiBaseUrl","isSinglePageApp","splitTestGroups","version","webLiveUrl","isSpaNavigationEnabled","frameElement","setEnvironment","setFeatureSwitches","setSplitTestGroups","setVersion","setVariables","PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID","PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID","PUBLIC_GEO_PUBLIC_API_BASE_URL","PUBLIC_WEB_LIVE_URL","setNativeAppInfo","browserName","isMobileDevice","isMobile","isMobileSafari","isIOS","isAndroid","variables","gtm","sessionId","setGATrackingData","parseAppVersion","_String$split$map$fil2","number","isNaN","_String$split$map$fil3","major","_String$split$map$fil4","minor","_String$split$map$fil5","patch","isSupportedMinimumVersion","appVersionString","minimumVersionString","minimumVersion","createSlice","gaTrackingSessionId","isHybridAppContextForAndroid","isHybridAppContextForIos","isNativeAppWithApplyPaySupport","isNativeAppWithSwishCallbackSupport","isNativeAppWithKlarnaSupport","isNativeAppWithTrustlySupport","isNativeAppWithInternationalVerificationSupport","isHybridAppContext","reducers","_ref6","_ref9","_ref9$payload","isNativeAppContext","nativeAppSupport","hybridAppDevice","hybridAppVersion","appOsVersion","toLowerCase","includes","isIos13","getNativeAppSupport","_slice$actions","actions","reducer","useAppDispatch","useDispatch","GdprSettings","getCookie","setCookie","isCategoryEnabled","cookieCategory","COOKIE_CATEGORIES","Essential","encodedConsentCookie","GDPR_CONSENT_COOKIE","consentCookie","decodeURI","isPerformanceEnabled","Performance","isFunctionalEnabled","Functional","isMarketingEnabled","Marketing","performance","functional","marketing","cookieString","expires","httpOnly","path","dayjs","toDate","getCookieFromBrowser","setCookieToBrowser","userLanguage","languageCodeIso2","memberEmail","isLoggedIn","memberHashedEmail","memberEmailSha256","memberEmailMd5","memberFirstName","memberLastName","memberCountry","loginState","isNotInIframe","blueshiftEventApiKey","blueshiftEventSignature","isQuantcastConsentEnabled","isTikTokPixelEnabled","isDigitalAudienceTrackingEnabled","quantcastSite","getElementById","nullifyUndefinedProperties","mapObject","removePropertiesWithoutValue","removeEmptyString","omitBy","SANDBOX_IFRAME_SRC","isGoogleAdsIframe","node","HTMLIFrameElement","sandboxOrigins","startsWith","isSandboxOrigin","allow","isPrivacySandbox","body","querySelectorAll","iframe","remove","uriComponent","decodeURIComponent","NS_CATEGORIES","NS_BACKEND","SUPPORT_SITE_DEFAULT_LANGUAGE","SUPPORT_SITE_LANGUAGE_CODE_MAP","sv","en","da","de","fr","nl","I18N_FRONTEND_NAMESPACES","I18N_BACKEND_NAMESPACES","SUPPORTED_LANGUAGES","TRANS_SUFFIX"],"sourceRoot":""}