{"version":3,"sources":["libs/iframeResizer/iframeResizer.js"],"names":["undefined","window","count","logEnabled","hiddenCheckEnabled","msgHeader","msgHeaderLen","length","msgId","msgIdLen","pagePosition","requestAnimationFrame","resetRequiredMethods","max","scroll","bodyScroll","documentElementScroll","settings","timer","defaults","autoResize","bodyBackground","bodyMargin","bodyMarginV1","bodyPadding","checkOrigin","inPageLinks","enablePublicMethods","heightCalculationMethod","id","interval","log","maxHeight","Infinity","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClose","onClosed","onInit","onMessage","warn","onResized","onScroll","getMutationObserver","MutationObserver","WebKitMutationObserver","MozMutationObserver","addEventListener","el","evt","func","removeEventListener","setupRequestAnimationFrame","vendors","x","bind","getMyID","iframeId","retStr","top","self","parentIFrame","getId","formatLogHeader","isLogEnabled","msg","output","info","type","enabled","console","iFrameListener","event","resizeIFrame","resize","setSize","messageData","setPagePosition","on","ensureInRange","syncResize","processMsg","data","substr","split","height","parseInt","iframe","compStyle","getComputedStyle","getPaddingEnds","getBorderEnds","width","boxSizing","paddingTop","bot","paddingBottom","borderTopWidth","borderBottomWidth","Dimension","Number","min","dimension","toLowerCase","size","isMessageFromIFrame","checkAllowedOrigin","checkList","i","retCode","origin","checkSingle","remoteHost","constructor","Array","Error","isMessageForUs","isMessageFromMetaParent","true","false","getMsgBody","offset","indexOf","forwardMsgFromIFrame","msgBody","message","JSON","parse","getPageInfo","bodyPosition","document","body","getBoundingClientRect","iFramePosition","stringify","iframeHeight","iframeWidth","clientHeight","Math","documentElement","innerHeight","clientWidth","innerWidth","offsetTop","offsetLeft","left","scrollTop","pageYOffset","scrollLeft","pageXOffset","documentHeight","documentWidth","windowHeight","windowWidth","sendPageInfoToIframe","debouncedTrigger","trigger","debounceFrameEvents","startPageInfoMonitor","setListener","sendPageInfo","stop","forEach","start","stopPageInfo","stopPageInfoMonitor","checkIFrameExists","retBool","getElementPosition","target","getPagePosition","floor","y","scrollRequestFromChild","addOffset","reposition","newPosition","scrollTo","calcOffset","scrollParent","unsetPagePosition","findTarget","location","jumpToTarget","jumpPosition","hash","jumpToParent","moveToAnchor","hashData","decodeURIComponent","getElementById","getElementsByName","funcName","val","chkEvent","actionMsg","firstRun","closeIFrame","resetIFrame","hasSettings","iFrameReadyMsgReceived","createOutgoingMsg","loaded","retVal","TypeError","removeIframeListeners","parentNode","removeChild","error","reset","setDimension","style","chkZero","fixHiddenIFrames","processDimension","doNotSync","jasmine","calleeMsg","noResponseWarning","postMessageToIFrame","targetOrigin","contentWindow","postMessage","iFrameNotFound","chkAndSend","warnOnNoResponse","warning","errorShown","msgTimeout","setTimeout","setupIFrame","options","setLimits","addStyle","chkMinMax","newId","ensureHasId","src","setScrolling","overflow","setupBodyMarginValues","checkReset","resetRequertMethod","setupIFrameObject","iFrameResizer","close","removeListeners","anchor","sendMessage","init","iFrameLoaded","createDestroyObserver","destroyObserver","mutations","mutation","removedNodes","prototype","slice","call","removedNode","observe","childList","checkOptions","copyOptions","option","Object","hasOwnProperty","getTargetOrigin","match","depricate","key","splitName","name","charAt","toUpperCase","processOptions","join","keys","beenHere","debouce","fn","time","frameTimer","frameId","checkIFrames","checkIFrame","settingId","chkDimension","isVisible","offsetParent","mutationObserved","createMutationObserver","querySelector","config","attributes","attributeOldValue","characterData","characterDataOldValue","subtree","observer","resizeIFrames","sendTriggerMsg","tabVisible","visibilityState","eventName","isIFrameResizeEnabled","setupEventListeners","factory","element","chkType","tagName","iFrames","push","warnDeprecatedOptions","iFrameResizeF","querySelectorAll","createJQueryPublicMethod","$","iFrameResize","$iFrameResizeF","index","filter","each","end","jQuery","define","amd","module","exports"],"mappings":";;;;AAAA;;;;;;;;;AAUA;AACA;;AAAC,CAAC,UAASA,SAAT,EAAoB;AACpB,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC,OADf,CACsB;;AAE1C,MAAIC,KAAK,GAAG,CAAZ;AAAA,MACEC,UAAU,GAAG,KADf;AAAA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AM,IAAImC,SAAJ,CAAc,mCAAkCnC,MAAlC,IAA2C,GAAzD,CAAN;AAdJ;;AAiBA,aAAO8I,OAAP;AACD,KAvBD;AAwBD;;AAED,WAASK,wBAAT,CAAkCC,CAAlC,EAAqC;AACnC,QAAI,CAACA,CAAC,CAACrC,EAAP,EAAW;AACTrN,MAAAA,IAAI,CAAC,EAAD,EAAK,mDAAL,CAAJ;AACD,KAFD,MAEO,IAAI,CAAC0P,CAAC,CAACrC,EAAF,CAAKsC,YAAV,EAAwB;AAC7BD,MAAAA,CAAC,CAACrC,EAAF,CAAKsC,YAAL,GAAoB,SAASC,cAAT,CAAwBxF,OAAxB,EAAiC;AACnD,iBAASkB,IAAT,CAAcuE,KAAd,EAAqBZ,OAArB,EAA8B;AAC5B9E,UAAAA,WAAW,CAAC8E,OAAD,EAAU7E,OAAV,CAAX;AACD;;AAED,eAAO,KAAK0F,MAAL,CAAY,QAAZ,EACJC,IADI,CACCzE,IADD,EAEJ0E,GAFI,EAAP;AAGD,OARD;AASD;AACF;;AAED,MAAI1U,MAAM,CAAC2U,MAAX,EAAmB;AACjBR,IAAAA,wBAAwB,CAACnU,MAAM,CAAC2U,MAAR,CAAxB;AACD;;AAED,MAAI,OAAOC,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAA3C,EAAgD;AAC9CD,IAAAA,MAAM,CAAC,EAAD,EAAKlB,OAAL,CAAN;AACD,GAFD,MAEO,IAAI,QAAOoB,MAAP,yCAAOA,MAAP,OAAkB,QAAlB,IAA8B,QAAOA,MAAM,CAACC,OAAd,MAA0B,QAA5D,EAAsE;AAC3E;AACAD,IAAAA,MAAM,CAACC,OAAP,GAAiBrB,OAAO,EAAxB;AACD;;AACD1T,EAAAA,MAAM,CAACqU,YAAP,GAAsBrU,MAAM,CAACqU,YAAP,IAAuBX,OAAO,EAApD;AACD,CA71CA","sourcesContent":["/*\r\n * File: iframeResizer.js\r\n * Desc: Force iframes to size to content.\r\n * Requires: iframeResizer.contentWindow.js to be loaded into the target frame.\r\n * Doc: https://github.com/davidjbradshaw/iframe-resizer\r\n * Author: David J. Bradshaw - dave@bradshaw.net\r\n * Contributor: Jure Mav - jure.mav@gmail.com\r\n * Contributor: Reed Dadoune - reed@dadoune.com\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 count = 0,\r\n logEnabled = false,\r\n hiddenCheckEnabled = false,\r\n msgHeader = 'message',\r\n msgHeaderLen = msgHeader.length,\r\n msgId = '[iFrameSizer]', // Must match iframe msg ID\r\n msgIdLen = msgId.length,\r\n pagePosition = null,\r\n requestAnimationFrame = window.requestAnimationFrame,\r\n resetRequiredMethods = {\r\n max: 1,\r\n scroll: 1,\r\n bodyScroll: 1,\r\n documentElementScroll: 1\r\n },\r\n settings = {},\r\n timer = null,\r\n defaults = {\r\n autoResize: true,\r\n bodyBackground: null,\r\n bodyMargin: null,\r\n bodyMarginV1: 8,\r\n bodyPadding: null,\r\n checkOrigin: true,\r\n inPageLinks: false,\r\n enablePublicMethods: true,\r\n heightCalculationMethod: 'bodyOffset',\r\n id: 'iFrameResizer',\r\n interval: 32,\r\n log: false,\r\n maxHeight: Infinity,\r\n maxWidth: Infinity,\r\n minHeight: 0,\r\n minWidth: 0,\r\n resizeFrom: 'parent',\r\n scrolling: false,\r\n sizeHeight: true,\r\n sizeWidth: false,\r\n warningTimeout: 5000,\r\n tolerance: 0,\r\n widthCalculationMethod: 'scroll',\r\n onClose: function() {\r\n return true\r\n },\r\n onClosed: function() {},\r\n onInit: function() {},\r\n onMessage: function() {\r\n warn('onMessage function not defined')\r\n },\r\n onResized: function() {},\r\n onScroll: function() {\r\n return true\r\n }\r\n }\r\n\r\n function getMutationObserver() {\r\n return (\r\n window.MutationObserver ||\r\n window.WebKitMutationObserver ||\r\n window.MozMutationObserver\r\n )\r\n }\r\n\r\n function addEventListener(el, evt, func) {\r\n el.addEventListener(evt, func, 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 setupRequestAnimationFrame() {\r\n var vendors = ['moz', 'webkit', 'o', 'ms']\r\n var x\r\n\r\n // Remove vendor prefixing if prefixed and break early if not\r\n for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {\r\n requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']\r\n }\r\n\r\n if (!requestAnimationFrame) {\r\n log('setup', 'RequestAnimationFrame not supported')\r\n } else {\r\n // Firefox extension content-scripts have a globalThis object that is not the same as window.\r\n // Binding `requestAnimationFrame` to window allows the function to work and prevents errors\r\n // being thrown when run in that context, and should be a no-op in every other context.\r\n requestAnimationFrame = requestAnimationFrame.bind(window);\r\n }\r\n }\r\n\r\n function getMyID(iframeId) {\r\n var retStr = 'Host page: ' + iframeId\r\n\r\n if (window.top !== window.self) {\r\n if (window.parentIFrame && window.parentIFrame.getId) {\r\n retStr = window.parentIFrame.getId() + ': ' + iframeId\r\n } else {\r\n retStr = 'Nested host page: ' + iframeId\r\n }\r\n }\r\n\r\n return retStr\r\n }\r\n\r\n function formatLogHeader(iframeId) {\r\n return msgId + '[' + getMyID(iframeId) + ']'\r\n }\r\n\r\n function isLogEnabled(iframeId) {\r\n return settings[iframeId] ? settings[iframeId].log : logEnabled\r\n }\r\n\r\n function log(iframeId, msg) {\r\n output('log', iframeId, msg, isLogEnabled(iframeId))\r\n }\r\n\r\n function info(iframeId, msg) {\r\n output('info', iframeId, msg, isLogEnabled(iframeId))\r\n }\r\n\r\n function warn(iframeId, msg) {\r\n output('warn', iframeId, msg, true)\r\n }\r\n\r\n function output(type, iframeId, msg, enabled) {\r\n if (true === enabled && 'object' === typeof window.console) {\r\n // eslint-disable-next-line no-console\r\n console[type](formatLogHeader(iframeId), msg)\r\n }\r\n }\r\n\r\n function iFrameListener(event) {\r\n function resizeIFrame() {\r\n function resize() {\r\n setSize(messageData)\r\n setPagePosition(iframeId)\r\n on('onResized', messageData)\r\n }\r\n\r\n ensureInRange('Height')\r\n ensureInRange('Width')\r\n\r\n syncResize(resize, messageData, 'init')\r\n }\r\n\r\n function processMsg() {\r\n var data = msg.substr(msgIdLen).split(':')\r\n var height = data[1] ? parseInt(data[1], 10) : 0;\r\n var iframe = settings[data[0]] && settings[data[0]].iframe;\r\n var compStyle = getComputedStyle(iframe)\r\n\r\n return {\r\n iframe: iframe,\r\n id: data[0],\r\n height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),\r\n width: data[2],\r\n type: data[3]\r\n }\r\n }\r\n\r\n function getPaddingEnds(compStyle) {\r\n if (compStyle.boxSizing !== 'border-box') {\r\n return 0;\r\n }\r\n var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0\r\n var bot = compStyle.paddingBottom ? parseInt(compStyle.paddingBottom, 10) : 0\r\n return top + bot\r\n }\r\n\r\n function getBorderEnds(compStyle) {\r\n if (compStyle.boxSizing !== 'border-box') {\r\n return 0;\r\n }\r\n var top = compStyle.borderTopWidth ? parseInt(compStyle.borderTopWidth, 10) : 0\r\n var bot = compStyle.borderBottomWidth ? parseInt(compStyle.borderBottomWidth, 10) : 0\r\n return top + bot\r\n }\r\n\r\n function ensureInRange(Dimension) {\r\n var max = Number(settings[iframeId]['max' + Dimension]),\r\n min = Number(settings[iframeId]['min' + Dimension]),\r\n dimension = Dimension.toLowerCase(),\r\n size = Number(messageData[dimension])\r\n\r\n log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max)\r\n\r\n if (size < min) {\r\n size = min\r\n log(iframeId, 'Set ' + dimension + ' to min value')\r\n }\r\n\r\n if (size > max) {\r\n size = max\r\n log(iframeId, 'Set ' + dimension + ' to max value')\r\n }\r\n\r\n messageData[dimension] = '' + size\r\n }\r\n\r\n function isMessageFromIFrame() {\r\n function checkAllowedOrigin() {\r\n function checkList() {\r\n var i = 0,\r\n retCode = false\r\n\r\n log(\r\n iframeId,\r\n 'Checking connection is from allowed list of origins: ' +\r\n checkOrigin\r\n )\r\n\r\n for (; i < checkOrigin.length; i++) {\r\n if (checkOrigin[i] === origin) {\r\n retCode = true\r\n break\r\n }\r\n }\r\n return retCode\r\n }\r\n\r\n function checkSingle() {\r\n var remoteHost = settings[iframeId] && settings[iframeId].remoteHost\r\n log(iframeId, 'Checking connection is from: ' + remoteHost)\r\n return origin === remoteHost\r\n }\r\n\r\n return checkOrigin.constructor === Array ? checkList() : checkSingle()\r\n }\r\n\r\n var origin = event.origin,\r\n checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin\r\n\r\n if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {\r\n throw new Error(\r\n 'Unexpected message received from: ' +\r\n origin +\r\n ' for ' +\r\n messageData.iframe.id +\r\n '. Message was: ' +\r\n event.data +\r\n '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'\r\n )\r\n }\r\n\r\n return true\r\n }\r\n\r\n function isMessageForUs() {\r\n return (\r\n msgId === ('' + msg).substr(0, msgIdLen) &&\r\n msg.substr(msgIdLen).split(':')[0] in settings\r\n ) // ''+Protects against non-string msg\r\n }\r\n\r\n function isMessageFromMetaParent() {\r\n // Test if this message is from a parent above us. This is an ugly test, however, updating\r\n // the message format would break backwards compatibity.\r\n var retCode = messageData.type in { true: 1, false: 1, undefined: 1 }\r\n\r\n if (retCode) {\r\n log(iframeId, 'Ignoring init message from meta parent page')\r\n }\r\n\r\n return retCode\r\n }\r\n\r\n function getMsgBody(offset) {\r\n return msg.substr(msg.indexOf(':') + msgHeaderLen + offset)\r\n }\r\n\r\n function forwardMsgFromIFrame(msgBody) {\r\n log(\r\n iframeId,\r\n 'onMessage passed: {iframe: ' +\r\n messageData.iframe.id +\r\n ', message: ' +\r\n msgBody +\r\n '}'\r\n )\r\n on('onMessage', {\r\n iframe: messageData.iframe,\r\n message: JSON.parse(msgBody)\r\n })\r\n log(iframeId, '--')\r\n }\r\n\r\n function getPageInfo() {\r\n var bodyPosition = document.body.getBoundingClientRect(),\r\n iFramePosition = messageData.iframe.getBoundingClientRect()\r\n\r\n return JSON.stringify({\r\n iframeHeight: iFramePosition.height,\r\n iframeWidth: iFramePosition.width,\r\n clientHeight: Math.max(\r\n document.documentElement.clientHeight,\r\n window.innerHeight || 0\r\n ),\r\n clientWidth: Math.max(\r\n document.documentElement.clientWidth,\r\n window.innerWidth || 0\r\n ),\r\n offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),\r\n offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),\r\n scrollTop: window.pageYOffset,\r\n scrollLeft: window.pageXOffset,\r\n documentHeight: document.documentElement.clientHeight,\r\n documentWidth: document.documentElement.clientWidth,\r\n windowHeight: window.innerHeight,\r\n windowWidth: window.innerWidth\r\n })\r\n }\r\n\r\n function sendPageInfoToIframe(iframe, iframeId) {\r\n function debouncedTrigger() {\r\n trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId)\r\n }\r\n debounceFrameEvents(debouncedTrigger, 32, iframeId)\r\n }\r\n\r\n function startPageInfoMonitor() {\r\n function setListener(type, func) {\r\n function sendPageInfo() {\r\n if (settings[id]) {\r\n sendPageInfoToIframe(settings[id].iframe, id)\r\n } else {\r\n stop()\r\n }\r\n }\r\n\r\n ;['scroll', 'resize'].forEach(function(evt) {\r\n log(id, type + evt + ' listener for sendPageInfo')\r\n func(window, evt, sendPageInfo)\r\n })\r\n }\r\n\r\n function stop() {\r\n setListener('Remove ', removeEventListener)\r\n }\r\n\r\n function start() {\r\n setListener('Add ', addEventListener)\r\n }\r\n\r\n var id = iframeId // Create locally scoped copy of iFrame ID\r\n\r\n start()\r\n\r\n if (settings[id]) {\r\n settings[id].stopPageInfo = stop\r\n }\r\n }\r\n\r\n function stopPageInfoMonitor() {\r\n if (settings[iframeId] && settings[iframeId].stopPageInfo) {\r\n settings[iframeId].stopPageInfo()\r\n delete settings[iframeId].stopPageInfo\r\n }\r\n }\r\n\r\n function checkIFrameExists() {\r\n var retBool = true\r\n\r\n if (null === messageData.iframe) {\r\n warn(iframeId, 'IFrame (' + messageData.id + ') not found')\r\n retBool = false\r\n }\r\n return retBool\r\n }\r\n\r\n function getElementPosition(target) {\r\n var iFramePosition = target.getBoundingClientRect()\r\n\r\n getPagePosition(iframeId)\r\n\r\n return {\r\n x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),\r\n y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))\r\n }\r\n }\r\n\r\n function scrollRequestFromChild(addOffset) {\r\n /* istanbul ignore next */ // Not testable in Karma\r\n function reposition() {\r\n pagePosition = newPosition\r\n scrollTo()\r\n log(iframeId, '--')\r\n }\r\n\r\n function calcOffset() {\r\n return {\r\n x: Number(messageData.width) + offset.x,\r\n y: Number(messageData.height) + offset.y\r\n }\r\n }\r\n\r\n function scrollParent() {\r\n if (window.parentIFrame) {\r\n window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](\r\n newPosition.x,\r\n newPosition.y\r\n )\r\n } else {\r\n warn(\r\n iframeId,\r\n 'Unable to scroll to requested position, window.parentIFrame not found'\r\n )\r\n }\r\n }\r\n\r\n var offset = addOffset\r\n ? getElementPosition(messageData.iframe)\r\n : { x: 0, y: 0 },\r\n newPosition = calcOffset()\r\n\r\n log(\r\n iframeId,\r\n 'Reposition requested from iFrame (offset x:' +\r\n offset.x +\r\n ' y:' +\r\n offset.y +\r\n ')'\r\n )\r\n\r\n if (window.top !== window.self) {\r\n scrollParent()\r\n } else {\r\n reposition()\r\n }\r\n }\r\n\r\n function scrollTo() {\r\n if (false !== on('onScroll', pagePosition)) {\r\n setPagePosition(iframeId)\r\n } else {\r\n unsetPagePosition()\r\n }\r\n }\r\n\r\n function findTarget(location) {\r\n function jumpToTarget() {\r\n var jumpPosition = getElementPosition(target)\r\n\r\n log(\r\n iframeId,\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 pagePosition = {\r\n x: jumpPosition.x,\r\n y: jumpPosition.y\r\n }\r\n\r\n scrollTo()\r\n log(iframeId, '--')\r\n }\r\n\r\n function jumpToParent() {\r\n if (window.parentIFrame) {\r\n window.parentIFrame.moveToAnchor(hash)\r\n } else {\r\n log(\r\n iframeId,\r\n 'In page link #' +\r\n hash +\r\n ' not found and window.parentIFrame not found'\r\n )\r\n }\r\n }\r\n\r\n var hash = location.split('#')[1] || '',\r\n hashData = decodeURIComponent(hash),\r\n target =\r\n document.getElementById(hashData) ||\r\n document.getElementsByName(hashData)[0]\r\n\r\n if (target) {\r\n jumpToTarget()\r\n } else if (window.top !== window.self) {\r\n jumpToParent()\r\n } else {\r\n log(iframeId, 'In page link #' + hash + ' not found')\r\n }\r\n }\r\n\r\n function on(funcName, val) {\r\n return chkEvent(iframeId, funcName, val)\r\n }\r\n\r\n function actionMsg() {\r\n if (settings[iframeId] && settings[iframeId].firstRun) firstRun()\r\n\r\n switch (messageData.type) {\r\n case 'close':\r\n closeIFrame(messageData.iframe)\r\n break\r\n\r\n case 'message':\r\n forwardMsgFromIFrame(getMsgBody(6))\r\n break\r\n\r\n case 'autoResize':\r\n settings[iframeId].autoResize = JSON.parse(getMsgBody(9))\r\n break\r\n\r\n case 'scrollTo':\r\n scrollRequestFromChild(false)\r\n break\r\n\r\n case 'scrollToOffset':\r\n scrollRequestFromChild(true)\r\n break\r\n\r\n case 'pageInfo':\r\n sendPageInfoToIframe(\r\n settings[iframeId] && settings[iframeId].iframe,\r\n iframeId\r\n )\r\n startPageInfoMonitor()\r\n break\r\n\r\n case 'pageInfoStop':\r\n stopPageInfoMonitor()\r\n break\r\n\r\n case 'inPageLink':\r\n findTarget(getMsgBody(9))\r\n break\r\n\r\n case 'reset':\r\n resetIFrame(messageData)\r\n break\r\n\r\n case 'init':\r\n resizeIFrame()\r\n on('onInit', messageData.iframe)\r\n break\r\n\r\n default:\r\n resizeIFrame()\r\n }\r\n }\r\n\r\n function hasSettings(iframeId) {\r\n var retBool = true\r\n\r\n if (!settings[iframeId]) {\r\n retBool = false\r\n warn(\r\n messageData.type +\r\n ' No settings for ' +\r\n iframeId +\r\n '. Message was: ' +\r\n msg\r\n )\r\n }\r\n\r\n return retBool\r\n }\r\n\r\n function iFrameReadyMsgReceived() {\r\n // eslint-disable-next-line no-restricted-syntax, guard-for-in\r\n for (var iframeId in settings) {\r\n trigger(\r\n 'iFrame requested init',\r\n createOutgoingMsg(iframeId),\r\n settings[iframeId].iframe,\r\n iframeId\r\n )\r\n }\r\n }\r\n\r\n function firstRun() {\r\n if (settings[iframeId]) {\r\n settings[iframeId].firstRun = false\r\n }\r\n }\r\n\r\n var msg = event.data,\r\n messageData = {},\r\n iframeId = null\r\n\r\n if ('[iFrameResizerChild]Ready' === msg) {\r\n iFrameReadyMsgReceived()\r\n } else if (isMessageForUs()) {\r\n messageData = processMsg()\r\n iframeId = messageData.id\r\n if (settings[iframeId]) {\r\n settings[iframeId].loaded = true\r\n }\r\n\r\n if (!isMessageFromMetaParent() && hasSettings(iframeId)) {\r\n log(iframeId, 'Received: ' + msg)\r\n\r\n if (checkIFrameExists() && isMessageFromIFrame()) {\r\n actionMsg()\r\n }\r\n }\r\n } else {\r\n info(iframeId, 'Ignored: ' + msg)\r\n }\r\n }\r\n\r\n function chkEvent(iframeId, funcName, val) {\r\n var func = null,\r\n retVal = null\r\n\r\n if (settings[iframeId]) {\r\n func = settings[iframeId][funcName]\r\n\r\n if ('function' === typeof func) {\r\n retVal = func(val)\r\n } else {\r\n throw new TypeError(\r\n funcName + ' on iFrame[' + iframeId + '] is not a function'\r\n )\r\n }\r\n }\r\n\r\n return retVal\r\n }\r\n\r\n function removeIframeListeners(iframe) {\r\n var iframeId = iframe.id\r\n delete settings[iframeId]\r\n }\r\n\r\n function closeIFrame(iframe) {\r\n var iframeId = iframe.id\r\n if (chkEvent(iframeId, 'onClose', iframeId) === false) {\r\n log(iframeId, 'Close iframe cancelled by onClose event')\r\n return\r\n }\r\n log(iframeId, 'Removing iFrame: ' + iframeId)\r\n\r\n try {\r\n // Catch race condition error with React\r\n if (iframe.parentNode) {\r\n iframe.parentNode.removeChild(iframe)\r\n }\r\n } catch (error) {\r\n warn(error)\r\n }\r\n\r\n chkEvent(iframeId, 'onClosed', iframeId)\r\n log(iframeId, '--')\r\n removeIframeListeners(iframe)\r\n }\r\n\r\n function getPagePosition(iframeId) {\r\n if (null === pagePosition) {\r\n pagePosition = {\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 log(\r\n iframeId,\r\n 'Get page position: ' + pagePosition.x + ',' + pagePosition.y\r\n )\r\n }\r\n }\r\n\r\n function setPagePosition(iframeId) {\r\n if (null !== pagePosition) {\r\n window.scrollTo(pagePosition.x, pagePosition.y)\r\n log(\r\n iframeId,\r\n 'Set page position: ' + pagePosition.x + ',' + pagePosition.y\r\n )\r\n unsetPagePosition()\r\n }\r\n }\r\n\r\n function unsetPagePosition() {\r\n pagePosition = null\r\n }\r\n\r\n function resetIFrame(messageData) {\r\n function reset() {\r\n setSize(messageData)\r\n trigger('reset', 'reset', messageData.iframe, messageData.id)\r\n }\r\n\r\n log(\r\n messageData.id,\r\n 'Size reset requested by ' +\r\n ('init' === messageData.type ? 'host page' : 'iFrame')\r\n )\r\n getPagePosition(messageData.id)\r\n syncResize(reset, messageData, 'reset')\r\n }\r\n\r\n function setSize(messageData) {\r\n function setDimension(dimension) {\r\n if (!messageData.id) {\r\n log('undefined', 'messageData id not set')\r\n return\r\n }\r\n messageData.iframe.style[dimension] = messageData[dimension] + 'px'\r\n log(\r\n messageData.id,\r\n 'IFrame (' +\r\n iframeId +\r\n ') ' +\r\n dimension +\r\n ' set to ' +\r\n messageData[dimension] +\r\n 'px'\r\n )\r\n }\r\n\r\n function chkZero(dimension) {\r\n // FireFox sets dimension of hidden iFrames to zero.\r\n // So if we detect that set up an event to check for\r\n // when iFrame becomes visible.\r\n\r\n /* istanbul ignore next */ // Not testable in PhantomJS\r\n if (!hiddenCheckEnabled && '0' === messageData[dimension]) {\r\n hiddenCheckEnabled = true\r\n log(iframeId, 'Hidden iFrame detected, creating visibility listener')\r\n fixHiddenIFrames()\r\n }\r\n }\r\n\r\n function processDimension(dimension) {\r\n setDimension(dimension)\r\n chkZero(dimension)\r\n }\r\n\r\n var iframeId = messageData.iframe.id\r\n\r\n if (settings[iframeId]) {\r\n if (settings[iframeId].sizeHeight) {\r\n processDimension('height')\r\n }\r\n if (settings[iframeId].sizeWidth) {\r\n processDimension('width')\r\n }\r\n }\r\n }\r\n\r\n function syncResize(func, messageData, doNotSync) {\r\n /* istanbul ignore if */ // Not testable in PhantomJS\r\n if (doNotSync !== messageData.type && requestAnimationFrame &&\r\n // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame\r\n !window.jasmine) {\r\n log(messageData.id, 'Requesting animation frame')\r\n requestAnimationFrame(func)\r\n } else {\r\n func()\r\n }\r\n }\r\n\r\n function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {\r\n function postMessageToIFrame() {\r\n var target = settings[id] && settings[id].targetOrigin\r\n log(\r\n id,\r\n '[' +\r\n calleeMsg +\r\n '] Sending msg to iframe[' +\r\n id +\r\n '] (' +\r\n msg +\r\n ') targetOrigin: ' +\r\n target\r\n )\r\n iframe.contentWindow.postMessage(msgId + msg, target)\r\n }\r\n\r\n function iFrameNotFound() {\r\n warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found')\r\n }\r\n\r\n function chkAndSend() {\r\n if (\r\n iframe &&\r\n 'contentWindow' in iframe &&\r\n null !== iframe.contentWindow\r\n ) {\r\n // Null test for PhantomJS\r\n postMessageToIFrame()\r\n } else {\r\n iFrameNotFound()\r\n }\r\n }\r\n\r\n function warnOnNoResponse() {\r\n function warning() {\r\n if (settings[id] && !settings[id].loaded && !errorShown) {\r\n errorShown = true\r\n warn(\r\n id,\r\n 'IFrame has not responded within ' +\r\n settings[id].warningTimeout / 1000 +\r\n ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'\r\n )\r\n }\r\n }\r\n\r\n if (\r\n !!noResponseWarning &&\r\n settings[id] &&\r\n !!settings[id].warningTimeout\r\n ) {\r\n settings[id].msgTimeout = setTimeout(\r\n warning,\r\n settings[id].warningTimeout\r\n )\r\n }\r\n }\r\n\r\n var errorShown = false\r\n\r\n id = id || iframe.id\r\n\r\n if (settings[id]) {\r\n chkAndSend()\r\n warnOnNoResponse()\r\n }\r\n }\r\n\r\n function createOutgoingMsg(iframeId) {\r\n return (\r\n iframeId +\r\n ':' +\r\n settings[iframeId].bodyMarginV1 +\r\n ':' +\r\n settings[iframeId].sizeWidth +\r\n ':' +\r\n settings[iframeId].log +\r\n ':' +\r\n settings[iframeId].interval +\r\n ':' +\r\n settings[iframeId].enablePublicMethods +\r\n ':' +\r\n settings[iframeId].autoResize +\r\n ':' +\r\n settings[iframeId].bodyMargin +\r\n ':' +\r\n settings[iframeId].heightCalculationMethod +\r\n ':' +\r\n settings[iframeId].bodyBackground +\r\n ':' +\r\n settings[iframeId].bodyPadding +\r\n ':' +\r\n settings[iframeId].tolerance +\r\n ':' +\r\n settings[iframeId].inPageLinks +\r\n ':' +\r\n settings[iframeId].resizeFrom +\r\n ':' +\r\n settings[iframeId].widthCalculationMethod\r\n )\r\n }\r\n\r\n function setupIFrame(iframe, options) {\r\n function setLimits() {\r\n function addStyle(style) {\r\n if (\r\n Infinity !== settings[iframeId][style] &&\r\n 0 !== settings[iframeId][style]\r\n ) {\r\n iframe.style[style] = settings[iframeId][style] + 'px'\r\n log(\r\n iframeId,\r\n 'Set ' + style + ' = ' + settings[iframeId][style] + 'px'\r\n )\r\n }\r\n }\r\n\r\n function chkMinMax(dimension) {\r\n if (\r\n settings[iframeId]['min' + dimension] >\r\n settings[iframeId]['max' + dimension]\r\n ) {\r\n throw new Error(\r\n 'Value for min' +\r\n dimension +\r\n ' can not be greater than max' +\r\n dimension\r\n )\r\n }\r\n }\r\n\r\n chkMinMax('Height')\r\n chkMinMax('Width')\r\n\r\n addStyle('maxHeight')\r\n addStyle('minHeight')\r\n addStyle('maxWidth')\r\n addStyle('minWidth')\r\n }\r\n\r\n function newId() {\r\n var id = (options && options.id) || defaults.id + count++\r\n if (null !== document.getElementById(id)) {\r\n id += count++\r\n }\r\n return id\r\n }\r\n\r\n function ensureHasId(iframeId) {\r\n if ('' === iframeId) {\r\n // eslint-disable-next-line no-multi-assign\r\n iframe.id = iframeId = newId()\r\n logEnabled = (options || {}).log\r\n log(\r\n iframeId,\r\n 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'\r\n )\r\n }\r\n\r\n return iframeId\r\n }\r\n\r\n function setScrolling() {\r\n log(\r\n iframeId,\r\n 'IFrame scrolling ' +\r\n (settings[iframeId] && settings[iframeId].scrolling\r\n ? 'enabled'\r\n : 'disabled') +\r\n ' for ' +\r\n iframeId\r\n )\r\n iframe.style.overflow =\r\n false === (settings[iframeId] && settings[iframeId].scrolling)\r\n ? 'hidden'\r\n : 'auto'\r\n switch (settings[iframeId] && settings[iframeId].scrolling) {\r\n case 'omit':\r\n break\r\n\r\n case true:\r\n iframe.scrolling = 'yes'\r\n break\r\n\r\n case false:\r\n iframe.scrolling = 'no'\r\n break\r\n\r\n default:\r\n iframe.scrolling = settings[iframeId]\r\n ? settings[iframeId].scrolling\r\n : 'no'\r\n }\r\n }\r\n\r\n // The V1 iFrame script expects an int, where as in V2 expects a CSS\r\n // string value such as '1px 3em', so if we have an int for V2, set V1=V2\r\n // and then convert V2 to a string PX value.\r\n function setupBodyMarginValues() {\r\n if (\r\n 'number' ===\r\n typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||\r\n '0' === (settings[iframeId] && settings[iframeId].bodyMargin)\r\n ) {\r\n settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin\r\n settings[iframeId].bodyMargin =\r\n '' + settings[iframeId].bodyMargin + 'px'\r\n }\r\n }\r\n\r\n function checkReset() {\r\n // Reduce scope of firstRun to function, because IE8's JS execution\r\n // context stack is borked and this value gets externally\r\n // changed midway through running this function!!!\r\n var firstRun = settings[iframeId] && settings[iframeId].firstRun,\r\n resetRequertMethod =\r\n settings[iframeId] &&\r\n settings[iframeId].heightCalculationMethod in resetRequiredMethods\r\n\r\n if (!firstRun && resetRequertMethod) {\r\n resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' })\r\n }\r\n }\r\n\r\n function setupIFrameObject() {\r\n if (settings[iframeId]) {\r\n settings[iframeId].iframe.iFrameResizer = {\r\n close: closeIFrame.bind(null, settings[iframeId].iframe),\r\n\r\n removeListeners: removeIframeListeners.bind(\r\n null,\r\n settings[iframeId].iframe\r\n ),\r\n\r\n resize: trigger.bind(\r\n null,\r\n 'Window resize',\r\n 'resize',\r\n settings[iframeId].iframe\r\n ),\r\n\r\n moveToAnchor: function(anchor) {\r\n trigger(\r\n 'Move to anchor',\r\n 'moveToAnchor:' + anchor,\r\n settings[iframeId].iframe,\r\n iframeId\r\n )\r\n },\r\n\r\n sendMessage: function(message) {\r\n message = JSON.stringify(message)\r\n trigger(\r\n 'Send Message',\r\n 'message:' + message,\r\n settings[iframeId].iframe,\r\n iframeId\r\n )\r\n }\r\n }\r\n }\r\n }\r\n\r\n // We have to call trigger twice, as we can not be sure if all\r\n // iframes have completed loading when this code runs. The\r\n // event listener also catches the page changing in the iFrame.\r\n function init(msg) {\r\n function iFrameLoaded() {\r\n trigger('iFrame.onload', msg, iframe, undefined, true)\r\n checkReset()\r\n }\r\n\r\n function createDestroyObserver(MutationObserver) {\r\n if (!iframe.parentNode) {\r\n return\r\n }\r\n\r\n var destroyObserver = new MutationObserver(function(mutations) {\r\n mutations.forEach(function(mutation) {\r\n var removedNodes = Array.prototype.slice.call(mutation.removedNodes) // Transform NodeList into an Array\r\n removedNodes.forEach(function(removedNode) {\r\n if (removedNode === iframe) {\r\n closeIFrame(iframe)\r\n }\r\n })\r\n })\r\n })\r\n destroyObserver.observe(iframe.parentNode, {\r\n childList: true\r\n })\r\n }\r\n\r\n var MutationObserver = getMutationObserver()\r\n if (MutationObserver) {\r\n createDestroyObserver(MutationObserver)\r\n }\r\n\r\n addEventListener(iframe, 'load', iFrameLoaded)\r\n trigger('init', msg, iframe, undefined, true)\r\n }\r\n\r\n function checkOptions(options) {\r\n if ('object' !== typeof options) {\r\n throw new TypeError('Options is not an object')\r\n }\r\n }\r\n\r\n function copyOptions(options) {\r\n // eslint-disable-next-line no-restricted-syntax\r\n for (var option in defaults) {\r\n if (Object.prototype.hasOwnProperty.call(defaults, option)) {\r\n settings[iframeId][option] = Object.prototype.hasOwnProperty.call(\r\n options,\r\n option\r\n )\r\n ? options[option]\r\n : defaults[option]\r\n }\r\n }\r\n }\r\n\r\n function getTargetOrigin(remoteHost) {\r\n return '' === remoteHost || null !== remoteHost.match(/^(about:blank|javascript:|file:\\/\\/)/) ? '*' : remoteHost\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 iframeId,\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 processOptions(options) {\r\n options = options || {}\r\n settings[iframeId] = {\r\n firstRun: true,\r\n iframe: iframe,\r\n remoteHost:\r\n iframe.src &&\r\n iframe.src\r\n .split('/')\r\n .slice(0, 3)\r\n .join('/')\r\n }\r\n\r\n checkOptions(options)\r\n Object.keys(options).forEach(depricate, options)\r\n copyOptions(options)\r\n\r\n if (settings[iframeId]) {\r\n settings[iframeId].targetOrigin =\r\n true === settings[iframeId].checkOrigin\r\n ? getTargetOrigin(settings[iframeId].remoteHost)\r\n : '*'\r\n }\r\n }\r\n\r\n function beenHere() {\r\n return iframeId in settings && 'iFrameResizer' in iframe\r\n }\r\n\r\n var iframeId = ensureHasId(iframe.id)\r\n\r\n if (!beenHere()) {\r\n processOptions(options)\r\n setScrolling()\r\n setLimits()\r\n setupBodyMarginValues()\r\n init(createOutgoingMsg(iframeId))\r\n setupIFrameObject()\r\n } else {\r\n warn(iframeId, 'Ignored iFrame, already setup.')\r\n }\r\n }\r\n\r\n function debouce(fn, time) {\r\n if (null === timer) {\r\n timer = setTimeout(function() {\r\n timer = null\r\n fn()\r\n }, time)\r\n }\r\n }\r\n\r\n var frameTimer = {}\r\n function debounceFrameEvents(fn, time, frameId) {\r\n if (!frameTimer[frameId]) {\r\n frameTimer[frameId] = setTimeout(function() {\r\n frameTimer[frameId] = null\r\n fn()\r\n }, time)\r\n }\r\n }\r\n\r\n // Not testable in PhantomJS\r\n /* istanbul ignore next */\r\n\r\n function fixHiddenIFrames() {\r\n function checkIFrames() {\r\n function checkIFrame(settingId) {\r\n function chkDimension(dimension) {\r\n return (\r\n '0px' ===\r\n (settings[settingId] && settings[settingId].iframe.style[dimension])\r\n )\r\n }\r\n\r\n function isVisible(el) {\r\n return null !== el.offsetParent\r\n }\r\n\r\n if (\r\n settings[settingId] &&\r\n isVisible(settings[settingId].iframe) &&\r\n (chkDimension('height') || chkDimension('width'))\r\n ) {\r\n trigger(\r\n 'Visibility change',\r\n 'resize',\r\n settings[settingId].iframe,\r\n settingId\r\n )\r\n }\r\n }\r\n\r\n Object.keys(settings).forEach(function(key) {\r\n checkIFrame(key)\r\n })\r\n }\r\n\r\n function mutationObserved(mutations) {\r\n log(\r\n 'window',\r\n 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type\r\n )\r\n debouce(checkIFrames, 16)\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 observer = new MutationObserver(mutationObserved)\r\n\r\n observer.observe(target, config)\r\n }\r\n\r\n var MutationObserver = getMutationObserver()\r\n if (MutationObserver) {\r\n createMutationObserver()\r\n }\r\n }\r\n\r\n function resizeIFrames(event) {\r\n function resize() {\r\n sendTriggerMsg('Window ' + event, 'resize')\r\n }\r\n\r\n log('window', 'Trigger event: ' + event)\r\n debouce(resize, 16)\r\n }\r\n\r\n // Not testable in PhantomJS\r\n /* istanbul ignore next */\r\n function tabVisible() {\r\n function resize() {\r\n sendTriggerMsg('Tab Visable', 'resize')\r\n }\r\n\r\n if ('hidden' !== document.visibilityState) {\r\n log('document', 'Trigger event: Visiblity change')\r\n debouce(resize, 16)\r\n }\r\n }\r\n\r\n function sendTriggerMsg(eventName, event) {\r\n function isIFrameResizeEnabled(iframeId) {\r\n return (\r\n settings[iframeId] &&\r\n 'parent' === settings[iframeId].resizeFrom &&\r\n settings[iframeId].autoResize &&\r\n !settings[iframeId].firstRun\r\n )\r\n }\r\n\r\n Object.keys(settings).forEach(function(iframeId) {\r\n if (isIFrameResizeEnabled(iframeId)) {\r\n trigger(eventName, event, settings[iframeId].iframe, iframeId)\r\n }\r\n })\r\n }\r\n\r\n function setupEventListeners() {\r\n addEventListener(window, 'message', iFrameListener)\r\n\r\n addEventListener(window, 'resize', function() {\r\n resizeIFrames('resize')\r\n })\r\n\r\n addEventListener(document, 'visibilitychange', tabVisible)\r\n\r\n addEventListener(document, '-webkit-visibilitychange', tabVisible)\r\n }\r\n\r\n function factory() {\r\n function init(options, element) {\r\n function chkType() {\r\n if (!element.tagName) {\r\n throw new TypeError('Object is not a valid DOM element')\r\n } else if ('IFRAME' !== element.tagName.toUpperCase()) {\r\n throw new TypeError(\r\n 'Expected