!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3f04e9e1-df0f-3cfa-bcd4-53aa2ccd4c61")}catch(e){}}(); define(["require","exports","./e_file_viewer_static_scl_page_folder","./e_core_exception","./c_ux_analytics_ux_variants","./c_pap_public","react","./c_flux_action_type","./c_src_sink_index","./c_init_data_debug_panel","./c_lodash-es_lodash","./c_api_v2_routes_team_provider","./e_edison","./c_pap-events_enums_flexible_sharing_entry_point_variant-utils","./c_pap-events_browse_view_folder_picker","./e_data_modules_stormcrow","./c_react-use_misc_util","./c_core_i18n","metaserver/static/js/langpack","./c_core_notify","react-dom"],(function(e,t,n,i,a,o,s,r,l,c,d,u,h,g,m,_,p,f,v,y,E){"use strict";function w(){try{return window.self!==window.top}catch(e){return!0}}const k=()=>location.hostname.split(".").slice(-2).join("."),I=()=>"dropbox.com"===k(),x=()=>!!I()||("docsend.com"===k()||("dash.ai"===k()||("dropboxforum.com"===k()||("webflow.io"===k()||"app.hellosign.com"===location.hostname)))),b=e=>({element_id:e.getAttribute("data-uxa-log"),tag_name:e.tagName.toLowerCase(),entity_id:e.getAttribute("data-uxa-entity-id"),trace_id:e.getAttribute("data-uxa-trace-id"),element_rank:S(e),untrusted_raw_variant:e.getAttribute("data-uxa-untrusted-raw-variant"),hierarchy_group:T(e)}),T=e=>{let t=0,n=e;for(;n&&t<10;){const e=n.getAttribute("data-uxa-hierarchy-group");if(e)return e;n=n.parentElement,t++}return null},S=e=>{const t=e.nodeName.toLowerCase(),n=e.getAttribute("data-uxa-log"),i=document.querySelectorAll(`${t}[data-uxa-log="${n}"]`);if(1===i.length)return 1;for(let t=0;t{if(x())return!0;return(()=>{var e,t,n;const i=null===(n=null===(t=null===(e=window.dropbox)||void 0===e?void 0:e.privacyConsent)||void 0===t?void 0:t.getConsentCategories)||void 0===n?void 0:n.call(t);if(!i)return{analyticsAllowed:!1,generalMarketingAndAdvertisingAllowed:!1,performanceAndFunctionalityAllowed:!1,socialMediaAdvertisingAllowed:!1};const{analytics:a,"general marketing and advertising":o,"performance and functionality":s,"social media advertising":r}=i;return{analyticsAllowed:a,generalMarketingAndAdvertisingAllowed:o,performanceAndFunctionalityAllowed:s,socialMediaAdvertisingAllowed:r}})().analyticsAllowed},mockableGetDate:()=>new Date},A=()=>{var e;const t=null===(e=null===document||void 0===document?void 0:document.cookie)||void 0===e?void 0:e.split("; ").find((e=>e.startsWith(C+"=")));return t?t.split("=")[1]:null},P=e=>`${C}=${e}; domain=.${k()}; expires=${(()=>{const e=M.mockableGetDate(),t=e.getTime()+15768e7;return e.setTime(t),e.toUTCString()})()}; Secure`,O={heartbeat:"heartbeat",linkClick:"link_click",elementClick:"element_click",linkNoSessionStorage:"link_no_session_storage",modalClose:"modal_close",modalOpen:"modal_open",pageView:"page_view",pageFreeze:"page_freeze",pageResume:"page_resume",scroll:"scroll_event",finalHeartbeat:"final_heartbeat",spaPageView:"spa_page_view",delayedPageViewWithLateMetaTag:"delayed_page_view_with_late_meta_tag",privacyConsentIframeLoaded:"privacy_consent_iframe_loaded",privacyConsentScriptLoaded:"privacy_consent_script_loaded",privacyConsentScriptLoadError:"privacy_consent_script_load_error",privacyConsentCookieValues:"privacy_consent_cookie_values",zoomChatIframeLoaded:"zoom_chat_iframe_loaded",zoomChatInitiated:"zoom_chat_initiated",zoomChatInitiationSuccess:"zoom_chat_initiation_success",zoomChatInitiationFailed:"zoom_chat_initiation_failed",zoomChatTimeOutFailed:"zoom_chat_timeout_failure",zoomChatNetworkFailed:"zoom_chat_network_failed",zoomChatMaximized:"zoom_chat_maximized",zoomChatMinimized:"zoom_chat_minimized",zoomChatEnded:"zoom_chat_ended",zoomChatRequested:"zoom_chat_requested",zoomChatInitialDisplay:"zoom_chat_initial_display",zoomChatLogoutByUser:"zoom_chat_logout_by_user",zoomChatConsentDeclined:"zoom_chat_consent_declined",marketingTrackerReadyForUxa:"marketing_tracker_ready_for_uxa",mouseupElementClick:"mouseup_element_click",dialogOpen:"dialog_open",dialogClose:"dialog_close",documentOpen:"document_open",documentClose:"document_close",conversionDataReady:"conversionDataReady",legacy_hs_analytics_event:"legacy_hs_analytics_event",elementShown:"element_shown",elementHide:"element_hide",formFieldchange:"form_field_change",exceptionReport:"exception_report"},L=["gclid","oqa","trigger","msclkid","_tk","_camp","_ad","_net","_kw","utm_campaign","utm_content","utm_medium","utm_source","utm_term","fbclid","tfo","desktop_logging_id"],D="SPAHistoryStateChange",N=e=>{const t={detail:{eventSource:e}};n.runAfterUxaListening((()=>{n.dispatchCustomEvent(D,t)}))},R=history.pushState,z=history.replaceState,V=e=>{N("popState")},U={oldReplaceState:z,oldPushState:R,resetHistoryListenersInstalled:()=>{self._DBX_UXA_historyListenersInstalled=!1},getHistoryListenersInstalled:()=>self._DBX_UXA_historyListenersInstalled,installPushStateMonkeyPatch:()=>{Object.defineProperty(history,"pushState",{value:(e,t,n)=>{const i=location.pathname+location.hash;U.oldPushState.call(history,e,t,n);i!==location.pathname+location.hash&&N("pushState")},writable:!0})},installReplaceStateMonkeyPatch:()=>{Object.defineProperty(history,"replaceState",{value:(e,t,n)=>{const i=location.pathname+location.hash;U.oldReplaceState.call(history,e,t,n);i!==location.pathname+location.hash&&N("replaceState")},writable:!0})}},F="data-uxa-log",q="data-uxa-interactions",H="[data-uxa-interactions]",W="element_interaction_event";var $,B;function G(e=document.body,t=H){const n=new Set;let i=null,a=s();const o=new MutationObserver((function(){if(null!==i)return;i=requestAnimationFrame((()=>{const e=s(),t=c(e,a);l(c(a,e)),function(e){n.forEach((t=>{t.addElements(e)}))}(t),a=e,i=null}))}));function s(){return Array.from(e.querySelectorAll(t)).filter((e=>e instanceof HTMLElement)).map((e=>e)).filter((e=>r(e)))}function r(e){var t;if(!e.hasAttribute(F))return!1;const n=null===(t=e.getAttribute(q))||void 0===t?void 0:t.trim().split(/\s+/);return!!(null==n?void 0:n.includes("shown"))}function l(e){n.forEach((t=>{t.removeElements(e)}))}function c(e,t){return e.filter((e=>t.indexOf(e)<0))}function d(){o.observe(e,{childList:!0,subtree:!0})}return d(),{registerElementMutationListener:function(e){n.has(e)||(e.addElements(a),n.add(e))},unregisterElementMutationListener:function(e){n.has(e)&&(e.removeElements(a),n.delete(e))},purgeEventListeners:function(){l(a),n.clear()},pause:function(){o.disconnect()},resume:d,getElementsLength:function(){return a.length},testOnlyObserver:o,testOnlyIsEligibleForTracking:r,testOnlyDiffElements:c,testOnlyGetAnimationFrameRequest:function(){return i}}}function X(e=.5){const t=new Map,i=new IntersectionObserver((function(t){t.forEach((t=>{const n=t.target;t.intersectionRatio>=e&&a(n,B.VIEWING),t.intersectionRatio{var a;const s=e.getAttribute(F),r=null===(a=t.get(s))||void 0===a?void 0:a.element;o.status!==B.VIEWING||null!==r&&r!==e||(o.status=B.VIEWED,n.dispatchCustomEvent(W,{detail:{eventType:$.ELEMENT_HIDE,extra:{...b(e),element_shown_duration_ms:i}}}))}))}}}return{addElements:function(e){e.forEach((e=>function(e){const n=e.getAttribute(F),a=t.get(n);a?a.element=e:t.set(n,{status:B.VIEWED,element:e,lastViewStarted:0});i.observe(e)}(e)))},removeElements:function(e){e.forEach((e=>function(e){const n=e.getAttribute(F),o=t.get(n);o&&(o.element=null,a(e,B.VIEWED),i.unobserve(e))}(e)))},pause:function(){i.disconnect()},resume:function(){for(const[e,n]of t)(null==n?void 0:n.element)&&i.observe(n.element)},testOnlyTryUpdateElementStatus:a,testOnlyGetElementStatus:function(e){const n=t.get(e);return n?[n.element,n.status]:[null,null]}}}!function(e){e.ELEMENT_HIDE="elementHide",e.ELEMENT_SHOWN="elementShown"}($||($={})),function(e){e.VIEWING="VIEWING",e.VIEWED="VIEWED"}(B||(B={}));const j="clicked_link",Y="tracking_params",J="visit_id",K="previous_url",Z="last_active_time",Q="event_log",ee="event_log_timestamp",te={inAnIFrame:w},ne=new Set([Q,ee,J]),ie=(()=>{let e=null;const t="uxa.onedoesnotsimplyusesessionstorage";try{e=window.sessionStorage,e&&(e.setItem(t,t),e.removeItem(t))}catch(t){e=null}return e})(),ae=(()=>{let e=null;const t=window;return e=t.hasOwnProperty("JSON")?t.JSON:null,e})();var oe;!function(e){function t(e){return te.inAnIFrame()&&!ne.has(e)?`uxa.inaniframe.${e}`:`uxa.${e}`}const n=ie,i=ae;function a(e){return n?(n.removeItem(t(e)),null):null}e.isEnabled=function(){return!!n},e.get=function(e){if(!n||!i)return null;try{const a=n.getItem(t(e));return null===a?null:i.parse(a)}catch(e){return null}},e.set=function(e,o){if(!n||!i)return null;try{return null===o?a(e):(n.setItem(t(e),i.stringify(o)),null)}catch(e){return null}},e.remove=a,e.clear=function(){return n?(n.clear(),null):null}}(oe||(oe={}));var se;function re(){return(new Date).getTime()}!function(e){e.Normal="normal",e.DbHistory="db_history",e.SpaNormal="spa_normal",e.SpaNormalOnDbHistoryPage="spa_normal_on_db_history_page"}(se||(se={}));const le={idGeneratingNow:re,testableTimeOnPageNow:re,testablePerformanceNow:performance.now.bind(performance),inAnIFrame:w,getCurrentURI:function(e=window){return e.location.href},getEventGuid:function(){return n.UUID.v4()},isDropboxDomain:I,getVerticalOffset:function(){const e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)},getScrollPercent:function(){const e=document.documentElement,t=document.body,n="scrollTop",i="scrollHeight",a=(e[n]||t[n])/((e[i]||t[i])-e.clientHeight)*100;return Math.round(a)},uxaIsEssential:x,isFileProtocol:function(){return"file:"===window.location.protocol}},ce=e=>{var t;const n=`data-uxa-${e}`,i=null===(t=document.querySelector(`meta[${n}]`))||void 0===t?void 0:t.getAttribute(n);return i||null};function de(e,t,n={}){let i=null,a=0;return function(){const o=re();a||!1!==n.leading||(a=o);const s=t-(o.valueOf()-a.valueOf());let r=arguments;if(s<=0||s>t)i&&(clearTimeout(i),i=null),a=o,e.apply(null,r),r=null;else if(!i&&!1!==n.trailing){const t=()=>{a=!1===n.leading?0:re(),i=null,e.apply(null,r),r=null};i=setTimeout(t,s)}}}function ue(){const e={},t=function(e=window){return e.location.search}();if(t.length){const n=t.substring(1).replace(/&/g,"&").split("&");for(const t of n){let[n,i]=t.split("=");n&&i&&(n=n.trim(),i=i.trim(),n.length&&i.length&&(e[n]=decodeURIComponent(i.replace(/\+/g," "))))}}return e}function he(e,t){var n;const i=null===(n=e.getAttribute("data-uxa-interactions"))||void 0===n?void 0:n.trim().split(/\s+/);return t.every((e=>null==i?void 0:i.includes(e)))}function ge(e){return e&&e instanceof HTMLElement&&e.hasAttribute("data-uxa-log")&&(!e.hasAttribute("data-uxa-interactions")||he(e,["click"]))}function me(e){return e&&e instanceof HTMLElement&&"A"===e.nodeName}function _e(e){return e&&e.getAttribute("data-trackingid")}function pe(e){return e&&"BODY"===e.nodeName}function fe(){return Math.random().toString().slice(2)}const ve=new Set(Object.keys(O).map((e=>O[e]))),ye=/\/account|\/share|\/buy|\/pro\/try/;const Ee=["element_id","link_id","uxa_v","instance_event_count","instance_init_ts","event_ts","client_event_id","uxa_debug_version"];function we(e,t){return t[e]?(t[e]+"_"+e).toLowerCase().replace(/[^a-z0-9$\[\].]+/g,"_"):e}class ke{static initialize(e,t,n=null,i=!0){if(null===ke.singleton)ke.singleton=new ke(e,t,i);else if(n){[["requestId",t.requestId,ke.singleton.requestId],["orgReferrer",t.orgReferrer,ke.singleton.orgReferrer],["httpReferrer",t.httpReferrer,ke.singleton.httpReferrer],["configs.delayed_link_click_logging",t.delayed_link_click_logging,ke.singleton.delayedLinkClickLogging],["configs.event_names",t.event_names,ke.singleton.event_names],["configs.modal_class",t.modal_class,ke.singleton.modalClass],["configs.shouldBeSentToMarketingTrackerVariables",t.shouldBeSentToMarketingTrackerVariables,ke.singleton.shouldBeSentToMarketingTrackerVariables],["configs.isInternalIp",t.isInternalIp,ke.singleton.isInternalIp],["configs.isUserDropboxAdmin",t.isUserDropboxAdmin,ke.singleton.isUserDropboxAdmin],["configs.expEventsToExpIdMap",t.expEventsToExpIdMap,ke.singleton.expEventsToExpIdMap],["configs.expDataFieldsToExpIdMap",t.expDataFieldsToExpIdMap,ke.singleton.expDataFieldsToExpIdMap]].forEach((([e,t,i])=>{void 0!==t&&JSON.stringify(t)!==JSON.stringify(i)&&n(new Error(`UX Analytics initialize overload attempt; ${e} '${t}' !== '${i}'`))}))}return ke.singleton}constructor(e,t,i=!0){var o,s,r;if(this.currentModalId=null,this.lastScrollOffset=0,this.scrollTimer=null,this.trackingParams=null,this.updateExternalIds=()=>{le.isDropboxDomain()||(this.externalTeamId=ce("external-team-id"),this.externalUserId=ce("external-user-id"))},this.startHeartbeat=()=>{for(const e of[2,5,10,15,30])setTimeout(this.logOnPage.bind(this,O.heartbeat),1e3*e);for(const e of[1,2,4,9])setTimeout(this.logOnPage.bind(this,O.heartbeat),60*e*1e3)},this.delayedInit=()=>{this.saveTrackingParams(),this.setupListeners(),this.logPageView(),this.logDelayedClickEvent(),function(){const e=G(),t=X();e.registerElementMutationListener(t)}()},this.getListeners=()=>[[window,"scroll",this.handleScroll],[window,"pageshow",this.handlePageShow],[window,"pagehide",this.handlePageClose],[document.body,"mousedown",this.handleMousedown],[document.body,"mouseup",this.handleMouseup],[document.body,"keydown",this.handleKeyboardEnter],[document,"modalOpened",this.trackModalShow],[document,"modalClosed",this.trackModalHide],[document,"freeze",this.handlePageFreeze],[document,"resume",this.handlePageResume],[document,"change",this.handleFormFieldChange],[document,"viewUpdate",e=>this.logViewUpdate(e)],[window,D,this.handleHistoryStateChange],[window,"delayed_page_view_with_late_meta_tag",this.handleDelayedPageViewEventWithLateMetaTags],[window,"zoom_chat_custom_event",this.handleZoomChatCustomEvent],[window,"privacy_consent_custom_event",this.handlePrivacyConsentCustomEvent],[window,"marketing_tracker_ready_for_uxa",this.handleMarketTrackerReadyEvent],[document,"dialog_custom_event",this.handleDialogCustomEvent],[document,"document_custom_event",this.handleDocumentCustomEvent],[window,W,this.handleInteractionCustomEvent],[document,"exceptionReport",this.handleExceptionReport]],this.trackScrolling=()=>{this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(this.onScroll,500)},this.handleScroll=de(this.trackScrolling,2e3,{leading:!0}),this.onScroll=()=>{const e=le.getVerticalOffset();this.lastScrollOffset!==e&&(this.lastScrollOffset=e,this.logOnPage(O.scroll,{vertical_offset:e,scroll_percent:le.getScrollPercent()}))},this.handleFormFieldChange=e=>{const t=e.target;if(!he(t,["change"]))return;const n=t.type.toLowerCase(),i={...b(t),input_type:n};"checkbox"!==n&&"radio"!==n||(i.input_checked=t.checked);const a=this.createEvent(O.formFieldchange,i);this.logEvent(a)},this.handlePageShow=e=>{if(this.navigationType=n.getNavigationType(),this.bfcacheEligible=e.persisted,e.persisted){if(this.cleanSessionStorage(),!le.inAnIFrame()){const e=oe.get(K);oe.set(K,le.getCurrentURI()),this.previousUrl=e}this.visitId=oe.get(J),setTimeout(this.delayedInit,200)}},this.handlePageClose=e=>{const t={};t.vertical_offset=t.vertical_offset||le.getVerticalOffset(),t.time_on_page=t.time_on_page||this.getTimeOnPage(),t.spa_relative_time_on_page_ms=t.spa_relative_time_on_page_ms||this.getTimeOnPageMs(),this.logEvent(this.createEvent(O.finalHeartbeat,t))},this.handleElementClick=(e,t,n)=>{const i=function(e){let t=e;for(let e=0;e<6&&!ge(t)&&!pe(t);e++){const e=t.parentNode;if(!(e instanceof Element))break;t=e}return t}(e.target);if(!ge(i))return;const a=i,o=a.getBoundingClientRect(),s=this.createEvent(t,{...b(a),left:Math.round(o.left),time_on_page:this.getTimeOnPage(),spa_relative_time_on_page_ms:this.getTimeOnPageMs(),top:Math.round(o.top),vertical_offset:le.getVerticalOffset(),click_source:n});if("offsetX"in e&&"offsetY"in e){const t=e,n=e.target;s.extra.position_pct_X=Math.round(t.offsetX/n.offsetWidth*100),s.extra.position_pct_Y=Math.round(t.offsetY/n.offsetHeight*100)}this.logEvent(s)},this.handleLinkClick=e=>{const t=function(e){let t=e;for(let e=0;e<6&&!me(t)&&!_e(t)&&!pe(t);e++){const e=t.parentNode;if(!(e instanceof Element))break;t=e}return t}(e.target);if(!me(t)&&!_e(t))return;const n=t,i=n.getBoundingClientRect(),a=this.createEvent(O.linkClick,{left:Math.round(i.left),link_id:n.getAttribute("data-trackingid"),link_rank:this.getLinkRank(n),origin_href:n.getAttribute("href"),time_on_page:this.getTimeOnPage(),spa_relative_time_on_page_ms:this.getTimeOnPageMs(),top:Math.round(i.top),vertical_offset:le.getVerticalOffset(),tag_name:n.tagName.toLowerCase()});this.delayedLinkClickLogging&&me(n)?this.storeDelayedLinkClick(a):this.logEvent(a)},this.handleHistoryStateChange=e=>{if(!le.inAnIFrame()){const e=oe.get(K);oe.set(K,le.getCurrentURI()),this.previousUrl=e}++this.requestSeq;const t=le.getCurrentURI(),n=(i=t,ye.test(i)?se.SpaNormalOnDbHistoryPage:se.SpaNormal);var i;this.logPageView(n,e.detail.eventSource)},this.handleDelayedPageViewEventWithLateMetaTags=e=>{a.addConfigsFromDOM(!0),this.updateExternalIds(),this.logEvent(this.createEvent(O.delayedPageViewWithLateMetaTag))},this.handlePrivacyConsentCustomEvent=e=>{this.logEvent(this.createEvent(O[e.detail.eventType],e.detail.extra))},this.handleZoomChatCustomEvent=e=>{this.logEvent(this.createEvent(O[e.detail.eventType],e.detail.extra))},this.handleDialogCustomEvent=e=>{this.logEvent(this.createEvent(O[e.detail.eventType],e.detail.extra))},this.handleDocumentCustomEvent=e=>{this.logEvent(this.createEvent(O[e.detail.eventType],e.detail.extra))},this.handleMousedown=e=>{this.handleLinkClick(e),this.handleElementClick(e,O.elementClick,"click")},this.handleMouseup=e=>{},this.handleKeyboardEnter=e=>{13===e.keyCode&&(this.handleLinkClick(e),this.handleElementClick(e,O.elementClick,"enter"))},this.handleMarketTrackerReadyEvent=e=>{this.logEvent(this.createEvent(O[e.detail.eventType],e.detail.extra))},this.handlePageFreeze=()=>{this.logEvent(this.createEvent(O.pageFreeze))},this.handlePageResume=()=>{this.logEvent(this.createEvent(O.pageResume))},this.handleInteractionCustomEvent=e=>{this.logEvent(this.createEvent(O[e.detail.eventType],e.detail.extra))},this.onExceptionReport=e=>{const t=e.detail.exception_message||"";this.logEvent(this.createEvent(O.exceptionReport,{exception_message:t.substring(0,512)}))},this.handleExceptionReport=de(this.onExceptionReport,2e3,{leading:!0}),this._modalIdSanitizer=e=>{const t="db-modal-custom-";if("upsell-home-modal"===e.id){const n=Array.from(e.classList).find((e=>e.indexOf(t)>-1));if(n)return n.replace(t,"")}return e.id},this.trackModalShow=()=>{const e=document.querySelectorAll(this.modalClass),t=Array.from(e).find((e=>"none"!==window.getComputedStyle(e).display||e.classList.contains("clean-react-modal")||e.classList.contains("uxa-modal-tracking-span")));t&&(this.currentModalId=this._modalIdSanitizer(t)||"n/a -- file bug to cgi-team",this.logModal(O.modalOpen,this.currentModalId))},this.trackModalHide=()=>{this.currentModalId&&(this.logModal(O.modalClose,this.currentModalId),this.currentModalId=null)},"PITHOS"===t.inclusionMethod||le.isDropboxDomain()){if(self._DBX_UXA_historyListenersInstalled||(U.installPushStateMonkeyPatch(),U.installReplaceStateMonkeyPatch(),window.addEventListener("popstate",V),self._DBX_UXA_historyListenersInstalled=!0),this.cleanSessionStorage(),!le.inAnIFrame()){const e=oe.get(K)||t.previousUrl;oe.set(K,le.getCurrentURI()),this.previousUrl=e}this.instance_event_count=0,this.instance_init_ts=le.idGeneratingNow(),this.requestId=t.requestId,this.orgReferrer=t.orgReferrer,this.httpReferrer=t.httpReferrer,this.visitId=oe.get(J),this.requestSeq=0,this.event_names=t.event_names,this.logger=e,this.cmsPageUuid=document.body.getAttribute("data-article-uuid"),this.bfcacheEligible=!1,void 0!==t.delayed_link_click_logging?this.delayedLinkClickLogging=t.delayed_link_click_logging:this.delayedLinkClickLogging=!0,void 0!==t.modal_class?this.modalClass=t.modal_class:this.modalClass=".uxa-modal",void 0!==t.shouldBeSentToMarketingTrackerVariables?this.shouldBeSentToMarketingTrackerVariables=t.shouldBeSentToMarketingTrackerVariables:this.shouldBeSentToMarketingTrackerVariables=Ee,this.isInternalIp=!!t.isInternalIp,this.isUserDropboxAdmin=!!t.isUserDropboxAdmin,this.expEventsToExpIdMap=null!==(o=t.expEventsToExpIdMap)&&void 0!==o?o:{},this.expDataFieldsToExpIdMap=null!==(s=t.expDataFieldsToExpIdMap)&&void 0!==s?s:{},this.inclusionMethod=null!==(r=t.inclusionMethod)&&void 0!==r?r:"need_to_define",this.configTime=Number(t.configTime)||0,this.analyticsId=t.analyticsId,this.updateExternalIds(),this.initTime=le.testableTimeOnPageNow(),this.initTimeMs=le.testablePerformanceNow(),this.startHeartbeat(),this.appName=ce("app-name")||"",this.appPath=ce("app-path")||"",this.appIsEntitled=(t.entitledApps||[]).includes(this.appName),i?setTimeout(this.delayedInit,200):this.delayedInit()}}canUseDevTools(){return(this.isInternalIp||this.isUserDropboxAdmin)&&"PITHOS"!==this.inclusionMethod}setupListeners(){this.getListeners().forEach((([e,t,n])=>{e.addEventListener(t,n)})),n.uxaIsListening()}cleanupListeners(){this.getListeners().forEach((([e,t,n])=>{e.removeEventListener(t,n)}))}cleanSessionStorage(){const e=re(),t=oe.get(J),n=oe.get(Z);null===t?oe.set(J,fe()):null!==n&&e-n>=18e5&&(oe.remove(K),oe.set(J,fe())),oe.set(Z,e)}logPageView(e=se.Normal,t){const n={page_view_latency:-100,bfcache_eligible:this.bfcacheEligible,navigation_type:this.navigationType,page_view_origin:e,hierarchy_group:document.body.getAttribute("data-uxa-hierarchy-group")};if(t&&(n.spa_source=t),this.configTime>0){const e=Math.round((this.instance_init_ts-this.configTime)/1e3);n.page_view_latency=e<=10?e:11,this.configTime=-1}else 0===this.configTime&&(n.page_view_latency=-10,this.configTime=-1);this.logEvent(this.createEvent(O.pageView,n)),this.initTimeMs=le.testablePerformanceNow()}logModal(e,t){const n={modal:t};this.logOnPage(e,n,!0)}logViewUpdate(e){const{viewId:t,viewStep:n}=e.detail,i={view:t,view_step:n};this.logOnPage("view_update",i,!0)}logDelayedClickEvent(){if(!oe.isEnabled())return null;const e=oe.get(j);if(e)try{e.destination_url=le.getCurrentURI();const t={eventName:O.linkClick,extra:e};this.logEvent(t),oe.remove(j)}catch(e){}return null}logOnPage(e,t={},n=!1){(this.getTimeOnPage()<600||n)&&this.logEvent(this.createEvent(e,t))}async logEvent(t){var i;try{if(!(e=>ve.has(e))(t.eventName))throw new Error(`UXAnalytics.log: trying to log an invalid event (${t.eventName})`);void 0!==a.addMatchedVariantsToEvent&&a.addMatchedVariantsToEvent(t);const o=le.idGeneratingNow();"loading"===document.readyState&&await new Promise((function(e){if("interactive"===document.readyState||"complete"===document.readyState)e();else{function t(){document.removeEventListener("DOMContentLoaded",t),e()}document.addEventListener("DOMContentLoaded",t)}})),t.extra.instance_event_count=++this.instance_event_count,t.extra.instance_init_ts=this.instance_init_ts,t.extra.event_ts=o,t.extra.client_event_id=le.getEventGuid(),this.getWARPInfo()&&(t.extra.warp_variants=this.getWARPInfo());let s={};s=function(e,t,n){const i={};for(const[a,o]of Object.entries(e))t.includes(a)&&(i["uxa_"+we(a,n)]=o);return i}(t.extra,this.shouldBeSentToMarketingTrackerVariables,this.expDataFieldsToExpIdMap);const r=we(t.eventName,this.expEventsToExpIdMap);n.pushToMarketingTrackerLoggingQueue(r,s),(e=>{if(!M.analyticsTrackingIsAllowed())return;if(null===A()){const t=P(e);document.cookie=t}})(this.analyticsId),le.isDropboxDomain()||(t.extra.external_team_id=this.externalTeamId,t.extra.external_user_id=this.externalUserId),t.extra.app_name=this.appName;const l=A();if(l&&(t.extra.analytics_id=l),(le.isDropboxDomain()||A()||this.appIsEntitled)&&this.logger.log(t.eventName,t.extra,!0,this.event_names,{}),this.canUseDevTools()){const n=parseFloat(String(oe.get(ee)));if(n<=Date.now()){const e=1e3,a=(Array.isArray(oe.get(Q))&&null!==(i=oe.get(Q))&&void 0!==i?i:[]).filter((e=>{var t;return parseFloat(String(null===(t=null==e?void 0:e.extra)||void 0===t?void 0:t.event_ts))>=n})).concat(t).slice(-e);oe.set(Q,a)}else Array.isArray(oe.get(Q))&&oe.remove(Q);try{await new Promise((function(t,n){e(["./c_ux_analytics_styles_devtools"],t,n)}))}catch(e){throw new Error("UXAnalytics.log: failed to load devtools.module.css")}}}catch(e){throw e}}maybeSanitizeAppName(e){return e&&e.startsWith("file:")&&this.appPath&&this.appName?e.replace(this.appPath,``):e}createEvent(e,t={}){this.orgReferrer&&(t.org_referrer=this.maybeSanitizeAppName(this.orgReferrer)),this.visitId&&(t.visit_id=this.visitId),t.request_seq=this.requestSeq,this.httpReferrer&&(t.http_referrer=this.maybeSanitizeAppName(this.httpReferrer)),this.previousUrl&&(t.previous_url=this.maybeSanitizeAppName(this.previousUrl)),this.cmsPageUuid&&(t.cms_page_uuid=this.cmsPageUuid),t.request_id=t.request_id||this.requestId,t.url=this.maybeSanitizeAppName(t.url||le.getCurrentURI()),location.hash&&(t.hash_fragment=location.hash),t.uxa_v=2.2,t.uxa_debug_version="2024-02-06T01:01:01",t.uxa_inclusion_method=this.inclusionMethod;const n=this.getTimeOnPage(),i=this.getTimeOnPageMs();if(t.vertical_offset=t.vertical_offset||le.getVerticalOffset(),t.time_on_page=t.time_on_page||n,t.spa_relative_time_on_page_ms=t.spa_relative_time_on_page_ms||i,this.trackingParams)for(const e of Object.keys(this.trackingParams)){const n=e.replace(/^_/,""),i=this.trackingParams[e];t[`param_${n}`]=i}return{eventName:e,extra:t}}storeDelayedLinkClick(e){if(!oe.isEnabled())return this.logOnPage(O.linkNoSessionStorage),!1;try{oe.set(j,e.extra)}catch(e){return!1}return!0}saveTrackingParams(){const e=this.getTrackingParams();Object.keys(e).length?(oe.set(Y,e),this.trackingParams=e):this.trackingParams=null}getTrackingParams(){const e=oe.get(Y)||{},t=ue();for(const n of L)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}getWARPInfo(){return this.warpInfo=this.warpInfo||n.getWARPInfoFromDOM(),this.warpInfo||null}getTimeOnPageMs(){return le.testablePerformanceNow()-this.initTimeMs}getTimeOnPage(){return Math.round((le.testableTimeOnPageNow()-this.initTime)/1e3)}getLinkRank(e){const t=e.getAttribute("href"),n=document.querySelectorAll(`a[href="${t}"]`);if(1===n.length)return 1;for(let t=0;t