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B,0mBCvDA,MAAMC,EAAU,CAAEC,QAAS,GAAIC,YAAa,IAEvCF,EAAQC,QAAQ,2BAA6B,CAC1CE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,GAEJC,KAAK,EACLC,GAAI,YACJC,EAAG,0BACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,uCAKRnE,OAAOoE,aAAepE,OAAOoE,cAAgB,GAC7CpE,OAAOoE,aAAaZ,QAAOa,EAAAA,EAAA,GACpBrE,OAAOoE,aAAaZ,SAAW,IAC/BD,EAAQC,SAGXxD,OAAOoE,aAAaX,YAAWY,EAAAA,EAAA,GAC5BrE,OAAOoE,aAAaX,aAAe,IACnCF,EAAQE,iCC5BnBa,EAAOC,QAAU7F,2BCAjB4F,EAAOC,QAAUC","sources":["webpack://Dobbies.Commerce/./src/modules/dobbies-back-top-footer/components/BackToTop.tsx?ef8e","webpack://Dobbies.Commerce/./src/modules/dobbies-back-top-footer/dobbies-back-top-footer.tsx?04b8","webpack://Dobbies.Commerce/./lib/dobbies-back-top-footer/module-registration.js?0148","webpack://Dobbies.Commerce/external var \"React\"?0d3b","webpack://Dobbies.Commerce/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nimport { getPayloadObject, getTelemetryAttributes, TelemetryConstant, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\n/**\r\n * BackToTop properties.\r\n */\r\nexport interface IBackToTopProps {\r\n className?: string;\r\n href?: string;\r\n 'aria-label'?: string;\r\n title?: string;\r\n threshold?: number;\r\n id?: string;\r\n scrollStepInPx?: number;\r\n delayInMs?: number;\r\n text?: string;\r\n telemetryContent?: ITelemetryContent;\r\n editProps?: Msdyn365.ITextEditProps | undefined;\r\n}\r\n\r\nexport interface IBackToTopStateAttributes {\r\n 'aria-hidden': boolean;\r\n tabIndex: number;\r\n}\r\n\r\nexport interface IBackToTopState extends React.ComponentState {\r\n attributes: IBackToTopStateAttributes;\r\n}\r\n\r\n/**\r\n * Back To Top - This component is used to scroll to the top of the page.\r\n */\r\nexport default class BackToTop extends React.PureComponent {\r\n // public static defaultProps: Partial = {\r\n // className: 'btn btn-lg btn-secondary',\r\n // delayInMs: 0,\r\n // scrollStepInPx: 25\r\n // };\r\n\r\n private readonly attributes?: Msdyn365.IDictionary;\r\n\r\n constructor(props: IBackToTopProps) {\r\n super(props);\r\n this.state = { attributes: { 'aria-hidden': true, tabIndex: -1 } };\r\n this._reevaluatePosition = this._reevaluatePosition.bind(this);\r\n this._scrollToTop = this._scrollToTop.bind(this);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.BackToTop);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n\r\n public componentDidMount(): void {\r\n window.addEventListener('resize', this._reevaluatePosition);\r\n window.addEventListener('scroll', this._reevaluatePosition);\r\n this._reevaluatePosition();\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window.removeEventListener('resize', this._reevaluatePosition);\r\n window.removeEventListener('scroll', this._reevaluatePosition);\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { className, threshold, delayInMs, scrollStepInPx, ...props } = this.props;\r\n const children = this.props.children || ;\r\n if (this.props.text) {\r\n return (\r\n \r\n {this._renderHeading(this.props.text)}\r\n \r\n );\r\n }\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }\r\n\r\n private readonly _renderHeading = (text: string): JSX.Element | undefined => {\r\n return ;\r\n };\r\n\r\n // private _scrollStep(): void {\r\n // if ((document.documentElement.scrollTop || document.body.scrollTop) === 0) {\r\n // clearInterval(this.state.intervalId);\r\n // this.setState({ intervalId: 0 });\r\n // this._reevaluatePosition();\r\n // }\r\n\r\n // if (this.state.intervalId !== 0) {\r\n // window.scrollTo(0, document.body.scrollTop - this.props.scrollStepInPx);\r\n // document.body.scrollTop = document.body.scrollTop > 0 ? document.body.scrollTop - this.props.scrollStepInPx : 0;\r\n // }\r\n // }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private _scrollToTop(e: any): void {\r\n e.preventDefault();\r\n // const intervalId = setInterval(this._scrollStep.bind(this), this.props.delayInMs);\r\n // this.setState({ intervalId });\r\n window.scroll({ top: 0, behavior: 'smooth' });\r\n }\r\n\r\n private _reevaluatePosition(): void {\r\n // TODO:\r\n // change the threshold minimum to zero\r\n // add a prop for specifying multiplier of page height instead of absolute threshold\r\n // add clientWidth check to hide at < 768\r\n const scrollTop = window.pageYOffset || document.body.scrollTop;\r\n const height = Math.min(window.innerHeight, document.documentElement.clientHeight);\r\n const threshold = Math.min(this.props.threshold !== undefined ? this.props.threshold : -1, 100);\r\n const hide =\r\n scrollTop > 0 && threshold >= 0\r\n ? scrollTop < ((document.documentElement.scrollHeight - height) * threshold) / 100\r\n : scrollTop < height * 2;\r\n const tabIndexValue = hide ? -1 : 0;\r\n this.setState({ attributes: { 'aria-hidden': hide, tabIndex: tabIndexValue } });\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport BackToTop from './components/BackToTop';\r\n\r\nimport { IDobbiesBackTopFooterProps } from './dobbies-back-top-footer.props.autogenerated';\r\n\r\n/**\r\n *\r\n * BackTopFooter component.\r\n * @extends {React.PureComponent>}\r\n */\r\nclass BackTopFooter extends React.PureComponent> {\r\n private readonly editProps: Msdyn365.ITextEditProps = {\r\n requestContext: this.props.context.request,\r\n onEdit: (event: Msdyn365.ContentEditableEvent) => (this.props.config.backtoTopText = event.target.value)\r\n };\r\n\r\n private readonly telemetryContent?: ITelemetryContent;\r\n\r\n constructor(props: IDobbiesBackTopFooterProps<{}>) {\r\n super(props);\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.props.config.destination) {\r\n this.props.telemetry.error('BackToTop.destination has not been provided, module wont render.');\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default BackTopFooter;\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['dobbies-back-top-footer'] = {\n c: () => require('partner/modules/dobbies-back-top-footer/dobbies-back-top-footer.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'dobbies-back-top-footer',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/dobbies-back-top-footer'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["BackToTop","React","constructor","props","super","_renderHeading","text","Msdyn365","className","editProps","this","state","attributes","tabIndex","_reevaluatePosition","bind","_scrollToTop","payLoad","getPayloadObject","telemetryContent","TelemetryConstant","getTelemetryAttributes","componentDidMount","window","addEventListener","componentWillUnmount","removeEventListener","render","_this$props","threshold","delayInMs","scrollStepInPx","_objectWithoutProperties","_excluded","children","Object","assign","role","onClick","e","preventDefault","scroll","top","behavior","scrollTop","pageYOffset","document","body","height","Math","min","innerHeight","documentElement","clientHeight","undefined","hide","scrollHeight","tabIndexValue","setState","BackTopFooter","requestContext","context","request","onEdit","event","config","backtoTopText","target","value","getTelemetryObject","telemetryPageName","friendlyName","telemetry","destination","href","title","ariaLabel","error","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","__bindings__","_objectSpread","module","exports","ReactDOM"],"sourceRoot":""}