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,AAAA,CAAA,EAAA,A,E,SAAA,EAAC,AAAD,EAAG,gDACN,AAAA,CAAA,EAAA,A,E,SAAA,2BAA0B,AAA1B,EAA4B,CAC3B,OAAQ,iCACR,WAAY,CACX,UAAW,CACZ,CACD,GAED,AAAA,EAAA,GAAQ,GAAG,CAAC,EAAK,EAAO,CAAE,GAAG,CAAU,CAAE,iBAAkB,CAAA,CAAK,EACjE,CAAE,MAAO,EAAQ,CAChB,AAAA,CAAA,EAAA,A,E,SAAA,MAAK,AAAL,EAAO,yBAAyB,CAAC,CAChC,OAAQ,sCACR,WAAY,CAAE,UAAW,CAAI,EAC7B,QAAS,CAAC,6CAA6C,EAAE,EAAE,OAAO,EAAI,GAAG,CAAC,AAC3E,EACD,CACD,C,G,E,Q,S,C,C,C,E,E,E,O,C,sB,I,GC9BO,IAAM,EAAsB,MAClC,IAGA,IAAM,EAAc,MAAM,AAAA,CAAA,EAAA,A,E,SAAA,uBAAsB,AAAtB,IACtB,CAAA,aAAE,CAAY,CAAA,iBAAE,CAAgB,CAAA,uBAAE,CAAsB,CAAE,CAAG,EAE7D,CAAA,QAAE,CAAO,CAAE,CAAG,AAAA,CAAA,EAAA,A,E,SAAA,yBAAwB,AAAxB,EAA0B,GAe5C,OAbI,GAAW,IAIb,EAHG,GAQY,CAAC,EAAE,EAAa,KAAK,CAAC,EAAG,GAAG,IAAI,CAAC,EAI3C,EAAU,CAAE,aAAA,EAAc,iBAAA,CAAiB,EAAI,KAAA,CACvD,C,G,E,Q,S,C,C,C,M,EC5BY,E,E,E,O,C,S,I,G,CAAA,EAAA,GAAA,CAAA,EAAA,CAAA,CAAA,G,O,C,U,E,O,C,U,E,M,C,Q","sources":["","src/packages/platform/ui/layouts/jira-shared-layout/src/ui/browser-storage-controls-init/index.tsx","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/initialize-controls/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/common/utils/feature-flagging/poll-for-feature-flag/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/initialize-controls/set-cookie-override/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/set-cookie/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/storage-preferences/get-preferences/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/get-consent-token/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/override-with-testing-cookies/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/set-required-consent-cookies/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/set-strictly-necessary-cookie/index.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/get-consent-token/utils.ts","../platform/packages/policy-platform/browser-storage-controls/src/controllers/cookie-controls/set-cookie/types.ts"],"sourcesContent":["\nfunction parcelexport(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\nfunction parcelinteropDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var parcelglobal = globalThis;\n var parcelRequire = parcelglobal["parcelRequire94c2"];\nvar parcelRegister = parcelRequire.register;\nparcelRegister("1r7p7", function(module, exports) {\n\nparcelexport(module.exports, "BrowserStorageControlsInit", () => 5372da7267fcd229export1e5524c82dfa4c29);\n\nvareUqFw = parcelRequire("eUqFw");\n\nvar gmFE1=parcelRequire(g¨5372da7267fcd229export1e5524c82dfa4c29 = ()=>{\n (0, eUqFw.useEffect)(()=>{\n (0, gmFE1.initializeControls)({\n product: 'Jira'\n });\n }, []);\n return null;\n};\n\n});\nparcelRegister("gmFE1", function(module, exports) {\n\nparcelexport(module.exports, "initializeControls", () => 07e94fddd0214724export919040c32a62c7db);\n\nvar1J3ZG = parcelRequire("1J3ZG");\nvar 3J72S=parcelRequire(3¨J72SiBOme = parcelRequire("iBOme");\n\nvar 4uLct=parcelRequire(4¨uLct6lAvk = parcelRequire("6lAvk");\n\nvar 5k1KZ=parcelRequire(5¨k1KZ07e94fddd0214724export45a5573b04db016c = async (args = {})=>{\n // exit silently if in SSR context\n if ((0, 3J72S.isSSR)())return;iBOme.pollForBrowserControlsFlag)();\n if (!isFlagEnabled) return;\n (0, 4uLct.initializeGlobalState)(args);\n const documentCookieProperty = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie');\n const originalSetter = documentCookieProperty?.set;\n const originalGetter = documentCookieProperty?.get;\n if (!originalSetter || !originalGetter) {\n (0, 6lAvk.Logger).warn('No document.cookie capabilities found');\n return;\n }\n // Ensures that the AWC is constructed before overwriting document.cookie. Not\n // doing so was allowing for cases of infinite recursion.\n const analyticsWebClientInstance = (0, 1J3ZG.getAnalyticsClient)();\n // If AWC is not initialized, it will be undefined\n const isAnalyticsInitialized = !!analyticsWebClientInstance;\n if (!isAnalyticsInitialized) throw new Error('Failed to initialize AnalyticsWebClient. Analytics logging will not be set for document.cookie.');\n // Override document.cookie setter\n Object.defineProperty(document, 'cookie', {\n get: originalGetter,\n set: (0, 5k1KZ.getSetCookieOverride)(originalSetter),\n configurable: true\n });\n};\nconst 07e94fddd0214724export919040c32a62c7db = async (args = {})=>{\n try {\n await 07e94fddd0214724export45a5573b04db016c(args);\n } catch (e) {\n (0, 6lAvk.Logger).errorWithOperationalEvent({\n action: 'initializeControlsError',\n message: `Failed to initialize browser storage controls. {e.message || ''}\n });\n }\n};\n\n});\nparcelRegister(\"iBOme\", function(module, exports) {\n\n$parcel$export(module.exports, \"pollForBrowserControlsFlag\", () => $ea6e32d3bbc94c51$export$cc1c284801c32a43);\n/* eslint-disable @atlaskit/platform/no-invalid-feature-flag-usage */ \nvar $XHGTv = parcelRequire(\"XHGTv\");\nconst $ea6e32d3bbc94c51$var$TIME_IN_MS = 1000;\nconst $ea6e32d3bbc94c51$var$MAX_WAIT_TIME = 300 * $ea6e32d3bbc94c51$var$TIME_IN_MS;\nconst $ea6e32d3bbc94c51$var$INITIAL_WAIT_TIME = 2 * $ea6e32d3bbc94c51$var$TIME_IN_MS;\nconst $ea6e32d3bbc94c51$export$cc1c284801c32a43 = async (waitTime = $ea6e32d3bbc94c51$var$INITIAL_WAIT_TIME, totalElapsedTime = 0)=>{\n return $ea6e32d3bbc94c51$var$pollForFeatureFlag('platform.moonjelly.browser-storage-controls', waitTime, totalElapsedTime);\n};\nconst $ea6e32d3bbc94c51$var$pollForFeatureFlag = (featureFlag, waitTime = $ea6e32d3bbc94c51$var$INITIAL_WAIT_TIME, totalElapsedTime = 0)=>{\n /*\n We don't know exactly if/when the FF will be enabled, so we want to exponentially poll from 2s to a max of ~5min\n If it never comes back as 'true' then we assume that:\n a) it's correctly set to false and thus we don't override the document.cookie behavior\n b) the FF client failed to load in time, don't override the behavior by making false assumptions\n */ const shouldCancelPolling = totalElapsedTime > $ea6e32d3bbc94c51$var$MAX_WAIT_TIME;\n if (shouldCancelPolling) return Promise.resolve(false);\n // eslint-disable-next-line @atlaskit/platform/static-feature-flags\n if (!(0, $XHGTv.fg)(featureFlag)) {\n const newWaitTime = waitTime * 2;\n // Use the max if new wait time exceeds it\n const cappedWaitTime = Math.min(newWaitTime, $ea6e32d3bbc94c51$var$MAX_WAIT_TIME);\n return new Promise((resolve)=>{\n setTimeout(async ()=>{\n const updatedElapsedTime = totalElapsedTime + cappedWaitTime;\n const newFlagState = await $ea6e32d3bbc94c51$export$cc1c284801c32a43(cappedWaitTime, updatedElapsedTime);\n resolve(newFlagState);\n }, cappedWaitTime);\n });\n }\n return Promise.resolve(true);\n};\n\n});\n\nparcelRegister(\"5k1KZ\", function(module, exports) {\n\n$parcel$export(module.exports, \"getSetCookieOverride\", () => $6bd6d17694d0aa80$export$b7364c41ddbfdb0a);\n\nvar $XHGTv = parcelRequire(\"XHGTv\");\n\nvar $1J3ZG = parcelRequire(\"1J3ZG\");\n\nvar $6lAvk = parcelRequire(\"6lAvk\");\n\nvar $9knmB = parcelRequire(\"9knmB\");\nconst $6bd6d17694d0aa80$export$b7364c41ddbfdb0a = (originalSetter)=>{\n return (originalCookieValue)=>{\n const cookieSetByPackage = originalCookieValue.includes('atl-set-cookie');\n if (cookieSetByPackage) try {\n // Controls have already been run, passthrough as usual\n return originalSetter.apply(document, [\n originalCookieValue\n ]);\n } catch (e) {\n (0, $6lAvk.Logger).errorWithOperationalEvent({\n action: 'usedDocumentCookieError',\n message: document.cookie setter failed to set cookie set by package. {e.message || ''}`,\n attributes: {\n outsidePackage: false\n }\n });\n }\n try {\n // Raw cookies and query params can contain sensitive PII/UGC we can't store, so we want to\n // strip that out before we log it out to our analytics client.\n const sanitizedCookieKey = originalCookieValue.slice(0, originalCookieValue.indexOf('=')) || '';\n (0, 1J3ZG.sendPackageOperationalEvent)({\n action: 'usedDocumentCookie',\n attributes: {\n cookieKey: sanitizedCookieKey,\n outsidePackage: !cookieSetByPackage\n }\n });\n try {\n // Attempt to set a known cookie that was set from outside the package\n (0, 9knmB.canSetCookie)({\n cookieKey: sanitizedCookieKey,\n allowedCallback: ()=>{\n return originalSetter.apply(document, [\n originalCookieValue\n ]);\n },\n blockedCallback: ({ cookieHasCategory: cookieHasCategory })=>{\n if ((0, XHGTv.fg)('platform.moonjelly.block-unknown-cookies')) return;\n else {\n if (!cookieHasCategory) return originalSetter.apply(document, [\n originalCookieValue\n ]);\n else return;\n }\n }\n });\n } catch (e) {\n (0, 6lAvk.Logger).errorWithOperationalEvent({\n action: 'usedDocumentCookieError',\n message: `Failed to set cookie. {e.message || ''},\n attributes: {\n cookieKey: sanitizedCookieKey\n }\n });\n }\n } catch (e) {\n (0, $6lAvk.Logger).errorWithOperationalEvent({\n action: 'usedDocumentCookieError',\n message: Failed to send document.cookie setter event. {e.message || ''}`\n });\n }\n };\n};\n\n});\nparcelRegister(\"9knmB\", function(module, exports) {\n\nparcelexport(module.exports,c¨anSe7eb8ba014800496fexport92f79a86880ed80);\nparcelexport(module.exports, "setCookie", () => 7eb8ba014800496fexport110700823644f4a6);\n\nvarM2DFp = parcelRequire("M2DFp");\n\nvar XHGTv=parcelRequire(X¨HGT1J3ZG = parcelRequire("1J3ZG");\n\nvar 038zE=parcelRequire(0¨38zE6lAvk = parcelRequire("6lAvk");\n\nvar epRiJ=parcelRequire(e¨pRiJdFvno = parcelRequire("dFvno");\n\nvar 5lvHu=parcelRequire(5¨lvH7eb8ba014800496fvarfindStartsWithPatternMatch = (cookieName, { startsWith: startsWith })=>{\n // Setup initial pattern step and position\n let currentStep = startsWith;\n let position = 0;\n // Iterate through cookie name symbol by symbol\n while(position < cookieName.length){\n // The value of cookie character at the position\n const currentStepValue = currentStep[cookieName[position]];\n // If there is no match for cookie symbol in cache, this means there is no\n // pattern match for the cookie name\n if (currentStepValue === undefined) return null;\n // If current step value is a number, this means we reached the end of the pattern\n // and should return category number\n if (typeof currentStepValue === 'number') return currentStepValue;\n // Continue to going through pattern\n currentStep = currentStepValue;\n position++;\n }\n // No pattern match - all patterns longer or shorter than cookie name\n return null;\n};\nconst 7eb8ba014800496fvargetPreferenceCategory = async (cookieName)=>{\n const storageControlsData = await (0, 038zE.loadStorageControlsData)();\n if (!storageControlsData) return null;\n else return 7eb8ba014800496fexportb48b796182639b54(cookieName, storageControlsData);\n};\nconst 7eb8ba014800496fexportb48b796182639b54 = (cookieName, storageControlsData)=>{\n let cookieCategoryNumber = null;\n const { keys: keys, categories: categories, patterns: patterns } = storageControlsData;\n // Find direct match in keys\n if (cookieName in Object(keys)) cookieCategoryNumber = keys[cookieName];\n else // Find pattern match or null\n cookieCategoryNumber = 7eb8ba014800496fvarfindStartsWithPatternMatch(cookieName, patterns);\n const numToCategoryMap = {\n [categories.STRICTLY_NECESSARY]: (0, epRiJ.PreferenceCategory).StrictlyNecessary,\n [categories.FUNCTIONAL]: (0, epRiJ.PreferenceCategoryepRiJ.PreferenceCategory).Analytics,\n [categories.MARKETING]: (0, epRiJ.PreferenceCategory)epRiJ.PreferenceCategory).Unknown\n };\n return cookieCategoryNumber !== null ? numToCategoryMap[cookieCategoryNumber] : null;\n};\nconst 7eb8ba014800496fexport92f79a86880ed80 = async ({ cookieKey: cookieKey, allowedCallback: allowedCallback = ()=>{}, blockedCallback: blockedCallback = ()=>{} })=>{\n let shouldSetCookie;\n const cookieCategory = await 7eb8ba014800496fvargetPreferenceCategory(cookieKey);\n if (cookieCategory === (0, epRiJ.PreferenceCategory).StrictlyNecessary) shouldSetCookie = true;\n else {\n const preferences = await (0, dFvno.getPreferences)();\n let hasPreferencesForCategory = false;\n if (!!preferences) {\n if (!!cookieCategory) hasPreferencesForCategory = preferences[cookieCategory];\n }\n shouldSetCookie = hasPreferencesForCategory;\n }\n if (shouldSetCookie) allowedCallback?.();\n else blockedCallback?.({\n cookieHasCategory: cookieCategory != null\n });\n return shouldSetCookie;\n};\nconst 7eb8ba014800496fexport110700823644f4a6 = async (key, value, attributes)=>{\n // Flag disabled, allow all cookies.\n if (!(0, XHGTv.fg)('platform.moonjelly.browser-storage-controls')) {\n const eventAttributes = {\n wasRejected: false,\n cookieKey: key\n };\n try {\n (0, (/@PURE/parcelinteropDefault(M2DFp))).set(key,value,attributes)5lvHu.Status).SUCCESS;\n } catch (e) {\n (0, 6lAvk.Logger).errorWithOperationalEvent({\n action: 'usedSetCookieError',\n attributes: eventAttributes,\n message: `Failed to use set cookie. {e.message || ''}\n });\n return (0, $5lvHu.Status).FAILED;\n }\n }\n // Flag enabled, user belongs to an org that opted into cookies management and we should respect their preferences\n const shouldSetCookie = await $7eb8ba014800496f$export$92f79a86880ed80({\n cookieKey: key\n });\n const eventAttributes = {\n wasRejected: !shouldSetCookie,\n cookieKey: key\n };\n try {\n (0, $1J3ZG.sendPackageOperationalEvent)({\n action: 'usedSetCookie',\n attributes: eventAttributes\n });\n if (shouldSetCookie) {\n (0, (/*@__PURE__*/$parcel$interopDefault($M2DFp))).set(key, value, {\n ...attributes,\n 'atl-set-cookie': true\n });\n return (0, $5lvHu.Status).SUCCESS;\n } else return (0, $5lvHu.Status).BLOCKED;\n } catch (e) {\n (0, $6lAvk.Logger).errorWithOperationalEvent({\n action: 'usedSetCookieError',\n attributes: eventAttributes,\n message: Failed to use set cookie. {e.message || ''}`\n });\n return (0, 5lvHu.Status).BLOCKED;\n }\n};\n\n});\nparcelRegister("dFvno", function(module, exports) {\n\nparcelexport(module.exports, "getPreferences", () => fa3438f1c3ad82aeexport1de6a888ae076ff8);\n\nvarXHGTv = parcelRequire("XHGTv");\n\nvar f8OZU=parcelRequire(f¨85idY = parcelRequire("85idY");\n\nvar b4VDn=parcelRequire(b¨4VDhuW21 = parcelRequire("huW21");\nasync function fa3438f1c3ad82aeexport1de6a888ae076ff8() {\n // Use V001 pattern without the V2 FF enabled\n if (!(0, XHGTv.fg)('platform.moonjelly.browser-storage-controls-v2')) {\n const packedPrefs = (0, b4VDn.getCookie)((0,f8OZU.LEGACY_ATLASSIAN_GDPR_COOKIE_KEY));\n if (!packedPrefs) return undefined;\n return (0, huW21.unpackUserPreferencesCookie)(packedPrefs);\n }\n let packedLocalPrefs = (0, b4VDn.getCookie)((0, f8OZU.ATLASSIAN_CONSENT_COOKIE_KEY));\n if (!packedLocalPrefs) {\n const consentToken = await (0, 85idY.getConsentToken)();\n return consentToken ? (0, huW21.unpackUserPreferencesCookie)(consentToken) : undefined;\n }\n return (0, huW21.unpackUserPreferencesCookie)(packedLocalPrefs);\n}\n\n});\nparcelRegister("85idY", function(module, exports) {\n\nparcelexport(module.exports, "getConsentToken", () => 391d5185569e2bfcexportf1b8f2ca713fca08);\n\nvarf8OZU = parcelRequire("f8OZU");\n\nvar b4VDn=parcelRequire(b¨4VD53MVb = parcelRequire("53MVb");\n\nvar 4TcP6=parcelRequire(4¨TcPhWRvQ = parcelRequire("hWRvQ");\nconst 391d5185569e2bfcexportf1b8f2ca713fca08 = async ()=>{\n const fallbackConsentToken = (0, b4VDn.getCookie)((0, f8OZU.ATLASSIANhWRvQ.getValidConsentData)(fallbackConsentToken);\n if (consentData) {\n const { consentToken: consentToken, consentTimestamp: consentTimestamp } = consentData;\n /*** TESTING OVERRIDES / const potentiallyOverriddenConsentToken = (0, 53MVb.overrib4VDn.getCookie)((0, 4TcP6.setShouldShowBannerCookie)(potentiallyOverriddenConsentToken);\n (0, 4TcP6.setRequiredConsentCookies)(potentiallyOverriddenConsentToken, consentTimestamp);\n return consentToken;\n }\n return undefined;\n};\n\n});\nparcelRegister("53MVb", function(module, exports) {\n\nexport(module.exports, "overrideConsentTokenForLiveTesting", () => exportf8OZU = parcelRequire("f8OZU");\n\nvar e87a9db0df2659c7b5282052fc15e1ae = (genuineConsentToken)=>{\n // The existence of this cookie will make it look like fetched ConsentHub data is missing\n // You can set it to undefined yourself/empty string, or an actual default value.\n const tokenOverride = (0, f8OZU.TESTING_TOKEN_OVERRIDE_COOKIE_KEY));\n // Note: Clear this cookie out of your browser when you're done testing empty data sets\n // Or you'll be stuck seeing the banner and never actually consenting on the UI\n return tokenOverride || genuineConsentToken;\n};\n\n});\n\nparcelRegister("4TcP6", function(module, exports) {\n\nexport(module.exports, "setConsentTokenCookie", () => exportparcel5947d7e9e7fd3832133cd762b0f705a2);\nexport(module.exports, "setShouldShowBannerCookie", () => exportparcel5947d7e9e7fd3832b3365240280cb3c3);\n\nvar f8OZU = parcelRequire("f8OZU");\n\nvar lIW4M = parcelRequire("lIW4M");\nconst exportlIW4M.setStrictlyNecessaryCookie)((0, 5947d7e9e7fd3832133cd762b0f705a2 = (consentToken)=>{\n const inOneYear = new Date();\n inOneYear.setFullYear(inOneYear.getFullYear() + 1);\n (0, f8OZU.ATLASSIAN_CONSENT_FALLBACK_COOKIE_KEY), consentToken, {\n expires: inOneYear,\n path: '/'\n });\n};\nconst export40nlu.getBannerVisibility)({\n consentToken: consentToken,\n consentTimestamp: consentTimestamp\n });\n const shouldShowBanner = (0, lIW4M.setStrictlyNecessaryCookie)((0, 5947d7e9e7fd3832b3365240280cb3c3 = (consentToken, consentTimestamps)=>{\n export5947d7e9e7fd383299ecece88c58d938(consentToken, consentTimestamps);\n};\n\n});\nparcelRegister("lIW4M", function(module, exports) {\n\nexport(module.exports, "setStrictlyNecessaryCookie", () => exportM2DFp = parcelRequire("M2DFp");\n\nvar 1J3ZG = parcelRequire("1J3ZG");\n\nvar 6d2869955a85148793509ff9a62ee022 = (key, value, attributes)=>{\n try {\n if ((0, 1J3ZG.sendPackageOperationalEvent)({\n action: 'usedSetStrictlyNecessaryCookie',\n attributes: {\n cookieKey: key\n }\n });\n (0, (/@ eslint-disable @atlaskit/platform/no-invalid-feature-flag-usage \n We don't know exactly if/when the FF will be enabled, so we want to exponentially poll from 2s to a max of ~5min\n If it never comes back as 'true' then we assume that:\n a) it's correctly set to false and thus we don't override the document.cookie behavior\n b) the FF client failed to load in time, don't override the behavior by making false assumptions\n */\n\tconst shouldCancelPolling = totalElapsedTime > MAX_WAIT_TIME;\n\n\tif (shouldCancelPolling) {\n\t\treturn Promise.resolve(false);\n\t}\n\n\t// eslint-disable-next-line @atlaskit/platform/static-feature-flags\n\tif (!fg(featureFlag)) {\n\t\tconst newWaitTime = waitTime * 2;\n\n\t\t// Use the max if new wait time exceeds it\n\t\tconst cappedWaitTime = Math.min(newWaitTime, MAX_WAIT_TIME);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tsetTimeout(async () => {\n\t\t\t\tconst updatedElapsedTime = totalElapsedTime + cappedWaitTime;\n\n\t\t\t\tconst newFlagState = await pollForBrowserControlsFlag(cappedWaitTime, updatedElapsedTime);\n\n\t\t\t\tresolve(newFlagState);\n\t\t\t}, cappedWaitTime);\n\t\t});\n\t}\n\treturn Promise.resolve(true);\n};\n","import { fg } from '@atlaskit/platform-feature-flags';\n\nimport { sendPackageOperationalEvent } from '../../../../common/utils';\nimport { Logger } from '../../../../common/utils/logger';\nimport { canSetCookie } from '../../set-cookie';\n\nexport const getSetCookieOverride = (originalSetter: (v: any) => any) => {\n\treturn (originalCookieValue: string) => {\n\t\tconst cookieSetByPackage = originalCookieValue.includes('atl-set-cookie');\n\t\tif (cookieSetByPackage) {\n\t\t\ttry {\n\t\t\t\t// Controls have already been run, passthrough as usual\n\t\t\t\treturn originalSetter.apply(document, [originalCookieValue]);\n\t\t\t} catch (e: any) {\n\t\t\t\tLogger.errorWithOperationalEvent({\n\t\t\t\t\taction: 'usedDocumentCookieError',\n\t\t\t\t\tmessage: ,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\toutsidePackage: false,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Raw cookies and query params can contain sensitive PII/UGC we can't store, so we want to\n\t\t\t// strip that out before we log it out to our analytics client.\n\t\t\tconst sanitizedCookieKey =\n\t\t\t\toriginalCookieValue.slice(0, originalCookieValue.indexOf('=')) || '';\n\n\t\t\tsendPackageOperationalEvent({\n\t\t\t\taction: 'usedDocumentCookie',\n\t\t\t\tattributes: {\n\t\t\t\t\tcookieKey: sanitizedCookieKey,\n\t\t\t\t\toutsidePackage: !cookieSetByPackage,\n\t\t\t\t},\n\t\t\t});\n\t\t\ttry {\n\t\t\t\t// Attempt to set a known cookie that was set from outside the package\n\t\t\t\tcanSetCookie({\n\t\t\t\t\tcookieKey: sanitizedCookieKey,\n\t\t\t\t\tallowedCallback: () => {\n\t\t\t\t\t\treturn originalSetter.apply(document, [originalCookieValue]);\n\t\t\t\t\t},\n\t\t\t\t\tblockedCallback: ({ cookieHasCategory }) => {\n\t\t\t\t\t\tif (fg('platform.moonjelly.block-unknown-cookies')) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!cookieHasCategory) {\n\t\t\t\t\t\t\t\treturn originalSetter.apply(document, [originalCookieValue]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} catch (e: any) {\n\t\t\t\tLogger.errorWithOperationalEvent({\n\t\t\t\t\taction: 'usedDocumentCookieError',\n\t\t\t\t\tmessage: ,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tcookieKey: sanitizedCookieKey,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e: any) {\n\t\t\tLogger.errorWithOperationalEvent({\n\t\t\t\taction: 'usedDocumentCookieError',\n\t\t\t\tmessage: ,\n\t\t\t});\n\t\t}\n\t};\n};\n","import Cookies, { type CookieAttributes } from 'js-cookie';\n\nimport { fg } from '@atlaskit/platform-feature-flags';\n\nimport { sendPackageOperationalEvent } from '../../../common/utils';\nimport { loadStorageControlsData } from '../../../common/utils/load-storage-controls-data';\nimport { Logger } from '../../../common/utils/logger';\nimport { type CategorizedCookiesCache, PreferenceCategory } from '../../../types';\nimport { getPreferences } from '../../storage-preferences/get-preferences';\n\nimport { Status } from './types';\n\nexport type { CookieAttributes as JSCookieAttributes };\n\nconst findStartsWithPatternMatch = (\n\tcookieName: string,\n\t{ startsWith }: CategorizedCookiesCache['patterns'],\n): number | null => {\n\t// Setup initial pattern step and position\n\tlet currentStep = startsWith;\n\tlet position = 0;\n\n\t// Iterate through cookie name symbol by symbol\n\twhile (position < cookieName.length) {\n\t\t// The value of cookie character at the position\n\t\tconst currentStepValue = currentStep[cookieName[position]];\n\t\t// If there is no match for cookie symbol in cache, this means there is no\n\t\t// pattern match for the cookie name\n\t\tif (currentStepValue === undefined) {\n\t\t\treturn null;\n\t\t}\n\t\t// If current step value is a number, this means we reached the end of the pattern\n\t\t// and should return category number\n\t\tif (typeof currentStepValue === 'number') {\n\t\t\treturn currentStepValue;\n\t\t}\n\t\t// Continue to going through pattern\n\t\tcurrentStep = currentStepValue;\n\t\tposition++;\n\t}\n\n\t// No pattern match - all patterns longer or shorter than cookie name\n\treturn null;\n};\n\nconst getPreferenceCategory = async (cookieName: string): Promise<PreferenceCategory | null> => {\n\tconst storageControlsData = await loadStorageControlsData();\n\n\tif (!storageControlsData) {\n\t\treturn null;\n\t} else {\n\t\treturn getPreferenceCategoryFromPassedCache(cookieName, storageControlsData);\n\t}\n};\n\n/\n * Synchronously fetches a cookie category from a CategorizedCookiesCache that has already been fetched\n *\n * This allows synchronous parts of the code to access cached versions of the cache but still maintain\n * a synchronous signature for clients\n \n /\nexport const getPreferenceCategoryFromPassedCache = (\n\tcookieName: string,\n\tstorageControlsData: CategorizedCookiesCache,\n) => {\n\tlet cookieCategoryNumber: number | null = null;\n\tconst { keys, categories, patterns } = storageControlsData;\n\t// Find direct match in keys\n\tif (cookieName in Object(keys)) {\n\t\tcookieCategoryNumber = keys[cookieName];\n\t} else {\n\t\t// Find pattern match or null\n\t\tcookieCategoryNumber = findStartsWithPatternMatch(cookieName, patterns);\n\t}\n\n\tconst numToCategoryMap = {\n\t\t[categories.STRICTLY_NECESSARY]: PreferenceCategory.StrictlyNecessary,\n\t\t[categories.FUNCTIONAL]: PreferenceCategory.Functional,\n\t\t[categories.ANALYTICS]: PreferenceCategory.Analytics,\n\t\t[categories.MARKETING]: PreferenceCategory.Marketing,\n\t\t[categories.UNKNOWN]: PreferenceCategory.Unknown,\n\t};\n\n\treturn cookieCategoryNumber !== null ? numToCategoryMap[cookieCategoryNumber] : null;\n};\n\n/\n * Given a cookie key, fetches preferences and categories and determines whether the cookie can be set\n *\n * Allows an optional allowedCallback to be passed which is invoked in the case the cookie is allowed to be set.\n * This allows synchronous parts of the code to check a cookie's status (e.g. the document.cookie set override)\n *\n */\nexport const canSetCookie = async ({\n\tcookieKey,\n\tallowedCallback = () => {},\n\tblockedCallback = () => {},\n}: {\n\tcookieKey: string;\n\tallowedCallback?: () => void;\n\tblockedCallback?: ({ cookieHasCategory }: { cookieHasCategory?: boolean }) => void;\n}) => {\n\tlet shouldSetCookie;\n\n\tconst cookieCategory = await getPreferenceCategory(cookieKey);\n\tif (cookieCategory === PreferenceCategory.StrictlyNecessary) {\n\t\tshouldSetCookie = true;\n\t} else {\n\t\tconst preferences = await getPreferences();\n\t\tlet hasPreferencesForCategory = false;\n\n\t\tif (!!preferences) {\n\t\t\tif (!!cookieCategory) {\n\t\t\t\thasPreferencesForCategory = preferences[cookieCategory];\n\t\t\t}\n\t\t}\n\t\tshouldSetCookie = hasPreferencesForCategory;\n\t}\n\tif (shouldSetCookie) {\n\t\tallowedCallback?.();\n\t} else {\n\t\tblockedCallback?.({ cookieHasCategory: cookieCategory != null });\n\t}\n\treturn shouldSetCookie;\n};\n\n/\n * Sets a cookie asynchronously. This queries user preferences before setting\n * the cookie, so it must be used for any cookies which are not strictly\n * necessary.\n /\nexport const setCookie = async (\n\tkey: string,\n\tvalue: string,\n\tattributes?: CookieAttributes,\n): Promise => {\n\t// Flag disabled, allow all cookies.\n\tif (!fg('platform.moonjelly.browser-storage-controls')) {\n\t\tconst eventAttributes = {\n\t\t\twasRejected: false,\n\t\t\tcookieKey: key,\n\t\t};\n\t\ttry {\n\t\t\tCookies.set(key, value, attributes);\n\t\t\treturn Status.SUCCESS;\n\t\t} catch (e: any) {\n\t\t\tLogger.errorWithOperationalEvent({\n\t\t\t\taction: 'usedSetCookieError',\n\t\t\t\tattributes: eventAttributes,\n\t\t\t\tmessage: Failed to use set cookie. ${e.message || ''},\n\t\t\t});\n\t\t\treturn Status.FAILED;\n\t\t}\n\t}\n\n\t// Flag enabled, user belongs to an org that opted into cookies management and we should respect their preferences\n\tconst shouldSetCookie = await canSetCookie({ cookieKey: key });\n\n\tconst eventAttributes = {\n\t\twasRejected: !shouldSetCookie,\n\t\tcookieKey: key,\n\t};\n\ttry {\n\t\tsendPackageOperationalEvent({\n\t\t\taction: 'usedSetCookie',\n\t\t\tattributes: eventAttributes,\n\t\t});\n\n\t\tif (shouldSetCookie) {\n\t\t\tCookies.set(key, value, { ...attributes, 'atl-set-cookie': true });\n\t\t\treturn Status.SUCCESS;\n\t\t} else {\n\t\t\treturn Status.BLOCKED;\n\t\t}\n\t} catch (e: any) {\n\t\tLogger.errorWithOperationalEvent({\n\t\t\taction: 'usedSetCookieError',\n\t\t\tattributes: eventAttributes,\n\t\t\tmessage: ,\n\t\t});\n\t\treturn Status.BLOCKED;\n\t}\n};\n","import { fg } from '@atlaskit/platform-feature-flags';\n\nimport { ATLASSIAN_CONSENT_COOKIE_KEY, LEGACY_ATLASSIAN_GDPR_COOKIE_KEY } from '../../../constants';\nimport type { ConsentPreference } from '../../../types';\nimport { getConsentToken } from '../../cookie-controls/get-consent-token';\nimport { getCookie } from '../../cookie-controls/get-cookie';\nimport { unpackUserPreferencesCookie } from '../../cookie-controls/transformer';\n\nexport async function getPreferences(): Promise<ConsentPreference | undefined> {\n\t// Use V001 pattern without the V2 FF enabled\n\tif (!fg('platform.moonjelly.browser-storage-controls-v2')) {\n\t\tconst packedPrefs = getCookie(LEGACY_ATLASSIAN_GDPR_COOKIE_KEY);\n\n\t\tif (!packedPrefs) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn unpackUserPreferencesCookie(packedPrefs);\n\t}\n\n\tlet packedLocalPrefs = getCookie(ATLASSIAN_CONSENT_COOKIE_KEY);\n\n\tif (!packedLocalPrefs) {\n\t\tconst consentToken = await getConsentToken();\n\t\treturn consentToken ? unpackUserPreferencesCookie(consentToken) : undefined;\n\t}\n\n\treturn unpackUserPreferencesCookie(packedLocalPrefs);\n}\n","import {\n\tATLASSIAN_CONSENT_FALLBACK_COOKIE_KEY,\n\tTESTING_TOKEN_OVERRIDE_COOKIE_KEY,\n} from '../../../constants';\nimport { getCookie } from '../get-cookie';\nimport { overrideConsentTokenForLiveTesting } from '../override-with-testing-cookies';\nimport {\n\tsetConsentTokenCookie,\n\tsetRequiredConsentCookies,\n\tsetShouldShowBannerCookie,\n} from '../set-required-consent-cookies';\n\nimport { getValidConsentData } from './utils';\n\nexport const getConsentToken = async () => {\n\tconst fallbackConsentToken = getCookie(ATLASSIAN_CONSENT_FALLBACK_COOKIE_KEY);\n\n\tconst consentData = await getValidConsentData(fallbackConsentToken);\n\tif (consentData) {\n\t\tconst { consentToken, consentTimestamp } = consentData;\n\n\t\t/ TESTING OVERRIDES /\n\n\t\tconst potentiallyOverriddenConsentToken = overrideConsentTokenForLiveTesting(consentToken);\n\n\t\tconst testingConsentOverride = getCookie(TESTING_TOKEN_OVERRIDE_COOKIE_KEY);\n\t\tconst hasTestingConsents = !!(testingConsentOverride || testingConsentOverride === '');\n\n\t\tif (hasTestingConsents) {\n\t\t\t// If testing, set the cookies accordingly so we can test with any overridden token data.\n\t\t\tsetShouldShowBannerCookie(potentiallyOverriddenConsentToken);\n\t\t\tsetConsentTokenCookie(potentiallyOverriddenConsentToken);\n\n\t\t\t// Unfortunately, if you've previously saved to ConsentHub, that data will always resolve, so to simulate ConsentHub\n\t\t\t// being down, or the token data being bunk/invalid, we must set the testing token to an empty string. This will\n\t\t\t// return undefined here and skip any unpacking of the token. Otherwise, it will use the overridden token value.\n\t\t\treturn potentiallyOverriddenConsentToken === ''\n\t\t\t\t? undefined\n\t\t\t\t: potentiallyOverriddenConsentToken;\n\t\t}\n\n\t\t// At this point, all data should be valid and overridden for testing as needed, so set those cookies!\n\t\tsetRequiredConsentCookies(potentiallyOverriddenConsentToken, consentTimestamp);\n\t\treturn consentToken;\n\t}\n\treturn undefined;\n};\n","import { TESTING_TOKEN_OVERRIDE_COOKIE_KEY } from '../../../constants';\nimport { getCookie } from '../get-cookie';\n\n/\n TESTING UTILITY: Override resulting ConsentToken to simulate having never saved ConsentHub data\n Without doing this, it's neigh impossible to test scenarios that require missing ConsentHub data once\n you've saved consents in a live environment as we cannot delete ConsentHub data\n/\nexport const overrideConsentTokenForLiveTesting = (genuineConsentToken: string) => {\n\t// The existence of this cookie will make it look like fetched ConsentHub data is missing\n\t// You can set it to undefined yourself/empty string, or an actual default value.\n\tconst tokenOverride = getCookie(TESTING_TOKEN_OVERRIDE_COOKIE_KEY);\n\n\t// Note: Clear this cookie out of your browser when you're done testing empty data sets\n\t// Or you'll be stuck seeing the banner and never actually consenting on the UI\n\treturn tokenOverride || genuineConsentToken;\n};\n","import { getBitValueFromBool } from '../../../common/utils';\nimport {\n\tATLASSIAN_CONSENT_COOKIE_KEY,\n\tATLASSIAN_CONSENT_FALLBACK_COOKIE_KEY,\n\tATLASSIAN_SHOW_BANNER_COOKIE_KEY,\n} from '../../../constants';\nimport { getBannerVisibility } from '../../banner-controls/get-banner-visibility';\nimport { setStrictlyNecessaryCookie } from '../set-strictly-necessary-cookie';\n\nexport const setConsentTokenCookie = (consentToken: string) => {\n\tconst inTenMinutes = new Date();\n\tinTenMinutes.setTime(inTenMinutes.getTime() + 10 * 60 * 1000);\n\tsetStrictlyNecessaryCookie(ATLASSIAN_CONSENT_COOKIE_KEY, consentToken, {\n\t\texpires: inTenMinutes,\n\t\tpath: '/',\n\t});\n};\n\nexport const setConsentTokenFallbackCookie = (consentToken: string) => {\n\tconst inOneYear = new Date();\n\tinOneYear.setFullYear(inOneYear.getFullYear() + 1);\n\tsetStrictlyNecessaryCookie(ATLASSIAN_CONSENT_FALLBACK_COOKIE_KEY, consentToken, {\n\t\texpires: inOneYear,\n\t\tpath: '/',\n\t});\n};\n\nexport const setShouldShowBannerCookie = (consentToken: string, consentTimestamp?: string) => {\n\t// Since we have no good way to reference this as a global state object, we want to precompute and store the\n\t// banner visibility in a temporary, session-scope cookie (same expiry as the other cookies), which we can\n\t// lookup in the UI as needed\n\tconst bannerVisibility = getBannerVisibility({\n\t\tconsentToken,\n\t\tconsentTimestamp,\n\t});\n\tconst shouldShowBanner = getBitValueFromBool(!!bannerVisibility);\n\n\tconst inTenMinutes = new Date();\n\tinTenMinutes.setTime(inTenMinutes.getTime() + 10 * 60 * 1000);\n\tsetStrictlyNecessaryCookie(ATLASSIAN_SHOW_BANNER_COOKIE_KEY, shouldShowBanner, {\n\t\texpires: inTenMinutes,\n\t\tpath: '/',\n\t});\n};\n\nexport const setRequiredConsentCookies = (consentToken: string, consentTimestamps?: string) => {\n\tsetConsentTokenCookie(consentToken);\n\tsetShouldShowBannerCookie(consentToken, consentTimestamps);\n};\n","import Cookies, { type CookieAttributes } from 'js-cookie';\n\nimport { fg } from '@atlaskit/platform-feature-flags';\n\nimport { sendPackageOperationalEvent } from '../../../common/utils';\nimport { Logger } from '../../../common/utils/logger';\n\n/**\n * Sets a cookie synchronously. Since this doesn't wait for user preferences,\n * it should only be used for strictly necessary cookies which are critical to\n * application functionality.\n */\n\nexport const setStrictlyNecessaryCookie = (\n\tkey: string,\n\tvalue: string,\n\tattributes?: CookieAttributes,\n) => {\n\ttry {\n\t\tif (fg('platform.moonjelly.browser-storage-controls')) {\n\t\t\tsendPackageOperationalEvent({\n\t\t\t\taction: 'usedSetStrictlyNecessaryCookie',\n\t\t\t\tattributes: {\n\t\t\t\t\tcookieKey: key,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t\tCookies.set(key, value, { ...attributes, 'atl-set-cookie': true });\n\t} catch (e: any) {\n\t\tLogger.errorWithOperationalEvent({\n\t\t\taction: 'usedSetStrictlyNecessaryCookieError',\n\t\t\tattributes: { cookieKey: key },\n\t\t\tmessage: Failed to use set strictly necessary cookie. ${e.message || ''},\n\t\t});\n\t}\n};\n","import { fetchConsentPreferences } from '../../../services/consent-hub-service';\nimport { checkTokenVersionValidity } from '../transformer';\n\nimport { type ValidConsentData } from './types';\n\nexport const getValidConsentData = async (\n\tfallbackConsentToken?: string,\n): Promise<ValidConsentData | undefined> => {\n\t// Fetches preferences from ConsentHub and returns serialized token data if possible\n\tconst consentData = await fetchConsentPreferences();\n\tlet { consentToken, consentTimestamp, consentHubInaccessible } = consentData;\n\n\tlet { isValid } = checkTokenVersionValidity(consentToken);\n\n\tif (isValid && consentHubInaccessible) {\n\t\tif (fallbackConsentToken) {\n\t\t\t// consentHubInaccessible: ConsentHub request failed (e.g. service is down/bad request/etc). Attempt to use\n\t\t\t// any previously set consents in the interim if we have them.\n\t\t\tconsentToken = fallbackConsentToken;\n\t\t} else {\n\t\t\t// Temporary: Sets the default token to have true consentedUnderXXXX bits\n\t\t\t// when ConsentHub is inaccessible and there is not fallback token. This\n\t\t\t// will ensure the banner isn't shown when ConsentHub is down.\n\t\t\tconsentToken = ${consentToken.slice(0, 8)}1111;\n\t\t}\n\t}\n\n\treturn isValid ? { consentToken, consentTimestamp } : undefined;\n};\n","export enum Status {\n\tSUCCESS = 'SUCCESS',\n\tBLOCKED = 'BLOCKED',\n\tFAILED = 'FAILED',\n}\n"],"names":["parcelexport","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","parcelinteropDefault","a","__esModule","default","parcelRequire","parcelglobal","globalThis","parcelRegister","register","module","exports","5372da7267fcd229export1e5524c82dfa4c29","eUqFw","useEffect","initializeControls","product","07e94fddd0214724export919040c32a62c7db","07e94fddd0214724export45a5573b04db016c","args","isSSR","isFlagEnabled","flagEnabled","pollForBrowserControlsFlag","initializeGlobalState","documentCookieProperty","getOwnPropertyDescriptor","Document","prototype","originalSetter","originalGetter","Logger","warn","analyticsWebClientInstance","getAnalyticsClient","Error","document","getSetCookieOverride","errorWithOperationalEvent","action","message","ea6e32d3bbc94c51exportcc1c284801c32a43","ea6e32d3bbc94c51varINITIAL_WAIT_TIME","waitTime","totalElapsedTime","ea6e32d3bbc94c51var6bd6d17694d0aa80exportb7364c41ddbfdb0a","originalCookieValue","cookieSetByPackage","includes","apply","attributes","outsidePackage","sanitizedCookieKey","slice","indexOf","sendPackageOperationalEvent","cookieKey","canSetCookie","allowedCallback","blockedCallback","cookieHasCategory","7eb8ba014800496fexport92f79a86880ed80","7eb8ba014800496fexport110700823644f4a6","M2DFp","7eb8ba014800496fvarfindStartsWithPatternMatch","cookieName","startsWith","currentStep","position","length","currentStepValue","undefined","7eb8ba014800496fvargetPreferenceCategory7eb8ba014800496fexportb48b796182639b54","cookieCategoryNumber","keys","categories","patterns","numToCategoryMap","STRICTLY_NECESSARY","PreferenceCategory","StrictlyNecessary","FUNCTIONAL","Functional","ANALYTICS","Analytics","MARKETING","Marketing","UNKNOWN","Unknown","shouldSetCookie","cookieCategory","preferences","getPreferences","hasPreferencesForCategory","key","value","Status","SUCCESS","wasRejected","FAILED","eventAttributes","BLOCKED","fa3438f1c3ad82aeexport391d5185569e2bfcexportf1b8f2ca713fca08","fallbackConsentToken","ATLASSIAN_CONSENT_FALLBACK_COOKIE_KEY","consentData","getValidConsentData","consentTimestamp","potentiallyOverriddenConsentToken","overrideConsentTokenForLiveTesting","testingConsentOverride","TESTING_TOKEN_OVERRIDE_COOKIE_KEY","setShouldShowBannerCookie","setConsentTokenCookie","setRequiredConsentCookies","e87a9db0df2659c7exportb5282052fc15e1ae","genuineConsentToken5947d7e9e7fd3832export8e560d0760f733a2","5947d7e9e7fd3832export133cd762b0f705a2","5947d7e9e7fd3832export99ecece88c58d938","5947d7e9e7fd3832export6d2869955a851487export93509ff9a62ee022","4f85d7ab666d3f6aexportc515de51e01b40e1f4626fexport96e9906d6d93a972"],"version":3,"file":"async-browser-storage-controls-init.9a5190e6.js.map" }