{"version":3,"sources":["libs/iframeResizer/iframeResizer.contentWindow.js"],"names":["undefined","window","autoResize","base","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateWidth","doubleEventList","resize","click","eventCancelTimer","firstRun","height","heightCalcModeDefault","heightCalcMode","initLock","initMsg","inPageLinks","interval","intervalTimer","logging","msgID","msgIdLen","length","myID","resetRequiredMethods","max","min","bodyScroll","documentElementScroll","resizeFrom","sendPermit","target","parent","targetOriginDefault","tolerance","triggerLocked","triggerLockedTimer","throttledTimer","width","widthCalcModeDefault","widthCalcMode","win","onMessage","warn","onReady","onPageInfo","customCalcMethods","document","documentElement","offsetHeight","body","scrollWidth","eventHandlersByName","passiveSupported","noop","options","Object","create","passive","get","addEventListener","removeEventListener","error","el","evt","func","capitalizeFirstLetter","string","charAt","toUpperCase","slice","throttle","context","args","result","timeout","previous","later","getNow","apply","now","remaining","arguments","clearTimeout","setTimeout","Date","getTime","formatLogMsg","msg","log","console","init","readDataFromParent","location","href","readDataFromPage","setMargin","setBodyStyle","injectClearFixIntoBodyElement","checkHeightMode","checkWidthMode","stopInfiniteResizingOfIFrame","setupPublicMethods","startEventListeners","setupInPageLinks","sendSize","strBool","str","data","substr","split","Number","enable","depricate","key","splitName","name","readData","iFrameResizer","JSON","stringify","keys","forEach","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","chkCSS","attr","value","indexOf","style","manageTriggerEvent","listener","add","eventName","handleEvent","eventType","remove","eventNames","Array","prototype","map","method","manageEventListeners","checkCalcMode","calcModeDefault","modes","type","getHeight","getWidth","setupMutationObserver","disconnectMutationObserver","disconnect","stopEventListeners","clearInterval","clearFix","createElement","clear","display","appendChild","getPagePosition","x","pageXOffset","scrollLeft","y","pageYOffset","scrollTop","getElementPosition","elPosition","getBoundingClientRect","pagePosition","parseInt","left","top","findTarget","jumpToTarget","jumpPosition","hash","sendMsg","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","bindAnchors","setupLink","linkClicked","e","preventDefault","getAttribute","call","querySelectorAll","bindLocationHash","initCheck","enableInPageLinks","parentIFrame","autoResizeF","close","closeF","getId","getIdF","getPageInfo","getPageInfoF","callback","moveToAnchor","moveToAnchorF","reset","resetF","resetIFrame","scrollTo","scrollToF","scrollToOffset","sendMessage","sendMessageF","setHeightCalculationMethod","setHeightCalculationMethodF","setWidthCalculationMethod","setWidthCalculationMethodF","setTargetOrigin","setTargetOriginF","size","sizeF","customHeight","customWidth","valString","initInterval","setInterval","Math","abs","setupBodyMutationObserver","addImageLoadListners","mutation","addImageLoadListener","element","complete","src","imageLoaded","imageError","elements","push","attributeName","removeFromArray","splice","removeImageLoadListener","imageEventTriggered","event","typeDesc","mutationObserved","mutations","createMutationObserver","querySelector","config","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","observer","MutationObserver","observe","WebKitMutationObserver","forceIntervalTimer","getComputedStyle","prop","retVal","defaultView","chkEventThottle","timer","getMaxElement","side","elementsLength","elVal","maxVal","Side","i","getAllMeasurements","dimention","bodyOffset","documentElementOffset","getTaggedElements","tag","noTaggedElementsFound","getAllElements","getBodyOffsetHeight","offset","getBodyScrollHeight","scrollHeight","custom","getCustomWidth","getDEOffsetHeight","getDEScrollHeight","getMaxHeight","getMinHeight","grow","growHeight","lowestElement","getBestHeight","taggedElement","getTaggedElementsHeight","getBodyScrollWidth","getBodyOffsetWidth","offsetWidth","getDEScrollWidth","getDEOffsetWidth","scroll","getMaxWidth","getMinWidth","rightMostElement","getTaggedElementsWidth","sizeIFrame","triggerEvent","triggerEventDesc","resizeIFrame","currentHeight","currentWidth","isSizeChangeDetected","checkTolarance","a","b","isForceResizableEvent","isForceResizableCalcMode","logIgnored","checkDownSizing","lockTrigger","sizeIFrameThrottled","recordTrigger","resetPage","isDoubleFiredEvent","triggerReset","hcm","sendToParent","message","postMessage","receiver","processRequestFromParent","initFromParent","source","resetFromParent","resizeFromParent","getData","inPageLink","inPageLinkF","pageInfo","pageInfoFromParent","msgBody","parse","messageFromParent","isMessageForUs","getMessageType","isMiddleTier","module","exports","jQuery","isInitMsg","true","false","callFromParent","messageType","processMessage","chkLateLoaded","readyState"],"mappings":";;;;AAAA;;;;;;;;;AAUA;AACA;;AAAC,CAAC,UAASA,SAAT,EAAoB;AACpB,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC,OADf,CACsB;;AAE1C,MAAIC,UAAU,GAAG,IAAjB;AAAA,MACEC,IAAI,GAAG,EADT;AAAA,MAEEC,cAAc,GAAG,EAFnB;AAAA,MAGEC,UAAU,GAAG,CAHf;AAAA,MAIEC,aAAa,GAAG,EAJlB;AAAA,MAKEC,YAAY,GAAG,IALjB;AAAA,MAMEC,WAAW,GAAG,EANhB;AAAA,MAOEC,cAAc,GAAG,KAPnB;AAAA,MAQEC,eAAe,GAAG;AAAEC,IAAAA,MAAM,EAAE,CAAV;AAAaC,IAAAA,KAAK,EAAE;AAApB,GARpB;AAAA,MASEC,gBAAgB,GAAG,GATrB;AAAA,MAUEC,QAAQ,GAAG,IAVb;AAAA,MAWEC,MAAM,GAAG,CAXX;AAAA,MAYEC,qBAAqB,GAAG,YAZ1B;AAAA,MAaEC,cAAc,GAAGD,qBAbnB;AAAA,MAcEE,QAAQ,GAAG,IAdb;AAAA,MAeEC,OAAO,GAAG,EAfZ;AAAA,MAgBEC,WAAW,GAAG,EAhBhB;AAAA,MAiBEC,QAAQ,GAAG,EAjBb;AAAA,MAkBEC,aAAa,GAAG,IAlBlB;AAAA,MAmBEC,OAAO,GAAG,KAnBZ;AAAA,MAoBEC,KAAK,GAAG,eApBV;AAAA,MAoB2B;AACzBC,EAAAA,QAAQ,GAAGD,KAAK,CAACE,MArBnB;AAAA,MAsBEC,IAAI,GAAG,EAtBT;AAAA,MAuBEC,oBAAoB,GAAG;AACrBC,IAAAA,GAAG,EAAE,CADgB;AAErBC,IAAAA,GAAG,EAAE,CAFgB;AAGrBC,IAAAA,UAAU,EAAE,CAHS;AAIrBC,IAA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AAW,IAAIvB,wBAAnB,EAA6C;AAC3CA,QAAAA,wBAAwB,CAACuB,WAAD,CAAxB;AACD,OAFD,MAEO,IAAI,CAACR,YAAY,EAAb,IAAmB,CAACI,SAAS,EAAjC,EAAqC;AAC1C3T,QAAAA,IAAI,CAAC,yBAAyB8M,KAAK,CAAC7I,IAA/B,GAAsC,GAAvC,CAAJ;AACD;AACF;;AAED,aAAS+P,cAAT,GAA0B;AACxB,UAAI,UAAUjW,QAAd,EAAwB;AACtB+V,QAAAA,cAAc;AACf,OAFD,MAEO,IAAIH,SAAS,EAAb,EAAiB;AACtBnB,QAAAA,wBAAwB,CAACxP,IAAzB;AACD,OAFM,MAEA;AACLF,QAAAA,GAAG,CACD,8BACEwQ,cAAc,EADhB,GAEE,oCAHD,CAAH;AAKD;AACF;;AAED,QAAID,cAAc,EAAlB,EAAsB;AACpBW,MAAAA,cAAc;AACf;AACF,GA7uCmB,CA+uCpB;AACA;;;AACA,WAASC,aAAT,GAAyB;AACvB,QAAI,cAAc7T,QAAQ,CAAC8T,UAA3B,EAAuC;AACrChX,MAAAA,MAAM,CAACmC,MAAP,CAAciT,WAAd,CAA0B,2BAA1B,EAAuD,GAAvD;AACD;AACF;;AAEDrR,EAAAA,gBAAgB,CAAC/D,MAAD,EAAS,SAAT,EAAoBqV,QAApB,CAAhB;AACAtR,EAAAA,gBAAgB,CAAC/D,MAAD,EAAS,kBAAT,EAA6B+W,aAA7B,CAAhB;AACAA,EAAAA,aAAa;AAGd,CA5vCA","sourcesContent":["/*\r\n * File: iframeResizer.contentWindow.js\r\n * Desc: Include this file in any page being loaded into an iframe\r\n * to force the iframe to resize to the content size.\r\n * Requires: iframeResizer.js on host page.\r\n * Doc: https://github.com/davidjbradshaw/iframe-resizer\r\n * Author: David J. Bradshaw - dave@bradshaw.net\r\n *\r\n */\r\n \r\n// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names\r\n;(function(undefined) {\r\n if (typeof window === 'undefined') return // don't run for server side render\r\n\r\n var autoResize = true,\r\n base = 10,\r\n bodyBackground = '',\r\n bodyMargin = 0,\r\n bodyMarginStr = '',\r\n bodyObserver = null,\r\n bodyPadding = '',\r\n calculateWidth = false,\r\n doubleEventList = { resize: 1, click: 1 },\r\n eventCancelTimer = 128,\r\n firstRun = true,\r\n height = 1,\r\n heightCalcModeDefault = 'bodyOffset',\r\n heightCalcMode = heightCalcModeDefault,\r\n initLock = true,\r\n initMsg = '',\r\n inPageLinks = {},\r\n interval = 32,\r\n intervalTimer = null,\r\n logging = false,\r\n msgID = '[iFrameSizer]', // Must match host page msg ID\r\n msgIdLen = msgID.length,\r\n myID = '',\r\n resetRequiredMethods = {\r\n max: 1,\r\n min: 1,\r\n bodyScroll: 1,\r\n documentElementScroll: 1\r\n },\r\n resizeFrom = 'child',\r\n sendPermit = true,\r\n target = window.parent,\r\n targetOriginDefault = '*',\r\n tolerance = 0,\r\n triggerLocked = false,\r\n triggerLockedTimer = null,\r\n throttledTimer = 16,\r\n width = 1,\r\n widthCalcModeDefault = 'scroll',\r\n widthCalcMode = widthCalcModeDefault,\r\n win = window,\r\n onMessage = function() {\r\n warn('onMessage function not defined')\r\n },\r\n onReady = function() {},\r\n onPageInfo = function() {},\r\n customCalcMethods = {\r\n height: function() {\r\n warn('Custom height calculation function not defined')\r\n return document.documentElement.offsetHeight\r\n },\r\n width: function() {\r\n warn('Custom width calculation function not defined')\r\n return document.body.scrollWidth\r\n }\r\n },\r\n eventHandlersByName = {},\r\n passiveSupported = false\r\n\r\n function noop() {}\r\n\r\n try {\r\n var options = Object.create(\r\n {},\r\n {\r\n passive: {\r\n get: function() {\r\n passiveSupported = true\r\n }\r\n }\r\n }\r\n )\r\n window.addEventListener('test', noop, options)\r\n window.removeEventListener('test', noop, options)\r\n } catch (error) {\r\n /* */\r\n }\r\n\r\n function addEventListener(el, evt, func, options) {\r\n el.addEventListener(evt, func, passiveSupported ? options || {} : false)\r\n }\r\n\r\n function removeEventListener(el, evt, func) {\r\n el.removeEventListener(evt, func, false)\r\n }\r\n\r\n function capitalizeFirstLetter(string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1)\r\n }\r\n\r\n // Based on underscore.js\r\n function throttle(func) {\r\n var context,\r\n args,\r\n result,\r\n timeout = null,\r\n previous = 0,\r\n later = function() {\r\n previous = getNow()\r\n timeout = null\r\n result = func.apply(context, args)\r\n if (!timeout) {\r\n // eslint-disable-next-line no-multi-assign\r\n context = args = null\r\n }\r\n }\r\n\r\n return function() {\r\n var now = getNow()\r\n\r\n if (!previous) {\r\n previous = now\r\n }\r\n\r\n var remaining = throttledTimer - (now - previous)\r\n\r\n context = this\r\n args = arguments\r\n\r\n if (remaining <= 0 || remaining > throttledTimer) {\r\n if (timeout) {\r\n clearTimeout(timeout)\r\n timeout = null\r\n }\r\n\r\n previous = now\r\n result = func.apply(context, args)\r\n\r\n if (!timeout) {\r\n // eslint-disable-next-line no-multi-assign\r\n context = args = null\r\n }\r\n } else if (!timeout) {\r\n timeout = setTimeout(later, remaining)\r\n }\r\n\r\n return result\r\n }\r\n }\r\n\r\n var getNow =\r\n Date.now ||\r\n function() {\r\n /* istanbul ignore next */ // Not testable in PhantonJS\r\n return new Date().getTime()\r\n }\r\n\r\n function formatLogMsg(msg) {\r\n return msgID + '[' + myID + '] ' + msg\r\n }\r\n\r\n function log(msg) {\r\n if (logging && 'object' === typeof window.console) {\r\n // eslint-disable-next-line no-console\r\n console.log(formatLogMsg(msg))\r\n }\r\n }\r\n\r\n function warn(msg) {\r\n if ('object' === typeof window.console) {\r\n // eslint-disable-next-line no-console\r\n console.warn(formatLogMsg(msg))\r\n }\r\n }\r\n\r\n function init() {\r\n readDataFromParent()\r\n log('Initialising iFrame (' + location.href + ')')\r\n readDataFromPage()\r\n setMargin()\r\n setBodyStyle('background', bodyBackground)\r\n setBodyStyle('padding', bodyPadding)\r\n injectClearFixIntoBodyElement()\r\n checkHeightMode()\r\n checkWidthMode()\r\n stopInfiniteResizingOfIFrame()\r\n setupPublicMethods()\r\n startEventListeners()\r\n inPageLinks = setupInPageLinks()\r\n sendSize('init', 'Init message from host page')\r\n onReady()\r\n }\r\n\r\n function readDataFromParent() {\r\n function strBool(str) {\r\n return 'true' === str\r\n }\r\n\r\n var data = initMsg.substr(msgIdLen).split(':')\r\n\r\n myID = data[0]\r\n bodyMargin = undefined !== data[1] ? Number(data[1]) : bodyMargin // For V1 compatibility\r\n calculateWidth = undefined !== data[2] ? strBool(data[2]) : calculateWidth\r\n logging = undefined !== data[3] ? strBool(data[3]) : logging\r\n interval = undefined !== data[4] ? Number(data[4]) : interval\r\n autoResize = undefined !== data[6] ? strBool(data[6]) : autoResize\r\n bodyMarginStr = data[7]\r\n heightCalcMode = undefined !== data[8] ? data[8] : heightCalcMode\r\n bodyBackground = data[9]\r\n bodyPadding = data[10]\r\n tolerance = undefined !== data[11] ? Number(data[11]) : tolerance\r\n inPageLinks.enable = undefined !== data[12] ? strBool(data[12]) : false\r\n resizeFrom = undefined !== data[13] ? data[13] : resizeFrom\r\n widthCalcMode = undefined !== data[14] ? data[14] : widthCalcMode\r\n }\r\n\r\n function depricate(key) {\r\n var splitName = key.split('Callback')\r\n\r\n if (splitName.length === 2) {\r\n var name =\r\n 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1)\r\n this[name] = this[key]\r\n delete this[key]\r\n warn(\r\n \"Deprecated: '\" +\r\n key +\r\n \"' has been renamed '\" +\r\n name +\r\n \"'. The old method will be removed in the next major version.\"\r\n )\r\n }\r\n }\r\n\r\n function readDataFromPage() {\r\n function readData() {\r\n var data = window.iFrameResizer\r\n\r\n log('Reading data from page: ' + JSON.stringify(data))\r\n Object.keys(data).forEach(depricate, data)\r\n\r\n onMessage = 'onMessage' in data ? data.onMessage : onMessage\r\n onReady = 'onReady' in data ? data.onReady : onReady\r\n targetOriginDefault =\r\n 'targetOrigin' in data ? data.targetOrigin : targetOriginDefault\r\n heightCalcMode =\r\n 'heightCalculationMethod' in data\r\n ? data.heightCalculationMethod\r\n : heightCalcMode\r\n widthCalcMode =\r\n 'widthCalculationMethod' in data\r\n ? data.widthCalculationMethod\r\n : widthCalcMode\r\n }\r\n\r\n function setupCustomCalcMethods(calcMode, calcFunc) {\r\n if ('function' === typeof calcMode) {\r\n log('Setup custom ' + calcFunc + 'CalcMethod')\r\n customCalcMethods[calcFunc] = calcMode\r\n calcMode = 'custom'\r\n }\r\n\r\n return calcMode\r\n }\r\n\r\n if (\r\n 'iFrameResizer' in window &&\r\n Object === window.iFrameResizer.constructor\r\n ) {\r\n readData()\r\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\r\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\r\n }\r\n\r\n log('TargetOrigin for parent set to: ' + targetOriginDefault)\r\n }\r\n\r\n function chkCSS(attr, value) {\r\n if (-1 !== value.indexOf('-')) {\r\n warn('Negative CSS value ignored for ' + attr)\r\n value = ''\r\n }\r\n return value\r\n }\r\n\r\n function setBodyStyle(attr, value) {\r\n if (undefined !== value && '' !== value && 'null' !== value) {\r\n document.body.style[attr] = value\r\n log('Body ' + attr + ' set to \"' + value + '\"')\r\n }\r\n }\r\n\r\n function setMargin() {\r\n // If called via V1 script, convert bodyMargin from int to str\r\n if (undefined === bodyMarginStr) {\r\n bodyMarginStr = bodyMargin + 'px'\r\n }\r\n\r\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\r\n }\r\n\r\n function stopInfiniteResizingOfIFrame() {\r\n document.documentElement.style.height = ''\r\n document.body.style.height = ''\r\n log('HTML & body height set to \"auto\"')\r\n }\r\n\r\n function manageTriggerEvent(options) {\r\n var listener = {\r\n add: function(eventName) {\r\n function handleEvent() {\r\n sendSize(options.eventName, options.eventType)\r\n }\r\n\r\n eventHandlersByName[eventName] = handleEvent\r\n\r\n addEventListener(window, eventName, handleEvent, { passive: true })\r\n },\r\n remove: function(eventName) {\r\n var handleEvent = eventHandlersByName[eventName]\r\n delete eventHandlersByName[eventName]\r\n\r\n removeEventListener(window, eventName, handleEvent)\r\n }\r\n }\r\n\r\n if (options.eventNames && Array.prototype.map) {\r\n options.eventName = options.eventNames[0]\r\n options.eventNames.map(listener[options.method])\r\n } else {\r\n listener[options.method](options.eventName)\r\n }\r\n\r\n log(\r\n capitalizeFirstLetter(options.method) +\r\n ' event listener: ' +\r\n options.eventType\r\n )\r\n }\r\n\r\n function manageEventListeners(method) {\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Animation Start',\r\n eventNames: ['animationstart', 'webkitAnimationStart']\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Animation Iteration',\r\n eventNames: ['animationiteration', 'webkitAnimationIteration']\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Animation End',\r\n eventNames: ['animationend', 'webkitAnimationEnd']\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Input',\r\n eventName: 'input'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Mouse Up',\r\n eventName: 'mouseup'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Mouse Down',\r\n eventName: 'mousedown'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Orientation Change',\r\n eventName: 'orientationchange'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Print',\r\n eventName: ['afterprint', 'beforeprint']\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Ready State Change',\r\n eventName: 'readystatechange'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Touch Start',\r\n eventName: 'touchstart'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Touch End',\r\n eventName: 'touchend'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Touch Cancel',\r\n eventName: 'touchcancel'\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Transition Start',\r\n eventNames: [\r\n 'transitionstart',\r\n 'webkitTransitionStart',\r\n 'MSTransitionStart',\r\n 'oTransitionStart',\r\n 'otransitionstart'\r\n ]\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Transition Iteration',\r\n eventNames: [\r\n 'transitioniteration',\r\n 'webkitTransitionIteration',\r\n 'MSTransitionIteration',\r\n 'oTransitionIteration',\r\n 'otransitioniteration'\r\n ]\r\n })\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'Transition End',\r\n eventNames: [\r\n 'transitionend',\r\n 'webkitTransitionEnd',\r\n 'MSTransitionEnd',\r\n 'oTransitionEnd',\r\n 'otransitionend'\r\n ]\r\n })\r\n if ('child' === resizeFrom) {\r\n manageTriggerEvent({\r\n method: method,\r\n eventType: 'IFrame Resized',\r\n eventName: 'resize'\r\n })\r\n }\r\n }\r\n\r\n function checkCalcMode(calcMode, calcModeDefault, modes, type) {\r\n if (calcModeDefault !== calcMode) {\r\n if (!(calcMode in modes)) {\r\n warn(\r\n calcMode + ' is not a valid option for ' + type + 'CalculationMethod.'\r\n )\r\n calcMode = calcModeDefault\r\n }\r\n log(type + ' calculation method set to \"' + calcMode + '\"')\r\n }\r\n\r\n return calcMode\r\n }\r\n\r\n function checkHeightMode() {\r\n heightCalcMode = checkCalcMode(\r\n heightCalcMode,\r\n heightCalcModeDefault,\r\n getHeight,\r\n 'height'\r\n )\r\n }\r\n\r\n function checkWidthMode() {\r\n widthCalcMode = checkCalcMode(\r\n widthCalcMode,\r\n widthCalcModeDefault,\r\n getWidth,\r\n 'width'\r\n )\r\n }\r\n\r\n function startEventListeners() {\r\n if (true === autoResize) {\r\n manageEventListeners('add')\r\n setupMutationObserver()\r\n } else {\r\n log('Auto Resize disabled')\r\n }\r\n }\r\n\r\n // function stopMsgsToParent() {\r\n // log('Disable outgoing messages')\r\n // sendPermit = false\r\n // }\r\n\r\n // function removeMsgListener() {\r\n // log('Remove event listener: Message')\r\n // removeEventListener(window, 'message', receiver)\r\n // }\r\n\r\n function disconnectMutationObserver() {\r\n if (null !== bodyObserver) {\r\n /* istanbul ignore next */ // Not testable in PhantonJS\r\n bodyObserver.disconnect()\r\n }\r\n }\r\n\r\n function stopEventListeners() {\r\n manageEventListeners('remove')\r\n disconnectMutationObserver()\r\n clearInterval(intervalTimer)\r\n }\r\n\r\n // function teardown() {\r\n // stopMsgsToParent()\r\n // removeMsgListener()\r\n // if (true === autoResize) stopEventListeners()\r\n // }\r\n\r\n function injectClearFixIntoBodyElement() {\r\n var clearFix = document.createElement('div')\r\n clearFix.style.clear = 'both'\r\n // Guard against the following having been globally redefined in CSS.\r\n clearFix.style.display = 'block'\r\n clearFix.style.height = '0'\r\n document.body.appendChild(clearFix)\r\n }\r\n\r\n function setupInPageLinks() {\r\n function getPagePosition() {\r\n return {\r\n x:\r\n window.pageXOffset !== undefined\r\n ? window.pageXOffset\r\n : document.documentElement.scrollLeft,\r\n y:\r\n window.pageYOffset !== undefined\r\n ? window.pageYOffset\r\n : document.documentElement.scrollTop\r\n }\r\n }\r\n\r\n function getElementPosition(el) {\r\n var elPosition = el.getBoundingClientRect(),\r\n pagePosition = getPagePosition()\r\n\r\n return {\r\n x: parseInt(elPosition.left, 10) + parseInt(pagePosition.x, 10),\r\n y: parseInt(elPosition.top, 10) + parseInt(pagePosition.y, 10)\r\n }\r\n }\r\n\r\n function findTarget(location) {\r\n function jumpToTarget(target) {\r\n var jumpPosition = getElementPosition(target)\r\n\r\n log(\r\n 'Moving to in page link (#' +\r\n hash +\r\n ') at x: ' +\r\n jumpPosition.x +\r\n ' y: ' +\r\n jumpPosition.y\r\n )\r\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\r\n }\r\n\r\n var hash = location.split('#')[1] || location, // Remove # if present\r\n hashData = decodeURIComponent(hash),\r\n target =\r\n document.getElementById(hashData) ||\r\n document.getElementsByName(hashData)[0]\r\n\r\n if (undefined !== target) {\r\n jumpToTarget(target)\r\n } else {\r\n log(\r\n 'In page link (#' +\r\n hash +\r\n ') not found in iFrame, so sending to parent'\r\n )\r\n sendMsg(0, 0, 'inPageLink', '#' + hash)\r\n }\r\n }\r\n\r\n function checkLocationHash() {\r\n if ('' !== location.hash && '#' !== location.hash) {\r\n findTarget(location.href)\r\n }\r\n }\r\n\r\n function bindAnchors() {\r\n function setupLink(el) {\r\n function linkClicked(e) {\r\n e.preventDefault()\r\n\r\n /* jshint validthis:true */\r\n findTarget(this.getAttribute('href'))\r\n }\r\n\r\n if ('#' !== el.getAttribute('href')) {\r\n addEventListener(el, 'click', linkClicked)\r\n }\r\n }\r\n\r\n Array.prototype.forEach.call(\r\n document.querySelectorAll('a[href^=\"#\"]'),\r\n setupLink\r\n )\r\n }\r\n\r\n function bindLocationHash() {\r\n addEventListener(window, 'hashchange', checkLocationHash)\r\n }\r\n\r\n function initCheck() {\r\n // Check if page loaded with location hash after init resize\r\n setTimeout(checkLocationHash, eventCancelTimer)\r\n }\r\n\r\n function enableInPageLinks() {\r\n /* istanbul ignore else */ // Not testable in phantonJS\r\n if (Array.prototype.forEach && document.querySelectorAll) {\r\n log('Setting up location.hash handlers')\r\n bindAnchors()\r\n bindLocationHash()\r\n initCheck()\r\n } else {\r\n warn(\r\n 'In page linking not fully supported in this browser! (See README.md for IE8 workaround)'\r\n )\r\n }\r\n }\r\n\r\n if (inPageLinks.enable) {\r\n enableInPageLinks()\r\n } else {\r\n log('In page linking not enabled')\r\n }\r\n\r\n return {\r\n findTarget: findTarget\r\n }\r\n }\r\n\r\n function setupPublicMethods() {\r\n log('Enable public methods')\r\n\r\n win.parentIFrame = {\r\n autoResize: function autoResizeF(resize) {\r\n if (true === resize && false === autoResize) {\r\n autoResize = true\r\n startEventListeners()\r\n } else if (false === resize && true === autoResize) {\r\n autoResize = false\r\n stopEventListeners()\r\n }\r\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\r\n return autoResize\r\n },\r\n\r\n close: function closeF() {\r\n sendMsg(0, 0, 'close')\r\n // teardown()\r\n },\r\n\r\n getId: function getIdF() {\r\n return myID\r\n },\r\n\r\n getPageInfo: function getPageInfoF(callback) {\r\n if ('function' === typeof callback) {\r\n onPageInfo = callback\r\n sendMsg(0, 0, 'pageInfo')\r\n } else {\r\n onPageInfo = function() {}\r\n sendMsg(0, 0, 'pageInfoStop')\r\n }\r\n },\r\n\r\n moveToAnchor: function moveToAnchorF(hash) {\r\n inPageLinks.findTarget(hash)\r\n },\r\n\r\n reset: function resetF() {\r\n resetIFrame('parentIFrame.reset')\r\n },\r\n\r\n scrollTo: function scrollToF(x, y) {\r\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\r\n },\r\n\r\n scrollToOffset: function scrollToF(x, y) {\r\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\r\n },\r\n\r\n sendMessage: function sendMessageF(msg, targetOrigin) {\r\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\r\n },\r\n\r\n setHeightCalculationMethod: function setHeightCalculationMethodF(\r\n heightCalculationMethod\r\n ) {\r\n heightCalcMode = heightCalculationMethod\r\n checkHeightMode()\r\n },\r\n\r\n setWidthCalculationMethod: function setWidthCalculationMethodF(\r\n widthCalculationMethod\r\n ) {\r\n widthCalcMode = widthCalculationMethod\r\n checkWidthMode()\r\n },\r\n\r\n setTargetOrigin: function setTargetOriginF(targetOrigin) {\r\n log('Set targetOrigin: ' + targetOrigin)\r\n targetOriginDefault = targetOrigin\r\n },\r\n\r\n size: function sizeF(customHeight, customWidth) {\r\n var valString =\r\n '' + (customHeight || '') + (customWidth ? ',' + customWidth : '')\r\n sendSize(\r\n 'size',\r\n 'parentIFrame.size(' + valString + ')',\r\n customHeight,\r\n customWidth\r\n )\r\n }\r\n }\r\n }\r\n\r\n function initInterval() {\r\n if (0 !== interval) {\r\n log('setInterval: ' + interval + 'ms')\r\n intervalTimer = setInterval(function() {\r\n sendSize('interval', 'setInterval: ' + interval)\r\n }, Math.abs(interval))\r\n }\r\n }\r\n\r\n // Not testable in PhantomJS\r\n /* istanbul ignore next */\r\n function setupBodyMutationObserver() {\r\n function addImageLoadListners(mutation) {\r\n function addImageLoadListener(element) {\r\n if (false === element.complete) {\r\n log('Attach listeners to ' + element.src)\r\n element.addEventListener('load', imageLoaded, false)\r\n element.addEventListener('error', imageError, false)\r\n elements.push(element)\r\n }\r\n }\r\n\r\n if (mutation.type === 'attributes' && mutation.attributeName === 'src') {\r\n addImageLoadListener(mutation.target)\r\n } else if (mutation.type === 'childList') {\r\n Array.prototype.forEach.call(\r\n mutation.target.querySelectorAll('img'),\r\n addImageLoadListener\r\n )\r\n }\r\n }\r\n\r\n function removeFromArray(element) {\r\n elements.splice(elements.indexOf(element), 1)\r\n }\r\n\r\n function removeImageLoadListener(element) {\r\n log('Remove listeners from ' + element.src)\r\n element.removeEventListener('load', imageLoaded, false)\r\n element.removeEventListener('error', imageError, false)\r\n removeFromArray(element)\r\n }\r\n\r\n function imageEventTriggered(event, type, typeDesc) {\r\n removeImageLoadListener(event.target)\r\n sendSize(type, typeDesc + ': ' + event.target.src, undefined, undefined)\r\n }\r\n\r\n function imageLoaded(event) {\r\n imageEventTriggered(event, 'imageLoad', 'Image loaded')\r\n }\r\n\r\n function imageError(event) {\r\n imageEventTriggered(event, 'imageLoadFailed', 'Image load failed')\r\n }\r\n\r\n function mutationObserved(mutations) {\r\n sendSize(\r\n 'mutationObserver',\r\n 'mutationObserver: ' + mutations[0].target + ' ' + mutations[0].type\r\n )\r\n\r\n // Deal with WebKit / Blink asyncing image loading when tags are injected into the page\r\n mutations.forEach(addImageLoadListners)\r\n }\r\n\r\n function createMutationObserver() {\r\n var target = document.querySelector('body'),\r\n config = {\r\n attributes: true,\r\n attributeOldValue: false,\r\n characterData: true,\r\n characterDataOldValue: false,\r\n childList: true,\r\n subtree: true\r\n }\r\n\r\n observer = new MutationObserver(mutationObserved)\r\n\r\n log('Create body MutationObserver')\r\n observer.observe(target, config)\r\n\r\n return observer\r\n }\r\n\r\n var elements = [],\r\n MutationObserver =\r\n window.MutationObserver || window.WebKitMutationObserver,\r\n observer = createMutationObserver()\r\n\r\n return {\r\n disconnect: function() {\r\n if ('disconnect' in observer) {\r\n log('Disconnect body MutationObserver')\r\n observer.disconnect()\r\n elements.forEach(removeImageLoadListener)\r\n }\r\n }\r\n }\r\n }\r\n\r\n function setupMutationObserver() {\r\n var forceIntervalTimer = 0 > interval\r\n\r\n // Not testable in PhantomJS\r\n /* istanbul ignore if */ if (\r\n window.MutationObserver ||\r\n window.WebKitMutationObserver\r\n ) {\r\n if (forceIntervalTimer) {\r\n initInterval()\r\n } else {\r\n bodyObserver = setupBodyMutationObserver()\r\n }\r\n } else {\r\n log('MutationObserver not supported in this browser!')\r\n initInterval()\r\n }\r\n }\r\n\r\n // document.documentElement.offsetHeight is not reliable, so\r\n // we have to jump through hoops to get a better value.\r\n function getComputedStyle(prop, el) {\r\n var retVal = 0\r\n el = el || document.body // Not testable in phantonJS\r\n\r\n retVal = document.defaultView.getComputedStyle(el, null)\r\n retVal = null !== retVal ? retVal[prop] : 0\r\n\r\n return parseInt(retVal, base)\r\n }\r\n\r\n function chkEventThottle(timer) {\r\n if (timer > throttledTimer / 2) {\r\n throttledTimer = 2 * timer\r\n log('Event throttle increased to ' + throttledTimer + 'ms')\r\n }\r\n }\r\n\r\n // Idea from https://github.com/guardian/iframe-messenger\r\n function getMaxElement(side, elements) {\r\n var elementsLength = elements.length,\r\n elVal = 0,\r\n maxVal = 0,\r\n Side = capitalizeFirstLetter(side),\r\n timer = getNow()\r\n\r\n for (var i = 0; i < elementsLength; i++) {\r\n elVal =\r\n elements[i].getBoundingClientRect()[side] +\r\n getComputedStyle('margin' + Side, elements[i])\r\n if (elVal > maxVal) {\r\n maxVal = elVal\r\n }\r\n }\r\n\r\n timer = getNow() - timer\r\n\r\n log('Parsed ' + elementsLength + ' HTML elements')\r\n log('Element position calculated in ' + timer + 'ms')\r\n\r\n chkEventThottle(timer)\r\n\r\n return maxVal\r\n }\r\n\r\n function getAllMeasurements(dimention) {\r\n return [\r\n dimention.bodyOffset(),\r\n dimention.bodyScroll(),\r\n dimention.documentElementOffset(),\r\n dimention.documentElementScroll()\r\n ]\r\n }\r\n\r\n function getTaggedElements(side, tag) {\r\n function noTaggedElementsFound() {\r\n warn('No tagged elements (' + tag + ') found on page')\r\n return document.querySelectorAll('body *')\r\n }\r\n\r\n var elements = document.querySelectorAll('[' + tag + ']')\r\n\r\n if (0 === elements.length) noTaggedElementsFound()\r\n\r\n return getMaxElement(side, elements)\r\n }\r\n\r\n function getAllElements() {\r\n return document.querySelectorAll('body *')\r\n }\r\n\r\n var getHeight = {\r\n bodyOffset: function getBodyOffsetHeight() {\r\n return (\r\n document.body.offsetHeight +\r\n getComputedStyle('marginTop') +\r\n getComputedStyle('marginBottom')\r\n )\r\n },\r\n\r\n offset: function() {\r\n return getHeight.bodyOffset() // Backwards compatability\r\n },\r\n\r\n bodyScroll: function getBodyScrollHeight() {\r\n return document.body.scrollHeight\r\n },\r\n\r\n custom: function getCustomWidth() {\r\n return customCalcMethods.height()\r\n },\r\n\r\n documentElementOffset: function getDEOffsetHeight() {\r\n return document.documentElement.offsetHeight\r\n },\r\n\r\n documentElementScroll: function getDEScrollHeight() {\r\n return document.documentElement.scrollHeight\r\n },\r\n\r\n max: function getMaxHeight() {\r\n return Math.max.apply(null, getAllMeasurements(getHeight))\r\n },\r\n\r\n min: function getMinHeight() {\r\n return Math.min.apply(null, getAllMeasurements(getHeight))\r\n },\r\n\r\n grow: function growHeight() {\r\n return getHeight.max() // Run max without the forced downsizing\r\n },\r\n\r\n lowestElement: function getBestHeight() {\r\n return Math.max(\r\n getHeight.bodyOffset() || getHeight.documentElementOffset(),\r\n getMaxElement('bottom', getAllElements())\r\n )\r\n },\r\n\r\n taggedElement: function getTaggedElementsHeight() {\r\n return getTaggedElements('bottom', 'data-iframe-height')\r\n }\r\n },\r\n getWidth = {\r\n bodyScroll: function getBodyScrollWidth() {\r\n return document.body.scrollWidth\r\n },\r\n\r\n bodyOffset: function getBodyOffsetWidth() {\r\n return document.body.offsetWidth\r\n },\r\n\r\n custom: function getCustomWidth() {\r\n return customCalcMethods.width()\r\n },\r\n\r\n documentElementScroll: function getDEScrollWidth() {\r\n return document.documentElement.scrollWidth\r\n },\r\n\r\n documentElementOffset: function getDEOffsetWidth() {\r\n return document.documentElement.offsetWidth\r\n },\r\n\r\n scroll: function getMaxWidth() {\r\n return Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll())\r\n },\r\n\r\n max: function getMaxWidth() {\r\n return Math.max.apply(null, getAllMeasurements(getWidth))\r\n },\r\n\r\n min: function getMinWidth() {\r\n return Math.min.apply(null, getAllMeasurements(getWidth))\r\n },\r\n\r\n rightMostElement: function rightMostElement() {\r\n return getMaxElement('right', getAllElements())\r\n },\r\n\r\n taggedElement: function getTaggedElementsWidth() {\r\n return getTaggedElements('right', 'data-iframe-width')\r\n }\r\n }\r\n\r\n function sizeIFrame(\r\n triggerEvent,\r\n triggerEventDesc,\r\n customHeight,\r\n customWidth\r\n ) {\r\n function resizeIFrame() {\r\n height = currentHeight\r\n width = currentWidth\r\n\r\n sendMsg(height, width, triggerEvent)\r\n }\r\n\r\n function isSizeChangeDetected() {\r\n function checkTolarance(a, b) {\r\n var retVal = Math.abs(a - b) <= tolerance\r\n return !retVal\r\n }\r\n\r\n currentHeight =\r\n undefined !== customHeight ? customHeight : getHeight[heightCalcMode]()\r\n currentWidth =\r\n undefined !== customWidth ? customWidth : getWidth[widthCalcMode]()\r\n\r\n return (\r\n checkTolarance(height, currentHeight) ||\r\n (calculateWidth && checkTolarance(width, currentWidth))\r\n )\r\n }\r\n\r\n function isForceResizableEvent() {\r\n return !(triggerEvent in { init: 1, interval: 1, size: 1 })\r\n }\r\n\r\n function isForceResizableCalcMode() {\r\n return (\r\n heightCalcMode in resetRequiredMethods ||\r\n (calculateWidth && widthCalcMode in resetRequiredMethods)\r\n )\r\n }\r\n\r\n function logIgnored() {\r\n log('No change in size detected')\r\n }\r\n\r\n function checkDownSizing() {\r\n if (isForceResizableEvent() && isForceResizableCalcMode()) {\r\n resetIFrame(triggerEventDesc)\r\n } else if (!(triggerEvent in { interval: 1 })) {\r\n logIgnored()\r\n }\r\n }\r\n\r\n var currentHeight, currentWidth\r\n\r\n if (isSizeChangeDetected() || 'init' === triggerEvent) {\r\n lockTrigger()\r\n resizeIFrame()\r\n } else {\r\n checkDownSizing()\r\n }\r\n }\r\n\r\n var sizeIFrameThrottled = throttle(sizeIFrame)\r\n\r\n function sendSize(triggerEvent, triggerEventDesc, customHeight, customWidth) {\r\n function recordTrigger() {\r\n if (!(triggerEvent in { reset: 1, resetPage: 1, init: 1 })) {\r\n log('Trigger event: ' + triggerEventDesc)\r\n }\r\n }\r\n\r\n function isDoubleFiredEvent() {\r\n return triggerLocked && triggerEvent in doubleEventList\r\n }\r\n\r\n if (!isDoubleFiredEvent()) {\r\n recordTrigger()\r\n if (triggerEvent === 'init') {\r\n sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth)\r\n } else {\r\n sizeIFrameThrottled(\r\n triggerEvent,\r\n triggerEventDesc,\r\n customHeight,\r\n customWidth\r\n )\r\n }\r\n } else {\r\n log('Trigger event cancelled: ' + triggerEvent)\r\n }\r\n }\r\n\r\n function lockTrigger() {\r\n if (!triggerLocked) {\r\n triggerLocked = true\r\n log('Trigger event lock on')\r\n }\r\n clearTimeout(triggerLockedTimer)\r\n triggerLockedTimer = setTimeout(function() {\r\n triggerLocked = false\r\n log('Trigger event lock off')\r\n log('--')\r\n }, eventCancelTimer)\r\n }\r\n\r\n function triggerReset(triggerEvent) {\r\n height = getHeight[heightCalcMode]()\r\n width = getWidth[widthCalcMode]()\r\n\r\n sendMsg(height, width, triggerEvent)\r\n }\r\n\r\n function resetIFrame(triggerEventDesc) {\r\n var hcm = heightCalcMode\r\n heightCalcMode = heightCalcModeDefault\r\n\r\n log('Reset trigger event: ' + triggerEventDesc)\r\n lockTrigger()\r\n triggerReset('reset')\r\n\r\n heightCalcMode = hcm\r\n }\r\n\r\n function sendMsg(height, width, triggerEvent, msg, targetOrigin) {\r\n function setTargetOrigin() {\r\n if (undefined === targetOrigin) {\r\n targetOrigin = targetOriginDefault\r\n } else {\r\n log('Message targetOrigin: ' + targetOrigin)\r\n }\r\n }\r\n\r\n function sendToParent() {\r\n var size = height + ':' + width,\r\n message =\r\n myID +\r\n ':' +\r\n size +\r\n ':' +\r\n triggerEvent +\r\n (undefined !== msg ? ':' + msg : '')\r\n\r\n log('Sending message to host page (' + message + ')')\r\n target.postMessage(msgID + message, targetOrigin)\r\n }\r\n\r\n if (true === sendPermit) {\r\n setTargetOrigin()\r\n sendToParent()\r\n }\r\n }\r\n\r\n function receiver(event) {\r\n var processRequestFromParent = {\r\n init: function initFromParent() {\r\n initMsg = event.data\r\n target = event.source\r\n\r\n init()\r\n firstRun = false\r\n setTimeout(function() {\r\n initLock = false\r\n }, eventCancelTimer)\r\n },\r\n\r\n reset: function resetFromParent() {\r\n if (!initLock) {\r\n log('Page size reset by host page')\r\n triggerReset('resetPage')\r\n } else {\r\n log('Page reset ignored by init')\r\n }\r\n },\r\n\r\n resize: function resizeFromParent() {\r\n sendSize('resizeParent', 'Parent window requested size check')\r\n },\r\n\r\n moveToAnchor: function moveToAnchorF() {\r\n inPageLinks.findTarget(getData())\r\n },\r\n inPageLink: function inPageLinkF() {\r\n this.moveToAnchor()\r\n }, // Backward compatability\r\n\r\n pageInfo: function pageInfoFromParent() {\r\n var msgBody = getData()\r\n log('PageInfoFromParent called from parent: ' + msgBody)\r\n onPageInfo(JSON.parse(msgBody))\r\n log(' --')\r\n },\r\n\r\n message: function messageFromParent() {\r\n var msgBody = getData()\r\n\r\n log('onMessage called from parent: ' + msgBody)\r\n // eslint-disable-next-line sonarjs/no-extra-arguments\r\n onMessage(JSON.parse(msgBody))\r\n log(' --')\r\n }\r\n }\r\n\r\n function isMessageForUs() {\r\n return msgID === ('' + event.data).substr(0, msgIdLen) // ''+ Protects against non-string messages\r\n }\r\n\r\n function getMessageType() {\r\n return event.data.split(']')[1].split(':')[0]\r\n }\r\n\r\n function getData() {\r\n return event.data.substr(event.data.indexOf(':') + 1)\r\n }\r\n\r\n function isMiddleTier() {\r\n return (\r\n (!(typeof module !== 'undefined' && module.exports) &&\r\n 'iFrameResize' in window) ||\r\n ('jQuery' in window && 'iFrameResize' in window.jQuery.prototype)\r\n )\r\n }\r\n\r\n function isInitMsg() {\r\n // Test if this message is from a child below us. This is an ugly test, however, updating\r\n // the message format would break backwards compatibity.\r\n return event.data.split(':')[2] in { true: 1, false: 1 }\r\n }\r\n\r\n function callFromParent() {\r\n var messageType = getMessageType()\r\n\r\n if (messageType in processRequestFromParent) {\r\n processRequestFromParent[messageType]()\r\n } else if (!isMiddleTier() && !isInitMsg()) {\r\n warn('Unexpected message (' + event.data + ')')\r\n }\r\n }\r\n\r\n function processMessage() {\r\n if (false === firstRun) {\r\n callFromParent()\r\n } else if (isInitMsg()) {\r\n processRequestFromParent.init()\r\n } else {\r\n log(\r\n 'Ignored message of type \"' +\r\n getMessageType() +\r\n '\". Received before initialization.'\r\n )\r\n }\r\n }\r\n\r\n if (isMessageForUs()) {\r\n processMessage()\r\n }\r\n }\r\n\r\n // Normally the parent kicks things off when it detects the iFrame has loaded.\r\n // If this script is async-loaded, then tell parent page to retry init.\r\n function chkLateLoaded() {\r\n if ('loading' !== document.readyState) {\r\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\r\n }\r\n }\r\n\r\n addEventListener(window, 'message', receiver)\r\n addEventListener(window, 'readystatechange', chkLateLoaded)\r\n chkLateLoaded()\r\n\r\n \r\n})()\r\n"],"file":"../../../libs/iframeResizer/iframeResizer.contentWindow.js"}