@iframe-resizer/core 5.3.1 → 5.3.2

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.
package/README.md CHANGED
@@ -22,4 +22,4 @@ yarn add @iframe-resizer/core
22
22
 
23
23
  ---
24
24
 
25
- _iframe-resizer version 5.3.1 2024-09-12 - 13:44:54.185Z_
25
+ _iframe-resizer version 5.3.2 2024-10-22 - 10:41:37.836Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/core 5.3.1 (cjs) - 2024-09-12
4
+ * @module iframe-resizer/core 5.3.2 (cjs) - 2024-10-22
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,4 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- "use strict";const e="5.3.1",t="[iFrameSizer]",i=t.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,t,i,n)=>e.addEventListener(t,i,n||!1),r=(e,t,i)=>e.removeEventListener(t,i,!1),s=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},a=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),l=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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</>."],c=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],u=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),d=e=>a(l[e]),f=e=>{const t=e[a("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=s(a(e));return i in u&&(t=u[i]),t}(i[0]);return 0===n||(e=>e[2]===s(e[0]+e[1]))(i)||(n=-2),n},p="[iframe-resizer]";const h=e=>`${p}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,m=(e,...t)=>((e,t,...i)=>window?.console[e](h(t),...i))("warn",e,...t),y=(e,t)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...t)=>[`${p}[${e}]`,...t].join(" "))(e))(t)),g={},b=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(y(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),w={position:null,version:e};function v(n){function s(){M(H),S(),O("onResized",H)}function a(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const c=e=>A.slice(A.indexOf(":")+7+e);const u=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){x(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame((()=>{o[s]=null})))},d=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[u]?i&&i!==t||(e(t,u),i=t,requestAnimationFrame((()=>{i=!1}))):c()},s=n("scroll"),a=n("resize window");function l(e,t){t(window,"scroll",s),t(window,"resize",a)}function c(){l(0,r),d.disconnect(),f.disconnect()}const u=P,d=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),d.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[u].iframe,{attributes:!0,childList:!1,subtree:!1}),g[u]&&(g[u][`stop${t}`]=c)},f=e=>()=>{e in g[P]&&(g[P][e](),delete g[P][e])},p=u("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,o||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})})),h=u("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})})),b=d(p,"PageInfo"),v=d(h,"ParentInfo"),j=f("stopPageInfo"),W=f("stopParentInfo");function L(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(w.position.x),y:Number(t.top)+Number(w.position.y)}}function N(e){const t=e?L(H.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){w.position=e,C(P)}(i)}function C(e){const{x:t,y:i}=w.position,n=g[e]?.iframe;!1!==O("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?S():$()}function E(e){let t={};if(0===H.width&&0===H.height){const e=c(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const O=(e,t)=>z(P,e,t);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?t===`${A}`.slice(0,i)&&A.slice(i).split(":")[0]in g&&(H=function(){const e=A.slice(i).split(":"),t=e[1]?Number(e[1]):0,n=g[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+a(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!g[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(g[P].loaded=!0,(null!==H.iframe||(m(P,`The iframe (${H.id}) was not found.`),0))&&function(){const{origin:e,sameDomain:t}=n;if(t)return!0;let i=g[P]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,n=!1;for(;t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){const t=g[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[P]?.firstRun&&g[P]&&(g[P].firstRun=!1),H.type){case"close":T(H.iframe);break;case"message":i=c(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":g[P].autoResize=JSON.parse(c(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":p("start",P),b();break;case"parentInfo":h("start",P),v();break;case"pageInfoStop":j();break;case"parentInfoStop":W();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=L(n);w.position={x:e.x,y:e.y},C(P),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(c(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(H.msg,P);break;case"reset":I(H);break;case"init":s(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(P),(t=H.msg)!==e&&(void 0!==t||y(P,"<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")),F=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void m(P,`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;s()}var t,i}())):m("","iframeResizer received messageData without id, message was: ",A)):Object.keys(g).forEach((e=>{g[e].mode>=0&&x("iFrame requested init",R(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){m(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===w.position&&(w.position={x:window.scrollX,y:window.scrollY})}function $(){w.position=null}function S(e){null!==w.position&&(window.scrollTo(w.position.x,w.position.y),$())}function I(e){k(e.id),M(e),x("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function x(e,i,n,o){g[n]&&(g[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:r,targetOrigin:s}=g[n];if(r)try{return void e.contentWindow.iframeChildListener(t+i)}catch(e){}o.postMessage(t+i,s)}():m(n,`[${e}] IFrame(${n}) not found`),o&&g[n]?.warningTimeout&&(g[n].msgTimeout=setTimeout((function(){if(void 0===g[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=g[n],{sandbox:r}=e;t||i||(g[n].loadErrorShown=!0,y(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${g[n].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The 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`))}),g[n].warningTimeout)))}function R(e){const t=g[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,w.version,t.mode].join(":")}let W=0,F=!1,L=!1;function N(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&x(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",v),o(document,"visibilitychange",N),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))}));module.exports=t=>i=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&y(l,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function s(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const l=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||b.id+W++;return null!==document.getElementById(e)&&(e+=W++),e}(),i.id=e,(t||{}).log),e}(i.id);return l in g&&"iFrameResizer"in i?m(l,"Ignored iFrame, already setup."):(function(e){var t,n;g[l]={iframe:i,firstRun:!0,remoteHost:i?.src.split("/").slice(0,3).join("/"),...b,...r(e),mode:f(e),syncTitle:s(l)},function(){const{direction:e}=g[l];if("horizontal"===e)return g[l].sizeWidth=!0,void(g[l].sizeHeight=!1);if("none"===e)return g[l].sizeWidth=!1,g[l].sizeHeight=!1,void(g[l].autoResize=!1);if("vertical"!==e)throw new TypeError(l,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===g[l].direction?g[l].offsetHeight=t:g[l].offsetWidth=t),e?.offset&&y(l,"<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</>."),null===g[l].postMessageTarget&&(g[l].postMessageTarget=i.contentWindow),g[l].targetOrigin=!0===g[l].checkOrigin?""===(n=g[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(t),function(){const{mode:t}=g[l];var i;t<0&&y("Parent",`${d(t+2)}${d(2)}`),L||t<0||(L=!0,i=`v${e} (${(e=>a(c[e]))(t)})`,console.info(`%c[iframe-resizer] ${i}`,"font-weight: bold;"),t<1&&y("Parent",d(3)))}(),C(),function(){switch(i.style.overflow=!1===g[l]?.scrolling?"hidden":"auto",g[l]?.scrolling){case"omit":break;case!0:i.scrolling="yes";break;case!1:i.scrolling="no";break;default:i.scrolling=g[l]?g[l].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[l];"number"!=typeof e&&"0"!==e||(g[l].bodyMargin=`${e}px`)}(),function(e){const{id:t}=i,{mode:r,waitForLoad:s}=g[t];-1!==r&&-2!==r&&(o(i,"load",(function(){x("iFrame.onload",`${e}:${F}`,t,!0),function(){const e=g[l]?.firstRun,t=g[l]?.heightCalculationMethod in n;!e&&t&&I({iframe:i,height:0,width:0,type:"init"})}()})),!1===s&&x("init",`${e}:${F}`,t,!0))}(R(l)),function(){if(g[l]){const{iframe:e}=g[l],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){y(l,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:x.bind(null,"Window resize","resize",l),moveToAnchor(e){x("Move to anchor",`moveToAnchor:${e}`,l)},sendMessage(e){x("Send Message",`message:${e=JSON.stringify(e)}`,l)}};e.iframeResizer=t,e.iFrameResizer=t}}()),i?.iFrameResizer};
20
+ "use strict";const e="5.3.2",t="[iFrameSizer]",i=t.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,t,i,n)=>e.addEventListener(t,i,n||!1),r=(e,t,i)=>e.removeEventListener(t,i,!1),s=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},a=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),l=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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</>."],c=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],u=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),d=e=>a(l[e]),f=e=>{const t=e[a("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=s(a(e));return i in u&&(t=u[i]),t}(i[0]);return 0===n||(e=>e[2]===s(e[0]+e[1]))(i)||(n=-2),n},p="[iframe-resizer]";const h=e=>`${p}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,m=(e,...t)=>((e,t,...i)=>window?.console[e](h(t),...i))("warn",e,...t),y=(e,t)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...t)=>[`${p}[${e}]`,...t].join(" "))(e))(t)),g={},b=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(y(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),w={position:null,version:e};function v(n){function s(){M(H),S(),O("onResized",H)}function a(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const c=e=>A.slice(A.indexOf(":")+7+e);const u=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){x(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame((()=>{o[s]=null})))},d=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[u]?i&&i!==t||(e(t,u),i=t,requestAnimationFrame((()=>{i=!1}))):c()},s=n("scroll"),a=n("resize window");function l(e,t){t(window,"scroll",s),t(window,"resize",a)}function c(){l(0,r),d.disconnect(),f.disconnect()}const u=P,d=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),d.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[u].iframe,{attributes:!0,childList:!1,subtree:!1}),g[u]&&(g[u][`stop${t}`]=c)},f=e=>()=>{e in g[P]&&(g[P][e](),delete g[P][e])},p=u("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,o||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})})),h=u("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})})),b=d(p,"PageInfo"),v=d(h,"ParentInfo"),j=f("stopPageInfo"),W=f("stopParentInfo");function L(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(w.position.x),y:Number(t.top)+Number(w.position.y)}}function N(e){const t=e?L(H.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){w.position=e,C(P)}(i)}function C(e){const{x:t,y:i}=w.position,n=g[e]?.iframe;!1!==O("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?S():$()}function E(e){let t={};if(0===H.width&&0===H.height){const e=c(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const O=(e,t)=>z(P,e,t);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?t===`${A}`.slice(0,i)&&A.slice(i).split(":")[0]in g&&(H=function(){const e=A.slice(i).split(":"),t=e[1]?Number(e[1]):0,n=g[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+a(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!g[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(g[P].loaded=!0,(null!==H.iframe||(m(P,`The iframe (${H.id}) was not found.`),0))&&function(){const{origin:e,sameDomain:t}=n;if(t)return!0;let i=g[P]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,n=!1;for(;t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){const t=g[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[P]?.firstRun&&g[P]&&(g[P].firstRun=!1),H.type){case"close":T(H.iframe);break;case"message":i=c(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":g[P].autoResize=JSON.parse(c(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":p("start",P),b();break;case"parentInfo":h("start",P),v();break;case"pageInfoStop":j();break;case"parentInfoStop":W();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=L(n);w.position={x:e.x,y:e.y},C(P),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(c(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(H.msg,P);break;case"reset":I(H);break;case"init":s(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(P),(t=H.msg)!==e&&(void 0!==t||y(P,"<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")),F=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void m(P,`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;s()}var t,i}())):m("","iframeResizer received messageData without id, message was: ",A)):Object.keys(g).forEach((e=>{g[e].mode>=0&&x("iFrame requested init",R(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){m(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===w.position&&(w.position={x:window.scrollX,y:window.scrollY})}function $(){w.position=null}function S(e){null!==w.position&&(window.scrollTo(w.position.x,w.position.y),$())}function I(e){k(e.id),M(e),x("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function x(e,i,n,o){g[n]&&(g[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:r,targetOrigin:s}=g[n];if(r)try{return void e.contentWindow.iframeChildListener(t+i)}catch(e){}o.postMessage(t+i,s)}():m(n,`[${e}] IFrame(${n}) not found`),o&&g[n]?.warningTimeout&&(g[n].msgTimeout=setTimeout((function(){if(void 0===g[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=g[n],{sandbox:r}=e;t||i||(g[n].loadErrorShown=!0,y(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${g[n].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The 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`))}),g[n].warningTimeout)))}function R(e){const t=g[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,w.version,t.mode].join(":")}let W=0,F=!1,L=!1;function N(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&x(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",v),o(document,"visibilitychange",N),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))}));module.exports=t=>i=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&y(l,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function s(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const l=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||b.id+W++;return null!==document.getElementById(e)&&(e+=W++),e}(),i.id=e,(t||{}).log),e}(i.id);return l in g&&"iFrameResizer"in i?m(l,"Ignored iFrame, already setup."):(function(e){var t,n;g[l]={iframe:i,firstRun:!0,remoteHost:i?.src.split("/").slice(0,3).join("/"),...b,...r(e),mode:f(e),syncTitle:s(l)},function(){const{direction:e}=g[l];if("horizontal"===e)return g[l].sizeWidth=!0,void(g[l].sizeHeight=!1);if("none"===e)return g[l].sizeWidth=!1,g[l].sizeHeight=!1,void(g[l].autoResize=!1);if("vertical"!==e)throw new TypeError(l,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===g[l].direction?g[l].offsetHeight=t:g[l].offsetWidth=t),e?.offset&&y(l,"<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</>."),null===g[l].postMessageTarget&&(g[l].postMessageTarget=i.contentWindow),g[l].targetOrigin=!0===g[l].checkOrigin?""===(n=g[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(t),function(){const{mode:t}=g[l];var i;t<0&&y("Parent",`${d(t+2)}${d(2)}`),L||t<0||(L=!0,i=`v${e} (${(e=>a(c[e]))(t)})`,console.info(`%c[iframe-resizer] ${i}`,"font-weight: bold;"),t<1&&y("Parent",d(3)))}(),C(),function(){switch(i.style.overflow=!1===g[l]?.scrolling?"hidden":"auto",g[l]?.scrolling){case"omit":break;case!0:i.scrolling="yes";break;case!1:i.scrolling="no";break;default:i.scrolling=g[l]?g[l].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[l];"number"!=typeof e&&"0"!==e||(g[l].bodyMargin=`${e}px`)}(),function(e){const{id:t}=i,{mode:r,waitForLoad:s}=g[t];-1!==r&&-2!==r&&(o(i,"load",(function(){x("iFrame.onload",`${e}:${F}`,t,!0),function(){const e=g[l]?.firstRun,t=g[l]?.heightCalculationMethod in n;!e&&t&&I({iframe:i,height:0,width:0,type:"init"})}()})),!1===s&&x("init",`${e}:${F}`,t,!0))}(R(l)),function(){if(g[l]){const{iframe:e}=g[l],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){y(l,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:x.bind(null,"Window resize","resize",l),moveToAnchor(e){x("Move to anchor",`moveToAnchor:${e}`,l)},sendMessage(e){x("Send Message",`message:${e=JSON.stringify(e)}`,l)}};e.iframeResizer=t,e.iFrameResizer=t}}()),i?.iFrameResizer};
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/core 5.3.1 (esm) - 2024-09-12
4
+ * @module iframe-resizer/core 5.3.2 (esm) - 2024-10-22
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,4 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- const e="5.3.1",t="[iFrameSizer]",i=t.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,t,i,n)=>e.addEventListener(t,i,n||!1),r=(e,t,i)=>e.removeEventListener(t,i,!1),a=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},s=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),l=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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</>."],c=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],u=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),d=e=>s(l[e]),f=e=>{const t=e[s("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=a(s(e));return i in u&&(t=u[i]),t}(i[0]);return 0===n||(e=>e[2]===a(e[0]+e[1]))(i)||(n=-2),n},p="[iframe-resizer]";const h=e=>`${p}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,m=(e,...t)=>((e,t,...i)=>window?.console[e](h(t),...i))("warn",e,...t),y=(e,t)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...t)=>[`${p}[${e}]`,...t].join(" "))(e))(t)),g={},b=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(y(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),w={position:null,version:e};function v(n){function a(){M(H),S(),O("onResized",H)}function s(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const c=e=>A.slice(A.indexOf(":")+7+e);const u=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){x(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},d=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[u]?i&&i!==t||(e(t,u),i=t,requestAnimationFrame((()=>{i=!1}))):c()},a=n("scroll"),s=n("resize window");function l(e,t){t(window,"scroll",a),t(window,"resize",s)}function c(){l(0,r),d.disconnect(),f.disconnect()}const u=P,d=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),d.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[u].iframe,{attributes:!0,childList:!1,subtree:!1}),g[u]&&(g[u][`stop${t}`]=c)},f=e=>()=>{e in g[P]&&(g[P][e](),delete g[P][e])},p=u("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),h=u("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),b=d(p,"PageInfo"),v=d(h,"ParentInfo"),j=f("stopPageInfo"),W=f("stopParentInfo");function L(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(w.position.x),y:Number(t.top)+Number(w.position.y)}}function N(e){const t=e?L(H.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){w.position=e,C(P)}(i)}function C(e){const{x:t,y:i}=w.position,n=g[e]?.iframe;!1!==O("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?S():$()}function E(e){let t={};if(0===H.width&&0===H.height){const e=c(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const O=(e,t)=>z(P,e,t);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?t===`${A}`.slice(0,i)&&A.slice(i).split(":")[0]in g&&(H=function(){const e=A.slice(i).split(":"),t=e[1]?Number(e[1]):0,n=g[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+s(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!g[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(g[P].loaded=!0,(null!==H.iframe||(m(P,`The iframe (${H.id}) was not found.`),0))&&function(){const{origin:e,sameDomain:t}=n;if(t)return!0;let i=g[P]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,n=!1;for(;t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){const t=g[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[P]?.firstRun&&g[P]&&(g[P].firstRun=!1),H.type){case"close":T(H.iframe);break;case"message":i=c(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":g[P].autoResize=JSON.parse(c(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":p("start",P),b();break;case"parentInfo":h("start",P),v();break;case"pageInfoStop":j();break;case"parentInfoStop":W();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=L(n);w.position={x:e.x,y:e.y},C(P),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(c(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(H.msg,P);break;case"reset":I(H);break;case"init":a(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(P),(t=H.msg)!==e&&(void 0!==t||y(P,"<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")),F=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void m(P,`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;a()}var t,i}())):m("","iframeResizer received messageData without id, message was: ",A)):Object.keys(g).forEach((e=>{g[e].mode>=0&&x("iFrame requested init",R(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){m(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===w.position&&(w.position={x:window.scrollX,y:window.scrollY})}function $(){w.position=null}function S(e){null!==w.position&&(window.scrollTo(w.position.x,w.position.y),$())}function I(e){k(e.id),M(e),x("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function x(e,i,n,o){g[n]&&(g[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:r,targetOrigin:a}=g[n];if(r)try{return void e.contentWindow.iframeChildListener(t+i)}catch(e){}o.postMessage(t+i,a)}():m(n,`[${e}] IFrame(${n}) not found`),o&&g[n]?.warningTimeout&&(g[n].msgTimeout=setTimeout((function(){if(void 0===g[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=g[n],{sandbox:r}=e;t||i||(g[n].loadErrorShown=!0,y(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${g[n].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The 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`))}),g[n].warningTimeout)))}function R(e){const t=g[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,w.version,t.mode].join(":")}let W=0,F=!1,L=!1;const N=t=>i=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&y(l,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function a(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const l=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||b.id+W++;return null!==document.getElementById(e)&&(e+=W++),e}(),i.id=e,(t||{}).log),e}(i.id);return l in g&&"iFrameResizer"in i?m(l,"Ignored iFrame, already setup."):(function(e){var t,n;g[l]={iframe:i,firstRun:!0,remoteHost:i?.src.split("/").slice(0,3).join("/"),...b,...r(e),mode:f(e),syncTitle:a(l)},function(){const{direction:e}=g[l];if("horizontal"===e)return g[l].sizeWidth=!0,void(g[l].sizeHeight=!1);if("none"===e)return g[l].sizeWidth=!1,g[l].sizeHeight=!1,void(g[l].autoResize=!1);if("vertical"!==e)throw new TypeError(l,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===g[l].direction?g[l].offsetHeight=t:g[l].offsetWidth=t),e?.offset&&y(l,"<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</>."),null===g[l].postMessageTarget&&(g[l].postMessageTarget=i.contentWindow),g[l].targetOrigin=!0===g[l].checkOrigin?""===(n=g[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(t),function(){const{mode:t}=g[l];var i;t<0&&y("Parent",`${d(t+2)}${d(2)}`),L||t<0||(L=!0,i=`v${e} (${(e=>s(c[e]))(t)})`,console.info(`%c[iframe-resizer] ${i}`,"font-weight: bold;"),t<1&&y("Parent",d(3)))}(),E(),function(){switch(i.style.overflow=!1===g[l]?.scrolling?"hidden":"auto",g[l]?.scrolling){case"omit":break;case!0:i.scrolling="yes";break;case!1:i.scrolling="no";break;default:i.scrolling=g[l]?g[l].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[l];"number"!=typeof e&&"0"!==e||(g[l].bodyMargin=`${e}px`)}(),function(e){const{id:t}=i,{mode:r,waitForLoad:a}=g[t];-1!==r&&-2!==r&&(o(i,"load",(function(){x("iFrame.onload",`${e}:${F}`,t,!0),function(){const e=g[l]?.firstRun,t=g[l]?.heightCalculationMethod in n;!e&&t&&I({iframe:i,height:0,width:0,type:"init"})}()})),!1===a&&x("init",`${e}:${F}`,t,!0))}(R(l)),function(){if(g[l]){const{iframe:e}=g[l],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){y(l,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:x.bind(null,"Window resize","resize",l),moveToAnchor(e){x("Move to anchor",`moveToAnchor:${e}`,l)},sendMessage(e){x("Send Message",`message:${e=JSON.stringify(e)}`,l)}};e.iframeResizer=t,e.iFrameResizer=t}}()),i?.iFrameResizer};function C(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&x(e,t,n)}))}("Tab Visible","resize")}const E=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",v),o(document,"visibilitychange",C),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))}));export{N as default};
20
+ const e="5.3.2",t="[iFrameSizer]",i=t.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,t,i,n)=>e.addEventListener(t,i,n||!1),r=(e,t,i)=>e.removeEventListener(t,i,!1),a=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},s=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),l=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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</>."],c=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],u=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),d=e=>s(l[e]),f=e=>{const t=e[s("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=a(s(e));return i in u&&(t=u[i]),t}(i[0]);return 0===n||(e=>e[2]===a(e[0]+e[1]))(i)||(n=-2),n},p="[iframe-resizer]";const h=e=>`${p}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,m=(e,...t)=>((e,t,...i)=>window?.console[e](h(t),...i))("warn",e,...t),y=(e,t)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...t)=>[`${p}[${e}]`,...t].join(" "))(e))(t)),g={},b=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(y(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),w={position:null,version:e};function v(n){function a(){M(H),S(),O("onResized",H)}function s(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const c=e=>A.slice(A.indexOf(":")+7+e);const u=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){x(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},d=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[u]?i&&i!==t||(e(t,u),i=t,requestAnimationFrame((()=>{i=!1}))):c()},a=n("scroll"),s=n("resize window");function l(e,t){t(window,"scroll",a),t(window,"resize",s)}function c(){l(0,r),d.disconnect(),f.disconnect()}const u=P,d=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),d.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[u].iframe,{attributes:!0,childList:!1,subtree:!1}),g[u]&&(g[u][`stop${t}`]=c)},f=e=>()=>{e in g[P]&&(g[P][e](),delete g[P][e])},p=u("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),h=u("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),b=d(p,"PageInfo"),v=d(h,"ParentInfo"),j=f("stopPageInfo"),W=f("stopParentInfo");function L(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(w.position.x),y:Number(t.top)+Number(w.position.y)}}function N(e){const t=e?L(H.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){w.position=e,C(P)}(i)}function C(e){const{x:t,y:i}=w.position,n=g[e]?.iframe;!1!==O("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?S():$()}function E(e){let t={};if(0===H.width&&0===H.height){const e=c(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const O=(e,t)=>z(P,e,t);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?t===`${A}`.slice(0,i)&&A.slice(i).split(":")[0]in g&&(H=function(){const e=A.slice(i).split(":"),t=e[1]?Number(e[1]):0,n=g[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+s(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!g[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(g[P].loaded=!0,(null!==H.iframe||(m(P,`The iframe (${H.id}) was not found.`),0))&&function(){const{origin:e,sameDomain:t}=n;if(t)return!0;let i=g[P]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,n=!1;for(;t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){const t=g[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[P]?.firstRun&&g[P]&&(g[P].firstRun=!1),H.type){case"close":T(H.iframe);break;case"message":i=c(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":g[P].autoResize=JSON.parse(c(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":p("start",P),b();break;case"parentInfo":h("start",P),v();break;case"pageInfoStop":j();break;case"parentInfoStop":W();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=L(n);w.position={x:e.x,y:e.y},C(P),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(c(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(H.msg,P);break;case"reset":I(H);break;case"init":a(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(P),(t=H.msg)!==e&&(void 0!==t||y(P,"<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")),F=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void m(P,`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;a()}var t,i}())):m("","iframeResizer received messageData without id, message was: ",A)):Object.keys(g).forEach((e=>{g[e].mode>=0&&x("iFrame requested init",R(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){m(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===w.position&&(w.position={x:window.scrollX,y:window.scrollY})}function $(){w.position=null}function S(e){null!==w.position&&(window.scrollTo(w.position.x,w.position.y),$())}function I(e){k(e.id),M(e),x("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function x(e,i,n,o){g[n]&&(g[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:r,targetOrigin:a}=g[n];if(r)try{return void e.contentWindow.iframeChildListener(t+i)}catch(e){}o.postMessage(t+i,a)}():m(n,`[${e}] IFrame(${n}) not found`),o&&g[n]?.warningTimeout&&(g[n].msgTimeout=setTimeout((function(){if(void 0===g[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=g[n],{sandbox:r}=e;t||i||(g[n].loadErrorShown=!0,y(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${g[n].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The 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`))}),g[n].warningTimeout)))}function R(e){const t=g[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,w.version,t.mode].join(":")}let W=0,F=!1,L=!1;const N=t=>i=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&y(l,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function a(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const l=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||b.id+W++;return null!==document.getElementById(e)&&(e+=W++),e}(),i.id=e,(t||{}).log),e}(i.id);return l in g&&"iFrameResizer"in i?m(l,"Ignored iFrame, already setup."):(function(e){var t,n;g[l]={iframe:i,firstRun:!0,remoteHost:i?.src.split("/").slice(0,3).join("/"),...b,...r(e),mode:f(e),syncTitle:a(l)},function(){const{direction:e}=g[l];if("horizontal"===e)return g[l].sizeWidth=!0,void(g[l].sizeHeight=!1);if("none"===e)return g[l].sizeWidth=!1,g[l].sizeHeight=!1,void(g[l].autoResize=!1);if("vertical"!==e)throw new TypeError(l,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===g[l].direction?g[l].offsetHeight=t:g[l].offsetWidth=t),e?.offset&&y(l,"<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</>."),null===g[l].postMessageTarget&&(g[l].postMessageTarget=i.contentWindow),g[l].targetOrigin=!0===g[l].checkOrigin?""===(n=g[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(t),function(){const{mode:t}=g[l];var i;t<0&&y("Parent",`${d(t+2)}${d(2)}`),L||t<0||(L=!0,i=`v${e} (${(e=>s(c[e]))(t)})`,console.info(`%c[iframe-resizer] ${i}`,"font-weight: bold;"),t<1&&y("Parent",d(3)))}(),E(),function(){switch(i.style.overflow=!1===g[l]?.scrolling?"hidden":"auto",g[l]?.scrolling){case"omit":break;case!0:i.scrolling="yes";break;case!1:i.scrolling="no";break;default:i.scrolling=g[l]?g[l].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[l];"number"!=typeof e&&"0"!==e||(g[l].bodyMargin=`${e}px`)}(),function(e){const{id:t}=i,{mode:r,waitForLoad:a}=g[t];-1!==r&&-2!==r&&(o(i,"load",(function(){x("iFrame.onload",`${e}:${F}`,t,!0),function(){const e=g[l]?.firstRun,t=g[l]?.heightCalculationMethod in n;!e&&t&&I({iframe:i,height:0,width:0,type:"init"})}()})),!1===a&&x("init",`${e}:${F}`,t,!0))}(R(l)),function(){if(g[l]){const{iframe:e}=g[l],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){y(l,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:x.bind(null,"Window resize","resize",l),moveToAnchor(e){x("Move to anchor",`moveToAnchor:${e}`,l)},sendMessage(e){x("Send Message",`message:${e=JSON.stringify(e)}`,l)}};e.iframeResizer=t,e.iFrameResizer=t}}()),i?.iFrameResizer};function C(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&x(e,t,n)}))}("Tab Visible","resize")}const E=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",v),o(document,"visibilitychange",C),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))}));export{N as default};
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/core 5.3.1 (umd) - 2024-09-12
4
+ * @module iframe-resizer/core 5.3.2 (umd) - 2024-10-22
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,4 +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).createResizer=t()}(this,(function(){"use strict";const e="5.3.1",t="[iFrameSizer]",i=t.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,t,i,n)=>e.addEventListener(t,i,n||!1),r=(e,t,i)=>e.removeEventListener(t,i,!1),s=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},a=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),l=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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</>."],c=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],d=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),u=e=>a(l[e]),f=e=>{const t=e[a("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=s(a(e));return i in d&&(t=d[i]),t}(i[0]);return 0===n||(e=>e[2]===s(e[0]+e[1]))(i)||(n=-2),n},p="[iframe-resizer]";const h=e=>`${p}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,m=(e,...t)=>((e,t,...i)=>window?.console[e](h(t),...i))("warn",e,...t),y=(e,t)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...t)=>[`${p}[${e}]`,...t].join(" "))(e))(t)),g={},b=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(y(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),w={position:null,version:e};function v(n){function s(){I(H),S(),O("onResized",H)}function a(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const c=e=>A.slice(A.indexOf(":")+7+e);const d=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){M(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame((()=>{o[s]=null})))},u=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[d]?i&&i!==t||(e(t,d),i=t,requestAnimationFrame((()=>{i=!1}))):c()},s=n("scroll"),a=n("resize window");function l(e,t){t(window,"scroll",s),t(window,"resize",a)}function c(){l(0,r),u.disconnect(),f.disconnect()}const d=P,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[d].iframe,{attributes:!0,childList:!1,subtree:!1}),g[d]&&(g[d][`stop${t}`]=c)},f=e=>()=>{e in g[P]&&(g[P][e](),delete g[P][e])},p=d("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,o||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})})),h=d("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})})),b=u(p,"PageInfo"),v=u(h,"ParentInfo"),j=f("stopPageInfo"),W=f("stopParentInfo");function L(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(w.position.x),y:Number(t.top)+Number(w.position.y)}}function N(e){const t=e?L(H.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){w.position=e,C(P)}(i)}function C(e){const{x:t,y:i}=w.position,n=g[e]?.iframe;!1!==O("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?S():$()}function E(e){let t={};if(0===H.width&&0===H.height){const e=c(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const O=(e,t)=>z(P,e,t);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?t===`${A}`.slice(0,i)&&A.slice(i).split(":")[0]in g&&(H=function(){const e=A.slice(i).split(":"),t=e[1]?Number(e[1]):0,n=g[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+a(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!g[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(g[P].loaded=!0,(null!==H.iframe||(m(P,`The iframe (${H.id}) was not found.`),0))&&function(){const{origin:e,sameDomain:t}=n;if(t)return!0;let i=g[P]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,n=!1;for(;t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){const t=g[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[P]?.firstRun&&g[P]&&(g[P].firstRun=!1),H.type){case"close":T(H.iframe);break;case"message":i=c(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":g[P].autoResize=JSON.parse(c(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":p("start",P),b();break;case"parentInfo":h("start",P),v();break;case"pageInfoStop":j();break;case"parentInfoStop":W();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=L(n);w.position={x:e.x,y:e.y},C(P),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(c(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(H.msg,P);break;case"reset":x(H);break;case"init":s(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(P),(t=H.msg)!==e&&(void 0!==t||y(P,"<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")),F=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void m(P,`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;s()}var t,i}())):m("","iframeResizer received messageData without id, message was: ",A)):Object.keys(g).forEach((e=>{g[e].mode>=0&&M("iFrame requested init",R(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){m(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===w.position&&(w.position={x:window.scrollX,y:window.scrollY})}function $(){w.position=null}function S(e){null!==w.position&&(window.scrollTo(w.position.x,w.position.y),$())}function x(e){k(e.id),I(e),M("reset","reset",e.id)}function I(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function M(e,i,n,o){g[n]&&(g[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:r,targetOrigin:s}=g[n];if(r)try{return void e.contentWindow.iframeChildListener(t+i)}catch(e){}o.postMessage(t+i,s)}():m(n,`[${e}] IFrame(${n}) not found`),o&&g[n]?.warningTimeout&&(g[n].msgTimeout=setTimeout((function(){if(void 0===g[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=g[n],{sandbox:r}=e;t||i||(g[n].loadErrorShown=!0,y(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${g[n].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The 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`))}),g[n].warningTimeout)))}function R(e){const t=g[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,w.version,t.mode].join(":")}let W=0,F=!1,L=!1;function N(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&M(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",v),o(document,"visibilitychange",N),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))}));return t=>i=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&y(l,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function s(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const l=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||b.id+W++;return null!==document.getElementById(e)&&(e+=W++),e}(),i.id=e,(t||{}).log),e}(i.id);return l in g&&"iFrameResizer"in i?m(l,"Ignored iFrame, already setup."):(function(e){var t,n;g[l]={iframe:i,firstRun:!0,remoteHost:i?.src.split("/").slice(0,3).join("/"),...b,...r(e),mode:f(e),syncTitle:s(l)},function(){const{direction:e}=g[l];if("horizontal"===e)return g[l].sizeWidth=!0,void(g[l].sizeHeight=!1);if("none"===e)return g[l].sizeWidth=!1,g[l].sizeHeight=!1,void(g[l].autoResize=!1);if("vertical"!==e)throw new TypeError(l,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===g[l].direction?g[l].offsetHeight=t:g[l].offsetWidth=t),e?.offset&&y(l,"<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</>."),null===g[l].postMessageTarget&&(g[l].postMessageTarget=i.contentWindow),g[l].targetOrigin=!0===g[l].checkOrigin?""===(n=g[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(t),function(){const{mode:t}=g[l];var i;t<0&&y("Parent",`${u(t+2)}${u(2)}`),L||t<0||(L=!0,i=`v${e} (${(e=>a(c[e]))(t)})`,console.info(`%c[iframe-resizer] ${i}`,"font-weight: bold;"),t<1&&y("Parent",u(3)))}(),C(),function(){switch(i.style.overflow=!1===g[l]?.scrolling?"hidden":"auto",g[l]?.scrolling){case"omit":break;case!0:i.scrolling="yes";break;case!1:i.scrolling="no";break;default:i.scrolling=g[l]?g[l].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[l];"number"!=typeof e&&"0"!==e||(g[l].bodyMargin=`${e}px`)}(),function(e){const{id:t}=i,{mode:r,waitForLoad:s}=g[t];-1!==r&&-2!==r&&(o(i,"load",(function(){M("iFrame.onload",`${e}:${F}`,t,!0),function(){const e=g[l]?.firstRun,t=g[l]?.heightCalculationMethod in n;!e&&t&&x({iframe:i,height:0,width:0,type:"init"})}()})),!1===s&&M("init",`${e}:${F}`,t,!0))}(R(l)),function(){if(g[l]){const{iframe:e}=g[l],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){y(l,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:M.bind(null,"Window resize","resize",l),moveToAnchor(e){M("Move to anchor",`moveToAnchor:${e}`,l)},sendMessage(e){M("Send Message",`message:${e=JSON.stringify(e)}`,l)}};e.iframeResizer=t,e.iFrameResizer=t}}()),i?.iFrameResizer}}));
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).createResizer=t()}(this,(function(){"use strict";const e="5.3.2",t="[iFrameSizer]",i=t.length,n=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),o=(e,t,i,n)=>e.addEventListener(t,i,n||!1),r=(e,t,i)=>e.removeEventListener(t,i,!1),s=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},a=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),l=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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</>."],c=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],d=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),u=e=>a(l[e]),f=e=>{const t=e[a("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=s(a(e));return i in d&&(t=d[i]),t}(i[0]);return 0===n||(e=>e[2]===s(e[0]+e[1]))(i)||(n=-2),n},p="[iframe-resizer]";const h=e=>`${p}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(e)}]`,m=(e,...t)=>((e,t,...i)=>window?.console[e](h(t),...i))("warn",e,...t),y=(e,t)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((e=>(...t)=>[`${p}[${e}]`,...t].join(" "))(e))(t)),g={},b=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(y(e.id,"\nDeprecated Option\n\nThe onInit() function is deprecated and has been replaced with onReady(). It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),w={position:null,version:e};function v(n){function s(){I(H),S(),O("onResized",H)}function a(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function l(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const c=e=>A.slice(A.indexOf(":")+7+e);const d=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){M(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame((()=>{o[s]=null})))},u=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[d]?i&&i!==t||(e(t,d),i=t,requestAnimationFrame((()=>{i=!1}))):c()},s=n("scroll"),a=n("resize window");function l(e,t){t(window,"scroll",s),t(window,"resize",a)}function c(){l(0,r),u.disconnect(),f.disconnect()}const d=P,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));l(0,o),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[d].iframe,{attributes:!0,childList:!1,subtree:!1}),g[d]&&(g[d][`stop${t}`]=c)},f=e=>()=>{e in g[P]&&(g[P][e](),delete g[P][e])},p=d("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=H.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,o||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})})),h=d("parentInfo",(function(){const{iframe:e}=H,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})})),b=u(p,"PageInfo"),v=u(h,"ParentInfo"),j=f("stopPageInfo"),W=f("stopParentInfo");function L(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(w.position.x),y:Number(t.top)+Number(w.position.y)}}function N(e){const t=e?L(H.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(H,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){w.position=e,C(P)}(i)}function C(e){const{x:t,y:i}=w.position,n=g[e]?.iframe;!1!==O("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?S():$()}function E(e){let t={};if(0===H.width&&0===H.height){const e=c(9).split(":");t={x:e[1],y:e[0]}}else t={x:H.width,y:H.height};O(e,{iframe:H.iframe,screenX:Number(t.x),screenY:Number(t.y),type:H.type})}const O=(e,t)=>z(P,e,t);let A=n.data,H={},P=null;"[iFrameResizerChild]Ready"!==A?t===`${A}`.slice(0,i)&&A.slice(i).split(":")[0]in g&&(H=function(){const e=A.slice(i).split(":"),t=e[1]?Number(e[1]):0,n=g[e[0]]?.iframe,o=getComputedStyle(n);return{iframe:n,id:e[0],height:t+a(o)+l(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),P=H.id,P?(function(e){if(!g[e])throw new Error(`${H.type} No settings for ${e}. Message was: ${A}`)}(P),H.type in{true:1,false:1,undefined:1}||(g[P].loaded=!0,(null!==H.iframe||(m(P,`The iframe (${H.id}) was not found.`),0))&&function(){const{origin:e,sameDomain:t}=n;if(t)return!0;let i=g[P]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,n=!1;for(;t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){const t=g[P]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${H.iframe.id}. Message was: ${n.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[P]?.firstRun&&g[P]&&(g[P].firstRun=!1),H.type){case"close":T(H.iframe);break;case"message":i=c(6),O("onMessage",{iframe:H.iframe,message:JSON.parse(i)});break;case"mouseenter":E("onMouseEnter");break;case"mouseleave":E("onMouseLeave");break;case"autoResize":g[P].autoResize=JSON.parse(c(9));break;case"scrollBy":!function(){const e=H.width,t=H.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":p("start",P),b();break;case"parentInfo":h("start",P),v();break;case"pageInfoStop":j();break;case"parentInfoStop":W();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=L(n);w.position={x:e.x,y:e.y},C(P),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(c(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(H.msg,P);break;case"reset":x(H);break;case"init":s(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(P),(t=H.msg)!==e&&(void 0!==t||y(P,"<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")),F=!0,O("onReady",H.iframe);break;default:if(0===H.width&&0===H.height)return void m(P,`Unsupported message received (${H.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===H.width||0===H.height)return;if(document.hidden)return;s()}var t,i}())):m("","iframeResizer received messageData without id, message was: ",A)):Object.keys(g).forEach((e=>{g[e].mode>=0&&M("iFrame requested init",R(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){m(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===w.position&&(w.position={x:window.scrollX,y:window.scrollY})}function $(){w.position=null}function S(e){null!==w.position&&(window.scrollTo(w.position.x,w.position.y),$())}function x(e){k(e.id),I(e),M("reset","reset",e.id)}function I(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function M(e,i,n,o){g[n]&&(g[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:r,targetOrigin:s}=g[n];if(r)try{return void e.contentWindow.iframeChildListener(t+i)}catch(e){}o.postMessage(t+i,s)}():m(n,`[${e}] IFrame(${n}) not found`),o&&g[n]?.warningTimeout&&(g[n].msgTimeout=setTimeout((function(){if(void 0===g[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=g[n],{sandbox:r}=e;t||i||(g[n].loadErrorShown=!0,y(n,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${g[n].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 <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}\n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The 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`))}),g[n].warningTimeout)))}function R(e){const t=g[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,w.version,t.mode].join(":")}let W=0,F=!1,L=!1;function N(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&M(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{o(window,"message",v),o(document,"visibilitychange",N),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))}));return t=>i=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&y(l,'<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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e}function s(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const l=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||b.id+W++;return null!==document.getElementById(e)&&(e+=W++),e}(),i.id=e,(t||{}).log),e}(i.id);return l in g&&"iFrameResizer"in i?m(l,"Ignored iFrame, already setup."):(function(e){var t,n;g[l]={iframe:i,firstRun:!0,remoteHost:i?.src.split("/").slice(0,3).join("/"),...b,...r(e),mode:f(e),syncTitle:s(l)},function(){const{direction:e}=g[l];if("horizontal"===e)return g[l].sizeWidth=!0,void(g[l].sizeHeight=!1);if("none"===e)return g[l].sizeWidth=!1,g[l].sizeHeight=!1,void(g[l].autoResize=!1);if("vertical"!==e)throw new TypeError(l,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===g[l].direction?g[l].offsetHeight=t:g[l].offsetWidth=t),e?.offset&&y(l,"<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</>."),null===g[l].postMessageTarget&&(g[l].postMessageTarget=i.contentWindow),g[l].targetOrigin=!0===g[l].checkOrigin?""===(n=g[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}(t),function(){const{mode:t}=g[l];var i;t<0&&y("Parent",`${u(t+2)}${u(2)}`),L||t<0||(L=!0,i=`v${e} (${(e=>a(c[e]))(t)})`,console.info(`%c[iframe-resizer] ${i}`,"font-weight: bold;"),t<1&&y("Parent",u(3)))}(),C(),function(){switch(i.style.overflow=!1===g[l]?.scrolling?"hidden":"auto",g[l]?.scrolling){case"omit":break;case!0:i.scrolling="yes";break;case!1:i.scrolling="no";break;default:i.scrolling=g[l]?g[l].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[l];"number"!=typeof e&&"0"!==e||(g[l].bodyMargin=`${e}px`)}(),function(e){const{id:t}=i,{mode:r,waitForLoad:s}=g[t];-1!==r&&-2!==r&&(o(i,"load",(function(){M("iFrame.onload",`${e}:${F}`,t,!0),function(){const e=g[l]?.firstRun,t=g[l]?.heightCalculationMethod in n;!e&&t&&x({iframe:i,height:0,width:0,type:"init"})}()})),!1===s&&M("init",`${e}:${F}`,t,!0))}(R(l)),function(){if(g[l]){const{iframe:e}=g[l],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){y(l,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:M.bind(null,"Window resize","resize",l),moveToAnchor(e){M("Move to anchor",`moveToAnchor:${e}`,l)},sendMessage(e){M("Send Message",`message:${e=JSON.stringify(e)}`,l)}};e.iframeResizer=t,e.iFrameResizer=t}}()),i?.iFrameResizer}}));
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@iframe-resizer/core",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
7
7
  "name": "David J. Bradshaw",
8
8
  "email": "info@iframe-resizer.com"
9
9
  },
10
- "description": "Keep iFrames sized to their content.",
10
+ "description": "Keep iframes sized to their content.",
11
11
  "github": "https://github.com/davidjbradshaw/iframe-resizer",
12
12
  "repository": {
13
13
  "type": "git",