@iframe-resizer/jquery 5.5.6 → 5.5.7

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
@@ -25,4 +25,4 @@ yarn add @iframe-resizer/jquery
25
25
 
26
26
  ---
27
27
 
28
- _iframe-resizer version 5.5.6 2025-09-10 - 16:04:48.965Z_
28
+ _iframe-resizer version 5.5.7 2025-09-23 - 09:33:32.779Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.6 (cjs) - 2025-09-10
4
+ * @module iframe-resizer/jquery 5.5.7 (cjs) - 2025-09-23
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -23,6 +23,7 @@ const connectResizer = require('@iframe-resizer/core');
23
23
  const acg = require('auto-console-group');
24
24
 
25
25
  const LABEL = 'iframeResizer';
26
+ const PARENT = 'parent';
26
27
 
27
28
  const deprecate = (advise) =>
28
29
  (type, change = 'renamed to') =>
@@ -61,7 +62,7 @@ const createConsoleGroup = esModuleInterop(acg);
61
62
 
62
63
  const parent = createConsoleGroup({
63
64
  expand: false,
64
- label: 'parent',
65
+ label: PARENT,
65
66
  });
66
67
 
67
68
  const output =
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.6 (esm) - 2025-09-10
4
+ * @module iframe-resizer/jquery 5.5.7 (esm) - 2025-09-23
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -21,6 +21,7 @@ import connectResizer from '@iframe-resizer/core';
21
21
  import acg from 'auto-console-group';
22
22
 
23
23
  const LABEL = 'iframeResizer';
24
+ const PARENT = 'parent';
24
25
 
25
26
  const deprecate = (advise) =>
26
27
  (type, change = 'renamed to') =>
@@ -59,7 +60,7 @@ const createConsoleGroup = esModuleInterop(acg);
59
60
 
60
61
  const parent = createConsoleGroup({
61
62
  expand: false,
62
- label: 'parent',
63
+ label: PARENT,
63
64
  });
64
65
 
65
66
  const output =
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.6 (umd) - 2025-09-10
4
+ * @module iframe-resizer/jquery 5.5.7 (umd) - 2025-09-23
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){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t=e+"font-style: italic;",i="default",n=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:a,keys:l}=Object,c=e=>[e,s[e]],u=e=>t=>[t,function(i){e[t]=i}],d=(e,t)=>a(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.6",g="iframeResizer",y="autoResize",b="init",v="iframeReady",w="load",z="message",j="onload",$="pageInfo",k="parentInfo",T="reset",x="resize",M="scroll",R="none",S="vertical",E="horizontal",O="[iFrameSizer]",C=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),I=Object.freeze({[j]:1,[b]:1,[v]:1}),A="expanded",W="collapsed",L=Object.freeze({[A]:1,[W]:1}),N=(e,t,i,n)=>e.addEventListener(t,i,n||!1),B=(e,t,i)=>e.removeEventListener(t,i,!1),F=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)},H=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),P=["spjluzl","rlf","clyzpvu"],q=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],U=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],D=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),Q=e=>H(q[e]),J=e=>{const t=e[H(P[0])]||e[H(P[1])]||e[H(P[2])];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=F(H(e));return i in D&&(t=D[i]),t}(i[0]);return 0===n||(e=>e[2]===F(e[0]+e[1]))(i)||(n=-2),n},Z=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),V=e=>e,X=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),Y={},G=(_=function(a={}){const l={},f={},p=[],m={...o,expand:!a.collapsed||o.expanded,...a};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in n)||!!m.expand;function v(){if(0!==p.length){s[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),y()}else y()}function w(){""===h&&(h=function(){const e=new Date,t=(t,i)=>e[t]().toString().padStart(i,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(v))),p.push([e,...t])}function j(e=i,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(m,u(m)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=i){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=i){delete f[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let i;try{i=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),v()}return i},event:function(e){w(),m.event=e},purge:g,time:function(e=i){w(),l[e]=performance.now()},timeEnd:function(e=i){j(e),delete l[e]},timeLog:j,touch:w}},_?.__esModule?_.default:_);var _;let K=!0;const ee=G({expand:!1,label:"parent"}),te=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const ie=e=>(t,...i)=>Y[t]?Y[t].console[e](...i):ee[e](...i);var ne;const oe=(ne="log",(e,...t)=>!0===(e=>Y[e]?Y[e].log:K)(e)?ie(ne)(e,...t):null),re=ie("warn"),se=ie("error"),ae=ie("event"),le=ie("purge"),ce=ie("errorBoundary");const ue=(e,...t)=>Y[e]?Y[e].console.warn(X(V)(...t)):queueMicrotask(()=>console?.warn(X((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),de=(e=>(t,i="renamed to")=>(n,o,r="",s="")=>e(s,`<rb>Deprecated ${t}(${n.replace("()","")})</>\n\nThe <b>${n}</> ${t.toLowerCase()} has been ${i} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(ue),fe=de("Method"),pe=de("Option");function me(e,t){const{msgTimeout:i,warningTimeout:n}=t[e];n&&(i&&clearTimeout(i),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:i,loadErrorShown:n}=t[e];t[e].msgTimeout=void 0,i||n||(t[e].loadErrorShown=!0,function(e,t){const{iframe:i,waitForLoad:n}=t[e],{sandbox:o}=i,r="object"==typeof o&&o.length>0&&!(o.contains("allow-scripts")&&o.contains("allow-same-origin"));ae(e,"noResponse"),ue(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${n?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},n))}const he=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:S,firstRun:!0,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof Y[e.id].onInit&&(pe("init()","onReady()","",e.id),Y[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ge={position:null,version:h};function ye(e){function t(){Te(L),$e(P),E("onResized",L)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>A.slice(A.indexOf(":")+7+e);const r=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){Me(`${i} (${e})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame(()=>{o[s]=null}))},s=(e,t)=>()=>{let i=!1;const n=t=>()=>{Y[l]?i&&i!==t||(e(t,l),i=t,requestAnimationFrame(()=>{i=!1})):a()},o=n(M),r=n("resize window");function s(e,t){t(window,M,o),t(window,x,r)}function a(){ae(l,`stop${t}`),s(0,B),c.disconnect(),u.disconnect(),B(Y[l].iframe,w,a)}const l=P,c=new ResizeObserver(n("pageObserver")),u=new ResizeObserver(n("iframeObserver"));Y[l]&&(Y[l][`stop${t}`]=a,N(Y[l].iframe,w,a),s(0,N),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(Y[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},a=e=>()=>{e in Y[P]&&(Y[P][e](),delete Y[P][e])},l=r($,function(){const e=document.body.getBoundingClientRect(),t=L.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})}),c=r(k,function(){const{iframe:e}=L,{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}})}),u=s(l,"PageInfo"),d=s(c,"ParentInfo"),f=a("stopPageInfo"),g=a("stopParentInfo");function v(e){const t=e.getBoundingClientRect();return ze(),{x:Number(t.left)+Number(ge.position.x),y:Number(t.top)+Number(ge.position.y)}}function j(e){const t=e?v(L.iframe):{x:0,y:0};oe(P,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(L,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](i.x,i.y))}(n,i):function(e){ge.position=e,R(P)}(i)}function R(e){const{x:t,y:i}=ge.position,n=Y[e]?.iframe;!1!==E("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?$e(e):je()}function S(e){let t={};if(0===L.width&&0===L.height){const e=o(9).split(":");t={x:e[1],y:e[0]}}else t={x:L.width,y:L.height};E(e,{iframe:L.iframe,screenX:Number(t.x),screenY:Number(t.y),type:L.type})}const E=(e,t)=>be(P,e,t);function C(){const{height:e,iframe:i,msg:n,type:r,width:s}=L;switch(Y[P]?.firstRun&&function(){if(!Y[P])return;Oe(P,L.mode),Y[P].firstRun=!1}(),r){case"close":we(i);break;case z:l=o(6),E("onMessage",{iframe:L.iframe,message:JSON.parse(l)});break;case"mouseenter":S("onMouseEnter");break;case"mouseleave":S("onMouseLeave");break;case"beforeUnload":oe(P,"Ready state reset"),Y[P].initialised=!1;break;case y:Y[P].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=L.width,t=L.height,i=window.parentIframe||window.parentIFrame||window;oe(P,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),i.scrollBy(e,t)}();break;case"scrollTo":j(!1);break;case"scrollToOffset":j(!0);break;case $:u();break;case k:d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();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=v(n);oe(P,`Moving to in page link: %c#${t}`,p),ge.position={x:e.x,y:e.y},R(P),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(o(9));break;case"title":!function(e,t){Y[t]?.syncTitle&&(Y[t].iframe.title=e,oe(t,`Set iframe title attribute: %c${e}`,p))}(n,P);break;case T:ke(L);break;case b:t(),function(e){try{Y[e].sameOrigin=!!Y[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){Y[e].sameOrigin=!1}}(P),(a=n)!==h&&(void 0!==a||ue(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")),Y[P].initialised=!0,E("onReady",i);break;default:if(0===s&&0===e)return void re(P,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===s||0===e)return;if(document.hidden)return;t()}var a,l}function I(e){if(!Y[e])throw new Error(`${L.type} No settings for ${e}. Message was: ${A}`)}let A=e.data;if("[iFrameResizerChild]Ready"===A)return W=e.source,void Object.values(Y).forEach((e=>({initChild:t,initialised:i,postMessageTarget:n})=>{i||e!==n||t()})(W));var W;if(!(e=>O===`${e}`.slice(0,13)&&e.slice(13).split(":")[0]in Y)(A)){if("string"!=typeof A)return;return void ae("parent","ignoredMessage")}const L=function(e){const t=e.slice(13).split(":"),o=t[1]?Number(t[1]):0,r=Y[t[0]]?.iframe,s=getComputedStyle(r),a={iframe:r,id:t[0],height:o+i(s)+n(s),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(A),{id:F,type:H}=L,P=F;P?(ae(P,H),ce(P,function(t){I(P),L.type in{true:1,false:1,undefined:1}||(null!==L.iframe||(re(P,`The iframe (${L.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:i}=e;if(i)return!0;let n=Y[P]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(;e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=Y[P]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${L.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&C()})(A)):re("","iframeResizer received messageData without id, message was: ",A)}function be(e,t,i){let n=null,o=null;if(Y[e]){if(n=Y[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{o=n(i)}catch(i){console.error(i),re(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(n,i)}return o}function ve(e){const{id:t}=e;delete Y[t],delete e.iframeResizer}function we(e){const{id:t}=e;if(!1!==be(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){re(t,e)}be(t,"onAfterClose",t),ve(e)}}function ze(e){null===ge.position&&(ge.position={x:window.scrollX,y:window.scrollY})}function je(){ge.position=null}function $e(e){null!==ge.position&&(window.scrollTo(ge.position.x,ge.position.y),oe(e,`Set page position: %c${ge.position.x}%c, %c${ge.position.y}`,p,m,p),je())}function ke(e){ze(e.id),Te(e),Me(T,T,e.id)}function Te(e){function t(t){const n=`${e[t]}px`;e.iframe.style[t]=n,oe(i,`Set ${t}: %c${n}`,p)}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=Y[i];n&&t("height"),o&&t("width")}const xe=e=>e.split(":").filter((e,t)=>19!==t).join(":");function Me(e,t,i){function n(n){const o=e in I?xe(t):t;oe(i,n,p,m,p),oe(i,`Message data: %c${o}`,p)}ae(i,e),Y[i]&&(Y[i]?.postMessageTarget?function(){const{iframe:o,postMessageTarget:r,sameOrigin:s,targetOrigin:a}=Y[i];if(s)try{return o.contentWindow.iframeChildListener(O+t),void n(`Sending message to iframe %c${i}%c via same origin%c`)}catch(t){e in I?Y[i].sameOrigin=!1:re(i,"Same origin messaging failed, falling back to postMessage")}n(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),r.postMessage(O+t,a)}():re(i,`Iframe(${i}) not found`))}let Re=0,Se=!1,Ee=!1;function Oe(t,i=-3){if(Se)return;const n=Math.max(Y[t].mode,i);if(n>Y[t].mode&&(Y[t].mode=n),n<0)throw le(t),Y[t].vAdvised||ue(t||"Parent",`${Q(n+2)}${Q(2)}`),Y[t].vAdvised=!0,Q(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");n>0&&Ee||function(t,i){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,K||i<1?"font-weight: bold;":e))}(`v${h} (${(e=>H(U[e]))(n)})`,n),n<1&&ue("Parent",Q(3)),Se=!0}const Ce=e=>t=>{function i(){if(Y[u]){const{iframe:e}=Y[u],t={close:we.bind(null,e),disconnect:ve.bind(null,e),removeListeners(){ue(u,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){ue(u,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),Me.bind(null,"Window resize",x,u)},moveToAnchor(e){((e,t,i)=>{if(typeof e!==t)throw new TypeError(`${i} is not a ${n=t,n.charAt(0).toUpperCase()+n.slice(1)}`);var n})(e,"string","moveToAnchor(anchor) anchor"),Me("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){e=JSON.stringify(e),Me(z,`${z}:${e}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function n(e,i){const{waitForLoad:n}=Y[e],o=n=>()=>{Y[e]&&!0!==Y[e].initialised&&(Me(n,i,e),me(e,Y),Y[e].firstRun||Y[u]?.heightCalculationMethod in C&&ke({iframe:t,height:1,width:1,type:b}))},r=o(j);N(t,w,()=>setTimeout(r,1)),Y[e].initChild=o(v),!0!==n&&((e=>{const{src:t,srcdoc:i}=e;return!i&&(null==t||""===t||"about:blank"===t)})(t)?setTimeout(()=>{ae(e,"noContent"),oe(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(o(b)))}function o(e){return e?(("sizeWidth"in e||"sizeHeight"in e||y in e)&&ue(u,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${S}"</>, <i>"${E}"</> or <i>"${R}"</>.\n`),e):{}}function r(e){const t=Y[e]?.iframe?.title;return""===t||void 0===t}function s(e,t){Z(Y[u],e)&&(ue(u,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),Y[u][t]=Y[u][e],delete Y[u][e])}const a=e=>Z(e,"onMouseEnter")||Z(e,"onMouseLeave");function l(e){var i,n;Y[u]={...Y[u],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...he,...o(e),mouseEvents:a(e),mode:J(e),syncTitle:r(u)},s("offset","offsetSize"),s("onClose","onBeforeClose"),s("onClosed","onAfterClose"),ae(u,"setup"),function(){const{direction:e}=Y[u];switch(e){case S:break;case E:Y[u].sizeHeight=!1;case"both":Y[u].sizeWidth=!0;break;case R:Y[u].sizeWidth=!1,Y[u].sizeHeight=!1,Y[u].autoResize=!1;break;default:throw new TypeError(u,`Direction value of "${e}" is not valid`)}}(),(i=e?.offsetSize||e?.offset)&&(Y[u].direction===S?Y[u].offsetHeight=i:Y[u].offsetWidth=i),function(e){e?.offset&&ue(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),Y[u].warningTimeout||oe(u,"warningTimeout:%c disabled",p),null===Y[u].postMessageTarget&&(Y[u].postMessageTarget=t.contentWindow),Y[u].targetOrigin=!0===Y[u].checkOrigin?""===(n=Y[u].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const c=()=>g in t,u=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||he.id+Re++;return null!==document.getElementById(t)&&(t+=Re++),t}(),t.id=i,ae(i,"assignId")),i}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=W,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const i=Z(t,"log"),n="string"==typeof t.log,o=i?!!n||t.log:he.log;Z(t,"logExpand")||(t.logExpand=i&&n?t.log===A:he.logExpand),function(e){-1===e?.log&&(e.log=!1,Ee=!0)}(t),function({enabled:e,expand:t,iframeId:i}){const n=G({expand:t,label:te(i)});K=e,Y[i]||(Y[i]={console:n})}({enabled:o,expand:t.logExpand,iframeId:e}),n&&!(t.log in L)&&se(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,e),ce(u,function(e){c()?re(u,`Ignored iframe (${u}), already setup.`):(l(e),function(){if(Se)return;const{mode:e}=Y[u];-1!==e&&Oe(u,e)}(),Ae(),function(){switch(t.style.overflow=!1===Y[u]?.scrolling?"hidden":"auto",Y[u]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=Y[u]?Y[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=Y[u];"number"!=typeof e&&"0"!==e||(Y[u].bodyMargin=`${e}px`)}(),n(u,function(e){const t=Y[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,ge.version,t.mode,"",t.logExpand].join(":")}(u)),i())})(e),t?.iframeResizer};function Ie(){!0!==document.hidden&&((e,t)=>{Object.values(Y).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:i})=>Me(e,t,i.id))})("tabVisible",x)}const Ae=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{N(window,z,ye),N(document,"visibilitychange",Ie),window.iframeParentListener=e=>setTimeout(()=>ye({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:re("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:re("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:re("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Ce(e);return this.filter("iframe").each((e,i)=>t(i)).end()},window.jQuery.fn.iFrameResize=function(e){return fe("iFrameResize()","iframeResize()","","jQuery"),this.iframeResize(e)}}});
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t=e+"font-style: italic;",n="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:a,keys:l}=Object,c=e=>[e,s[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>a(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.7",g="iframeResizer",y=":",b="autoResize",v="init",w="iframeReady",z="load",j="message",$="onload",k="pageInfo",T="parentInfo",x="reset",M="resize",R="scroll",S="child",E="parent",O="string",C="object",I="function",W="auto",A="none",L="vertical",N="horizontal",B="[iFrameSizer]",F=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),H=Object.freeze({[$]:1,[v]:1,[w]:1}),P="expanded",q="collapsed",U=Object.freeze({[P]:1,[q]:1}),D=(e,t,n,i)=>e.addEventListener(t,n,i||!1),Q=(e,t,n)=>e.removeEventListener(t,n,!1),J=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Z=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),V=["spjluzl","rlf","clyzpvu"],X=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],Y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],G=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),_=e=>Z(X[e]),K=e=>{const t=e[Z(V[0])]||e[Z(V[1])]||e[Z(V[2])];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=J(Z(e));return n in G&&(t=G[n]),t}(n[0]);return 0===i||(e=>e[2]===J(e[0]+e[1]))(n)||(i=-2),i},ee=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),te=e=>e,ne=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),ie={},oe=(re=function(a={}){const l={},f={},p=[],m={...o,expand:!a.collapsed||o.expanded,...a};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in i)||!!m.expand;function v(){if(0!==p.length){s[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),y()}else y()}function w(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(v))),p.push([e,...t])}function j(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(m,u(m)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),v()}return n},event:function(e){w(),m.event=e},purge:g,time:function(e=n){w(),l[e]=performance.now()},timeEnd:function(e=n){j(e),delete l[e]},timeLog:j,touch:w}},re?.__esModule?re.default:re);var re;let se=!0;const ae=oe({expand:!1,label:E}),le=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const ce=e=>(t,...n)=>ie[t]?ie[t].console[e](...n):ae[e](...n);var ue;const de=(ue="log",(e,...t)=>!0===(e=>ie[e]?ie[e].log:se)(e)?ce(ue)(e,...t):null),fe=ce("warn"),pe=ce("error"),me=ce("event"),he=ce("purge"),ge=ce("errorBoundary");const ye=(e,...t)=>ie[e]?ie[e].console.warn(ne(te)(...t)):queueMicrotask(()=>console?.warn(ne((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),be=(e=>(t,n="renamed to")=>(i,o,r="",s="")=>e(s,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(ye),ve=be("Method"),we=be("Option");function ze(e,t){const{msgTimeout:n,warningTimeout:i}=t[e];i&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:n,loadErrorShown:i}=t[e];t[e].msgTimeout=void 0,n||i||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:i}=t[e],{sandbox:o}=n,r=typeof o===C&&o.length>0&&!(o.contains("allow-scripts")&&o.contains("allow-same-origin"));me(e,"noResponse"),ye(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},i))}const je=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:L,firstRun:!0,inPageLinks:!1,heightCalculationMethod:W,id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:W,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof ie[e.id].onInit===I&&(we("init()","onReady()","",e.id),ie[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),$e={position:null,version:h};function ke(e){function t(){Ce(F),Ee(q),I("onResized",F)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>L.slice(L.indexOf(y)+7+e);const r=(e,t)=>(n,i)=>{const o={};var r,s;r=function(){We(`${n} (${e})`,`${e}:${t()}`,i)},o[s=i]||(r(),o[s]=requestAnimationFrame(()=>{o[s]=null}))},s=(e,t)=>()=>{let n=!1;const i=t=>()=>{ie[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):a()},o=i(R),r=i("resize window");function s(e,t){t(window,R,o),t(window,M,r)}function a(){me(l,`stop${t}`),s(0,Q),c.disconnect(),u.disconnect(),Q(ie[l].iframe,z,a)}const l=q,c=new ResizeObserver(i("pageObserver")),u=new ResizeObserver(i("iframeObserver"));ie[l]&&(ie[l][`stop${t}`]=a,D(ie[l].iframe,z,a),s(0,D),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ie[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},a=e=>()=>{e in ie[q]&&(ie[q][e](),delete ie[q][e])},l=r(k,function(){const e=document.body.getBoundingClientRect(),t=F.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,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:n,scrollLeft:i,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})}),c=r(T,function(){const{iframe:e}=F,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})}),u=s(l,"PageInfo"),d=s(c,"ParentInfo"),f=a("stopPageInfo"),g=a("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return Re(),{x:Number(t.left)+Number($e.position.x),y:Number(t.top)+Number($e.position.y)}}function $(e){const t=e?w(F.iframe):{x:0,y:0};de(q,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(F,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(i,n):function(e){$e.position=e,S(q)}(n)}function S(e){const{x:t,y:n}=$e.position,i=ie[e]?.iframe;!1!==I("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?Ee(e):Se()}function C(e){let t={};if(0===F.width&&0===F.height){const e=o(9).split(y);t={x:e[1],y:e[0]}}else t={x:F.width,y:F.height};I(e,{iframe:F.iframe,screenX:Number(t.x),screenY:Number(t.y),type:F.type})}const I=(e,t)=>Te(q,e,t);function W(){const{height:e,iframe:n,msg:i,type:r,width:s}=F;switch(ie[q]?.firstRun&&function(){if(!ie[q])return;Be(q,F.mode),ie[q].firstRun=!1}(),r){case"close":Me(n);break;case j:l=o(6),I("onMessage",{iframe:F.iframe,message:JSON.parse(l)});break;case"mouseenter":C("onMouseEnter");break;case"mouseleave":C("onMouseLeave");break;case"beforeUnload":de(q,"Ready state reset"),ie[q].initialised=!1;break;case b:ie[q].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=F.width,t=F.height,n=window.parentIframe||window.parentIFrame||window;de(q,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),n.scrollBy(e,t)}();break;case"scrollTo":$(!1);break;case"scrollToOffset":$(!0);break;case k:u();break;case T:d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=w(i);de(q,`Moving to in page link: %c#${t}`,p),$e.position={x:e.x,y:e.y},S(q),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(o(9));break;case"title":!function(e,t){ie[t]?.syncTitle&&(ie[t].iframe.title=e,de(t,`Set iframe title attribute: %c${e}`,p))}(i,q);break;case x:Oe(F);break;case v:t(),function(e){try{ie[e].sameOrigin=!!ie[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ie[e].sameOrigin=!1}}(q),(a=i)!==h&&(void 0!==a||ye(q,"<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")),ie[q].initialised=!0,I("onReady",n);break;default:if(0===s&&0===e)return void fe(q,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===s||0===e)return;if(document.hidden)return;t()}var a,l}function A(e){if(!ie[e])throw new Error(`${F.type} No settings for ${e}. Message was: ${L}`)}let L=e.data;if("[iFrameResizerChild]Ready"===L)return N=e.source,void Object.values(ie).forEach((e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()})(N));var N;if(!(e=>B===`${e}`.slice(0,13)&&e.slice(13).split(y)[0]in ie)(L)){if(typeof L!==O)return;return void me(E,"ignoredMessage")}const F=function(e){const t=e.slice(13).split(y),o=t[1]?Number(t[1]):0,r=ie[t[0]]?.iframe,s=getComputedStyle(r),a={iframe:r,id:t[0],height:o+n(s)+i(s),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(L),{id:H,type:P}=F,q=H;q?(me(q,P),ge(q,function(t){A(q),F.type in{true:1,false:1,undefined:1}||(null!==F.iframe||(fe(q,`The iframe (${F.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ie[q]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(;e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ie[q]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${F.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&W()})(L)):fe("","iframeResizer received messageData without id, message was: ",L)}function Te(e,t,n){let i=null,o=null;if(ie[e]){if(i=ie[e][t],typeof i!==I)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),fe(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(i,n)}return o}function xe(e){const{id:t}=e;delete ie[t],delete e.iframeResizer}function Me(e){const{id:t}=e;if(!1!==Te(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){fe(t,e)}Te(t,"onAfterClose",t),xe(e)}}function Re(e){null===$e.position&&($e.position={x:window.scrollX,y:window.scrollY})}function Se(){$e.position=null}function Ee(e){null!==$e.position&&(window.scrollTo($e.position.x,$e.position.y),de(e,`Set page position: %c${$e.position.x}%c, %c${$e.position.y}`,p,m,p),Se())}function Oe(e){Re(e.id),Ce(e),We(x,x,e.id)}function Ce(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,de(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ie[n];i&&t("height"),o&&t("width")}const Ie=e=>e.split(y).filter((e,t)=>19!==t).join(y);function We(e,t,n){function i(i){const o=e in H?Ie(t):t;de(n,i,p,m,p),de(n,`Message data: %c${o}`,p)}me(n,e),ie[n]&&(ie[n]?.postMessageTarget?function(){const{iframe:o,postMessageTarget:r,sameOrigin:s,targetOrigin:a}=ie[n];if(s)try{return o.contentWindow.iframeChildListener(B+t),void i(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in H?ie[n].sameOrigin=!1:fe(n,"Same origin messaging failed, falling back to postMessage")}i(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),r.postMessage(B+t,a)}():fe(n,`Iframe(${n}) not found`))}let Ae=0,Le=!1,Ne=!1;function Be(t,n=-3){if(Le)return;const i=Math.max(ie[t].mode,n);if(i>ie[t].mode&&(ie[t].mode=i),i<0)throw he(t),ie[t].vAdvised||ye(t||"Parent",`${_(i+2)}${_(2)}`),ie[t].vAdvised=!0,_(i+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");i>0&&Ne||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,se||n<1?"font-weight: bold;":e))}(`v${h} (${(e=>Z(Y[e]))(i)})`,i),i<1&&ye("Parent",_(3)),Le=!0}const Fe=e=>t=>{function n(){ie[d]?.heightCalculationMethod in F&&Oe({iframe:t,height:1,width:1,type:v})}function i(){if(ie[d]){const{iframe:e}=ie[d],t={close:Me.bind(null,e),disconnect:xe.bind(null,e),removeListeners(){ye(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){ye(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),We.bind(null,"Window resize",M,d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,O,"moveToAnchor(anchor) anchor"),We("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){e=JSON.stringify(e),We(j,`${j}:${e}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,t){const i=i=>()=>{if(!ie[e])return;const{firstRun:o,iframe:r}=ie[e];We(i,t,e),(e=>e===v)(i)&&(e=>"lazy"===e.loading)(r)||ze(e,ie),o||n()},{iframe:o}=ie[e];ie[e].initChild=i(w),function(e,t){D(e,z,()=>setTimeout(t,1))}(o,i($)),function(e,t){const{iframe:n,waitForLoad:i}=ie[e];!0!==i&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(n)?setTimeout(()=>{me(e,"noContent"),de(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,i(v))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||b in e)&&ye(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${L}"</>, <i>"${N}"</> or <i>"${A}"</>.\n`),e):{}}function s(e){const t=ie[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){ee(ie[d],e)&&(ye(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),ie[d][t]=ie[d][e],delete ie[d][e])}const l=e=>ee(e,"onMouseEnter")||ee(e,"onMouseLeave");function c(e){var n,i;ie[d]={...ie[d],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...je,...r(e),mouseEvents:l(e),mode:K(e),syncTitle:s(d)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),me(d,"setup"),function(){const{direction:e}=ie[d];switch(e){case L:break;case N:ie[d].sizeHeight=!1;case"both":ie[d].sizeWidth=!0;break;case A:ie[d].sizeWidth=!1,ie[d].sizeHeight=!1,ie[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}}(),(n=e?.offsetSize||e?.offset)&&(ie[d].direction===L?ie[d].offsetHeight=n:ie[d].offsetWidth=n),function(e){e?.offset&&ye(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),ie[d].warningTimeout||de(d,"warningTimeout:%c disabled",p),null===ie[d].postMessageTarget&&(ie[d].postMessageTarget=t.contentWindow),ie[d].targetOrigin=!0===ie[d].checkOrigin?""===(i=ie[d].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const u=()=>g in t,d=function(n){if(n&&typeof n!==O)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||je.id+Ae++;return null!==document.getElementById(t)&&(t+=Ae++),t}(),t.id=n,me(n,"assignId")),n}(t.id);if(typeof e!==C)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=q,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=ee(t,"log"),i=typeof t.log===O,o=n?!!i||t.log:je.log;ee(t,"logExpand")||(t.logExpand=n&&i?t.log===P:je.logExpand),function(e){-1===e?.log&&(e.log=!1,Ne=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=oe({expand:t,label:le(n)});se=e,ie[n]||(ie[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in U)&&pe(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(d,e),ge(d,function(e){u()?fe(d,`Ignored iframe (${d}), already setup.`):(c(e),function(){if(Le)return;const{mode:e}=ie[d];-1!==e&&Be(d,e)}(),Pe(),function(){switch(t.style.overflow=!1===ie[d]?.scrolling?"hidden":W,ie[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=ie[d]?ie[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=ie[d];"number"!=typeof e&&"0"!==e||(ie[d].bodyMargin=`${e}px`)}(),o(d,function(e){const{autoResize:t,bodyBackground:n,bodyMargin:i,bodyPadding:o,heightCalculationMethod:r,inPageLinks:s,license:a,log:l,logExpand:c,mouseEvents:u,offsetHeight:d,offsetWidth:f,mode:p,sizeHeight:m,sizeWidth:h,tolerance:g,widthCalculationMethod:b}=ie[e];return[e,"8",h,l,"32",!0,t,i,r,n,o,g,s,S,b,u,d,f,m,a,$e.version,p,"",c].join(y)}(d)),i())})(e),t?.iframeResizer};function He(){!0!==document.hidden&&((e,t)=>{Object.values(ie).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>We(e,t,n.id))})("tabVisible",M)}const Pe=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{D(window,j,ke),D(document,"visibilitychange",He),window.iframeParentListener=e=>setTimeout(()=>ke({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:fe("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:fe("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:fe("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Fe(e);return this.filter("iframe").each((e,n)=>t(n)).end()},window.jQuery.fn.iFrameResize=function(e){return ve("iFrameResize()","iframeResize()","","jQuery"),this.iframeResize(e)}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/jquery",
3
- "version": "5.5.6",
3
+ "version": "5.5.7",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -34,6 +34,6 @@
34
34
  "jquery"
35
35
  ],
36
36
  "dependencies": {
37
- "@iframe-resizer/core": "5.5.6"
37
+ "@iframe-resizer/core": "5.5.7"
38
38
  }
39
39
  }