iframe-resizer 5.5.4-beta.3 → 5.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.5.4-beta.3 (umd) - 2025-08-27
4
+ * @module iframe-resizer/legacy (parent) 5.5.4 (umd) - 2025-08-27
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],d=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>s(l(e).map(t));const u=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=u?"color: #A9C7FB;":"color: #135CD2;",m=u?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.4-beta.3",g="iframeResizer",y="none",b="vertical",w="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),T="expanded",x="collapsed",M=Object.freeze({[T]:1,[x]:1}),E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),R=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),S=e=>e,I=(O=function(s={}){const l={},u={},p=[],m={...i,expand:!s.collapsed||i.expanded,...s};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!m.expand;function w(){if(0!==p.length){a[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...f(m,d(m)),...f(console,e=>[e,(...t)=>z(e,...t)]),...f(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){u[e]?u[e]+=1:u[e]=1,z("log",`${e}: ${u[e]}`)},countReset:function(e=n){delete u[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),m.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},O?.__esModule?O.default:O);var O;let C={},A=!1;const W=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const L=e=>(t,...n)=>C[t]?.console[e](...n),N=(F="log",(e,...t)=>!0===(e=>C[e]?C[e].log:A)(e)?L(F)(e,...t):null);var F;const B=N,P=L("warn"),H=L("error"),q=L("event"),D=L("purge"),U=L("errorBoundary");const V=(e,...t)=>C[e]?C[e].console.warn(E(S)(...t)):queueMicrotask(()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),J=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(V),Z=J("Function"),G=J("Option"),X=(e,t,n,o)=>e.addEventListener(t,n,o||!1),Y=(e,t,n)=>e.removeEventListener(t,n,!1),_=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),K=["spjluzl","rlf","clyzpvu"],ee=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],te=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ne=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),oe=e=>Q(ee[e]),ie=e=>{const t=e[Q(K[0])]||e[Q(K[1])]||e[Q(K[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=_(Q(e));return n in ne&&(t=ne[n]),t}(n[0]);return 0===o||(e=>e[2]===_(e[0]+e[1]))(n)||(o=-2),o};function re(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{ready:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));q(e,"noResponse"),V(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const ae={},se=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:b,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ae[e.id].onInit&&(G("init()","onReady()","",e.id),ae[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),le={position:null,version:h};function ce(e){function t(){ye(x),he(M),$("onResized",x)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>T.slice(T.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){we(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{ae[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o("scroll"),r=o("resize window");function a(e,n){N(l,`${e}listeners for send${t}`),n(window,"scroll",i),n(window,"resize",r)}function s(){q(l,`stop${t}`),a("Remove ",Y),c.disconnect(),d.disconnect(),Y(ae[l].iframe,"load",s)}const l=M,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));ae[l]&&(ae[l][`stop${t}`]=s,X(ae[l].iframe,"load",s),a("Add ",X),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ae[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ae[M]&&(ae[M][e](),delete ae[M][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),d=a(l,"PageInfo"),f=a(c,"ParentInfo"),u=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return pe(M),{x:Number(t.left)+Number(le.position.x),y:Number(t.top)+Number(le.position.y)}}function b(e){const t=e?y(x.iframe):{x:0,y:0};B(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){le.position=e,w(M)}(n)}function w(e){const{x:t,y:n}=le.position,o=ae[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?he(e):me()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>de(M,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=x;switch(ae[M]?.firstRun&&function(){if(!ae[M])return;Te(M,x.mode),ae[M].firstRun=!1}(),r){case"close":ue(n);break;case"message":l=i(6),N(M,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${l}%c}`,p,m,p,m),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"beforeUnload":B(M,"Ready state reset"),ae[M].ready=!1;break;case"autoResize":ae[M].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;B(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":f();break;case"pageInfoStop":u();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);B(M,`Moving to in page link: %c#${t}`,p),le.position={x:e.x,y:e.y},w(M),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):N(M,`In page link #${t} not found and window.parentIframe not found`)}():N(M,`In page link #${t} not found`)}(i(9));break;case"title":!function(e,t){ae[t]?.syncTitle&&(ae[t].iframe.title=e,B(t,`Set iframe title attribute: %c${e}`,p))}(o,M);break;case"reset":ge(x);break;case"init":t(),function(e){try{ae[e].sameOrigin=!!ae[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ae[e].sameOrigin=!1}N(e,`sameOrigin: %c${ae[e].sameOrigin}`,p)}(M),(s=o)!==h&&(void 0!==s?N(M,`Version mismatch (Child: %c${s}%c !== Parent: %c${h})`,p,m,p):V(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),$e=!0,$("onReady",n);break;default:if(0===a&&0===e)return void P(M,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return void N(M,"Ignoring message with 0 height or width");if(document.hidden)return void N(M,"Page hidden - ignored resize request");t()}var s,l}function k(e){ae[e].ready||(we("iframe requested init",ve(e),e),re(e,ae))}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?v===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in ae?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=ae[e[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(a.mode=e[5]),a}(),M=x.id,M?(q(M,x.type),U(M,function(){!function(e){if(!ae[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&N(M,"Ignoring init message from meta parent page"),e}()||(N(M,`Received: %c${T}`,p),ae[M].ready=!0,(null!==x.iframe||(P(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=ae[M]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(N(M,`Checking connection is from allowed list of origins: %c${o}`,p);e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=ae[M]?.remoteHost;return N(M,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):P("","iframeResizer received messageData without id, message was: ",T)):null!==M&&N(M,"Ignored:",T):Object.keys(ae).forEach(k)}function de(e,t,n){let o=null,i=null;if(ae[e]){if(o=ae[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),P(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function fe(e){const{id:t}=e;N(t,"Disconnected from iframe"),delete ae[t],delete e.iframeResizer}function ue(e){const{id:t}=e;if(!1!==de(t,"onBeforeClose",t)){N(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){P(t,e)}de(t,"onAfterClose",t),fe(e)}else N(t,"Close iframe cancelled by onBeforeClose")}function pe(e){null===le.position&&(le.position={x:window.scrollX,y:window.scrollY},N(e,`Get page position: %c${le.position.x}%c, %c${le.position.y}`,p,m,p))}function me(){le.position=null}function he(e){null!==le.position&&(window.scrollTo(le.position.x,le.position.y),B(e,`Set page position: %c${le.position.x}%c, %c${le.position.y}`,p,m,p),me())}function ge(e){N(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),pe(e.id),ye(e),we("reset","reset",e.id)}function ye(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,B(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=ae[n];o&&t("height"),i&&t("width")}C=ae;const be=e=>e.split(":").filter((e,t)=>19!==t).join(":");function we(e,t,n){function o(o){const i=e in k?be(t):t;B(n,o,p,m,p),B(n,`Message data: %c${i}`,p)}q(n,e),ae[n]&&(ae[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ae[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){N(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(v+t,a)}():P(n,`Iframe(${n}) not found`))}function ve(e){const t=ae[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,le.version,t.mode,"",t.logExpand].join(":")}let ze=0,$e=!1,je=!1,ke=!1;function Te(t,n=-3){if(je)return;const o=Math.max(ae[t].mode,n);if(o>ae[t].mode&&(ae[t].mode=o),o<0)throw D(t),ae[t].vAdvised||V(t||"Parent",`${oe(o+2)}${oe(2)}`),ae[t].vAdvised=!0,oe(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&ke||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,A||n<1?"font-weight: bold;":e))}(`v${h} (${(e=>Q(te[e]))(o)})`,o),o<1&&V("Parent",oe(3)),je=!0}const xe=e=>t=>{function n(){if(ae[d]){const{iframe:e}=ae[d],t={close:ue.bind(null,e),disconnect:fe.bind(null,e),removeListeners(){V(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){V(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),we.bind(null,"Window resize","resize",d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),we("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){we("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=ae[n];X(t,"load",()=>{we($,`${e}:${$e}`,n),re(n,ae),function(){const e=ae[d]?.firstRun,n=ae[d]?.heightCalculationMethod in z;!e&&n&&ge({iframe:t,height:0,width:0,type:"init"})}()}),!0!==o&&(we(j,`${e}:${$e}`,n),re(n,ae))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&V(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${b}"</>, <i>"${w}"</> or <i>"${y}"</>.\n`),e):{}}function r(e){const t=ae[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){R(ae[d],e)&&(V(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),ae[d][t]=ae[d][e],delete ae[d][e])}const s=e=>R(e,"onMouseEnter")||R(e,"onMouseLeave");function l(e){var n,o;ae[d]={...ae[d],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...se,...i(e),mouseEvents:s(e),mode:ie(e),syncTitle:r(d)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),q(d,"setup"),function(){const{direction:e}=ae[d];switch(e){case b:break;case w:ae[d].sizeHeight=!1;case"both":ae[d].sizeWidth=!0;break;case y:ae[d].sizeWidth=!1,ae[d].sizeHeight=!1,ae[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}N(d,`direction: %c${e}`,p)}(),(n=e?.offsetSize||e?.offset)&&(ae[d].direction===b?(ae[d].offsetHeight=n,N(d,`Offset height: %c${n}`,p)):(ae[d].offsetWidth=n,N(d,`Offset width: %c${n}`,p))),function(e){e?.offset&&V(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),ae[d].warningTimeout||B(d,"warningTimeout:%c disabled",p),null===ae[d].postMessageTarget&&(ae[d].postMessageTarget=t.contentWindow),ae[d].targetOrigin=!0===ae[d].checkOrigin?""===(o=ae[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,d=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||se.id+ze++;return null!==document.getElementById(t)&&(t+=ze++),t}(),t.id=n,N(n,`Added missing iframe ID: ${n} (${t.src})`)),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=x,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=R(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:se.log;R(t,"logExpand")||(t.logExpand=n&&o?t.log===T:se.logExpand),function(e){-1===e?.log&&(e.log=!1,ke=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=I({expand:t,label:W(n)});A=e,C[n]||(C[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in M)&&H(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,e),U(d,function(e){c()?P(d,`Ignored iframe (${d}), already setup.`):(l(e),function(){if(je)return;const{mode:e}=ae[d];-1!==e&&Te(d,e)}(),Ee(),function(){switch(N(d,`Iframe scrolling ${ae[d]?.scrolling?"enabled":"disabled"} for ${d}`),t.style.overflow=!1===ae[d]?.scrolling?"hidden":"auto",ae[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=ae[d]?ae[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=ae[d];"number"!=typeof e&&"0"!==e||(ae[d].bodyMargin=`${e}px`)}(),o(ve(d)),n(),N(d,"Setup complete"))})(e),t?.iframeResizer};function Me(){!1===document.hidden&&(N("document","Trigger event: Visibility change"),function(e,t){const n=e=>ae[e]?.autoResize&&!ae[e]?.firstRun;Object.keys(ae).forEach(function(o){n(o)&&we(e,t,o)})}("tabVisible","resize"))}const Ee=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{X(window,"message",ce),X(document,"visibilitychange",Me),window.iframeParentListener=e=>setTimeout(()=>ce({data:e,sameOrigin:!0}))}),Re=`[${g}] `;const Se=function(){function e(e){switch(!0){case!e:throw new TypeError(`${Re}iframe is not defined`);case!e.tagName:throw new TypeError(`${Re}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${Re}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=xe(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${Re}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){Z("iFrameResize()","iframeResize()","","parent"),Se(...e)}),Se});
21
- //# sourceMappingURL=iframeResizer.min.js.map
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.5.4",g="iframeResizer",y="none",b="vertical",w="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),T="expanded",x="collapsed",M=Object.freeze({[T]:1,[x]:1}),E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),R=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),S=e=>e,O=(I=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!h.expand;function w(){if(0!==p.length){a[b()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},I?.__esModule?I.default:I);var I;let A={},C=!1;const W=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const L=e=>(t,...n)=>A[t]?.console[e](...n);var N;const F=(N="log",(e,...t)=>!0===(e=>A[e]?A[e].log:C)(e)?L(N)(e,...t):null),B=L("warn"),P=L("error"),H=L("event"),q=L("purge"),D=L("errorBoundary");const U=(e,...t)=>A[e]?A[e].console.warn(E(S)(...t)):queueMicrotask(()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),J=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(U),Z=J("Function"),V=J("Option"),G=(e,t,n,o)=>e.addEventListener(t,n,o||!1),X=(e,t,n)=>e.removeEventListener(t,n,!1),Y=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},_=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Q=["spjluzl","rlf","clyzpvu"],K=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],ee=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],te=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ne=e=>_(K[e]),oe=e=>{const t=e[_(Q[0])]||e[_(Q[1])]||e[_(Q[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=Y(_(e));return n in te&&(t=te[n]),t}(n[0]);return 0===o||(e=>e[2]===Y(e[0]+e[1]))(n)||(o=-2),o};function ie(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{ready:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));H(e,"noResponse"),U(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const re={},ae=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:b,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof re[e.id].onInit&&(V("init()","onReady()","",e.id),re[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),se={position:null,version:m};function le(e){function t(){ge(x),he(M),$("onResized",x)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>T.slice(T.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){be(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{re[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o("scroll"),r=o("resize window");function a(e,t){t(window,"scroll",i),t(window,"resize",r)}function s(){H(l,`stop${t}`),a(0,X),c.disconnect(),u.disconnect(),X(re[l].iframe,"load",s)}const l=M,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));re[l]&&(re[l][`stop${t}`]=s,G(re[l].iframe,"load",s),a(0,G),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(re[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in re[M]&&(re[M][e](),delete re[M][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return fe(),{x:Number(t.left)+Number(se.position.x),y:Number(t.top)+Number(se.position.y)}}function b(e){const t=e?y(x.iframe):{x:0,y:0};F(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){se.position=e,w(M)}(n)}function w(e){const{x:t,y:n}=se.position,o=re[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?he(e):pe()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>ce(M,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=x;switch(re[M]?.firstRun&&function(){if(!re[M])return;ke(M,x.mode),re[M].firstRun=!1}(),r){case"close":de(n);break;case"message":l=i(6),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"beforeUnload":F(M,"Ready state reset"),re[M].ready=!1;break;case"autoResize":re[M].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;F(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":u();break;case"parentInfo":d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);F(M,`Moving to in page link: %c#${t}`,p),se.position={x:e.x,y:e.y},w(M),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){re[t]?.syncTitle&&(re[t].iframe.title=e,F(t,`Set iframe title attribute: %c${e}`,p))}(o,M);break;case"reset":me(x);break;case"init":t(),function(e){try{re[e].sameOrigin=!!re[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){re[e].sameOrigin=!1}}(M),(s=o)!==m&&(void 0!==s||U(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ze=!0,$("onReady",n);break;default:if(0===a&&0===e)return void B(M,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}function k(e){re[e].ready||(be("iframe requested init",we(e),e),ie(e,re))}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?v===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in re&&(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=re[e[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(a.mode=e[5]),a}(),M=x.id,M?(H(M,x.type),D(M,function(){!function(e){if(!re[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),x.type in{true:1,false:1,undefined:1}||(re[M].ready=!0,(null!==x.iframe||(B(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=re[M]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(;e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=re[M]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):B("","iframeResizer received messageData without id, message was: ",T)):Object.keys(re).forEach(k)}function ce(e,t,n){let o=null,i=null;if(re[e]){if(o=re[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),B(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function ue(e){const{id:t}=e;delete re[t],delete e.iframeResizer}function de(e){const{id:t}=e;if(!1!==ce(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){B(t,e)}ce(t,"onAfterClose",t),ue(e)}}function fe(e){null===se.position&&(se.position={x:window.scrollX,y:window.scrollY})}function pe(){se.position=null}function he(e){null!==se.position&&(window.scrollTo(se.position.x,se.position.y),F(e,`Set page position: %c${se.position.x}%c, %c${se.position.y}`,p,h,p),pe())}function me(e){fe(e.id),ge(e),be("reset","reset",e.id)}function ge(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,F(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=re[n];o&&t("height"),i&&t("width")}A=re;const ye=e=>e.split(":").filter((e,t)=>19!==t).join(":");function be(e,t,n){function o(o){const i=e in k?ye(t):t;F(n,o,p,h,p),F(n,`Message data: %c${i}`,p)}H(n,e),re[n]&&(re[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=re[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(v+t,a)}():B(n,`Iframe(${n}) not found`))}function we(e){const t=re[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,se.version,t.mode,"",t.logExpand].join(":")}let ve=0,ze=!1,$e=!1,je=!1;function ke(t,n=-3){if($e)return;const o=Math.max(re[t].mode,n);if(o>re[t].mode&&(re[t].mode=o),o<0)throw q(t),re[t].vAdvised||U(t||"Parent",`${ne(o+2)}${ne(2)}`),re[t].vAdvised=!0,ne(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&je||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,C||n<1?"font-weight: bold;":e))}(`v${m} (${(e=>_(ee[e]))(o)})`,o),o<1&&U("Parent",ne(3)),$e=!0}const Te=e=>t=>{function n(){if(re[u]){const{iframe:e}=re[u],t={close:de.bind(null,e),disconnect:ue.bind(null,e),removeListeners(){U(u,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){U(u,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),be.bind(null,"Window resize","resize",u)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),be("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){be("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=re[n];G(t,"load",()=>{be($,`${e}:${ze}`,n),ie(n,re),function(){const e=re[u]?.firstRun,n=re[u]?.heightCalculationMethod in z;!e&&n&&me({iframe:t,height:0,width:0,type:"init"})}()}),!0!==o&&(be(j,`${e}:${ze}`,n),ie(n,re))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&U(u,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${b}"</>, <i>"${w}"</> or <i>"${y}"</>.\n`),e):{}}function r(e){const t=re[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){R(re[u],e)&&(U(u,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),re[u][t]=re[u][e],delete re[u][e])}const s=e=>R(e,"onMouseEnter")||R(e,"onMouseLeave");function l(e){var n,o;re[u]={...re[u],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...ae,...i(e),mouseEvents:s(e),mode:oe(e),syncTitle:r(u)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),H(u,"setup"),function(){const{direction:e}=re[u];switch(e){case b:break;case w:re[u].sizeHeight=!1;case"both":re[u].sizeWidth=!0;break;case y:re[u].sizeWidth=!1,re[u].sizeHeight=!1,re[u].autoResize=!1;break;default:throw new TypeError(u,`Direction value of "${e}" is not valid`)}}(),(n=e?.offsetSize||e?.offset)&&(re[u].direction===b?re[u].offsetHeight=n:re[u].offsetWidth=n),function(e){e?.offset&&U(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),re[u].warningTimeout||F(u,"warningTimeout:%c disabled",p),null===re[u].postMessageTarget&&(re[u].postMessageTarget=t.contentWindow),re[u].targetOrigin=!0===re[u].checkOrigin?""===(o=re[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,u=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||ae.id+ve++;return null!==document.getElementById(t)&&(t+=ve++),t}(),t.id=n),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=x,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=R(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:ae.log;R(t,"logExpand")||(t.logExpand=n&&o?t.log===T:ae.logExpand),function(e){-1===e?.log&&(e.log=!1,je=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=O({expand:t,label:W(n)});C=e,A[n]||(A[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in M)&&P(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(u,e),D(u,function(e){c()?B(u,`Ignored iframe (${u}), already setup.`):(l(e),function(){if($e)return;const{mode:e}=re[u];-1!==e&&ke(u,e)}(),Me(),function(){switch(t.style.overflow=!1===re[u]?.scrolling?"hidden":"auto",re[u]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=re[u]?re[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=re[u];"number"!=typeof e&&"0"!==e||(re[u].bodyMargin=`${e}px`)}(),o(we(u)),n())})(e),t?.iframeResizer};function xe(){!1===document.hidden&&function(e,t){const n=e=>re[e]?.autoResize&&!re[e]?.firstRun;Object.keys(re).forEach(function(o){n(o)&&be(e,t,o)})}("tabVisible","resize")}const Me=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{G(window,"message",le),G(document,"visibilitychange",xe),window.iframeParentListener=e=>setTimeout(()=>le({data:e,sameOrigin:!0}))}),Ee=`[${g}] `;const Re=function(){function e(e){switch(!0){case!e:throw new TypeError(`${Ee}iframe is not defined`);case!e.tagName:throw new TypeError(`${Ee}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${Ee}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=Te(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${Ee}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){Z("iFrameResize()","iframeResize()","","parent"),Re(...e)}),Re});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iframe-resizer",
3
- "version": "5.5.4-beta.3",
3
+ "version": "5.5.4",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -33,8 +33,8 @@
33
33
  "legacy"
34
34
  ],
35
35
  "dependencies": {
36
- "@iframe-resizer/child": "5.5.4-beta.3",
37
- "@iframe-resizer/jquery": "5.5.4-beta.3",
38
- "@iframe-resizer/parent": "5.5.4-beta.3"
36
+ "@iframe-resizer/child": "5.5.4",
37
+ "@iframe-resizer/jquery": "5.5.4",
38
+ "@iframe-resizer/parent": "5.5.4"
39
39
  }
40
40
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"iframeResizer.contentWindow.js","sources":["../../../node_modules/auto-console-group/dist/index.js","../../../packages/common/consts.js","../../../packages/common/listeners.js","../../../packages/common/mode.js","../../../packages/common/utils.js","../../../packages/child/console.js","../../../packages/common/format-advise.js","../../../packages/common/deprecate.js","../../../packages/child/check-blocking-css.js","../../../packages/child/from-string.js","../../../packages/child/observers/utils.js","../../../packages/child/observers/mutation.js","../../../packages/child/observers/overflow.js","../../../packages/child/observers/perf.js","../../../packages/child/observers/resize.js","../../../packages/child/observers/visibility.js","../../../packages/child/read.js","../../../packages/child/index.js"],"sourcesContent":["/*!\n * @module auto-console-group v1.2.10\n *\n * @description Automagically group console logs in the browser console.\n *\n * @author David J. Bradshaw <info@iframe-resizer.com>\n * @see {@link https://github.com/davidjbradshaw/auto-console-group#readme}\n * @license MIT\n *\n * @copyright (c) 2025, David J. Bradshaw. All rights reserved.\n */\n\nconst T = \"font-weight: normal;\", H = \"font-weight: bold;\", S = \"font-style: italic;\", U = T + S, N = \"color: #135CD2;\", k = \"color: #A9C7FB;\", j = \"color: #1F1F1F;\", Q = \"color: #E3E3E3;\", f = \"default\", _ = \"error\", C = \"log\", q = Object.freeze({\n assert: !0,\n error: !0,\n warn: !0\n}), L = {\n expand: !0,\n defaultEvent: void 0,\n event: void 0,\n label: \"AutoConsoleGroup\",\n showTime: !0\n}, P = {\n profile: 0,\n profileEnd: 0,\n timeStamp: 0,\n trace: 0\n}, V = (o) => {\n const t = o.event || o.defaultEvent;\n return t ? `${t}` : \"\";\n}, u = Object.assign(console);\nfunction W() {\n const o = /* @__PURE__ */ new Date(), t = (d, l) => o[d]().toString().padStart(l, \"0\"), s = t(\"getHours\", 2), c = t(\"getMinutes\", 2), r = t(\"getSeconds\", 2), i = t(\"getMilliseconds\", 3);\n return `@ ${s}:${c}:${r}.${i}`;\n}\nconst { fromEntries: b, keys: z } = Object, K = (o) => [\n o,\n u[o]\n], X = (o) => (t) => [\n t,\n function(s) {\n o[t] = s;\n }\n], h = (o, t) => b(z(o).map(t));\nfunction J(o = {}) {\n const t = {}, s = {}, c = [], r = {\n ...L,\n // @ts-expect-error: backwards compatibility\n expand: !o.collapsed || L.expanded,\n ...o\n };\n let i = \"\";\n function d() {\n c.length = 0, i = \"\";\n }\n function l() {\n delete r.event, d();\n }\n const v = () => c.some(([e]) => e in q), O = () => v() ? !0 : !!r.expand, A = () => r.showTime ? i : \"\";\n function g() {\n if (c.length === 0) {\n l();\n return;\n }\n u[O() ? \"group\" : \"groupCollapsed\"](\n `%c${r.label}%c ${V(r)} %c${A()}`,\n T,\n H,\n U\n );\n for (const [e, ...n] of c)\n u.assert(\n e in u,\n `Unknown console method: ${e}`\n ), e in u && u[e](...n);\n u.groupEnd(), l();\n }\n function p() {\n i === \"\" && (i = W());\n }\n function G(e) {\n p(), r.event = e;\n }\n function D() {\n p(), queueMicrotask(() => queueMicrotask(g));\n }\n function a(e, ...n) {\n c.length === 0 && D(), c.push([e, ...n]);\n }\n const M = (e) => (...n) => {\n let m;\n try {\n m = e(...n);\n } catch (E) {\n if (!Error.prototype.isPrototypeOf(E)) throw E;\n a(_, E), g();\n }\n return m;\n };\n function I(e, ...n) {\n e !== !0 && a(\"assert\", e, ...n);\n }\n function R(e = f) {\n s[e] ? s[e] += 1 : s[e] = 1, a(C, `${e}: ${s[e]}`);\n }\n function x(e = f) {\n delete s[e];\n }\n function y(e = f) {\n p(), t[e] = performance.now();\n }\n function w(e = f, ...n) {\n if (!t[e]) {\n a(\"timeLog\", e, ...n);\n return;\n }\n const m = performance.now() - t[e];\n a(C, `${e}: ${m} ms`, ...n);\n }\n function B(e = f) {\n w(e), delete t[e];\n }\n const F = (e) => [\n e,\n (...n) => a(e, ...n)\n ];\n return {\n ...h(r, X(r)),\n ...h(console, F),\n ...h(P, K),\n assert: I,\n count: R,\n countReset: x,\n endAutoGroup: g,\n errorBoundary: M,\n event: G,\n purge: d,\n time: y,\n timeEnd: B,\n timeLog: w,\n touch: p\n };\n}\nconst $ = typeof window > \"u\" || typeof window.matchMedia != \"function\" ? !1 : window.matchMedia(\"(prefers-color-scheme: dark)\").matches, Y = $ ? k : N, Z = $ ? Q : j;\nexport {\n H as BOLD,\n Z as FOREGROUND,\n Y as HIGHLIGHT,\n S as ITALIC,\n T as NORMAL,\n J as default\n};\n","export const VERSION = '[VI]{version}[/VI]'\nexport const LABEL = 'iframeResizer'\n\nexport const BASE = 10\nexport const SINGLE = 1\nexport const MIN_SIZE = 1\n\nexport const SIZE_ATTR = 'data-iframe-size'\nexport const OVERFLOW_ATTR = 'data-iframe-overflowed'\nexport const IGNORE_ATTR = 'data-iframe-ignore'\n\nexport const HEIGHT_EDGE = 'bottom'\nexport const WIDTH_EDGE = 'right'\n\nexport const ENABLE = 'autoResizeEnabled'\nexport const SIZE_CHANGE_DETECTED = Symbol('sizeChanged')\nexport const MANUAL_RESIZE_REQUEST = 'manualResize'\nexport const PARENT_RESIZE_REQUEST = 'parentResize'\nexport const IGNORE_DISABLE_RESIZE = {\n [MANUAL_RESIZE_REQUEST]: 1,\n [PARENT_RESIZE_REQUEST]: 1,\n}\n\nexport const SET_OFFSET_SIZE = 'setOffsetSize'\n\nexport const RESIZE_OBSERVER = 'resizeObserver'\nexport const OVERFLOW_OBSERVER = 'overflowObserver'\nexport const MUTATION_OBSERVER = 'mutationObserver'\nexport const VISIBILITY_OBSERVER = 'visibilityObserver'\n\nexport const BOLD = 'font-weight: bold;'\nexport const NORMAL = 'font-weight: normal;'\nexport const ITALIC = 'font-style: italic;'\nexport const BLUE = 'color: #135CD2;'\nexport const BLUE_LIGHT = 'color: #A9C7FB;'\nexport const BLACK = 'color: black;'\nexport const WHITE = 'color: #E3E3E3;'\n\nexport const NONE = 'none'\nexport const BOTH = 'both'\nexport const VERTICAL = 'vertical'\nexport const HORIZONTAL = 'horizontal'\n\nexport const NO_CHANGE = 'No change in content size detected'\n\nexport const msgHeader = 'message'\nexport const msgHeaderLen = msgHeader.length\nexport const msgId = '[iFrameSizer]' // Must match iframe msg ID\nexport const msgIdLen = msgId.length\nexport const resetRequiredMethods = Object.freeze({\n max: 1,\n scroll: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n})\n\nexport const ONLOAD = 'onload'\nexport const INIT = 'init'\n\nexport const INIT_EVENTS = Object.freeze({\n [ONLOAD]: 1,\n [INIT]: 1,\n})\n\nexport const EXPAND = 'expanded'\nexport const COLLAPSE = 'collapsed'\n\nexport const LOG_OPTIONS = Object.freeze({\n [EXPAND]: 1,\n [COLLAPSE]: 1,\n})\n\nexport const IGNORE_TAGS = new Set([\n 'head',\n 'body',\n 'meta',\n 'base',\n 'title',\n 'script',\n 'link',\n 'style',\n 'map',\n 'area',\n 'option',\n 'optgroup',\n 'template',\n 'track',\n 'wbr',\n 'nobr',\n])\n","export const addEventListener = (el, evt, func, options) =>\n el.addEventListener(evt, func, options || false)\n\nexport const removeEventListener = (el, evt, func) =>\n el.removeEventListener(evt, func, false)\n","const l = (l) => {\n if (!l) return ''\n let p = -559038744,\n y = 1103547984\n for (let z, t = 0; t < l.length; t++)\n ((z = l.codePointAt(t)),\n (p = Math.imul(p ^ z, 2246822519)),\n (y = Math.imul(y ^ z, 3266489917)))\n return (\n (p ^= Math.imul(p ^ (y >>> 15), 1935289751)),\n (y ^= Math.imul(y ^ (p >>> 15), 3405138345)),\n (p ^= y >>> 16),\n (y ^= p >>> 16),\n (2097152 * (y >>> 0) + (p >>> 11)).toString(36)\n )\n },\n p = (l) =>\n l.replace(/[A-Za-z]/g, (l) =>\n String.fromCodePoint(\n (l <= 'Z' ? 90 : 122) >= (l = l.codePointAt(0) + 19) ? l : l - 26,\n ),\n ),\n x = ['spjluzl', 'rlf', 'clyzpvu'],\n y = [\n '<yi>Puchspk Spjluzl Rlf</><iy><iy>',\n '<yi>Tpzzpun Spjluzl Rlf</><iy><iy>',\n 'Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>',\n '<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.',\n '<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.',\n ],\n z = ['NWSc3', 'zvsv', 'wyv', 'ibzpulzz', 'vlt'],\n t = Object.fromEntries(\n [\n '2cgs7fdf4xb',\n '1c9ctcccr4z',\n '1q2pc4eebgb',\n 'ueokt0969w',\n 'w2zxchhgqz',\n '1umuxblj2e5',\n ].map((l, p) => [l, Math.max(0, p - 1)]),\n )\nexport const getModeData = (l) => p(y[l])\nexport const getModeLabel = (l) => p(z[l])\nexport const getKey = (l) => p(x[l])\nexport default (y) => {\n const z = y[p(x[0])] || y[p(x[1])] || y[p(x[2])]\n if (!z) return -1\n const u = z.split('-')\n let v = (function (y = '') {\n let z = -2\n const u = l(p(y))\n return u in t && (z = t[u]), z\n })(u[0])\n return 0 === v || ((p) => p[2] === l(p[0] + p[1]))(u) || (v = -2), v\n}\n","export const isElement = (node) => node.nodeType === Node.ELEMENT_NODE\n\nexport const isNumber = (value) => !Number.isNaN(value)\n\nexport const isolateUserCode = (func, ...val) =>\n setTimeout(() => func(...val), 0)\n\nexport const once = (fn) => {\n let done = false\n\n return function () {\n return done\n ? undefined\n : ((done = true), Reflect.apply(fn, this, arguments))\n }\n}\n\nexport const hasOwn =\n Object.hasOwn || ((o, k) => Object.prototype.hasOwnProperty.call(o, k))\n\nexport const isDarkModeEnabled = () =>\n window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches\n\nexport const id = (x) => x\n\nconst ROUNDING = 1000\n\nexport const round = (value) => Math.round(value * ROUNDING) / ROUNDING\n\nexport const capitalizeFirstLetter = (string) =>\n string.charAt(0).toUpperCase() + string.slice(1)\n\nexport const isDef = (value) => `${value}` !== '' && value !== undefined\n\nexport function getElementName(el) {\n switch (true) {\n case !isDef(el):\n return ''\n\n case isDef(el.id):\n return `${el.nodeName}#${el.id}`\n\n case isDef(el.name):\n return `${el.nodeName} (${el.name}`\n\n case isDef(el.className):\n return `${el.nodeName}.${el.className}`\n\n default:\n return el.nodeName\n }\n}\n\nexport const esModuleInterop = (mod) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\nexport const typeAssert = (value, type, error) => {\n // eslint-disable-next-line valid-typeof\n if (typeof value !== type) {\n throw new TypeError(`${error} is not a ${capitalizeFirstLetter(type)}`)\n }\n}\n","import acg, { NORMAL } from 'auto-console-group'\n\nimport { BOLD, LABEL } from '../common/consts'\nimport deprecate from '../common/deprecate'\nimport formatAdvise from '../common/format-advise'\nimport { esModuleInterop, id as identity } from '../common/utils'\n\nlet enabled = true\nlet id = LABEL\n\n// Deal with UMD not converting default exports to named exports\nconst createGroupConsole = esModuleInterop(acg)\n\nconst childConsole = createGroupConsole({ label: `${LABEL}(child)` })\n\nexport function setConsoleOptions(options) {\n id = options.id || LABEL\n childConsole.label(`${id}`)\n childConsole.expand(options.expand)\n enabled = options.enabled\n}\n\nexport const setupConsoleMethod =\n (method) =>\n (...args) =>\n enabled ? childConsole[method](...args) : true\n\nexport const log = setupConsoleMethod('log')\nexport const info = log // setupConsoleMethod('info')\nexport const debug = setupConsoleMethod('debug')\n\nexport function vInfo(ver, mode) {\n // eslint-disable-next-line no-console\n console.info(\n `${id} %ciframe-resizer ${ver}`,\n enabled || mode < 1 ? BOLD : NORMAL,\n )\n}\n\nexport const {\n assert,\n endAutoGroup,\n error,\n errorBoundary,\n event,\n label,\n purge,\n warn,\n} = childConsole\n\nexport const advise = (msg) => childConsole.warn(formatAdvise(identity)(msg))\n\nexport const adviser = advise\n\nconst deprecateAdvise = deprecate((id, msg) => advise(msg))\nexport const deprecateMethod = deprecateAdvise('Method')\nexport const deprecateMethodReplace = deprecateAdvise('Method', 'replaced with')\nexport const deprecateOption = deprecateAdvise('Option')\n","const encode = (s) =>\n s\n .replaceAll('<br>', '\\n')\n .replaceAll('<rb>', '\\u001B[31;1m')\n .replaceAll('</>', '\\u001B[m')\n .replaceAll('<b>', '\\u001B[1m')\n .replaceAll('<i>', '\\u001B[3m')\n .replaceAll('<u>', '\\u001B[4m')\n\nconst remove = (s) => s.replaceAll('<br>', '\\n').replaceAll(/<[/a-z]+>/gi, '')\n\nexport default (formatLogMsg) => (msg) =>\n window.chrome // Only show formatting in Chrome as not supported in other browsers\n ? formatLogMsg(encode(msg))\n : formatLogMsg(remove(msg))\n","export default (advise) =>\n (type, change = 'renamed to') =>\n (old, replacement, info = '', iframeId = '') =>\n advise(\n iframeId,\n `<rb>Deprecated ${type}(${old.replace('()', '')})</>\\n\\nThe <b>${old}</> ${type.toLowerCase()} has been ${change} <b>${replacement}</>. ${info}Use of the old ${type.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`,\n )\n","import { advise, log } from './console'\n\nconst nodes = () => [document.documentElement, document.body]\nconst properties = ['min-height', 'min-width', 'max-height', 'max-width']\n\nconst blockedStyleSheets = new Set()\n\nconst hasCssValue = (value) =>\n value && value !== '0px' && value !== 'auto' && value !== 'none'\n\nconst getElementName = (node) =>\n node.tagName ? node.tagName.toLowerCase() : 'unknown'\n\nconst getComputedStyle = (node, property) =>\n window.getComputedStyle(node).getPropertyValue(property)\n\nconst hasBlockingCSS = (node, property) =>\n hasCssValue(getComputedStyle(node, property))\n\nfunction getInlineStyleValue(node, property) {\n const inlineValue = node.style[property]\n return inlineValue\n ? { source: 'an inline style attribute', value: inlineValue }\n : null\n}\n\nfunction crossOriginStylesheetError({ href }) {\n if (blockedStyleSheets.has(href)) return\n log('Unable to access stylesheet:', href)\n blockedStyleSheets.add(href)\n}\n\n// eslint-disable-next-line sonarjs/cognitive-complexity\nfunction getStyleSheetCSSPropertyValue(node, property) {\n for (const stylesheet of document.styleSheets) {\n try {\n for (const rule of stylesheet.cssRules || []) {\n if (rule.selectorText && node.matches(rule.selectorText)) {\n const ruleValue = rule.style[property]\n if (ruleValue) {\n const sourceType =\n stylesheet.ownerNode.tagName === 'STYLE'\n ? 'an inline <style> block'\n : `stylesheet (${stylesheet.href})`\n\n return {\n source: sourceType,\n value: ruleValue,\n }\n }\n }\n }\n } catch (error) {\n crossOriginStylesheetError(stylesheet)\n }\n }\n\n return {\n source: 'cross-origin stylesheet',\n value: getComputedStyle(node, property),\n }\n}\n\nconst getSetCSSPropertyValue = (node, property) =>\n getInlineStyleValue(node, property) ||\n getStyleSheetCSSPropertyValue(node, property)\n\nconst showCssWarning = (node, property) => {\n const { source, value } = getSetCSSPropertyValue(node, property)\n const nodeName = getElementName(node)\n\n advise(\n `The <b>${property}</> CSS property is set to <b>${value}</> on the <b><${nodeName}></> element via ${source}. This may cause issues with the correct operation of <i>iframe-resizer</>.\\n\\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`,\n )\n}\n\nexport default function checkBlockingCSS() {\n for (const node of nodes()) {\n for (const property of properties) {\n log(`Checking <${getElementName(node)}> for blocking CSS: ${property}`)\n if (hasBlockingCSS(node, property)) showCssWarning(node, property)\n }\n }\n}\n","const strBool = (str) => str === 'true'\n\nconst castDefined = (cast) => (data) =>\n undefined === data ? undefined : cast(data)\n\nexport const getBoolean = castDefined(strBool)\nexport const getNumber = castDefined(Number)\n","import { HIGHLIGHT, NORMAL } from 'auto-console-group'\n\nimport { debug, error, info } from '../console'\n\nexport const metaCreateDebugObserved =\n (text = '') =>\n (type) =>\n (observed) => {\n if (observed.size > 0) {\n debug(\n `${type}Observer ${text}:`,\n ...Array.from(observed).flatMap((node) => ['\\n', node]),\n )\n }\n }\n\nexport const metaCreateErrorObserved =\n (text = '') =>\n (type) =>\n (observed) => {\n if (observed.size > 0) {\n error(\n `${type}Observer ${text}:`,\n ...Array.from(observed).flatMap((node) => ['\\n', node]),\n )\n }\n }\n\nexport const createLogNewlyObserved = metaCreateDebugObserved('attached to')\n\nexport const createWarnAlreadyObserved =\n metaCreateErrorObserved('already attached')\n\nconst createLogNewlyRemoved = metaCreateDebugObserved('detached from')\n\nexport const createLogCounter =\n (type, isAttach = true) =>\n (counter) => {\n if (counter > 0) {\n info(\n `${isAttach ? 'At' : 'De'}tached ${type}Observer ${isAttach ? 'to' : 'from'} %c${counter}%c element${counter === 1 ? '' : 's'}`,\n HIGHLIGHT,\n NORMAL,\n )\n }\n }\n\nexport const createDetachObservers = (type, observer, observed, logCounter) => {\n const logNewlyRemoved = createLogNewlyRemoved(type)\n\n return (nodeList) => {\n const newlyRemoved = new Set()\n let counter = 0\n\n for (const node of nodeList) {\n if (!observed.has(node)) continue\n observer.unobserve(node)\n observed.delete(node)\n newlyRemoved.add(node)\n counter += 1\n }\n\n logNewlyRemoved(newlyRemoved)\n logCounter(counter)\n newlyRemoved.clear()\n }\n}\n","import { FOREGROUND, HIGHLIGHT } from 'auto-console-group'\n\nimport { IGNORE_ATTR, IGNORE_TAGS, SIZE_ATTR } from '../../common/consts'\nimport { round } from '../../common/utils'\nimport { event, info, log } from '../console'\nimport { metaCreateDebugObserved } from './utils'\n\nconst DELAY = 16 // Corresponds to 60fps\nconst DELAY_MARGIN = 2\nconst DELAY_MAX = 200\nconst MUTATION = 'Mutation'\n\nconst addedNodes = new Set()\nconst removedNodes = new Set()\nconst removedAddedNodes = new Set()\nconst newMutations = []\n\nconst config = {\n attributes: true,\n attributeFilter: [IGNORE_ATTR, SIZE_ATTR],\n attributeOldValue: false,\n characterData: false,\n characterDataOldValue: false,\n childList: true,\n subtree: true,\n}\n\nlet delayCount = 1\nlet processMutations\nlet pending = false\nlet perfMon = 0\n\nconst logAdded = metaCreateDebugObserved('added')(MUTATION)\nconst logRemovedPage = metaCreateDebugObserved('removed (page)')(MUTATION)\nconst logRemovedAdded = metaCreateDebugObserved('removed (added)')(MUTATION)\n\nconst shouldSkip = (node) =>\n node.nodeType !== Node.ELEMENT_NODE ||\n IGNORE_TAGS.has(node.tagName.toLowerCase())\n\nfunction addedMutation(mutation) {\n const added = mutation.addedNodes\n\n for (const node of added) {\n if (shouldSkip(node)) continue\n addedNodes.add(node)\n }\n}\n\nfunction removedMutation(mutation) {\n const removed = mutation.removedNodes\n\n for (const node of removed) {\n if (shouldSkip(node)) continue\n if (addedNodes.has(node)) {\n addedNodes.delete(node)\n removedAddedNodes.add(node)\n } else {\n removedNodes.add(node)\n }\n }\n}\n\nconst flatFilterMutations = (mutations) => {\n info('Mutations:', mutations)\n\n for (const mutation of mutations) {\n addedMutation(mutation)\n removedMutation(mutation)\n }\n\n logAdded(addedNodes)\n logRemovedPage(removedNodes)\n logRemovedAdded(removedAddedNodes)\n removedAddedNodes.clear()\n}\n\nfunction logMutations() {\n if (removedNodes.size > 0) {\n log(\n `Detected %c${removedNodes.size} %cremoved element${removedNodes.size > 1 ? 's' : ''}`,\n HIGHLIGHT,\n FOREGROUND,\n )\n }\n\n if (addedNodes.size > 0) {\n log(\n `Found %c${addedNodes.size} %cnew element${addedNodes.size > 1 ? 's' : ''}`,\n HIGHLIGHT,\n FOREGROUND,\n )\n }\n}\n\nconst createProcessMutations = (callback) => () => {\n const now = performance.now()\n const delay = now - perfMon\n const delayLimit = DELAY * delayCount++ + DELAY_MARGIN\n\n // Back off if the callStack is busy with other stuff\n if (delay > delayLimit && delay < DELAY_MAX) {\n event('mutationThrottled')\n info('Update delayed due to heavy workload on the callStack')\n info(\n `EventLoop busy time: %c${round(delay)}ms %c> Max wait: %c${delayLimit - DELAY_MARGIN}ms`,\n HIGHLIGHT,\n FOREGROUND,\n HIGHLIGHT,\n )\n setTimeout(processMutations, DELAY * delayCount)\n perfMon = now\n return\n }\n\n delayCount = 1\n\n newMutations.forEach(flatFilterMutations)\n newMutations.length = 0\n pending = false\n\n logMutations()\n\n callback({ addedNodes, removedNodes })\n\n addedNodes.clear()\n removedNodes.clear()\n}\n\nfunction mutationObserved(mutations) {\n newMutations.push(mutations)\n if (pending) return\n\n perfMon = performance.now()\n pending = true\n requestAnimationFrame(processMutations)\n}\n\nexport default function createMutationObserver(callback) {\n const observer = new window.MutationObserver(mutationObserved)\n const target = document.body || document.documentElement\n\n processMutations = createProcessMutations(callback)\n\n observer.observe(target, config)\n\n info('Attached MutationObserver to body')\n\n return {\n ...observer,\n disconnect: () => {\n addedNodes.clear()\n removedNodes.clear()\n newMutations.length = 0\n observer.disconnect()\n info('Detached MutationObserver')\n },\n }\n}\n","import { HEIGHT_EDGE, OVERFLOW_ATTR } from '../../common/consts'\nimport { id } from '../../common/utils'\nimport { info } from '../console'\nimport {\n createDetachObservers,\n createLogCounter,\n createLogNewlyObserved,\n createWarnAlreadyObserved,\n} from './utils'\n\nconst OVERFLOW = 'Overflow'\nconst logAddOverflow = createLogCounter(OVERFLOW)\nconst logRemoveOverflow = createLogCounter(OVERFLOW, false)\nconst logNewlyObserved = createLogNewlyObserved(OVERFLOW)\nconst warnAlreadyObserved = createWarnAlreadyObserved(OVERFLOW)\n\nconst isHidden = (node) =>\n node.hidden || node.offsetParent === null || node.style.display === 'none'\n\nconst createOverflowObserver = (callback, options) => {\n const side = options.side || HEIGHT_EDGE\n const observerOptions = {\n root: options.root,\n rootMargin: '0px',\n threshold: 1,\n }\n\n const afterReflow = window?.requestAnimationFrame || id\n const emitOverflowDetected = (mutated = false) => callback(mutated)\n\n const isOverflowed = (edge, rootBounds) =>\n edge === 0 || edge > rootBounds[side]\n\n const setOverflow = (node, hasOverflow) =>\n node.toggleAttribute(OVERFLOW_ATTR, hasOverflow)\n\n function observation(entries) {\n for (const entry of entries) {\n const { boundingClientRect, rootBounds, target } = entry\n if (!rootBounds) continue // guard\n const edge = boundingClientRect[side]\n const hasOverflow = isOverflowed(edge, rootBounds) && !isHidden(target)\n\n setOverflow(target, hasOverflow)\n }\n\n afterReflow(emitOverflowDetected)\n }\n\n const observer = new IntersectionObserver(observation, observerOptions)\n const observed = new WeakSet()\n\n function attachObservers(nodeList) {\n const alreadyObserved = new Set()\n const newlyObserved = new Set()\n let counter = 0\n\n for (const node of nodeList) {\n if (node.nodeType !== Node.ELEMENT_NODE) continue\n if (observed.has(node)) {\n alreadyObserved.add(node)\n continue\n }\n\n observer.observe(node)\n observed.add(node)\n newlyObserved.add(node)\n counter += 1\n }\n\n warnAlreadyObserved(alreadyObserved)\n logNewlyObserved(newlyObserved)\n logAddOverflow(counter)\n\n newlyObserved.clear()\n alreadyObserved.clear()\n }\n\n return {\n attachObservers,\n detachObservers: createDetachObservers(\n OVERFLOW,\n observer,\n observed,\n logRemoveOverflow,\n ),\n disconnect: () => {\n observer.disconnect()\n info('Detached OverflowObserver')\n },\n }\n}\n\nexport default createOverflowObserver\n","import { round } from '../../common/utils'\nimport { advise, event, info, log } from '../console'\n\nconst SECOND = 1000\nconst PERF_CHECK_INTERVAL = 5 * SECOND\nconst THRESHOLD = 4 // ms\nconst MIN_SAMPLES = 10\nconst MAX_SAMPLES = 100\n\nexport const PREF_START = '--ifr-start'\nexport const PREF_END = '--ifr-end'\nconst PREF_MEASURE = '--ifr-measure'\n\nconst timings = []\n// const usedTags = new WeakSet()\n\n// const addUsedTag = (el) => typeof el === 'object' && usedTags.add(el)\n\nlet detail = {}\nlet oldAverage = 0\nlet timingCheckId\n\nfunction clearPerfMarks() {\n try {\n performance.clearMarks(PREF_START)\n performance.clearMarks(PREF_END)\n performance.clearMeasures(PREF_MEASURE)\n } catch {\n // Ignore errors if marks are not supported\n }\n}\n\nfunction startTimingCheck() {\n timingCheckId = setInterval(() => {\n if (timings.length < MIN_SAMPLES) return\n if (detail.hasTags && detail.len < 25) return\n\n timings.sort()\n\n const average = Math.min(\n timings.reduce((a, b) => a + b, 0) / timings.length,\n timings[Math.floor(timings.length / 2)],\n )\n\n const roundedAverage = round(average)\n\n if (roundedAverage > oldAverage) {\n oldAverage = roundedAverage\n event('performanceObserver')\n log('Mean time:', round(timings[Math.floor(timings.length / 2)]))\n log(\n 'Median time:',\n round(timings.reduce((a, b) => a + b, 0) / timings.length),\n )\n log('Average time:', roundedAverage)\n log('Max time:', round(Math.max(...timings)))\n // debug('Timings:', JSON.parse(JSON.stringify(timings.map(round))))\n }\n\n clearPerfMarks()\n\n if (average <= THRESHOLD) return\n\n clearInterval(timingCheckId)\n\n advise(\n `<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${round(average)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${detail.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`,\n )\n }, PERF_CHECK_INTERVAL)\n}\n\nfunction perfObserver(list) {\n list.getEntries().forEach((entry) => {\n if (entry.name !== PREF_END) return\n try {\n const { duration } = performance.measure(\n PREF_MEASURE,\n PREF_START,\n PREF_END,\n )\n detail = entry.detail\n timings.push(duration)\n if (timings.length > MAX_SAMPLES) timings.shift()\n } catch {\n // Missing marks; ignore\n }\n })\n}\n\nexport default function createPerformanceObserver() {\n info('Attached PerformanceObserver to page')\n const observer = new PerformanceObserver(perfObserver)\n observer.observe({ entryTypes: ['mark'] })\n\n // addUsedTag(document.documentElement)\n // addUsedTag(document.body)\n\n startTimingCheck()\n\n return {\n disconnect: () => {\n clearPerfMarks()\n clearInterval(timingCheckId)\n observer.disconnect()\n info('Detached PerformanceObserver')\n },\n }\n}\n","import { info } from '../console'\nimport {\n createDetachObservers,\n createLogCounter,\n createLogNewlyObserved,\n createWarnAlreadyObserved,\n} from './utils'\n\nconst RESIZE = 'Resize'\nconst logAddResize = createLogCounter(RESIZE)\nconst logRemoveResize = createLogCounter(RESIZE, false)\nconst logNewlyObserved = createLogNewlyObserved(RESIZE)\nconst warnAlreadyObserved = createWarnAlreadyObserved(RESIZE)\nconst observed = new WeakSet()\nconst alreadyObserved = new Set()\nconst newlyObserved = new Set()\n\nlet observer\n\nexport function attachObserverToNonStaticElements(nodeList) {\n let counter = 0\n\n for (const node of nodeList) {\n if (node.nodeType !== Node.ELEMENT_NODE) continue\n\n const position = getComputedStyle(node)?.position\n if (position === '' || position === 'static') continue\n\n if (observed.has(node)) {\n alreadyObserved.add(node)\n continue\n }\n\n observer.observe(node)\n observed.add(node)\n newlyObserved.add(node)\n counter += 1\n }\n\n warnAlreadyObserved(alreadyObserved)\n logNewlyObserved(newlyObserved)\n logAddResize(counter)\n\n newlyObserved.clear()\n alreadyObserved.clear()\n}\n\nexport default (callback) => {\n observer = new ResizeObserver(callback)\n observer.observe(document.body)\n observed.add(document.body)\n info('Attached ResizeObserver to body')\n\n return {\n attachObserverToNonStaticElements,\n detachObservers: createDetachObservers(\n RESIZE,\n observer,\n observed,\n logRemoveResize,\n ),\n disconnect: () => {\n observer.disconnect()\n info('Detached ResizeObserver')\n },\n }\n}\n","import { info } from '../console'\n\nexport default function visibilityObserver(callback) {\n const observer = new IntersectionObserver(\n (entries) => callback(entries[0].isIntersecting),\n {\n threshold: 0,\n },\n )\n\n const target = document.documentElement\n observer.observe(target)\n\n info('Attached VisibilityObserver to page')\n\n return {\n disconnect: () => {\n observer.disconnect()\n info('Detached VisibilityObserver')\n },\n }\n}\n","const read = (type) => (data, key) => {\n if (!(key in data)) return\n // eslint-disable-next-line valid-typeof, consistent-return\n if (typeof data[key] === type) return data[key]\n\n throw new TypeError(`${key} is not a ${type}.`)\n}\n\nexport const readFunction = read('function')\nexport const readBoolean = read('boolean')\nexport const readNumber = read('number')\nexport const readString = read('string')\n","import { BOLD, FOREGROUND, HIGHLIGHT, ITALIC, NORMAL } from 'auto-console-group'\n\nimport {\n BASE,\n // BOTH,\n ENABLE,\n HEIGHT_EDGE,\n // HORIZONTAL,\n IGNORE_ATTR,\n IGNORE_DISABLE_RESIZE,\n IGNORE_TAGS,\n INIT,\n MANUAL_RESIZE_REQUEST,\n MIN_SIZE,\n MUTATION_OBSERVER,\n NO_CHANGE,\n NONE,\n OVERFLOW_ATTR,\n OVERFLOW_OBSERVER,\n PARENT_RESIZE_REQUEST,\n RESIZE_OBSERVER,\n SET_OFFSET_SIZE,\n SIZE_ATTR,\n SIZE_CHANGE_DETECTED,\n VERSION,\n // VERTICAL,\n VISIBILITY_OBSERVER,\n WIDTH_EDGE,\n} from '../common/consts'\nimport { addEventListener, removeEventListener } from '../common/listeners'\nimport setMode, { getKey, getModeData, getModeLabel } from '../common/mode'\nimport {\n capitalizeFirstLetter,\n getElementName,\n id,\n isDef,\n // isElement,\n isolateUserCode,\n once,\n round,\n typeAssert,\n} from '../common/utils'\nimport checkBlockingCSS from './check-blocking-css'\nimport {\n advise,\n adviser,\n assert,\n debug,\n deprecateMethod,\n deprecateMethodReplace,\n deprecateOption,\n endAutoGroup,\n error,\n errorBoundary,\n event as consoleEvent,\n info,\n label,\n log,\n purge,\n setConsoleOptions,\n vInfo,\n warn,\n} from './console'\nimport { getBoolean, getNumber } from './from-string'\nimport createMutationObserver from './observers/mutation'\nimport createOverflowObserver from './observers/overflow'\nimport createPerformanceObserver, {\n PREF_END,\n PREF_START,\n} from './observers/perf'\nimport createResizeObserver from './observers/resize'\nimport createVisibilityObserver from './observers/visibility'\nimport { readFunction, readNumber, readString } from './read'\n\nfunction iframeResizerChild() {\n const customCalcMethods = {\n height: () => {\n warn('Custom height calculation function not defined')\n return getHeight.auto()\n },\n width: () => {\n warn('Custom width calculation function not defined')\n return getWidth.auto()\n },\n }\n const deprecatedResizeMethods = {\n bodyOffset: 1,\n bodyScroll: 1,\n offset: 1,\n documentElementOffset: 1,\n documentElementScroll: 1,\n boundingClientRect: 1,\n max: 1,\n min: 1,\n grow: 1,\n lowestElement: 1,\n }\n const eventCancelTimer = 128\n const eventHandlersByName = {}\n const heightCalcModeDefault = 'auto'\n // const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\n const msgID = '[iFrameSizer]' // Must match host page msg ID\n const msgIdLen = msgID.length\n const tearDown = []\n const widthCalcModeDefault = 'scroll'\n\n let autoResize = true\n let bodyBackground = ''\n let bodyMargin = 0\n let bodyMarginStr = ''\n let bodyPadding = ''\n let bothDirections = false\n let calculateHeight = true\n let calculateWidth = false\n let firstRun = true\n let hasIgnored = false\n let hasOverflow = false\n let hasOverflowUpdated = true\n let hasTags = false\n let height = 1\n let heightCalcMode = heightCalcModeDefault // only applies if not provided by host page (V1 compatibility)\n let ignoreSelector = ''\n let initLock = true\n let inPageLinks = {}\n let isHidden = false\n let logExpand = false\n let logging = false\n let key\n let key2\n let mode = 0\n let mouseEvents = false\n let offsetHeight = 0\n let offsetWidth = 0\n let origin\n let overflowedNodeSet = new Set()\n let overflowObserver\n let parentId = ''\n let resizeFrom = 'child'\n let resizeObserver\n let sameOrigin = false\n let sizeSelector = ''\n let taggedElements = []\n let target = window.parent\n let targetOriginDefault = '*'\n let timerActive\n let totalTime\n let tolerance = 0\n let triggerLocked = false\n let version\n let width = 1\n let widthCalcMode = widthCalcModeDefault\n let win = window\n\n let onBeforeResize\n let onMessage = () => {\n warn('onMessage function not defined')\n }\n let onReady = () => {}\n let onPageInfo = null\n let onParentInfo = null\n\n function isolate(funcs) {\n funcs.forEach((func) => {\n try {\n func()\n } catch (error_) {\n if (mode < 0) throw error_\n advise(\n `<rb>Error in setup function</>\\n<i>iframe-resizer</> detected an error during setup.\\n\\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`,\n )\n error(error_)\n }\n })\n }\n\n function init(data) {\n readDataFromParent(data)\n\n setConsoleOptions({ id: parentId, enabled: logging, expand: logExpand })\n log(`Initialising iframe v${VERSION} ${window.location.href}`)\n readDataFromPage()\n\n const setup = [\n checkVersion,\n checkBoth,\n checkMode,\n checkIgnoredElements,\n checkCrossDomain,\n checkHeightMode,\n checkWidthMode,\n checkDeprecatedAttrs,\n checkQuirksMode,\n checkAndSetupTags,\n bothDirections ? id : checkBlockingCSS,\n\n applySelectors,\n setupPublicMethods,\n setupMouseEvents,\n setupInPageLinks,\n setMargin,\n () => setBodyStyle('background', bodyBackground),\n () => setBodyStyle('padding', bodyPadding),\n\n bothDirections ? id : stopInfiniteResizingOfIframe,\n injectClearFixIntoBodyElement,\n\n initEventListeners,\n attachObservers,\n beforeUnload,\n ]\n\n isolate(setup)\n\n checkReadyYet(once(onReady))\n log('Initialization complete')\n\n sendSize(\n INIT,\n 'Init message from host page',\n undefined,\n undefined,\n `${VERSION}:${mode}`,\n )\n\n sendTitle()\n }\n\n function beforeUnload() {\n addEventListener(window, 'beforeunload', () => {\n tearDown.forEach((func) => func())\n sendMessage(0, 0, 'beforeUnload')\n })\n }\n\n function checkReadyYet(readyCallback) {\n if (document.readyState === 'complete') isolateUserCode(readyCallback)\n else\n addEventListener(document, 'readystatechange', () =>\n checkReadyYet(readyCallback),\n )\n }\n\n function checkAndSetupTags() {\n taggedElements = document.querySelectorAll(`[${SIZE_ATTR}]`)\n hasTags = taggedElements.length > 0\n log(`Tagged elements found: %c${hasTags}`, HIGHLIGHT)\n }\n\n function sendTitle() {\n if (document.title && document.title !== '') {\n sendMessage(0, 0, 'title', document.title)\n }\n }\n\n function warnIgnored(ignoredElements) {\n const s = ignoredElements.length === 1 ? '' : 's'\n\n warn(\n `%c[${IGNORE_ATTR}]%c found on %c${ignoredElements.length}%c element${s}`,\n BOLD,\n NORMAL,\n BOLD,\n NORMAL,\n )\n }\n\n let ignoredElementsCount = 0\n function checkIgnoredElements() {\n const ignoredElements = document.querySelectorAll(`*[${IGNORE_ATTR}]`)\n hasIgnored = ignoredElements.length > 0\n if (hasIgnored && ignoredElements.length !== ignoredElementsCount) {\n warnIgnored(ignoredElements)\n ignoredElementsCount = ignoredElements.length\n }\n return hasIgnored\n }\n\n function checkQuirksMode() {\n if (document.compatMode !== 'BackCompat') return\n\n advise(\n `<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n`,\n )\n }\n\n function checkVersion() {\n if (!version || version === '' || version === 'false') {\n advise(\n `<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n`,\n )\n return\n }\n\n if (version !== VERSION) {\n advise(\n `<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${version} - Child page: ${VERSION}.\n`,\n )\n }\n }\n\n function checkCrossDomain() {\n try {\n sameOrigin = mode === 1 || 'iframeParentListener' in window.parent\n } catch (error) {\n log('Cross domain iframe detected')\n }\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity\n function readDataFromParent(data) {\n parentId = data[0] ?? parentId\n bodyMargin = getNumber(data[1]) ?? bodyMargin // For V1 compatibility\n calculateWidth = getBoolean(data[2]) ?? calculateWidth\n logging = getBoolean(data[3]) ?? logging\n // data[4] no longer used (was intervalTimer)\n autoResize = getBoolean(data[6]) ?? autoResize\n bodyMarginStr = data[7] ?? bodyMarginStr\n heightCalcMode = data[8] ?? heightCalcMode\n bodyBackground = data[9] ?? bodyBackground\n bodyPadding = data[10] ?? bodyPadding\n tolerance = getNumber(data[11]) ?? tolerance\n inPageLinks.enable = getBoolean(data[12]) ?? false\n resizeFrom = data[13] ?? resizeFrom\n widthCalcMode = data[14] ?? widthCalcMode\n mouseEvents = getBoolean(data[15]) ?? mouseEvents\n offsetHeight = getNumber(data[16]) ?? offsetHeight\n offsetWidth = getNumber(data[17]) ?? offsetWidth\n calculateHeight = getBoolean(data[18]) ?? calculateHeight\n key = data[19] ?? key\n version = data[20] ?? version\n mode = getNumber(data[21]) ?? mode\n // sizeSelector = data[22] || sizeSelector\n logExpand = getBoolean(data[23]) ?? logExpand\n }\n\n function readDataFromPage() {\n // eslint-disable-next-line sonarjs/cognitive-complexity\n function readData(data) {\n log(`Reading data from page:`, Object.keys(data))\n\n onBeforeResize = readFunction(data, 'onBeforeResize') ?? onBeforeResize\n onMessage = readFunction(data, 'onMessage') ?? onMessage\n onReady = readFunction(data, 'onReady') ?? onReady\n\n if (typeof data?.offset === 'number') {\n deprecateOption('offset', 'offsetSize')\n if (calculateHeight)\n offsetHeight = readNumber(data, 'offset') ?? offsetHeight\n if (calculateWidth)\n offsetWidth = readNumber(data, 'offset') ?? offsetWidth\n }\n\n if (typeof data?.offsetSize === 'number') {\n if (calculateHeight)\n offsetHeight = readNumber(data, 'offsetSize') ?? offsetHeight\n if (calculateWidth)\n offsetWidth = readNumber(data, 'offsetSize') ?? offsetWidth\n }\n\n key2 = readString(data, getKey(0)) ?? key2\n ignoreSelector = readString(data, 'ignoreSelector') ?? ignoreSelector\n sizeSelector = readString(data, 'sizeSelector') ?? sizeSelector\n targetOriginDefault =\n readString(data, 'targetOrigin') ?? targetOriginDefault\n\n // String or Function\n heightCalcMode = data?.heightCalculationMethod || heightCalcMode\n widthCalcMode = data?.widthCalculationMethod || widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if (typeof calcMode === 'function') {\n advise(\n `<rb>Deprecated Option(${calcFunc}CalculationMethod)</>\n\nThe use of <b>${calcFunc}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`,\n )\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (mode === 1) return\n\n const data = window.iframeResizer || window.iFrameResizer\n\n if (typeof data !== 'object') return\n\n readData(data)\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n\n info(`Set targetOrigin for parent: %c${targetOriginDefault}`, HIGHLIGHT)\n }\n\n function checkBoth() {\n if (calculateWidth === calculateHeight) {\n bothDirections = true\n }\n }\n\n function chkCSS(attr, value) {\n if (value.includes('-')) {\n warn(`Negative CSS value ignored for ${attr}`)\n value = ''\n }\n\n return value\n }\n\n function setBodyStyle(attr, value) {\n if (undefined !== value && value !== '' && value !== 'null') {\n document.body.style.setProperty(attr, value)\n info(`Set body ${attr}: %c${value}`, HIGHLIGHT)\n }\n }\n\n function applySelector(name, attribute, selector) {\n if (selector === '') return\n\n log(`${name}: %c${selector}`, HIGHLIGHT)\n\n for (const el of document.querySelectorAll(selector)) {\n log(`Applying ${attribute} to:`, el)\n el.toggleAttribute(attribute, true)\n }\n }\n\n function applySelectors() {\n applySelector('sizeSelector', SIZE_ATTR, sizeSelector)\n applySelector('ignoreSelector', IGNORE_ATTR, ignoreSelector)\n }\n\n function setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = `${bodyMargin}px`\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n }\n\n function stopInfiniteResizingOfIframe() {\n const setAutoHeight = (el) =>\n el.style.setProperty('height', 'auto', 'important')\n\n setAutoHeight(document.documentElement)\n setAutoHeight(document.body)\n\n log('Set HTML & body height: %cauto !important', HIGHLIGHT)\n }\n\n function manageTriggerEvent(options) {\n const listener = {\n add(eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove(eventName) {\n const handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n },\n }\n\n listener[options.method](options.eventName)\n\n log(\n `${capitalizeFirstLetter(options.method)} event listener: %c${\n options.eventType\n }`,\n HIGHLIGHT,\n )\n }\n\n function manageEventListeners(method) {\n manageTriggerEvent({\n method,\n eventType: 'After Print',\n eventName: 'afterprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Before Print',\n eventName: 'beforeprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange',\n })\n }\n\n function checkDeprecatedAttrs() {\n let found = false\n\n const checkAttrs = (attr) =>\n document.querySelectorAll(`[${attr}]`).forEach((el) => {\n found = true\n el.removeAttribute(attr)\n el.toggleAttribute(SIZE_ATTR, true)\n })\n\n checkAttrs('data-iframe-height')\n checkAttrs('data-iframe-width')\n\n if (found) {\n advise(\n `<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`,\n )\n }\n }\n\n function checkCalcMode(calcMode, calcModeDefault, modes) {\n const { label } = modes\n\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(`${calcMode} is not a valid option for ${label}CalculationMethod.`)\n calcMode = calcModeDefault\n }\n\n if (calcMode in deprecatedResizeMethods) {\n const actionMsg = version\n ? 'remove this option.'\n : `set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${label}CalculationMethod: 'auto',\n}\n`\n\n advise(\n `<rb>Deprecated ${label}CalculationMethod (${calcMode})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${label} calculation method. It is recommended that you ${actionMsg}\n`,\n )\n }\n }\n\n log(`Set ${label} calculation method: %c${calcMode}`, HIGHLIGHT)\n return calcMode\n }\n\n function checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n )\n }\n\n function checkWidthMode() {\n widthCalcMode = checkCalcMode(widthCalcMode, widthCalcModeDefault, getWidth)\n }\n\n function checkMode() {\n const oMode = mode\n const pMode = setMode({ key })\n const cMode = setMode({ key: key2 })\n mode = Math.max(pMode, cMode)\n if (mode < 0) {\n mode = Math.min(pMode, cMode)\n purge()\n advise(`${getModeData(mode + 2)}${getModeData(2)}`)\n if (isDef(version))\n throw getModeData(mode + 2).replace(/<\\/?[a-z][^>]*>|<\\/>/gi, '')\n } else if (!isDef(version) || (oMode > -1 && mode > oMode)) {\n if (sessionStorage.getItem('ifr') !== VERSION)\n vInfo(`v${VERSION} (${getModeLabel(mode)})`, mode)\n if (mode < 2) adviser(getModeData(3))\n sessionStorage.setItem('ifr', VERSION)\n }\n }\n\n function initEventListeners() {\n if (autoResize !== true) {\n log('Auto Resize disabled')\n }\n\n manageEventListeners('add')\n tearDown.push(() => manageEventListeners('remove'))\n }\n\n function injectClearFixIntoBodyElement() {\n const clearFix = document.createElement('div')\n\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n\n document.body.append(clearFix)\n }\n\n function setupInPageLinks() {\n const getPagePosition = () => ({\n x: document.documentElement.scrollLeft,\n y: document.documentElement.scrollTop,\n })\n\n function getElementPosition(el) {\n const elPosition = el.getBoundingClientRect()\n const pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, BASE) + parseInt(pagePosition.x, BASE),\n y: parseInt(elPosition.top, BASE) + parseInt(pagePosition.y, BASE),\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n const jumpPosition = getElementPosition(target)\n\n log(\n `Moving to in page link (%c#${hash}%c) at x: %c${jumpPosition.x}%c y: %c${jumpPosition.y}`,\n HIGHLIGHT,\n FOREGROUND,\n HIGHLIGHT,\n FOREGROUND,\n HIGHLIGHT,\n )\n\n sendMessage(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMessage uses height/width\n }\n\n const hash = location.split('#')[1] || location // Remove # if present\n const hashData = decodeURIComponent(hash)\n const target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (target !== undefined) {\n jumpToTarget(target)\n return\n }\n\n log(`In page link (#${hash}) not found in iFrame, so sending to parent`)\n sendMessage(0, 0, 'inPageLink', `#${hash}`)\n }\n\n function checkLocationHash() {\n const { hash, href } = window.location\n\n if (hash !== '' && hash !== '#') {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n for (const link of document.querySelectorAll('a[href^=\"#\"]')) {\n if (link.getAttribute('href') !== '#') {\n addEventListener(link, 'click', (e) => {\n e.preventDefault()\n findTarget(link.getAttribute('href'))\n })\n }\n }\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n }\n\n if (inPageLinks.enable) {\n if (mode === 1) {\n advise(\n `In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details.`,\n )\n } else {\n enableInPageLinks()\n }\n } else {\n log('In page linking not enabled')\n }\n\n inPageLinks = {\n findTarget,\n }\n }\n\n function setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMessage(0, 0, e.type, `${e.screenY}:${e.screenX}`)\n }\n\n function addMouseListener(evt, name) {\n log(`Add event listener: %c${name}`, HIGHLIGHT)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n }\n\n function setupPublicMethods() {\n if (mode === 1) return\n\n win.parentIframe = Object.freeze({\n autoResize: (enable) => {\n typeAssert(enable, 'boolean', 'parentIframe.autoResize(enable) enable')\n\n // if (calculateWidth === calculateHeight) {\n if (calculateWidth === false && calculateHeight === false) {\n consoleEvent(ENABLE)\n advise(\n `Auto Resize can not be changed when <b>direction</> is set to '${NONE}'.`, // or '${BOTH}'\n )\n return false\n }\n\n if (enable === true && autoResize === false) {\n autoResize = true\n queueMicrotask(() => sendSize(ENABLE, 'Auto Resize enabled'))\n } else if (enable === false && autoResize === true) {\n autoResize = false\n }\n\n sendMessage(0, 0, 'autoResize', JSON.stringify(autoResize))\n\n return autoResize\n },\n\n close() {\n sendMessage(0, 0, 'close')\n },\n\n getId: () => parentId,\n\n getOrigin: () => {\n deprecateMethod('getOrigin()', 'getParentOrigin()')\n return origin\n },\n\n getParentOrigin: () => origin,\n\n getPageInfo(callback) {\n if (typeof callback === 'function') {\n onPageInfo = callback\n sendMessage(0, 0, 'pageInfo')\n deprecateMethodReplace(\n 'getPageInfo()',\n 'getParentProps()',\n 'See <u>https://iframe-resizer.com/upgrade</> for details. ',\n )\n return\n }\n\n onPageInfo = null\n sendMessage(0, 0, 'pageInfoStop')\n },\n\n getParentProps(callback) {\n typeAssert(\n callback,\n 'function',\n 'parentIframe.getParentProps(callback) callback',\n )\n\n onParentInfo = callback\n sendMessage(0, 0, 'parentInfo')\n\n return () => {\n onParentInfo = null\n sendMessage(0, 0, 'parentInfoStop')\n }\n },\n\n getParentProperties(callback) {\n deprecateMethod('getParentProperties()', 'getParentProps()')\n this.getParentProps(callback)\n },\n\n moveToAnchor(anchor) {\n typeAssert(anchor, 'string', 'parentIframe.moveToAnchor(anchor) anchor')\n inPageLinks.findTarget(anchor)\n },\n\n reset() {\n resetIframe('parentIframe.reset')\n },\n\n setOffsetSize(newOffset) {\n typeAssert(\n newOffset,\n 'number',\n 'parentIframe.setOffsetSize(offset) offset',\n )\n offsetHeight = newOffset\n offsetWidth = newOffset\n sendSize(SET_OFFSET_SIZE, `parentIframe.setOffsetSize(${newOffset})`)\n },\n\n scrollBy(x, y) {\n typeAssert(x, 'number', 'parentIframe.scrollBy(x, y) x')\n typeAssert(y, 'number', 'parentIframe.scrollBy(x, y) y')\n sendMessage(y, x, 'scrollBy') // X&Y reversed at sendMessage uses height/width\n },\n\n scrollTo(x, y) {\n typeAssert(x, 'number', 'parentIframe.scrollTo(x, y) x')\n typeAssert(y, 'number', 'parentIframe.scrollTo(x, y) y')\n sendMessage(y, x, 'scrollTo') // X&Y reversed at sendMessage uses height/width\n },\n\n scrollToOffset(x, y) {\n typeAssert(x, 'number', 'parentIframe.scrollToOffset(x, y) x')\n typeAssert(y, 'number', 'parentIframe.scrollToOffset(x, y) y')\n sendMessage(y, x, 'scrollToOffset') // X&Y reversed at sendMessage uses height/width\n },\n\n sendMessage(msg, targetOrigin) {\n if (targetOrigin)\n typeAssert(\n targetOrigin,\n 'string',\n 'parentIframe.sendMessage(msg, targetOrigin) targetOrigin',\n )\n sendMessage(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod(heightCalculationMethod) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod(widthCalculationMethod) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin(targetOrigin) {\n typeAssert(\n targetOrigin,\n 'string',\n 'parentIframe.setTargetOrigin(targetOrigin) targetOrigin',\n )\n\n log(`Set targetOrigin: %c${targetOrigin}`, HIGHLIGHT)\n targetOriginDefault = targetOrigin\n },\n\n resize(customHeight, customWidth) {\n if (customHeight !== undefined)\n typeAssert(\n customHeight,\n 'number',\n 'parentIframe.resize(customHeight, customWidth) customHeight',\n )\n\n if (customWidth !== undefined)\n typeAssert(\n customWidth,\n 'number',\n 'parentIframe.resize(customHeight, customWidth) customWidth',\n )\n\n const valString = `${customHeight || ''}${customWidth ? `,${customWidth}` : ''}`\n\n sendSize(\n MANUAL_RESIZE_REQUEST,\n `parentIframe.resize(${valString})`,\n customHeight,\n customWidth,\n )\n },\n\n size(customHeight, customWidth) {\n deprecateMethod('size()', 'resize()')\n this.resize(customHeight, customWidth)\n },\n })\n\n win.parentIFrame = win.parentIframe\n }\n\n function filterIgnoredElements(nodeList) {\n const filteredNodeSet = new Set()\n const ignoredNodeSet = new Set()\n\n for (const node of nodeList) {\n if (node.closest(`[${IGNORE_ATTR}]`)) {\n ignoredNodeSet.add(node)\n } else {\n filteredNodeSet.add(node)\n }\n }\n\n if (ignoredNodeSet.size > 0) {\n queueMicrotask(() => {\n consoleEvent('overflowIgnored')\n info(\n `Ignoring elements with [data-iframe-ignore] > *:\\n`,\n ignoredNodeSet,\n )\n endAutoGroup()\n })\n }\n\n return filteredNodeSet\n }\n\n let prevOverflowedNodeSet = new Set()\n function checkOverflow() {\n const allOverflowedNodes = document.querySelectorAll(`[${OVERFLOW_ATTR}]`)\n\n overflowedNodeSet = filterIgnoredElements(allOverflowedNodes)\n\n hasOverflow = overflowedNodeSet.size > 0\n\n // Not supported in Safari 16 (or esLint!!!)\n // eslint-disable-next-line no-use-extend-native/no-use-extend-native\n if (typeof Set.prototype.symmetricDifference === 'function')\n hasOverflowUpdated =\n overflowedNodeSet.symmetricDifference(prevOverflowedNodeSet).size > 0\n\n prevOverflowedNodeSet = overflowedNodeSet\n }\n\n function overflowObserved() {\n checkOverflow()\n\n switch (true) {\n case !hasOverflowUpdated:\n return\n\n case overflowedNodeSet.size > 1:\n info('Overflowed Elements:', overflowedNodeSet)\n break\n\n case hasOverflow:\n break\n\n default:\n info('No overflow detected')\n }\n\n sendSize(OVERFLOW_OBSERVER, 'Overflow updated')\n }\n\n function createOverflowObservers(nodeList) {\n const overflowObserverOptions = {\n root: document.documentElement,\n side: calculateHeight ? HEIGHT_EDGE : WIDTH_EDGE,\n }\n\n overflowObserver = createOverflowObserver(\n overflowObserved,\n overflowObserverOptions,\n )\n\n overflowObserver.attachObservers(nodeList)\n\n return overflowObserver\n }\n\n function resizeObserved(entries) {\n if (!Array.isArray(entries) || entries.length === 0) return\n const el = entries[0].target\n sendSize(RESIZE_OBSERVER, `Element resized <${getElementName(el)}>`)\n }\n\n function createResizeObservers(nodeList) {\n resizeObserver = createResizeObserver(resizeObserved)\n resizeObserver.attachObserverToNonStaticElements(nodeList)\n return resizeObserver\n }\n\n function visibilityChange(isVisible) {\n log(`Visible: %c${isVisible}`, HIGHLIGHT)\n isHidden = !isVisible\n sendSize(VISIBILITY_OBSERVER, 'Visibility changed')\n }\n\n const getCombinedElementLists = (nodeList) => {\n const elements = new Set()\n\n for (const node of nodeList) {\n elements.add(node)\n for (const element of getAllElements(node)) elements.add(element)\n }\n\n info(`Inspecting:\\n`, elements)\n return elements\n }\n\n const addObservers = (nodeList) => {\n if (nodeList.size === 0) return\n\n consoleEvent('addObservers')\n\n const elements = getCombinedElementLists(nodeList)\n\n overflowObserver.attachObservers(elements)\n resizeObserver.attachObserverToNonStaticElements(elements)\n\n endAutoGroup()\n }\n\n const removeObservers = (nodeList) => {\n if (nodeList.size === 0) return\n\n consoleEvent('removeObservers')\n\n const elements = getCombinedElementLists(nodeList)\n\n overflowObserver.detachObservers(elements)\n resizeObserver.detachObservers(elements)\n\n endAutoGroup()\n }\n\n function contentMutated({ addedNodes, removedNodes }) {\n consoleEvent('contentMutated')\n applySelectors()\n checkAndSetupTags()\n checkOverflow()\n endAutoGroup()\n\n removeObservers(removedNodes)\n addObservers(addedNodes)\n }\n\n function mutationObserved(mutations) {\n contentMutated(mutations)\n sendSize(MUTATION_OBSERVER, 'Mutation Observed')\n }\n\n function pushDisconnectsOnToTearDown(observers) {\n tearDown.push(...observers.map((observer) => observer.disconnect))\n }\n\n function attachObservers() {\n const nodeList = getAllElements(document.documentElement)\n\n log('Attaching Observers')\n const observers = [\n createMutationObserver(mutationObserved),\n createOverflowObservers(nodeList),\n createPerformanceObserver(),\n createResizeObservers(nodeList),\n createVisibilityObserver(visibilityChange),\n ]\n\n pushDisconnectsOnToTearDown(observers)\n }\n\n function getMaxElement(side) {\n performance.mark(PREF_START)\n\n const Side = capitalizeFirstLetter(side)\n\n let elVal = MIN_SIZE\n let maxEl = document.documentElement\n let maxVal = hasTags\n ? 0\n : document.documentElement.getBoundingClientRect().bottom\n\n const targetElements = hasTags\n ? taggedElements\n : hasOverflow\n ? Array.from(overflowedNodeSet)\n : getAllElements(document.documentElement) // Width resizing may need to check all elements\n\n for (const element of targetElements) {\n elVal =\n element.getBoundingClientRect()[side] +\n parseFloat(getComputedStyle(element).getPropertyValue(`margin-${side}`))\n\n if (elVal > maxVal) {\n maxVal = elVal\n maxEl = element\n }\n }\n\n info(`${Side} position calculated from:`, maxEl)\n info(`Checked %c${targetElements.length}%c elements`, HIGHLIGHT, FOREGROUND)\n\n performance.mark(PREF_END, {\n detail: {\n hasTags,\n len: targetElements.length,\n logging,\n Side,\n },\n })\n\n return maxVal\n }\n\n const getAllMeasurements = (dimension) => [\n dimension.bodyOffset(),\n dimension.bodyScroll(),\n dimension.documentElementOffset(),\n dimension.documentElementScroll(),\n dimension.boundingClientRect(),\n ]\n\n const addNot = (tagName) => `:not(${tagName})`\n const selector = `* ${Array.from(IGNORE_TAGS).map(addNot).join('')}`\n const getAllElements = (node) => node.querySelectorAll(selector)\n\n function getOffsetSize(getDimension) {\n const offset = getDimension.getOffset()\n\n if (offset !== 0) {\n info(`Page offsetSize: %c${offset}px`, HIGHLIGHT)\n }\n\n return offset\n }\n\n const prevScrollSize = {\n height: 0,\n width: 0,\n }\n\n const prevBoundingSize = {\n height: 0,\n width: 0,\n }\n\n const getAdjustedScroll = (getDimension) =>\n getDimension.documentElementScroll() + Math.max(0, getDimension.getOffset())\n\n const BOUNDING_FORMAT = [HIGHLIGHT, FOREGROUND, HIGHLIGHT]\n\n function getAutoSize(getDimension) {\n function returnBoundingClientRect() {\n prevBoundingSize[dimension] = boundingSize\n prevScrollSize[dimension] = scrollSize\n return Math.max(boundingSize, MIN_SIZE)\n }\n\n const isHeight = getDimension === getHeight\n const dimension = getDimension.label\n const boundingSize = getDimension.boundingClientRect()\n const ceilBoundingSize = Math.ceil(boundingSize)\n const floorBoundingSize = Math.floor(boundingSize)\n const scrollSize = getAdjustedScroll(getDimension)\n const sizes = `HTML: %c${boundingSize}px %cPage: %c${scrollSize}px`\n\n let calculatedSize = 0\n\n switch (true) {\n case !getDimension.enabled():\n return Math.max(scrollSize, MIN_SIZE)\n\n case hasTags:\n info(`Found element with data-iframe-size attribute`)\n calculatedSize = getDimension.taggedElement()\n break\n\n case !hasOverflow &&\n firstRun &&\n prevBoundingSize[dimension] === 0 &&\n prevScrollSize[dimension] === 0:\n info(`Initial page size values: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case triggerLocked &&\n boundingSize === prevBoundingSize[dimension] &&\n scrollSize === prevScrollSize[dimension]:\n info(`Size unchanged: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = Math.max(boundingSize, scrollSize)\n break\n\n case boundingSize === 0 && scrollSize !== 0:\n info(`Page is hidden: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = scrollSize\n break\n\n case !hasOverflow &&\n boundingSize !== prevBoundingSize[dimension] &&\n scrollSize <= prevScrollSize[dimension]:\n info(`New <html> size: ${sizes} `, ...BOUNDING_FORMAT)\n info(\n `Previous <html> size: %c${prevBoundingSize[dimension]}px`,\n HIGHLIGHT,\n )\n calculatedSize = returnBoundingClientRect()\n break\n\n case !isHeight:\n calculatedSize = getDimension.taggedElement()\n break\n\n case !hasOverflow && boundingSize < prevBoundingSize[dimension]:\n info(`<html> size decreased: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case scrollSize === floorBoundingSize || scrollSize === ceilBoundingSize:\n info(`<html> size equals page size: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case boundingSize > scrollSize:\n info(`Page size < <html> size: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case hasOverflow:\n info(`Found elements possibly overflowing <html> `)\n calculatedSize = getDimension.taggedElement()\n break\n\n default:\n info(`Using <html> size: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n }\n\n info(`Content ${dimension}: %c${calculatedSize}px`, HIGHLIGHT)\n\n calculatedSize += getOffsetSize(getDimension)\n\n return calculatedSize\n }\n\n const getBodyOffset = () => {\n const { body } = document\n const style = getComputedStyle(body)\n\n return (\n body.offsetHeight +\n parseInt(style.marginTop, BASE) +\n parseInt(style.marginBottom, BASE)\n )\n }\n\n const getHeight = {\n label: 'height',\n enabled: () => calculateHeight,\n getOffset: () => offsetHeight,\n auto: () => getAutoSize(getHeight),\n bodyOffset: getBodyOffset,\n bodyScroll: () => document.body.scrollHeight,\n offset: () => getHeight.bodyOffset(), // Backwards compatibility\n custom: () => customCalcMethods.height(),\n documentElementOffset: () => document.documentElement.offsetHeight,\n documentElementScroll: () => document.documentElement.scrollHeight,\n boundingClientRect: () =>\n Math.max(\n document.documentElement.getBoundingClientRect().bottom,\n document.body.getBoundingClientRect().bottom,\n ),\n max: () => Math.max(...getAllMeasurements(getHeight)),\n min: () => Math.min(...getAllMeasurements(getHeight)),\n grow: () => getHeight.max(),\n lowestElement: () => getMaxElement(HEIGHT_EDGE),\n taggedElement: () => getMaxElement(HEIGHT_EDGE),\n }\n\n const getWidth = {\n label: 'width',\n enabled: () => calculateWidth,\n getOffset: () => offsetWidth,\n auto: () => getAutoSize(getWidth),\n bodyScroll: () => document.body.scrollWidth,\n bodyOffset: () => document.body.offsetWidth,\n custom: () => customCalcMethods.width(),\n documentElementScroll: () => document.documentElement.scrollWidth,\n documentElementOffset: () => document.documentElement.offsetWidth,\n boundingClientRect: () =>\n Math.max(\n document.documentElement.getBoundingClientRect().right,\n document.body.getBoundingClientRect().right,\n ),\n max: () => Math.max(...getAllMeasurements(getWidth)),\n min: () => Math.min(...getAllMeasurements(getWidth)),\n rightMostElement: () => getMaxElement(WIDTH_EDGE),\n scroll: () =>\n Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll()),\n taggedElement: () => getMaxElement(WIDTH_EDGE),\n }\n\n const checkTolerance = (a, b) => !(Math.abs(a - b) <= tolerance)\n\n function callOnBeforeResize(newSize) {\n const returnedSize = onBeforeResize(newSize)\n\n if (returnedSize === undefined) {\n throw new TypeError(\n 'No value returned from onBeforeResize(), expected a numeric value',\n )\n }\n\n if (Number.isNaN(returnedSize))\n throw new TypeError(\n `Invalid value returned from onBeforeResize(): ${returnedSize}, expected Number`,\n )\n\n if (returnedSize < MIN_SIZE) {\n throw new RangeError(\n `Out of range value returned from onBeforeResize(): ${returnedSize}, must be at least ${MIN_SIZE}`,\n )\n }\n\n return returnedSize\n }\n\n function getNewSize(direction, mode) {\n const calculatedSize = direction[mode]()\n const newSize =\n direction.enabled() && onBeforeResize !== undefined\n ? callOnBeforeResize(calculatedSize)\n : calculatedSize\n\n assert(\n newSize >= MIN_SIZE,\n `New iframe ${direction.label} is too small: ${newSize}, must be at least ${MIN_SIZE}`,\n )\n\n return newSize\n }\n\n function sizeIframe(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n ) {\n const isSizeChangeDetected = () =>\n (calculateHeight && checkTolerance(height, newHeight)) ||\n (calculateWidth && checkTolerance(width, newWidth))\n\n const newHeight = customHeight ?? getNewSize(getHeight, heightCalcMode)\n const newWidth = customWidth ?? getNewSize(getWidth, widthCalcMode)\n\n const updateEvent = isSizeChangeDetected()\n ? SIZE_CHANGE_DETECTED\n : triggerEvent\n\n log(`Resize event: %c${triggerEventDesc}`, HIGHLIGHT)\n\n switch (updateEvent) {\n case INIT:\n case ENABLE:\n case SIZE_CHANGE_DETECTED:\n // lockTrigger()\n height = newHeight\n width = newWidth\n // eslint-disable-next-line no-fallthrough\n case SET_OFFSET_SIZE:\n dispatchMessage(height, width, triggerEvent, msg)\n break\n\n // the following case needs {} to prevent a compile error\n case OVERFLOW_OBSERVER:\n case MUTATION_OBSERVER:\n case RESIZE_OBSERVER:\n case VISIBILITY_OBSERVER: {\n log(NO_CHANGE)\n purge()\n break\n }\n\n default:\n purge()\n info(NO_CHANGE)\n }\n\n timerActive = false // Reset time for next resize\n }\n\n let sendPending = false\n const sendFailed = once(() => adviser(getModeData(4)))\n let hiddenMessageShown = false\n let rafId\n\n const sendSize = errorBoundary(\n (triggerEvent, triggerEventDesc, customHeight, customWidth, msg) => {\n consoleEvent(triggerEvent)\n\n switch (true) {\n case isHidden === true: {\n if (hiddenMessageShown === true) break\n log('Iframe hidden - Ignored resize request')\n hiddenMessageShown = true\n sendPending = false\n cancelAnimationFrame(rafId)\n break\n }\n\n case sendPending === true: {\n purge()\n break // only update once per frame\n }\n\n case !autoResize && !(triggerEvent in IGNORE_DISABLE_RESIZE): {\n info('Resizing disabled')\n break\n }\n\n default: {\n hiddenMessageShown = false\n sendPending = true\n totalTime = performance.now()\n timerActive = true\n\n rafId = requestAnimationFrame(() => {\n sendPending = false\n consoleEvent('requestAnimationFrame')\n debug(`Reset sendPending: %c${triggerEvent}`, HIGHLIGHT)\n })\n\n sizeIframe(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n )\n }\n }\n\n endAutoGroup()\n },\n )\n\n function lockTrigger() {\n if (triggerLocked) {\n log('TriggerLock blocked calculation')\n return\n }\n triggerLocked = true\n debug('Trigger event lock on')\n\n requestAnimationFrame(() => {\n triggerLocked = false\n debug('Trigger event lock off')\n })\n }\n\n function triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMessage(height, width, triggerEvent)\n }\n\n function resetIframe(triggerEventDesc) {\n const hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log(`Reset trigger event: %c${triggerEventDesc}`, HIGHLIGHT)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n }\n\n function dispatchMessage(height, width, triggerEvent, msg, targetOrigin) {\n if (mode < -1) return\n\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n return\n }\n\n log(`Message targetOrigin: %c${targetOrigin}`, HIGHLIGHT)\n }\n\n function displayTimeTaken() {\n const timer = round(performance.now() - totalTime)\n return triggerEvent === INIT\n ? `Initialised iFrame in %c${timer}ms`\n : `Size calculated in %c${timer}ms`\n }\n\n function dispatchToParent() {\n const size = `${height}:${width}`\n const message = `${parentId}:${size}:${triggerEvent}${undefined === msg ? '' : `:${msg}`}`\n\n if (sameOrigin)\n try {\n window.parent.iframeParentListener(msgID + message)\n } catch (error) {\n if (mode === 1) sendFailed()\n else throw error\n return\n }\n else target.postMessage(msgID + message, targetOrigin)\n\n if (timerActive) log(displayTimeTaken(), HIGHLIGHT)\n\n info(\n `Sending message to parent page via ${sameOrigin ? 'sameOrigin' : 'postMessage'}: %c%c${message}`,\n ITALIC,\n HIGHLIGHT,\n )\n }\n\n setTargetOrigin()\n dispatchToParent()\n }\n\n const sendMessage = errorBoundary(\n (height, width, triggerEvent, message, targetOrigin) => {\n consoleEvent(triggerEvent)\n dispatchMessage(height, width, triggerEvent, message, targetOrigin)\n endAutoGroup()\n },\n )\n\n function receiver(event) {\n consoleEvent('onMessage')\n const { freeze } = Object\n const { parse } = JSON\n const parseFrozen = (data) => freeze(parse(data))\n\n const notExpected = (type) => sendMessage(0, 0, `${type}Stop`)\n\n const processRequestFromParent = {\n init: function initFromParent() {\n if (document.readyState === 'loading') {\n log('Page not ready, ignoring init message')\n return\n }\n\n const data = event.data.slice(msgIdLen).split(':')\n\n target = event.source\n origin = event.origin\n\n init(data)\n\n firstRun = false\n\n setTimeout(() => {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset() {\n if (initLock) {\n log('Page reset ignored by init')\n return\n }\n\n log('Page size reset by host page')\n triggerReset('resetPage')\n },\n\n resize() {\n // This method is used by the tabVisible event on the parent page\n log('Resize requested by host page')\n sendSize(PARENT_RESIZE_REQUEST, 'Parent window requested size check')\n },\n\n moveToAnchor() {\n inPageLinks.findTarget(getData())\n },\n\n inPageLink() {\n this.moveToAnchor()\n }, // Backward compatibility\n\n pageInfo() {\n const msgBody = getData()\n log(`PageInfo received from parent:`, parseFrozen(msgBody))\n if (onPageInfo) {\n isolateUserCode(onPageInfo, parse(msgBody))\n } else {\n notExpected('pageInfo')\n }\n },\n\n parentInfo() {\n const msgBody = parseFrozen(getData())\n log(`ParentInfo received from parent:`, msgBody)\n if (onParentInfo) {\n isolateUserCode(onParentInfo, msgBody)\n } else {\n notExpected('parentInfo')\n }\n },\n\n message() {\n const msgBody = getData()\n log(`onMessage called from parent:%c`, HIGHLIGHT, parseFrozen(msgBody))\n // eslint-disable-next-line sonarjs/no-extra-arguments\n isolateUserCode(onMessage, parse(msgBody))\n },\n }\n\n const isMessageForUs = () => msgID === `${event.data}`.slice(0, msgIdLen)\n\n const getMessageType = () => event.data.split(']')[1].split(':')[0]\n\n const getData = () => event.data.slice(event.data.indexOf(':') + 1)\n\n const isMiddleTier = () =>\n 'iframeResize' in window ||\n (window.jQuery !== undefined && '' in window.jQuery.prototype)\n\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibility.\n const isInitMsg = () => event.data.split(':')[2] in { true: 1, false: 1 }\n\n function callFromParent() {\n const messageType = getMessageType()\n\n consoleEvent(messageType)\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n return\n }\n\n if (!isMiddleTier() && !isInitMsg()) {\n warn(`Unexpected message (${event.data})`)\n }\n }\n\n function processMessage() {\n if (firstRun === false) {\n callFromParent()\n return\n }\n\n if (isInitMsg()) {\n label(getMessageType())\n consoleEvent(INIT)\n processRequestFromParent.init()\n return\n }\n\n log(\n `Ignored message of type \"${getMessageType()}\". Received before initialization.`,\n )\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n }\n\n const received = errorBoundary(receiver)\n\n // Normally the parent kicks things off when it detects the iFrame has loaded.\n // If this script is async-loaded, then tell parent page to retry init.\n let sent = false\n const sendReady = (target) =>\n target.postMessage('[iFrameResizerChild]Ready', '*')\n\n function checkLateLoaded() {\n if (document.readyState === 'loading' || !firstRun || sent) return\n\n const { parent, top } = window\n\n log('[iFrameResizerChild]Ready')\n\n sendReady(parent)\n if (parent !== top) sendReady(top)\n\n sent = true\n }\n\n if ('iframeChildListener' in window) {\n warn('Already setup')\n } else {\n window.iframeChildListener = (data) =>\n setTimeout(() => received({ data, sameOrigin: true }))\n\n addEventListener(window, 'message', received)\n addEventListener(document, 'readystatechange', checkLateLoaded)\n\n setTimeout(checkLateLoaded)\n }\n\n /* TEST CODE START */\n function mockMsgListener(msgObject) {\n received(msgObject)\n return win\n }\n\n try {\n // eslint-disable-next-line no-restricted-globals\n if (top?.document?.getElementById('banner')) {\n win = {}\n\n // Create test hooks\n window.mockMsgListener = mockMsgListener\n\n removeEventListener(window, 'message', received)\n\n define([], () => mockMsgListener)\n }\n } catch (error) {\n // do nothing\n }\n\n /* TEST CODE END */\n}\n\n// Don't run for server side render\nif (typeof window !== 'undefined') {\n iframeResizerChild()\n}\n"],"names":["T","H","S","U","f","q","Object","freeze","assert","error","warn","L","expand","defaultEvent","event","label","showTime","P","profile","profileEnd","timeStamp","trace","u","assign","console","fromEntries","b","keys","z","K","o","X","t","s","h","map","$","window","matchMedia","matches","Y","Z","VERSION","LABEL","BASE","SIZE_ATTR","OVERFLOW_ATTR","IGNORE_ATTR","HEIGHT_EDGE","WIDTH_EDGE","ENABLE","SIZE_CHANGE_DETECTED","Symbol","MANUAL_RESIZE_REQUEST","PARENT_RESIZE_REQUEST","IGNORE_DISABLE_RESIZE","SET_OFFSET_SIZE","RESIZE_OBSERVER","OVERFLOW_OBSERVER","MUTATION_OBSERVER","VISIBILITY_OBSERVER","NO_CHANGE","INIT","IGNORE_TAGS","Set","addEventListener","el","evt","func","options","l","p","y","length","codePointAt","Math","imul","toString","replace","String","fromCodePoint","x","max","getModeData","setMode","split","v","isolateUserCode","val","setTimeout","once","fn","done","undefined","Reflect","apply","this","arguments","id","round","value","capitalizeFirstLetter","string","charAt","toUpperCase","slice","isDef","typeAssert","type","TypeError","enabled","createGroupConsole","mod","c","r","collapsed","expanded","i","d","O","some","e","g","V","n","groupEnd","Date","padStart","W","a","queueMicrotask","push","w","performance","now","count","countReset","endAutoGroup","errorBoundary","m","E","Error","prototype","isPrototypeOf","purge","time","timeEnd","timeLog","touch","__esModule","default","childConsole","setupConsoleMethod","method","args","log","info","debug","advise","msg","formatLogMsg","identity","chrome","replaceAll","adviser","deprecateAdvise","change","old","replacement","iframeId","toLowerCase","deprecate","deprecateMethod","deprecateMethodReplace","deprecateOption","properties","blockedStyleSheets","getElementName","node","tagName","getComputedStyle","property","getPropertyValue","hasBlockingCSS","hasCssValue","crossOriginStylesheetError","href","has","add","getSetCSSPropertyValue","inlineValue","style","source","getInlineStyleValue","stylesheet","document","styleSheets","rule","cssRules","selectorText","ruleValue","ownerNode","getStyleSheetCSSPropertyValue","showCssWarning","nodeName","checkBlockingCSS","documentElement","body","castDefined","cast","data","getBoolean","str","getNumber","Number","metaCreateDebugObserved","text","observed","size","Array","from","flatMap","createLogNewlyObserved","createWarnAlreadyObserved","metaCreateErrorObserved","createLogNewlyRemoved","createLogCounter","isAttach","counter","HIGHLIGHT","NORMAL","createDetachObservers","observer","logCounter","logNewlyRemoved","nodeList","newlyRemoved","unobserve","delete","clear","MUTATION","addedNodes","removedNodes","removedAddedNodes","newMutations","config","attributes","attributeFilter","attributeOldValue","characterData","characterDataOldValue","childList","subtree","processMutations","delayCount","pending","perfMon","logAdded","logRemovedPage","logRemovedAdded","shouldSkip","nodeType","Node","ELEMENT_NODE","addedMutation","mutation","added","removedMutation","removed","flatFilterMutations","mutations","createProcessMutations","callback","delay","delayLimit","FOREGROUND","forEach","mutationObserved","requestAnimationFrame","createMutationObserver","MutationObserver","target","observe","disconnect","OVERFLOW","logAddOverflow","logRemoveOverflow","logNewlyObserved","warnAlreadyObserved","isHidden","hidden","offsetParent","display","createOverflowObserver","side","observerOptions","root","rootMargin","threshold","afterReflow","emitOverflowDetected","mutated","isOverflowed","edge","rootBounds","setOverflow","hasOverflow","toggleAttribute","IntersectionObserver","entries","entry","boundingClientRect","WeakSet","attachObservers","alreadyObserved","newlyObserved","detachObservers","PREF_START","PREF_END","PREF_MEASURE","timings","timingCheckId","detail","oldAverage","clearPerfMarks","clearMarks","clearMeasures","perfObserver","list","getEntries","name","duration","measure","shift","createPerformanceObserver","PerformanceObserver","entryTypes","setInterval","hasTags","len","sort","average","min","reduce","floor","roundedAverage","clearInterval","Side","RESIZE","logAddResize","logRemoveResize","attachObserverToNonStaticElements","position","visibilityObserver","isIntersecting","read","key","readFunction","readNumber","readString","customCalcMethods","height","getHeight","auto","width","getWidth","deprecatedResizeMethods","bodyOffset","bodyScroll","offset","documentElementOffset","documentElementScroll","grow","lowestElement","eventHandlersByName","heightCalcModeDefault","msgID","tearDown","widthCalcModeDefault","key2","origin","overflowObserver","resizeObserver","timerActive","totalTime","version","onBeforeResize","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyPadding","bothDirections","calculateHeight","calculateWidth","firstRun","hasIgnored","hasOverflowUpdated","heightCalcMode","ignoreSelector","initLock","inPageLinks","logExpand","logging","mode","mouseEvents","offsetHeight","offsetWidth","overflowedNodeSet","parentId","resizeFrom","sameOrigin","sizeSelector","taggedElements","parent","targetOriginDefault","tolerance","triggerLocked","widthCalcMode","win","onMessage","onReady","onPageInfo","onParentInfo","init","enable","readDataFromParent","location","readData","offsetSize","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","iframeResizer","iFrameResizer","readDataFromPage","checkVersion","checkBoth","checkMode","checkIgnoredElements","checkCrossDomain","checkHeightMode","checkWidthMode","checkDeprecatedAttrs","checkQuirksMode","checkAndSetupTags","applySelectors","setupPublicMethods","setupMouseEvents","setupInPageLinks","setMargin","setBodyStyle","stopInfiniteResizingOfIframe","injectClearFixIntoBodyElement","initEventListeners","beforeUnload","error_","checkReadyYet","sendSize","title","sendMessage","readyCallback","readyState","querySelectorAll","ignoredElementsCount","ignoredElements","BOLD","warnIgnored","compatMode","attr","setProperty","applySelector","attribute","selector","includes","setAutoHeight","manageTriggerEvent","eventName","handleEvent","eventType","passive","remove","removeEventListener","manageEventListeners","found","checkAttrs","removeAttribute","checkCalcMode","calcModeDefault","modes","oMode","pMode","cMode","sessionStorage","getItem","ver","vInfo","getModeLabel","setItem","clearFix","createElement","append","getElementPosition","elPosition","getBoundingClientRect","pagePosition","scrollLeft","scrollTop","parseInt","left","top","findTarget","hash","hashData","decodeURIComponent","getElementById","getElementsByName","jumpPosition","jumpToTarget","checkLocationHash","link","getAttribute","preventDefault","bindAnchors","sendMouse","screenY","screenX","addMouseListener","parentIframe","consoleEvent","JSON","stringify","close","getId","getOrigin","getParentOrigin","getPageInfo","getParentProps","getParentProperties","moveToAnchor","anchor","reset","hcm","triggerReset","resetIframe","setOffsetSize","newOffset","scrollBy","scrollTo","scrollToOffset","targetOrigin","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","resize","customHeight","customWidth","parentIFrame","prevOverflowedNodeSet","checkOverflow","allOverflowedNodes","filteredNodeSet","ignoredNodeSet","closest","filterIgnoredElements","symmetricDifference","overflowObserved","createOverflowObservers","overflowObserverOptions","resizeObserved","isArray","className","createResizeObservers","ResizeObserver","visibilityChange","isVisible","getCombinedElementLists","elements","element","getAllElements","addObservers","removeObservers","contentMutated","observers","createVisibilityObserver","getMaxElement","mark","elVal","maxEl","maxVal","bottom","targetElements","parseFloat","getAllMeasurements","dimension","join","prevScrollSize","prevBoundingSize","BOUNDING_FORMAT","getAutoSize","getDimension","returnBoundingClientRect","boundingSize","scrollSize","isHeight","ceilBoundingSize","ceil","floorBoundingSize","getOffset","getAdjustedScroll","sizes","calculatedSize","taggedElement","getOffsetSize","marginTop","marginBottom","scrollHeight","custom","scrollWidth","right","rightMostElement","scroll","checkTolerance","abs","getNewSize","direction","newSize","returnedSize","isNaN","RangeError","callOnBeforeResize","sendPending","sendFailed","rafId","hiddenMessageShown","triggerEvent","triggerEventDesc","cancelAnimationFrame","newHeight","newWidth","updateEvent","dispatchMessage","sizeIframe","message","iframeParentListener","postMessage","timer","displayTimeTaken","ITALIC","dispatchToParent","received","parse","parseFrozen","notExpected","processRequestFromParent","getData","inPageLink","pageInfo","msgBody","parentInfo","getMessageType","indexOf","isInitMsg","true","false","callFromParent","messageType","jQuery","processMessage","sent","sendReady","checkLateLoaded","iframeChildListener","iframeResizerChild"],"mappings":";;;;;;;;;;;;;;;;;;;yBAYA,MAAMA,EAAI,uBAAwBC,EAAI,qBAAsBC,EAAI,sBAAuBC,EAAIH,EAAIE,EAA+FE,EAAI,UAAmCC,EAAIC,OAAOC,OAAO,CACrPC,QAAQ,EACRC,OAAO,EACPC,MAAM,IACJC,EAAI,CACNC,QAAQ,EACRC,kBAAc,EACdC,WAAO,EACPC,MAAO,mBACPC,UAAU,GACTC,EAAI,CACLC,QAAS,EACTC,WAAY,EACZC,UAAW,EACXC,MAAO,GAINC,EAAIhB,OAAOiB,OAAOC,SAKrB,MAAQC,YAAaC,EAAGC,KAAMC,GAAMtB,OAAQuB,EAAKC,GAAM,CACrDA,EACAR,EAAEQ,IACDC,EAAKD,GAAOE,GAAM,CACnBA,EACA,SAASC,GACPH,EAAEE,GAAKC,CACT,GACCC,EAAI,CAACJ,EAAGE,IAAMN,EAAEE,EAAEE,GAAGK,IAAIH,IAoG5B,MAAMI,WAAWC,OAAS,KAAmC,mBAArBA,OAAOC,aAAgCD,OAAOC,WAAW,gCAAgCC,QAASC,EAAIJ,EAnIjB,kBAAvB,kBAmImDK,EAAIL,EAnIc,kBAAvB,kBCZvIM,EAAU,eACVC,EAAQ,gBAERC,EAAO,GAIPC,EAAY,mBACZC,EAAgB,yBAChBC,EAAc,qBAEdC,EAAc,SACdC,EAAa,QAEbC,EAAS,oBACTC,EAAuBC,OAAO,eAC9BC,EAAwB,eACxBC,EAAwB,eACxBC,EAAwB,CACnCF,CAACA,GAAwB,EACzBC,CAACA,GAAwB,GAGdE,EAAkB,gBAElBC,EAAkB,iBAClBC,EAAoB,mBACpBC,EAAoB,m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