@iframe-resizer/child 5.5.6-beta.1 → 5.5.6

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/child
25
25
 
26
26
  ---
27
27
 
28
- _iframe-resizer version 5.5.6-beta.1 2025-09-04 - 10:55:49.979Z_
28
+ _iframe-resizer version 5.5.6 2025-09-10 - 16:04:48.965Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.5.6-beta.1 (cjs) - 2025-09-04
4
+ * @module iframe-resizer/child 5.5.6 (cjs) - 2025-09-10
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- "use strict";const e=require("auto-console-group"),t="5.5.6-beta.1",n="iframeResizer",o="beforeUnload",r="init",i="message",a="pageInfo",s="parentInfo",c="scrollToOffset",l="title",d=10,u="data-iframe-size",m="data-iframe-overflowed",f="data-iframe-ignore",h="height",p="width",g="readystatechange",y="bottom",b="right",v="autoResizeEnabled",z=Symbol("sizeChanged"),w="manualResize",$="parentResize",I={[w]:1,[$]:1},O="setOffsetSize",S="resizeObserver",H="overflowObserver",T="mutationObserver",M="visibilityObserver",E="No change in content size detected",k="[iFrameSizer]",R=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),G=(e,t,n,o)=>e.addEventListener(t,n,o||!1),N=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},A=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),x=["spjluzl","rlf","clyzpvu"],L=["<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."],j=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],P=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),C=e=>A(L[e]),D=e=>{const t=e[A(x[0])]||e[A(x[1])]||e[A(x[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=N(A(e));return n in P&&(t=P[n]),t}(n[0]);return 0===o||(e=>e[2]===N(e[0]+e[1]))(n)||(o=-2),o},q=(e,...t)=>setTimeout(()=>e(...t),0),B=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},F=e=>e,U=e=>Math.round(1e3*e)/1e3,W=e=>e.charAt(0).toUpperCase()+e.slice(1),V=e=>""!=`${e}`&&void 0!==e;const Z=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${W(t)}`)};let J=!0,_=n;var Q;const Y=(Q=e,Q?.__esModule?Q.default:Q)({label:`${n}(child)`,expand:!1});const X=e=>(...t)=>!J||Y[e](...t),K=X("log"),ee=K,te=X("debug");const{assert:ne,endAutoGroup:oe,error:re,errorBoundary:ie,event:ae,label:se,purge:ce,warn:le}=Y,de=e=>{return Y.warn((t=F,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ue=de,me=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>de(t)),fe=me("Method"),he=me("Method","replaced with"),pe=me("Option"),ge=["min-height","min-width","max-height","max-width"],ye=new Set,be=e=>e.tagName?e.tagName.toLowerCase():"unknown",ve=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ze=(e,t)=>{return(n=ve(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function we({href:e}){ye.has(e)||(K("Unable to access stylesheet:",e),ye.add(e))}const $e=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){we(n)}return{source:"cross-origin stylesheet",value:ve(e,t)}}(e,t),Ie=(e,t)=>{const{source:n,value:o}=$e(e,t),r=be(e);de(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Oe(){for(const e of[document.documentElement,document.body])for(const t of ge)K(`Checking <${be(e)}> for blocking CSS: ${t}`),ze(e,t)&&Ie(e,t)}const Se=e=>t=>void 0===t?void 0:e(t),He=Se(e=>"true"===e),Te=Se(Number),Me=(e="")=>t=>n=>{n.size>0&&te(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Ee=Me("attached to"),ke=((e="")=>t=>n=>{n.size>0&&re(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Re=Me("detached from"),Ge=(t,n=!0)=>o=>{o>0&&ee(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL)},Ne=(e,t,n,o)=>{const r=Re(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Ae="Mutation",xe=new Set,Le=new Set,je=new Set,Pe=[],Ce={attributes:!0,attributeFilter:[f,u],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let De,qe=1,Be=!1,Fe=0;const Ue=Me("added")(Ae),We=Me("removed (page)")(Ae),Ve=Me("removed (added)")(Ae),Ze=e=>e.nodeType!==Node.ELEMENT_NODE||R.has(e.tagName.toLowerCase());function Je(e){const t=e.addedNodes;for(const e of t)Ze(e)||xe.add(e)}function _e(e){const t=e.removedNodes;for(const e of t)Ze(e)||(xe.has(e)?(xe.delete(e),je.add(e)):Le.add(e))}const Qe=e=>{ee("Mutations:",e);for(const t of e)Je(t),_e(t);Ue(xe),We(Le),Ve(je),je.clear()};const Ye=t=>()=>{const n=performance.now(),o=n-Fe,r=16*qe+++2;if(o>r&&o<200)return ae("mutationThrottled"),ee("Update delayed due to heavy workload on the callStack"),ee(`EventLoop busy time: %c${U(o)}ms %c> Max wait: %c${r-2}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(De,16*qe),void(Fe=n);qe=1,Pe.forEach(Qe),Pe.length=0,Be=!1,Le.size>0&&K(`Detected %c${Le.size} %cremoved element${Le.size>1?"s":""}`,e.HIGHLIGHT,e.FOREGROUND),xe.size>0&&K(`Found %c${xe.size} %cnew element${xe.size>1?"s":""}`,e.HIGHLIGHT,e.FOREGROUND),t({addedNodes:xe,removedNodes:Le}),xe.clear(),Le.clear()};function Xe(e){Pe.push(e),Be||(Fe=performance.now(),Be=!0,requestAnimationFrame(De))}function Ke(e){const t=new window.MutationObserver(Xe),n=document.body||document.documentElement;return De=Ye(e),t.observe(n,Ce),ee("Attached MutationObserver to body"),{...t,disconnect:()=>{xe.clear(),Le.clear(),Pe.length=0,t.disconnect(),ee("Detached MutationObserver")}}}const et="Overflow",tt=Ge(et),nt=Ge(et,!1),ot=Ee(et),rt=ke(et),it=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,at=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||F,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(m,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!it(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));rt(t),ot(n),tt(o),n.clear(),t.clear()},detachObservers:Ne(et,c,l,nt),disconnect:()=>{c.disconnect(),ee("Detached OverflowObserver")}}},st="--ifr-start",ct="--ifr-end",lt="--ifr-measure",dt=[];let ut,mt={},ft=0;function ht(){try{performance.clearMarks(st),performance.clearMarks(ct),performance.clearMeasures(lt)}catch{}}function pt(e){e.getEntries().forEach(e=>{if(e.name===ct)try{const{duration:t}=performance.measure(lt,st,ct);mt=e.detail,dt.push(t),dt.length>100&&dt.shift()}catch{}})}function gt(){ee("Attached PerformanceObserver to page");const e=new PerformanceObserver(pt);return e.observe({entryTypes:["mark"]}),ut=setInterval(()=>{if(dt.length<10)return;if(mt.hasTags&&mt.len<25)return;dt.sort();const e=Math.min(dt.reduce((e,t)=>e+t,0)/dt.length,dt[Math.floor(dt.length/2)]),t=U(e);t>ft&&(ft=t,ae("performanceObserver"),K("Mean time:",U(dt[Math.floor(dt.length/2)])),K("Median time:",U(dt.reduce((e,t)=>e+t,0)/dt.length)),K("Average time:",t),K("Max time:",U(Math.max(...dt)))),ht(),e<=4||(clearInterval(ut),de(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${U(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${mt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ht(),clearInterval(ut),e.disconnect(),ee("Detached PerformanceObserver")}}}const yt="Resize",bt=Ge(yt),vt=Ge(yt,!1),zt=Ee(yt),wt=ke(yt),$t=new WeakSet,It=new Set,Ot=new Set;let St;function Ht(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&($t.has(n)?It.add(n):(St.observe(n),$t.add(n),Ot.add(n),t+=1))}wt(It),zt(Ot),bt(t),Ot.clear(),It.clear()}function Tt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),ee("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),ee("Detached VisibilityObserver")}}}const Mt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Et=Mt("function"),kt=Mt("number"),Rt=Mt("string");"undefined"!=typeof window&&function(){const N={height:()=>(le("Custom height calculation function not defined"),On.auto()),width:()=>(le("Custom width calculation function not defined"),Sn.auto())},L={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},P={},Q="auto",X=[],ce="scroll";let me,ge,ye,be,ve,ze,we,$e,Ie,Se=!0,Me="",Ee=0,ke="",Re="",Ge=!1,Ae=!0,xe=!1,Le=!0,je=!1,Pe=!1,Ce=!0,De=!1,qe=1,Be=Q,Fe="",Ue=!0,We={},Ve=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ye=0,Xe=0,et=new Set,tt="",nt="child",ot=!1,rt="",it=[],lt=window.parent,dt="*",ut=0,mt=!1,ft=1,ht=ce,pt=window,bt=()=>{le("onMessage function not defined")},zt=()=>{},wt=null,It=null;function Ot(o){var i;!function(e){tt=e[0]??tt,Ee=Te(e[1])??Ee,xe=He(e[2])??xe,Je=He(e[3])??Je,Se=He(e[6])??Se,ke=e[7]??ke,Be=e[8]??Be,Me=e[9]??Me,Re=e[10]??Re,ut=Te(e[11])??ut,We.enable=He(e[12])??!1,nt=e[13]??nt,ht=e[14]??ht,Qe=He(e[15])??Qe,Ye=Te(e[16])??Ye,Xe=Te(e[17])??Xe,Ae=He(e[18])??Ae,me=e[19]??me,$e=e[20]??$e,_e=Te(e[21])??_e,Ze=He(e[23])??Ze}(o),_=(i={id:tt,enabled:Je,expand:Ze}).id||n,Y.label(`${_}`),Y.expand(i.expand),J=i.enabled,K(`Initialising iframe v${t} ${window.location.href}`),function(){function t(e){K("Reading data from page:",Object.keys(e)),Ie=Et(e,"onBeforeResize")??Ie,bt=Et(e,"onMessage")??bt,zt=Et(e,"onReady")??zt,"number"==typeof e?.offset&&(pe("offset","offsetSize"),Ae&&(Ye=kt(e,"offset")??Ye),xe&&(Xe=kt(e,"offset")??Xe)),"number"==typeof e?.offsetSize&&(Ae&&(Ye=kt(e,"offsetSize")??Ye),xe&&(Xe=kt(e,"offsetSize")??Xe)),ge=Rt(e,A(x[0]))??ge,Fe=Rt(e,"ignoreSelector")??Fe,rt=Rt(e,"sizeSelector")??rt,dt=Rt(e,"targetOrigin")??dt,Be=e?.heightCalculationMethod||Be,ht=e?.widthCalculationMethod||ht}function n(e,t){return"function"==typeof e&&(de(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),N[t]=e,e="custom"),e}if(1===_e)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),Be=n(Be,h),ht=n(ht,p),ee(`Set targetOrigin for parent: %c${dt}`,e.HIGHLIGHT))}(),[jt,Ct,Yt,xt,Pt,_t,Qt,Zt,Lt,Nt,Ge?F:Oe,Bt,nn,tn,en,Ft,()=>Dt("background",Me),()=>Dt("padding",Re),()=>Dt("min-height","1px"),()=>Dt("min-width","1px"),Ge?F:Ut,Kt,Xt,pn,Mt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;de("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),re(e)}}),Gt(B(zt)),K("Initialization complete"),Gn(r,"Init message from host page",void 0,void 0,`${t}:${_e}`),document.title&&""!==document.title&&xn(0,0,l,document.title)}function Mt(){G(window,o.toLowerCase(),()=>{X.forEach(e=>e()),xn(0,0,o)})}function Gt(e){"complete"===document.readyState?q(e):G(document,g,()=>Gt(e))}function Nt(){it=document.querySelectorAll(`[${u}]`),De=it.length>0,K(`Tagged elements found: %c${De}`,e.HIGHLIGHT)}let At=0;function xt(){const t=document.querySelectorAll(`*[${f}]`);return je=t.length>0,je&&t.length!==At&&(function(t){const n=1===t.length?"":"s";le(`%c[${f}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),At=t.length),je}function Lt(){"BackCompat"===document.compatMode&&de("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function jt(){$e&&""!==$e&&"false"!==$e?$e!==t&&de(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${$e} - Child page: ${t}.\n`):de("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function Pt(){try{ot=1===_e||"iframeParentListener"in window.parent}catch(e){K("Cross domain iframe detected")}}function Ct(){xe===Ae&&(Ge=!0)}function Dt(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),ee(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function qt(t,n,o){if(""!==o){K(`${t}: %c${o}`,e.HIGHLIGHT);for(const e of document.querySelectorAll(o))K(`Applying ${n} to:`,e),e.toggleAttribute(n,!0)}}function Bt(){qt("sizeSelector",u,rt),qt("ignoreSelector",f,Fe)}function Ft(){var e,t;void 0===ke&&(ke=`${Ee}px`),Dt("margin",(e="margin",(t=ke).includes("-")&&(le(`Negative CSS value ignored for ${e}`),t=""),t))}function Ut(){const t=e=>e.style.setProperty(h,"auto","important");t(document.documentElement),t(document.body),K("Set HTML & body height: %cauto !important",e.HIGHLIGHT)}function Wt(t){({add(e){function n(){Gn(t.eventName,t.eventType)}P[e]=n,G(window,e,n,{passive:!0})},remove(e){const t=P[e];var n,o;delete P[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[t.method](t.eventName),K(`${W(t.method)} event listener: %c${t.eventType}`,e.HIGHLIGHT)}function Vt(e){Wt({method:e,eventType:"After Print",eventName:"afterprint"}),Wt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Wt({method:e,eventType:"Ready State Change",eventName:g})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(u,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&de("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Jt(t,n,o){const{label:r}=o;return n!==t&&(t in o||(le(`${t} is not a valid option for ${r}CalculationMethod.`),t=n),t in L)&&de(`<rb>Deprecated ${r}CalculationMethod (${t})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${$e?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${r}CalculationMethod: 'auto',\n}\n`}\n`),K(`Set ${r} calculation method: %c${t}`,e.HIGHLIGHT),t}function _t(){Be=Jt(Be,Q,On)}function Qt(){ht=Jt(ht,ce,Sn)}function Yt(){const n=_e,o=D({key:me}),r=D({key:ge});if(_e=Math.max(o,r),_e<0){if(_e=Math.min(o,r),de(`${C(_e+2)}${C(2)}`),V($e))throw C(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!V($e)||n>-1&&_e>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${_} %ciframe-resizer ${t}`,J||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>A(j[e]))(_e)})`,_e),_e<2&&ue(C(3)),sessionStorage.setItem("ifr",t))}function Xt(){!0!==Se&&K("Auto Resize disabled"),Vt("add"),X.push(()=>Vt("remove"))}function Kt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function en(){function t(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,d)+parseInt(n.x,d),y:parseInt(t.top,d)+parseInt(n.y,d)}}function n(n){const o=n.split("#")[1]||n,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(K(`In page link (#${o}) not found in iframe, so sending to parent`),xn(0,0,"inPageLink",`#${o}`)):function(n){const r=t(n);K(`Moving to in page link (%c#${o}%c) at x: %c${r.x}%c y: %c${r.y}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),xn(r.y,r.x,c)}(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}We.enable?1===_e?de("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(K("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&G(e,"click",t=>{t.preventDefault(),n(e.getAttribute("href"))})}(),G(window,"hashchange",o),setTimeout(o,128)):K("In page linking not enabled"),We={findTarget:n}}function tn(){function t(e){xn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function n(n,o){K(`Add event listener: %c${o}`,e.HIGHLIGHT),G(window.document,n,t)}!0===Qe&&(n("mouseenter","Mouse Enter"),n("mouseleave","Mouse Leave"))}function nn(){1!==_e&&(pt.parentIframe=Object.freeze({autoResize:e=>(Z(e,"boolean","parentIframe.autoResize(enable) enable"),!1===xe&&!1===Ae?(ae(v),de("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Se?(Se=!0,queueMicrotask(()=>Gn(v,"Auto Resize enabled"))):!1===e&&!0===Se&&(Se=!1),xn(0,0,"autoResize",JSON.stringify(Se)),Se)),close(){xn(0,0,"close")},getId:()=>tt,getOrigin:()=>(ae("getOrigin"),fe("getOrigin()","getParentOrigin()"),ye),getParentOrigin:()=>ye,getPageInfo(e){if("function"==typeof e)return wt=e,xn(0,0,a),void he("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");wt=null,xn(0,0,"pageInfoStop")},getParentProps:e=>(Z(e,"function","parentIframe.getParentProps(callback) callback"),It=e,xn(0,0,s),()=>{It=null,xn(0,0,"parentInfoStop")}),getParentProperties(e){fe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Z(e,"string","parentIframe.moveToAnchor(anchor) anchor"),We.findTarget(e)},reset(){!function(){const t=Be;Be=Q,K(`Reset trigger event: %c${"parentIframe.reset"}`,e.HIGHLIGHT),mt?K("TriggerLock blocked calculation"):(mt=!0,te("Trigger event lock on"),requestAnimationFrame(()=>{mt=!1,te("Trigger event lock off")})),Nn("reset"),Be=t}()},setOffsetSize(e){Z(e,"number","parentIframe.setOffsetSize(offset) offset"),Ye=e,Xe=e,Gn(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Z(e,"number","parentIframe.scrollBy(x, y) x"),Z(t,"number","parentIframe.scrollBy(x, y) y"),xn(t,e,"scrollBy")},scrollTo(e,t){Z(e,"number","parentIframe.scrollTo(x, y) x"),Z(t,"number","parentIframe.scrollTo(x, y) y"),xn(t,e,"scrollTo")},scrollToOffset(e,t){Z(e,"number","parentIframe.scrollToOffset(x, y) x"),Z(t,"number","parentIframe.scrollToOffset(x, y) y"),xn(t,e,c)},sendMessage(e,t){t&&Z(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),xn(0,0,i,JSON.stringify(e),t)},setHeightCalculationMethod(e){Be=e,_t()},setWidthCalculationMethod(e){ht=e,Qt()},setTargetOrigin(t){Z(t,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),K(`Set targetOrigin: %c${t}`,e.HIGHLIGHT),dt=t},resize(e,t){void 0!==e&&Z(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&Z(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Gn(w,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){fe("size()","resize()"),this.resize(e,t)}}),pt.parentIFrame=pt.parentIframe)}let on=new Set;function rn(){const e=document.querySelectorAll(`[${m}]`);et=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${f}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ae("overflowIgnored"),ee("Ignoring elements with [data-iframe-ignore] > *:\n",n),oe()}),t}(e),Pe=et.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ce=et.symmetricDifference(on).size>0),on=et}function an(){switch(rn(),!0){case!Ce:return;case et.size>1:ee("Overflowed Elements:",et);break;case Pe:break;default:ee("No overflow detected")}Gn(H,"Overflow updated")}function sn(e){const t={root:document.documentElement,side:Ae?y:b};return be=at(an,t),be.attachObservers(e),be}function cn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Gn(S,`Element resized <${function(e){switch(!0){case!V(e):return"";case V(e.id):return`${e.nodeName}#${e.id}`;case V(e.name):return`${e.nodeName} (${e.name}`;case V(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function ln(e){return St=new ResizeObserver(cn),St.observe(document.body),$t.add(document.body),ee("Attached ResizeObserver to body"),ve={attachObserverToNonStaticElements:Ht,detachObservers:Ne(yt,St,$t,vt),disconnect:()=>{St.disconnect(),ee("Detached ResizeObserver")}},ve.attachObserverToNonStaticElements(e),ve}function dn(t){K(`Visible: %c${t}`,e.HIGHLIGHT),Ve=!t,Gn(M,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of vn(n))t.add(e)}return ee("Inspecting:\n",t),t},mn=e=>{if(0===e.size)return;ae("addObservers");const t=un(e);be.attachObservers(t),ve.attachObserverToNonStaticElements(t),oe()},fn=e=>{if(0===e.size)return;ae("removeObservers");const t=un(e);be.detachObservers(t),ve.detachObservers(t),oe()};function hn(e){!function({addedNodes:e,removedNodes:t}){ae("contentMutated"),Bt(),Nt(),rn(),oe(),fn(t),mn(e)}(e),Gn(T,"Mutation Observed")}function pn(){const e=vn(document.documentElement);var t;K("Attaching Observers"),t=[Ke(hn),sn(e),gt(),ln(e),Tt(dn)],X.push(...t.map(e=>e.disconnect))}function gn(t){performance.mark(st);const n=W(t);let o=1,r=document.documentElement,i=De?0:document.documentElement.getBoundingClientRect().bottom;const a=De?it:Pe?Array.from(et):vn(document.documentElement);for(const e of a)o=e.getBoundingClientRect()[t]+parseFloat(getComputedStyle(e).getPropertyValue(`margin-${t}`)),o>i&&(i=o,r=e);return ee(`${n} position calculated from:`,r),ee(`Checked %c${a.length}%c elements`,e.HIGHLIGHT,e.FOREGROUND),performance.mark(ct,{detail:{hasTags:De,len:a.length,logging:Je,Side:n}}),i}const yn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],bn=`* ${Array.from(R).map(e=>`:not(${e})`).join("")}`,vn=e=>e.querySelectorAll(bn),zn={height:0,width:0},wn={height:0,width:0},$n=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function In(t){function n(){return wn[r]=i,zn[r]=c,Math.max(i,1)}const o=t===On,r=t.label,i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),l=`HTML: %c${i}px %cPage: %c${c}px`;let d=0;switch(!0){case!t.enabled():return Math.max(c,1);case De:ee("Found element with data-iframe-size attribute"),d=t.taggedElement();break;case!Pe&&Le&&0===wn[r]&&0===zn[r]:ee(`Initial page size values: ${l}`,...$n),d=n();break;case mt&&i===wn[r]&&c===zn[r]:ee(`Size unchanged: ${l}`,...$n),d=Math.max(i,c);break;case 0===i&&0!==c:ee(`Page is hidden: ${l}`,...$n),d=c;break;case!Pe&&i!==wn[r]&&c<=zn[r]:ee(`New <html> size: ${l} `,...$n),ee(`Previous <html> size: %c${wn[r]}px`,e.HIGHLIGHT),d=n();break;case!o:d=t.taggedElement();break;case!Pe&&i<wn[r]:ee(`<html> size decreased: ${l}`,...$n),d=n();break;case c===s||c===a:ee(`<html> size equals page size: ${l}`,...$n),d=n();break;case i>c:ee(`Page size < <html> size: ${l}`,...$n),d=n();break;case Pe:ee("Found elements possibly overflowing <html> "),d=t.taggedElement();break;default:ee(`Using <html> size: ${l}`,...$n),d=n()}return ee(`Content ${r}: %c${d}px`,e.HIGHLIGHT),d+=function(t){const n=t.getOffset();return 0!==n&&ee(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),d}const On={label:h,enabled:()=>Ae,getOffset:()=>Ye,auto:()=>In(On),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,d)+parseInt(t.marginBottom,d)},bodyScroll:()=>document.body.scrollHeight,offset:()=>On.bodyOffset(),custom:()=>N.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...yn(On)),min:()=>Math.min(...yn(On)),grow:()=>On.max(),lowestElement:()=>gn(y),taggedElement:()=>gn(y)},Sn={label:p,enabled:()=>xe,getOffset:()=>Xe,auto:()=>In(Sn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>N.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...yn(Sn)),min:()=>Math.min(...yn(Sn)),rightMostElement:()=>gn(b),scroll:()=>Math.max(Sn.bodyScroll(),Sn.documentElementScroll()),taggedElement:()=>gn(b)},Hn=(e,t)=>!(Math.abs(e-t)<=ut);function Tn(e,t){const n=e[t](),o=e.enabled()&&void 0!==Ie?function(e){const t=Ie(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return ne(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Mn=!1;const En=B(()=>ue(C(4)));let kn,Rn=!1;const Gn=ie((t,n,o,i,a)=>{switch(ae(t),!0){case!0===Ve:if(!0===Rn)break;K("Iframe hidden - Ignored resize request"),Rn=!0,Mn=!1,cancelAnimationFrame(kn);break;case!0===Mn&&t!==H:K("Resize already pending - Ignored resize request");break;case!Se&&!(t in I):ee("Resizing disabled");break;default:Rn=!1,Mn=!0,we=performance.now(),ze=!0,kn=requestAnimationFrame(()=>{Mn=!1,ae("requestAnimationFrame"),te(`Reset sendPending: %c${t}`,e.HIGHLIGHT)}),function(t,n,o,i,a){const s=o??Tn(On,Be),c=i??Tn(Sn,ht),l=Ae&&Hn(qe,s)||xe&&Hn(ft,c)?z:t;switch(K(`Resize event: %c${n}`,e.HIGHLIGHT),l){case r:case v:case z:qe=s,ft=c;case O:An(qe,ft,t,a);break;case H:case T:case S:case M:K(E);break;default:ee(E)}ze=!1}(t,n,o,i,a)}oe()});function Nn(e){qe=On[Be](),ft=Sn[ht](),xn(qe,ft,e)}function An(t,n,o,i,a){_e<-1||(void 0!==a?K(`Message targetOrigin: %c${a}`,e.HIGHLIGHT):a=dt,function(){const s=`${tt}:${t}:${n}:${o}${void 0===i?"":`:${i}`}`;if(ot)try{window.parent.iframeParentListener(k+s)}catch(e){if(1!==_e)throw e;return void En()}else lt.postMessage(k+s,a);ze&&K(function(){const e=U(performance.now()-we);return o===r?`Initialised iframe in %c${e}ms`:`Size calculated in %c${e}ms`}(),e.HIGHLIGHT),ee(`Sending message to parent page via ${ot?"sameOrigin":"postMessage"}: %c%c${s}`,e.ITALIC,e.HIGHLIGHT)}())}const xn=ie((e,t,n,o,r)=>{ae(n),An(e,t,n,o,r),oe()}),Ln=ie(function(t){ae("onMessage");const{freeze:n}=Object,{parse:o}=JSON,i=e=>n(o(e)),c=e=>xn(0,0,`${e}Stop`),l={init:function(){if("loading"===document.readyState)return void K("Page not ready, ignoring init message");const e=t.data.slice(13).split(":");lt=t.source,ye=t.origin,Ot(e),Le=!1,setTimeout(()=>{Ue=!1},128)},reset(){Ue?K("Page reset ignored by init"):(K("Page size reset by host page"),Nn("resetPage"))},resize(){K("Resize requested by host page"),Gn($,"Parent window requested size check")},moveToAnchor(){We.findTarget(u())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=u();K("PageInfo received from parent:",i(e)),wt?q(wt,o(e)):c(a)},parentInfo(){const e=i(u());K("ParentInfo received from parent:",e),It?q(It,e):c(s)},message(){const t=u();K("onMessage called from parent:%c",e.HIGHLIGHT,i(t)),q(bt,o(t))}},d=()=>t.data.split("]")[1].split(":")[0],u=()=>t.data.slice(t.data.indexOf(":")+1),m=()=>t.data.split(":")[2]in{true:1,false:1};function f(){const e=d();ae(e),e in l?l[e]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||m()||le(`Unexpected message (${t.data})`)}k===`${t.data}`.slice(0,13)&&function(){if(!1!==Le)return m()?(se(d()),ae(r),void l.init()):void K(`Ignored message of type "${d()}". Received before initialization.`);f()}()});let jn=!1;const Pn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Cn(){if("loading"===document.readyState||!Le||jn)return;const{parent:t,top:n}=window;ae("ready"),K("Sending%c ready%c to parent from",e.HIGHLIGHT,e.FOREGROUND,window.location.href),Pn(t),t!==n&&Pn(n),jn=!0}"iframeChildListener"in window?le("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Ln({data:e,sameOrigin:!0})),G(window,i,Ln),G(document,g,Cn),setTimeout(Cn))}();
21
- //# sourceMappingURL=index.cjs.js.map
20
+ "use strict";const e=require("auto-console-group"),t="5.5.6",n="iframeResizer",o="beforeUnload",r="init",a="message",i="pageInfo",s="parentInfo",c="scrollToOffset",l="title",u=10,d="data-iframe-size",f="data-iframe-overflowed",m="data-iframe-ignore",h="height",p="width",g="readystatechange",y="bottom",b="right",v="autoResizeEnabled",z=Symbol("sizeChanged"),w="manualResize",$="parentResize",O={[w]:1,[$]:1},S="setOffsetSize",I="resizeObserver",M="overflowObserver",E="mutationObserver",T="visibilityObserver",k="[iFrameSizer]",j=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),A=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},x=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),R=["spjluzl","rlf","clyzpvu"],C=["<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."],P=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),L=e=>x(C[e]),G=e=>{const t=e[x(R[0])]||e[x(R[1])]||e[x(R[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=A(x(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===A(e[0]+e[1]))(n)||(o=-2),o},B=(e,...t)=>setTimeout(()=>e(...t),0),q=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},D=e=>e,F=e=>Math.round(1e3*e)/1e3,W=e=>e.charAt(0).toUpperCase()+e.slice(1),U=e=>""!=`${e}`&&void 0!==e;const V=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${W(t)}`)};let Z=!0,J=n;var _;const Q=(_=e,_?.__esModule?_.default:_)({label:`${n}(child)`,expand:!1});var Y;const X=(Y="log",(...e)=>!Z||Q[Y](...e));const{assert:K,endAutoGroup:ee,error:te,errorBoundary:ne,event:oe,label:re,purge:ae,warn:ie}=Q,se=e=>{return Q.warn((t=D,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ce=se,le=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>se(t)),ue=le("Method"),de=le("Method","replaced with"),fe=le("Option"),me=["min-height","min-width","max-height","max-width"],he=new Set,pe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ge=(e,t)=>{return(n=pe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ye({href:e}){he.has(e)||he.add(e)}const be=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ye(n)}return{source:"cross-origin stylesheet",value:pe(e,t)}}(e,t),ve=(e,t)=>{const{source:n,value:o}=be(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);se(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ze(){for(const e of[document.documentElement,document.body])for(const t of me)ge(e,t)&&ve(e,t)}const we=e=>t=>void 0===t?void 0:e(t),$e=we(e=>"true"===e),Oe=we(Number),Se=e=>e=>{e.size},Ie=((e="")=>t=>n=>{n.size>0&&te(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Me=e=>e=>{e.size},Ee=(t,n=!0)=>o=>{o>0&&X(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL)},Te=(e,t,n,o)=>{const r=Me(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},ke=new Set,je=new Set,Ne=new Set,Ae=[],xe={attributes:!0,attributeFilter:[m,d],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Re,Ce=1,Pe=!1,He=0;const Le=e=>{e.size},Ge=e=>{e.size},Be=e=>{e.size},qe=e=>e.nodeType!==Node.ELEMENT_NODE||j.has(e.tagName.toLowerCase());function De(e){const t=e.addedNodes;for(const e of t)qe(e)||ke.add(e)}function Fe(e){const t=e.removedNodes;for(const e of t)qe(e)||(ke.has(e)?(ke.delete(e),Ne.add(e)):je.add(e))}const We=e=>{X("Mutations:",e);for(const t of e)De(t),Fe(t);Le(ke),Ge(je),Be(Ne),Ne.clear()};const Ue=t=>()=>{const n=performance.now(),o=n-He,r=16*Ce+++2;if(o>r&&o<200)return oe("mutationThrottled"),X("Update delayed due to heavy workload on the callStack"),X(`EventLoop busy time: %c${F(o)}ms %c> Max wait: %c${r-2}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(Re,16*Ce),void(He=n);Ce=1,Ae.forEach(We),Ae.length=0,Pe=!1,je.size,ke.size,t({addedNodes:ke,removedNodes:je}),ke.clear(),je.clear()};function Ve(e){Ae.push(e),Pe||(He=performance.now(),Pe=!0,requestAnimationFrame(Re))}function Ze(e){const t=new window.MutationObserver(Ve),n=document.body||document.documentElement;return Re=Ue(e),t.observe(n,xe),X("Attached MutationObserver to body"),{...t,disconnect:()=>{ke.clear(),je.clear(),Ae.length=0,t.disconnect(),X("Detached MutationObserver")}}}const Je="Overflow",_e=Ee(Je),Qe=Ee(Je,!1),Ye=Se(Je),Xe=Ie(Je),Ke=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||D,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(f,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],c=i(a,o)&&!Ke(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));Xe(t),Ye(n),_e(o),n.clear(),t.clear()},detachObservers:Te(Je,c,l,Qe),disconnect:()=>{c.disconnect(),X("Detached OverflowObserver")}}},tt="--ifr-start",nt="--ifr-end",ot="--ifr-measure",rt=[];let at,it={},st=0;function ct(){try{performance.clearMarks(tt),performance.clearMarks(nt),performance.clearMeasures(ot)}catch{}}function lt(e){e.getEntries().forEach(e=>{if(e.name===nt)try{const{duration:t}=performance.measure(ot,tt,nt);it=e.detail,rt.push(t),rt.length>100&&rt.shift()}catch{}})}function ut(){X("Attached PerformanceObserver to page");const e=new PerformanceObserver(lt);return e.observe({entryTypes:["mark"]}),at=setInterval(()=>{if(rt.length<10)return;if(it.hasTags&&it.len<25)return;rt.sort();const e=Math.min(rt.reduce((e,t)=>e+t,0)/rt.length,rt[Math.floor(rt.length/2)]),t=F(e);t>st&&(st=t,oe("performanceObserver")),ct(),e<=4||(clearInterval(at),se(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${F(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${it.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ct(),clearInterval(at),e.disconnect(),X("Detached PerformanceObserver")}}}const dt="Resize",ft=Ee(dt),mt=Ee(dt,!1),ht=Se(dt),pt=Ie(dt),gt=new WeakSet,yt=new Set,bt=new Set;let vt;function zt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(gt.has(n)?yt.add(n):(vt.observe(n),gt.add(n),bt.add(n),t+=1))}pt(yt),ht(bt),ft(t),bt.clear(),yt.clear()}function wt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),X("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),X("Detached VisibilityObserver")}}}const $t=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ot=$t("function"),St=$t("number"),It=$t("string");"undefined"!=typeof window&&function(){const A={height:()=>(ie("Custom height calculation function not defined"),vn.auto()),width:()=>(ie("Custom width calculation function not defined"),zn.auto())},C={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},H={},F="auto",_=[],Y="scroll";let le,me,he,pe,ge,ye,be,ve=!0,we="",Se=0,Ie="",Me="",Ee=!1,ke=!0,je=!1,Ne=!0,Ae=!1,xe=!1,Re=!0,Ce=!1,Pe=1,He=F,Le="",Ge=!0,Be={},qe=!1,De=!1,Fe=!1,We=0,Ue=!1,Ve=0,Je=0,_e=new Set,Qe="",Ye="child",Xe=!1,Ke="",ot=[],rt=window.parent,at="*",it=0,st=!1,ct=1,lt=Y,ft=window,ht=()=>{ie("onMessage function not defined")},pt=()=>{},yt=null,bt=null;function $t(o){var a;!function(e){Qe=e[0]??Qe,Se=Oe(e[1])??Se,je=$e(e[2])??je,Fe=$e(e[3])??Fe,ve=$e(e[6])??ve,Ie=e[7]??Ie,He=e[8]??He,we=e[9]??we,Me=e[10]??Me,it=Oe(e[11])??it,Be.enable=$e(e[12])??!1,Ye=e[13]??Ye,lt=e[14]??lt,Ue=$e(e[15])??Ue,Ve=Oe(e[16])??Ve,Je=Oe(e[17])??Je,ke=$e(e[18])??ke,le=e[19]??le,ye=e[20]??ye,We=Oe(e[21])??We,De=$e(e[23])??De}(o),J=(a={id:Qe,enabled:Fe,expand:De}).id||n,Q.label(`${J}`),Q.expand(a.expand),Z=a.enabled,function(){function t(e){be=Ot(e,"onBeforeResize")??be,ht=Ot(e,"onMessage")??ht,pt=Ot(e,"onReady")??pt,"number"==typeof e?.offset&&(fe("offset","offsetSize"),ke&&(Ve=St(e,"offset")??Ve),je&&(Je=St(e,"offset")??Je)),"number"==typeof e?.offsetSize&&(ke&&(Ve=St(e,"offsetSize")??Ve),je&&(Je=St(e,"offsetSize")??Je)),me=It(e,x(R[0]))??me,Le=It(e,"ignoreSelector")??Le,Ke=It(e,"sizeSelector")??Ke,at=It(e,"targetOrigin")??at,He=e?.heightCalculationMethod||He,lt=e?.widthCalculationMethod||lt}function n(e,t){return"function"==typeof e&&(se(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),A[t]=e,e="custom"),e}if(1===We)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),He=n(He,h),lt=n(lt,p),X(`Set targetOrigin for parent: %c${at}`,e.HIGHLIGHT))}(),[At,Rt,Vt,jt,xt,Wt,Ut,Dt,Nt,Tt,Ee?D:ze,Ht,Yt,Qt,_t,Lt,()=>Ct("background",we),()=>Ct("padding",Me),Ee?D:Gt,Jt,Zt,un,Mt].forEach(e=>{try{e()}catch(e){if(We<0)throw e;se("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),te(e)}}),Et(q(pt)),En(r,"Init message from host page",void 0,void 0,`${t}:${We}`),document.title&&""!==document.title&&jn(0,0,l,document.title)}function Mt(){N(window,o.toLowerCase(),()=>{_.forEach(e=>e()),jn(0,0,o)})}function Et(e){"complete"===document.readyState?B(e):N(document,g,()=>Et(e))}function Tt(){ot=document.querySelectorAll(`[${d}]`),Ce=ot.length>0}let kt=0;function jt(){const t=document.querySelectorAll(`*[${m}]`);return Ae=t.length>0,Ae&&t.length!==kt&&(function(t){const n=1===t.length?"":"s";ie(`%c[${m}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),kt=t.length),Ae}function Nt(){"BackCompat"===document.compatMode&&se("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function At(){ye&&""!==ye&&"false"!==ye?ye!==t&&se(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ye} - Child page: ${t}.\n`):se("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function xt(){try{Xe=1===We||"iframeParentListener"in window.parent}catch(e){}}function Rt(){je===ke&&(Ee=!0)}function Ct(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),X(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Pt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Ht(){Pt(0,d,Ke),Pt(0,m,Le)}function Lt(){var e,t;void 0===Ie&&(Ie=`${Se}px`),Ct("margin",(e="margin",(t=Ie).includes("-")&&(ie(`Negative CSS value ignored for ${e}`),t=""),t))}function Gt(){const e=e=>e.style.setProperty(h,"auto","important");e(document.documentElement),e(document.body)}function Bt(e){({add(t){function n(){En(e.eventName,e.eventType)}H[t]=n,N(window,t,n,{passive:!0})},remove(e){const t=H[e];var n,o;delete H[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function qt(e){Bt({method:e,eventType:"After Print",eventName:"afterprint"}),Bt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Bt({method:e,eventType:"Ready State Change",eventName:g})}function Dt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(d,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&se("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Ft(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ie(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in C)&&se(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${ye?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function Wt(){He=Ft(He,F,vn)}function Ut(){lt=Ft(lt,Y,zn)}function Vt(){const n=We,o=G({key:le}),r=G({key:me});if(We=Math.max(o,r),We<0){if(We=Math.min(o,r),ae(),se(`${L(We+2)}${L(2)}`),U(ye))throw L(We+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!U(ye)||n>-1&&We>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${J} %ciframe-resizer ${t}`,Z||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>x(P[e]))(We)})`,We),We<2&&ce(L(3)),sessionStorage.setItem("ifr",t))}function Zt(){qt("add"),_.push(()=>qt("remove"))}function Jt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function _t(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,u)+parseInt(n.x,u),y:parseInt(t.top,u)+parseInt(n.y,u)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?jn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);jn(n.y,n.x,c)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Be.enable&&(1===We?se("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&N(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),N(window,"hashchange",n),setTimeout(n,128))),Be={findTarget:t}}function Qt(){function e(e){jn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){N(window.document,t,e)}!0===Ue&&(t("mouseenter"),t("mouseleave"))}function Yt(){1!==We&&(ft.parentIframe=Object.freeze({autoResize:e=>(V(e,"boolean","parentIframe.autoResize(enable) enable"),!1===je&&!1===ke?(oe(v),se("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ve?(ve=!0,queueMicrotask(()=>En(v,"Auto Resize enabled"))):!1===e&&!0===ve&&(ve=!1),jn(0,0,"autoResize",JSON.stringify(ve)),ve)),close(){jn(0,0,"close")},getId:()=>Qe,getOrigin:()=>(oe("getOrigin"),ue("getOrigin()","getParentOrigin()"),he),getParentOrigin:()=>he,getPageInfo(e){if("function"==typeof e)return yt=e,jn(0,0,i),void de("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");yt=null,jn(0,0,"pageInfoStop")},getParentProps:e=>(V(e,"function","parentIframe.getParentProps(callback) callback"),bt=e,jn(0,0,s),()=>{bt=null,jn(0,0,"parentInfoStop")}),getParentProperties(e){ue("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){V(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Be.findTarget(e)},reset(){!function(){const e=He;He=F,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Tn("reset"),He=e}()},setOffsetSize(e){V(e,"number","parentIframe.setOffsetSize(offset) offset"),Ve=e,Je=e,En(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){V(e,"number","parentIframe.scrollBy(x, y) x"),V(t,"number","parentIframe.scrollBy(x, y) y"),jn(t,e,"scrollBy")},scrollTo(e,t){V(e,"number","parentIframe.scrollTo(x, y) x"),V(t,"number","parentIframe.scrollTo(x, y) y"),jn(t,e,"scrollTo")},scrollToOffset(e,t){V(e,"number","parentIframe.scrollToOffset(x, y) x"),V(t,"number","parentIframe.scrollToOffset(x, y) y"),jn(t,e,c)},sendMessage(e,t){t&&V(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),jn(0,0,a,JSON.stringify(e),t)},setHeightCalculationMethod(e){He=e,Wt()},setWidthCalculationMethod(e){lt=e,Ut()},setTargetOrigin(e){V(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),at=e},resize(e,t){void 0!==e&&V(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&V(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),En(w,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ue("size()","resize()"),this.resize(e,t)}}),ft.parentIFrame=ft.parentIframe)}let Xt=new Set;function Kt(){const e=document.querySelectorAll(`[${f}]`);_e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${m}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{oe("overflowIgnored"),X("Ignoring elements with [data-iframe-ignore] > *:\n",n),ee()}),t}(e),xe=_e.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Re=_e.symmetricDifference(Xt).size>0),Xt=_e}function en(){switch(Kt(),!0){case!Re:return;case _e.size>1:X("Overflowed Elements:",_e);break;case xe:break;default:X("No overflow detected")}En(M,"Overflow updated")}function tn(e){const t={root:document.documentElement,side:ke?y:b};return pe=et(en,t),pe.attachObservers(e),pe}function nn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;En(I,`Element resized <${function(e){switch(!0){case!U(e):return"";case U(e.id):return`${e.nodeName}#${e.id}`;case U(e.name):return`${e.nodeName} (${e.name}`;case U(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function on(e){return vt=new ResizeObserver(nn),vt.observe(document.body),gt.add(document.body),X("Attached ResizeObserver to body"),ge={attachObserverToNonStaticElements:zt,detachObservers:Te(dt,vt,gt,mt),disconnect:()=>{vt.disconnect(),X("Detached ResizeObserver")}},ge.attachObserverToNonStaticElements(e),ge}function rn(e){qe=!e,En(T,"Visibility changed")}const an=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of hn(n))t.add(e)}return X("Inspecting:\n",t),t},sn=e=>{if(0===e.size)return;oe("addObservers");const t=an(e);pe.attachObservers(t),ge.attachObserverToNonStaticElements(t),ee()},cn=e=>{if(0===e.size)return;oe("removeObservers");const t=an(e);pe.detachObservers(t),ge.detachObservers(t),ee()};function ln(e){!function({addedNodes:e,removedNodes:t}){oe("contentMutated"),Ht(),Tt(),Kt(),ee(),cn(t),sn(e)}(e),En(E,"Mutation Observed")}function un(){const e=hn(document.documentElement);var t;t=[Ze(ln),tn(e),ut(),on(e),wt(rn)],_.push(...t.map(e=>e.disconnect))}function dn(t){performance.mark(tt);const n=W(t);let o=1,r=document.documentElement,a=Ce?0:document.documentElement.getBoundingClientRect().bottom;const i=Ce?ot:xe?Array.from(_e):hn(document.documentElement);for(const e of i)o=e.getBoundingClientRect()[t]+parseFloat(getComputedStyle(e).getPropertyValue(`margin-${t}`)),o>a&&(a=o,r=e);return X(`${n} position calculated from:`,r),X(`Checked %c${i.length}%c elements`,e.HIGHLIGHT,e.FOREGROUND),performance.mark(nt,{detail:{hasTags:Ce,len:i.length,logging:Fe,Side:n}}),a}const fn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],mn=`* ${Array.from(j).map(e=>`:not(${e})`).join("")}`,hn=e=>e.querySelectorAll(mn),pn={height:0,width:0},gn={height:0,width:0},yn=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function bn(t){function n(){return gn[r]=a,pn[r]=c,Math.max(a,1)}const o=t===vn,r=t.label,a=t.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),l=`HTML: %c${a}px %cPage: %c${c}px`;let u=1;switch(!0){case!t.enabled():return Math.max(c,1);case Ce:X("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!xe&&Ne&&0===gn[r]&&0===pn[r]:X(`Initial page size values: ${l}`,...yn),u=n();break;case st&&a===gn[r]&&c===pn[r]:X(`Size unchanged: ${l}`,...yn),u=Math.max(a,c);break;case 0===a&&0!==c:X(`Page is hidden: ${l}`,...yn),u=c;break;case!xe&&a!==gn[r]&&c<=pn[r]:X(`New <html> size: ${l} `,...yn),X(`Previous <html> size: %c${gn[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!xe&&a<gn[r]:X(`<html> size decreased: ${l}`,...yn),u=n();break;case c===s||c===i:X(`<html> size equals page size: ${l}`,...yn),u=n();break;case a>c:X(`Page size < <html> size: ${l}`,...yn),u=n();break;case xe:X("Found elements possibly overflowing <html> "),u=t.taggedElement();break;default:X(`Using <html> size: ${l}`,...yn),u=n()}return X(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&X(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),Math.max(u,1)}const vn={label:h,enabled:()=>ke,getOffset:()=>Ve,auto:()=>bn(vn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,u)+parseInt(t.marginBottom,u)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vn.bodyOffset(),custom:()=>A.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...fn(vn)),min:()=>Math.min(...fn(vn)),grow:()=>vn.max(),lowestElement:()=>dn(y),taggedElement:()=>dn(y)},zn={label:p,enabled:()=>je,getOffset:()=>Je,auto:()=>bn(zn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>A.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...fn(zn)),min:()=>Math.min(...fn(zn)),rightMostElement:()=>dn(b),scroll:()=>Math.max(zn.bodyScroll(),zn.documentElementScroll()),taggedElement:()=>dn(b)},wn=(e,t)=>!(Math.abs(e-t)<=it);function $n(e,t){const n=e[t](),o=e.enabled()&&void 0!==be?function(e){const t=be(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return K(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let On=!1;const Sn=q(()=>ce(L(4)));let In,Mn=!1;const En=ne((e,t,n,o,a)=>{switch(oe(e),!0){case!0===qe:if(!0===Mn)break;Mn=!0,On=!1,cancelAnimationFrame(In);break;case!0===On&&e!==M:ae();break;case!ve&&!(e in O):X("Resizing disabled");break;default:Mn=!1,On=!0,performance.now(),In=requestAnimationFrame(()=>{On=!1,oe("requestAnimationFrame")}),function(e,t,n,o,a){const i=n??$n(vn,He),s=o??$n(zn,lt);switch(ke&&wn(Pe,i)||je&&wn(ct,s)?z:e){case r:case v:case z:Pe=i,ct=s;case S:kn(Pe,ct,e,a);break;case M:case E:case I:case T:ae();break;default:ae(),X("No change in content size detected")}}(e,0,n,o,a)}ee()});function Tn(e){Pe=vn[He](),ct=zn[lt](),jn(Pe,ct,e)}function kn(t,n,o,r,a){We<-1||(void 0!==a||(a=at),function(){const i=`${Qe}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Xe)try{window.parent.iframeParentListener(k+i)}catch(e){if(1!==We)throw e;return void Sn()}else rt.postMessage(k+i,a);X(`Sending message to parent page via ${Xe?"sameOrigin":"postMessage"}: %c%c${i}`,e.ITALIC,e.HIGHLIGHT)}())}const jn=ne((e,t,n,o,r)=>{oe(n),kn(e,t,n,o,r),ee()}),Nn=ne(function(e){oe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>jn(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,he=e.origin,$t(t),Ne=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Tn("resetPage")},resize(){En($,"Parent window requested size check")},moveToAnchor(){Be.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();yt?B(yt,n(e)):o(i)},parentInfo(){const e=(r=l(),t(n(r)));var r;bt?B(bt,e):o(s)},message(){const e=l();B(ht,n(e))}},c=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),u=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=c();oe(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||u()||ie(`Unexpected message (${e.data})`)}k===`${e.data}`.slice(0,13)&&function(){if(!1!==Ne)return u()?(re(c()),oe(r),void a.init()):void 0;d()}()});let An=!1;const xn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Rn(){if("loading"===document.readyState||!Ne||An)return;const{parent:e,top:t}=window;oe("ready"),xn(e),e!==t&&xn(t),An=!0}"iframeChildListener"in window?ie("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Nn({data:e,sameOrigin:!0})),N(window,a,Nn),N(document,g,Rn),Rn())}();
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.5.6-beta.1 (esm) - 2025-09-04
4
+ * @module iframe-resizer/child 5.5.6 (esm) - 2025-09-10
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as i}from"auto-console-group";const a="5.5.6-beta.1",s="iframeResizer",c="beforeUnload",l="init",d="message",u="pageInfo",m="parentInfo",f="scrollToOffset",p="title",h=10,g="data-iframe-size",y="data-iframe-overflowed",b="data-iframe-ignore",v="height",z="width",w="readystatechange",$="bottom",S="right",O="autoResizeEnabled",M=Symbol("sizeChanged"),k="manualResize",E="parentResize",I={[k]:1,[E]:1},T="setOffsetSize",x="resizeObserver",j="overflowObserver",A="mutationObserver",P="visibilityObserver",N="No change in content size detected",C="[iFrameSizer]",R=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),q=(e,t,n,o)=>e.addEventListener(t,n,o||!1),L=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},B=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),D=["spjluzl","rlf","clyzpvu"],W=["<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."],F=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],V=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>B(W[e]),U=e=>{const t=e[B(D[0])]||e[B(D[1])]||e[B(D[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=L(B(e));return n in V&&(t=V[n]),t}(n[0]);return 0===o||(e=>e[2]===L(e[0]+e[1]))(n)||(o=-2),o},Z=(e,...t)=>setTimeout(()=>e(...t),0),J=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},_=e=>e,Q=e=>Math.round(1e3*e)/1e3,Y=e=>e.charAt(0).toUpperCase()+e.slice(1),G=e=>""!=`${e}`&&void 0!==e;const X=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Y(t)}`)};let K=!0,ee=s;var te;const ne=(te=e,te?.__esModule?te.default:te)({label:`${s}(child)`,expand:!1});const oe=e=>(...t)=>!K||ne[e](...t),re=oe("log"),ie=re,ae=oe("debug");const{assert:se,endAutoGroup:ce,error:le,errorBoundary:de,event:ue,label:me,purge:fe,warn:pe}=ne,he=e=>{return ne.warn((t=_,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ge=he,ye=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>he(t)),be=ye("Method"),ve=ye("Method","replaced with"),ze=ye("Option"),we=["min-height","min-width","max-height","max-width"],$e=new Set,Se=e=>e.tagName?e.tagName.toLowerCase():"unknown",Oe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Me=(e,t)=>{return(n=Oe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ke({href:e}){$e.has(e)||(re("Unable to access stylesheet:",e),$e.add(e))}const Ee=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ke(n)}return{source:"cross-origin stylesheet",value:Oe(e,t)}}(e,t),Ie=(e,t)=>{const{source:n,value:o}=Ee(e,t),r=Se(e);he(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Te(){for(const e of[document.documentElement,document.body])for(const t of we)re(`Checking <${Se(e)}> for blocking CSS: ${t}`),Me(e,t)&&Ie(e,t)}const xe=e=>t=>void 0===t?void 0:e(t),je=xe(e=>"true"===e),Ae=xe(Number),Pe=(e="")=>t=>n=>{n.size>0&&ae(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Ne=Pe("attached to"),Ce=((e="")=>t=>n=>{n.size>0&&le(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Re=Pe("detached from"),qe=(e,o=!0)=>r=>{r>0&&ie(`${o?"At":"De"}tached ${e}Observer ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t)},Le=(e,t,n,o)=>{const r=Re(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Be="Mutation",De=new Set,We=new Set,Fe=new Set,Ve=[],He={attributes:!0,attributeFilter:[b,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ue,Ze=1,Je=!1,_e=0;const Qe=Pe("added")(Be),Ye=Pe("removed (page)")(Be),Ge=Pe("removed (added)")(Be),Xe=e=>e.nodeType!==Node.ELEMENT_NODE||R.has(e.tagName.toLowerCase());function Ke(e){const t=e.addedNodes;for(const e of t)Xe(e)||De.add(e)}function et(e){const t=e.removedNodes;for(const e of t)Xe(e)||(De.has(e)?(De.delete(e),Fe.add(e)):We.add(e))}const tt=e=>{ie("Mutations:",e);for(const t of e)Ke(t),et(t);Qe(De),Ye(We),Ge(Fe),Fe.clear()};const nt=e=>()=>{const t=performance.now(),r=t-_e,i=16*Ze+++2;if(r>i&&r<200)return ue("mutationThrottled"),ie("Update delayed due to heavy workload on the callStack"),ie(`EventLoop busy time: %c${Q(r)}ms %c> Max wait: %c${i-2}ms`,n,o,n),setTimeout(Ue,16*Ze),void(_e=t);Ze=1,Ve.forEach(tt),Ve.length=0,Je=!1,We.size>0&&re(`Detected %c${We.size} %cremoved element${We.size>1?"s":""}`,n,o),De.size>0&&re(`Found %c${De.size} %cnew element${De.size>1?"s":""}`,n,o),e({addedNodes:De,removedNodes:We}),De.clear(),We.clear()};function ot(e){Ve.push(e),Je||(_e=performance.now(),Je=!0,requestAnimationFrame(Ue))}function rt(e){const t=new window.MutationObserver(ot),n=document.body||document.documentElement;return Ue=nt(e),t.observe(n,He),ie("Attached MutationObserver to body"),{...t,disconnect:()=>{De.clear(),We.clear(),Ve.length=0,t.disconnect(),ie("Detached MutationObserver")}}}const it="Overflow",at=qe(it),st=qe(it,!1),ct=Ne(it),lt=Ce(it),dt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,ut=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||_,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(y,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!dt(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));lt(t),ct(n),at(o),n.clear(),t.clear()},detachObservers:Le(it,c,l,st),disconnect:()=>{c.disconnect(),ie("Detached OverflowObserver")}}},mt="--ifr-start",ft="--ifr-end",pt="--ifr-measure",ht=[];let gt,yt={},bt=0;function vt(){try{performance.clearMarks(mt),performance.clearMarks(ft),performance.clearMeasures(pt)}catch{}}function zt(e){e.getEntries().forEach(e=>{if(e.name===ft)try{const{duration:t}=performance.measure(pt,mt,ft);yt=e.detail,ht.push(t),ht.length>100&&ht.shift()}catch{}})}function wt(){ie("Attached PerformanceObserver to page");const e=new PerformanceObserver(zt);return e.observe({entryTypes:["mark"]}),gt=setInterval(()=>{if(ht.length<10)return;if(yt.hasTags&&yt.len<25)return;ht.sort();const e=Math.min(ht.reduce((e,t)=>e+t,0)/ht.length,ht[Math.floor(ht.length/2)]),t=Q(e);t>bt&&(bt=t,ue("performanceObserver"),re("Mean time:",Q(ht[Math.floor(ht.length/2)])),re("Median time:",Q(ht.reduce((e,t)=>e+t,0)/ht.length)),re("Average time:",t),re("Max time:",Q(Math.max(...ht)))),vt(),e<=4||(clearInterval(gt),he(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Q(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${yt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{vt(),clearInterval(gt),e.disconnect(),ie("Detached PerformanceObserver")}}}const $t="Resize",St=qe($t),Ot=qe($t,!1),Mt=Ne($t),kt=Ce($t),Et=new WeakSet,It=new Set,Tt=new Set;let xt;function jt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Et.has(n)?It.add(n):(xt.observe(n),Et.add(n),Tt.add(n),t+=1))}kt(It),Mt(Tt),St(t),Tt.clear(),It.clear()}function At(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),ie("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),ie("Detached VisibilityObserver")}}}const Pt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Nt=Pt("function"),Ct=Pt("number"),Rt=Pt("string");"undefined"!=typeof window&&function(){const e={height:()=>(pe("Custom height calculation function not defined"),In.auto()),width:()=>(pe("Custom width calculation function not defined"),Tn.auto())},L={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},W={},V="auto",te=[],oe="scroll";let fe,ye,we,$e,Se,Oe,Me,ke,Ee,Ie=!0,xe="",Pe=0,Ne="",Ce="",Re=!1,qe=!0,Be=!1,De=!0,We=!1,Fe=!1,Ve=!0,He=!1,Ue=1,Ze=V,Je="",_e=!0,Qe={},Ye=!1,Ge=!1,Xe=!1,Ke=0,et=!1,tt=0,nt=0,ot=new Set,it="",at="child",st=!1,ct="",lt=[],dt=window.parent,pt="*",ht=0,gt=!1,yt=1,bt=oe,vt=window,zt=()=>{pe("onMessage function not defined")},St=()=>{},Mt=null,kt=null;function It(t){var o;!function(e){it=e[0]??it,Pe=Ae(e[1])??Pe,Be=je(e[2])??Be,Xe=je(e[3])??Xe,Ie=je(e[6])??Ie,Ne=e[7]??Ne,Ze=e[8]??Ze,xe=e[9]??xe,Ce=e[10]??Ce,ht=Ae(e[11])??ht,Qe.enable=je(e[12])??!1,at=e[13]??at,bt=e[14]??bt,et=je(e[15])??et,tt=Ae(e[16])??tt,nt=Ae(e[17])??nt,qe=je(e[18])??qe,fe=e[19]??fe,ke=e[20]??ke,Ke=Ae(e[21])??Ke,Ge=je(e[23])??Ge}(t),ee=(o={id:it,enabled:Xe,expand:Ge}).id||s,ne.label(`${ee}`),ne.expand(o.expand),K=o.enabled,re(`Initialising iframe v${a} ${window.location.href}`),function(){function t(e){re("Reading data from page:",Object.keys(e)),Ee=Nt(e,"onBeforeResize")??Ee,zt=Nt(e,"onMessage")??zt,St=Nt(e,"onReady")??St,"number"==typeof e?.offset&&(ze("offset","offsetSize"),qe&&(tt=Ct(e,"offset")??tt),Be&&(nt=Ct(e,"offset")??nt)),"number"==typeof e?.offsetSize&&(qe&&(tt=Ct(e,"offsetSize")??tt),Be&&(nt=Ct(e,"offsetSize")??nt)),ye=Rt(e,B(D[0]))??ye,Je=Rt(e,"ignoreSelector")??Je,ct=Rt(e,"sizeSelector")??ct,pt=Rt(e,"targetOrigin")??pt,Ze=e?.heightCalculationMethod||Ze,bt=e?.widthCalculationMethod||bt}function o(t,n){return"function"==typeof t&&(he(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===Ke)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),Ze=o(Ze,v),bt=o(bt,z),ie(`Set targetOrigin for parent: %c${pt}`,n))}(),[Wt,Vt,tn,Bt,Ft,Kt,en,Gt,Dt,qt,Re?_:Te,Zt,sn,an,rn,Jt,()=>Ht("background",xe),()=>Ht("padding",Ce),()=>Ht("min-height","1px"),()=>Ht("min-width","1px"),Re?_:_t,on,nn,vn,Tt].forEach(e=>{try{e()}catch(e){if(Ke<0)throw e;he("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),le(e)}}),Pt(J(St)),re("Initialization complete"),Rn(l,"Init message from host page",void 0,void 0,`${a}:${Ke}`),document.title&&""!==document.title&&Bn(0,0,p,document.title)}function Tt(){q(window,c.toLowerCase(),()=>{te.forEach(e=>e()),Bn(0,0,c)})}function Pt(e){"complete"===document.readyState?Z(e):q(document,w,()=>Pt(e))}function qt(){lt=document.querySelectorAll(`[${g}]`),He=lt.length>0,re(`Tagged elements found: %c${He}`,n)}let Lt=0;function Bt(){const e=document.querySelectorAll(`*[${b}]`);return We=e.length>0,We&&e.length!==Lt&&(function(e){const n=1===e.length?"":"s";pe(`%c[${b}]%c found on %c${e.length}%c element${n}`,i,t,i,t)}(e),Lt=e.length),We}function Dt(){"BackCompat"===document.compatMode&&he("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Wt(){ke&&""!==ke&&"false"!==ke?ke!==a&&he(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ke} - Child page: ${a}.\n`):he("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function Ft(){try{st=1===Ke||"iframeParentListener"in window.parent}catch(e){re("Cross domain iframe detected")}}function Vt(){Be===qe&&(Re=!0)}function Ht(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ie(`Set body ${e}: %c${t}`,n))}function Ut(e,t,o){if(""!==o){re(`${e}: %c${o}`,n);for(const e of document.querySelectorAll(o))re(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Zt(){Ut("sizeSelector",g,ct),Ut("ignoreSelector",b,Je)}function Jt(){var e,t;void 0===Ne&&(Ne=`${Pe}px`),Ht("margin",(e="margin",(t=Ne).includes("-")&&(pe(`Negative CSS value ignored for ${e}`),t=""),t))}function _t(){const e=e=>e.style.setProperty(v,"auto","important");e(document.documentElement),e(document.body),re("Set HTML & body height: %cauto !important",n)}function Qt(e){({add(t){function n(){Rn(e.eventName,e.eventType)}W[t]=n,q(window,t,n,{passive:!0})},remove(e){const t=W[e];var n,o;delete W[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),re(`${Y(e.method)} event listener: %c${e.eventType}`,n)}function Yt(e){Qt({method:e,eventType:"After Print",eventName:"afterprint"}),Qt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qt({method:e,eventType:"Ready State Change",eventName:w})}function Gt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&he("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Xt(e,t,o){const{label:r}=o;return t!==e&&(e in o||(pe(`${e} is not a valid option for ${r}CalculationMethod.`),e=t),e in L)&&he(`<rb>Deprecated ${r}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${ke?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${r}CalculationMethod: 'auto',\n}\n`}\n`),re(`Set ${r} calculation method: %c${e}`,n),e}function Kt(){Ze=Xt(Ze,V,In)}function en(){bt=Xt(bt,oe,Tn)}function tn(){const e=Ke,n=U({key:fe}),o=U({key:ye});if(Ke=Math.max(n,o),Ke<0){if(Ke=Math.min(n,o),he(`${H(Ke+2)}${H(2)}`),G(ke))throw H(Ke+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(ke)||e>-1&&Ke>e)&&(sessionStorage.getItem("ifr")!==a&&function(e,n){console.info(`${ee} %ciframe-resizer ${e}`,K||n<1?"font-weight: bold;":t)}(`v${a} (${(e=>B(F[e]))(Ke)})`,Ke),Ke<2&&ge(H(3)),sessionStorage.setItem("ifr",a))}function nn(){!0!==Ie&&re("Auto Resize disabled"),Yt("add"),te.push(()=>Yt("remove"))}function on(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function rn(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,h)+parseInt(n.x,h),y:parseInt(t.top,h)+parseInt(n.y,h)}}function t(t){const r=t.split("#")[1]||t,i=decodeURIComponent(r),a=document.getElementById(i)||document.getElementsByName(i)[0];void 0===a?(re(`In page link (#${r}) not found in iframe, so sending to parent`),Bn(0,0,"inPageLink",`#${r}`)):function(t){const i=e(t);re(`Moving to in page link (%c#${r}%c) at x: %c${i.x}%c y: %c${i.y}`,n,o,n,o,n),Bn(i.y,i.x,f)}(a)}function r(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Qe.enable?1===Ke?he("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(re("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&q(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),q(window,"hashchange",r),setTimeout(r,128)):re("In page linking not enabled"),Qe={findTarget:t}}function an(){function e(e){Bn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,o){re(`Add event listener: %c${o}`,n),q(window.document,t,e)}!0===et&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function sn(){1!==Ke&&(vt.parentIframe=Object.freeze({autoResize:e=>(X(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Be&&!1===qe?(ue(O),he("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Ie?(Ie=!0,queueMicrotask(()=>Rn(O,"Auto Resize enabled"))):!1===e&&!0===Ie&&(Ie=!1),Bn(0,0,"autoResize",JSON.stringify(Ie)),Ie)),close(){Bn(0,0,"close")},getId:()=>it,getOrigin:()=>(ue("getOrigin"),be("getOrigin()","getParentOrigin()"),we),getParentOrigin:()=>we,getPageInfo(e){if("function"==typeof e)return Mt=e,Bn(0,0,u),void ve("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Mt=null,Bn(0,0,"pageInfoStop")},getParentProps:e=>(X(e,"function","parentIframe.getParentProps(callback) callback"),kt=e,Bn(0,0,m),()=>{kt=null,Bn(0,0,"parentInfoStop")}),getParentProperties(e){be("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){X(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Qe.findTarget(e)},reset(){!function(){const e=Ze;Ze=V,re(`Reset trigger event: %c${"parentIframe.reset"}`,n),gt?re("TriggerLock blocked calculation"):(gt=!0,ae("Trigger event lock on"),requestAnimationFrame(()=>{gt=!1,ae("Trigger event lock off")})),qn("reset"),Ze=e}()},setOffsetSize(e){X(e,"number","parentIframe.setOffsetSize(offset) offset"),tt=e,nt=e,Rn(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){X(e,"number","parentIframe.scrollBy(x, y) x"),X(t,"number","parentIframe.scrollBy(x, y) y"),Bn(t,e,"scrollBy")},scrollTo(e,t){X(e,"number","parentIframe.scrollTo(x, y) x"),X(t,"number","parentIframe.scrollTo(x, y) y"),Bn(t,e,"scrollTo")},scrollToOffset(e,t){X(e,"number","parentIframe.scrollToOffset(x, y) x"),X(t,"number","parentIframe.scrollToOffset(x, y) y"),Bn(t,e,f)},sendMessage(e,t){t&&X(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Bn(0,0,d,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ze=e,Kt()},setWidthCalculationMethod(e){bt=e,en()},setTargetOrigin(e){X(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),re(`Set targetOrigin: %c${e}`,n),pt=e},resize(e,t){void 0!==e&&X(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&X(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Rn(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){be("size()","resize()"),this.resize(e,t)}}),vt.parentIFrame=vt.parentIframe)}let cn=new Set;function ln(){const e=document.querySelectorAll(`[${y}]`);ot=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${b}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ue("overflowIgnored"),ie("Ignoring elements with [data-iframe-ignore] > *:\n",n),ce()}),t}(e),Fe=ot.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ve=ot.symmetricDifference(cn).size>0),cn=ot}function dn(){switch(ln(),!0){case!Ve:return;case ot.size>1:ie("Overflowed Elements:",ot);break;case Fe:break;default:ie("No overflow detected")}Rn(j,"Overflow updated")}function un(e){const t={root:document.documentElement,side:qe?$:S};return $e=ut(dn,t),$e.attachObservers(e),$e}function mn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Rn(x,`Element resized <${function(e){switch(!0){case!G(e):return"";case G(e.id):return`${e.nodeName}#${e.id}`;case G(e.name):return`${e.nodeName} (${e.name}`;case G(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function fn(e){return xt=new ResizeObserver(mn),xt.observe(document.body),Et.add(document.body),ie("Attached ResizeObserver to body"),Se={attachObserverToNonStaticElements:jt,detachObservers:Le($t,xt,Et,Ot),disconnect:()=>{xt.disconnect(),ie("Detached ResizeObserver")}},Se.attachObserverToNonStaticElements(e),Se}function pn(e){re(`Visible: %c${e}`,n),Ye=!e,Rn(P,"Visibility changed")}const hn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of Sn(n))t.add(e)}return ie("Inspecting:\n",t),t},gn=e=>{if(0===e.size)return;ue("addObservers");const t=hn(e);$e.attachObservers(t),Se.attachObserverToNonStaticElements(t),ce()},yn=e=>{if(0===e.size)return;ue("removeObservers");const t=hn(e);$e.detachObservers(t),Se.detachObservers(t),ce()};function bn(e){!function({addedNodes:e,removedNodes:t}){ue("contentMutated"),Zt(),qt(),ln(),ce(),yn(t),gn(e)}(e),Rn(A,"Mutation Observed")}function vn(){const e=Sn(document.documentElement);var t;re("Attaching Observers"),t=[rt(bn),un(e),wt(),fn(e),At(pn)],te.push(...t.map(e=>e.disconnect))}function zn(e){performance.mark(mt);const t=Y(e);let r=1,i=document.documentElement,a=He?0:document.documentElement.getBoundingClientRect().bottom;const s=He?lt:Fe?Array.from(ot):Sn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>a&&(a=r,i=t);return ie(`${t} position calculated from:`,i),ie(`Checked %c${s.length}%c elements`,n,o),performance.mark(ft,{detail:{hasTags:He,len:s.length,logging:Xe,Side:t}}),a}const wn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],$n=`* ${Array.from(R).map(e=>`:not(${e})`).join("")}`,Sn=e=>e.querySelectorAll($n),On={height:0,width:0},Mn={height:0,width:0},kn=[n,o,n];function En(e){function t(){return Mn[r]=i,On[r]=c,Math.max(i,1)}const o=e===In,r=e.label,i=e.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${i}px %cPage: %c${c}px`;let d=0;switch(!0){case!e.enabled():return Math.max(c,1);case He:ie("Found element with data-iframe-size attribute"),d=e.taggedElement();break;case!Fe&&De&&0===Mn[r]&&0===On[r]:ie(`Initial page size values: ${l}`,...kn),d=t();break;case gt&&i===Mn[r]&&c===On[r]:ie(`Size unchanged: ${l}`,...kn),d=Math.max(i,c);break;case 0===i&&0!==c:ie(`Page is hidden: ${l}`,...kn),d=c;break;case!Fe&&i!==Mn[r]&&c<=On[r]:ie(`New <html> size: ${l} `,...kn),ie(`Previous <html> size: %c${Mn[r]}px`,n),d=t();break;case!o:d=e.taggedElement();break;case!Fe&&i<Mn[r]:ie(`<html> size decreased: ${l}`,...kn),d=t();break;case c===s||c===a:ie(`<html> size equals page size: ${l}`,...kn),d=t();break;case i>c:ie(`Page size < <html> size: ${l}`,...kn),d=t();break;case Fe:ie("Found elements possibly overflowing <html> "),d=e.taggedElement();break;default:ie(`Using <html> size: ${l}`,...kn),d=t()}return ie(`Content ${r}: %c${d}px`,n),d+=function(e){const t=e.getOffset();return 0!==t&&ie(`Page offsetSize: %c${t}px`,n),t}(e),d}const In={label:v,enabled:()=>qe,getOffset:()=>tt,auto:()=>En(In),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,h)+parseInt(t.marginBottom,h)},bodyScroll:()=>document.body.scrollHeight,offset:()=>In.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...wn(In)),min:()=>Math.min(...wn(In)),grow:()=>In.max(),lowestElement:()=>zn($),taggedElement:()=>zn($)},Tn={label:z,enabled:()=>Be,getOffset:()=>nt,auto:()=>En(Tn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...wn(Tn)),min:()=>Math.min(...wn(Tn)),rightMostElement:()=>zn(S),scroll:()=>Math.max(Tn.bodyScroll(),Tn.documentElementScroll()),taggedElement:()=>zn(S)},xn=(e,t)=>!(Math.abs(e-t)<=ht);function jn(e,t){const n=e[t](),o=e.enabled()&&void 0!==Ee?function(e){const t=Ee(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return se(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let An=!1;const Pn=J(()=>ge(H(4)));let Nn,Cn=!1;const Rn=de((e,t,o,r,i)=>{switch(ue(e),!0){case!0===Ye:if(!0===Cn)break;re("Iframe hidden - Ignored resize request"),Cn=!0,An=!1,cancelAnimationFrame(Nn);break;case!0===An&&e!==j:re("Resize already pending - Ignored resize request");break;case!Ie&&!(e in I):ie("Resizing disabled");break;default:Cn=!1,An=!0,Me=performance.now(),Oe=!0,Nn=requestAnimationFrame(()=>{An=!1,ue("requestAnimationFrame"),ae(`Reset sendPending: %c${e}`,n)}),function(e,t,o,r,i){const a=o??jn(In,Ze),s=r??jn(Tn,bt),c=qe&&xn(Ue,a)||Be&&xn(yt,s)?M:e;switch(re(`Resize event: %c${t}`,n),c){case l:case O:case M:Ue=a,yt=s;case T:Ln(Ue,yt,e,i);break;case j:case A:case x:case P:re(N);break;default:ie(N)}Oe=!1}(e,t,o,r,i)}ce()});function qn(e){Ue=In[Ze](),yt=Tn[bt](),Bn(Ue,yt,e)}function Ln(e,t,o,i,a){Ke<-1||(void 0!==a?re(`Message targetOrigin: %c${a}`,n):a=pt,function(){const s=`${it}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(st)try{window.parent.iframeParentListener(C+s)}catch(e){if(1!==Ke)throw e;return void Pn()}else dt.postMessage(C+s,a);Oe&&re(function(){const e=Q(performance.now()-Me);return o===l?`Initialised iframe in %c${e}ms`:`Size calculated in %c${e}ms`}(),n),ie(`Sending message to parent page via ${st?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Bn=de((e,t,n,o,r)=>{ue(n),Ln(e,t,n,o,r),ce()}),Dn=de(function(e){ue("onMessage");const{freeze:t}=Object,{parse:o}=JSON,r=e=>t(o(e)),i=e=>Bn(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void re("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");dt=e.source,we=e.origin,It(t),De=!1,setTimeout(()=>{_e=!1},128)},reset(){_e?re("Page reset ignored by init"):(re("Page size reset by host page"),qn("resetPage"))},resize(){re("Resize requested by host page"),Rn(E,"Parent window requested size check")},moveToAnchor(){Qe.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();re("PageInfo received from parent:",r(e)),Mt?Z(Mt,o(e)):i(u)},parentInfo(){const e=r(c());re("ParentInfo received from parent:",e),kt?Z(kt,e):i(m)},message(){const e=c();re("onMessage called from parent:%c",n,r(e)),Z(zt,o(e))}},s=()=>e.data.split("]")[1].split(":")[0],c=()=>e.data.slice(e.data.indexOf(":")+1),d=()=>e.data.split(":")[2]in{true:1,false:1};function f(){const t=s();ue(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||d()||pe(`Unexpected message (${e.data})`)}C===`${e.data}`.slice(0,13)&&function(){if(!1!==De)return d()?(me(s()),ue(l),void a.init()):void re(`Ignored message of type "${s()}". Received before initialization.`);f()}()});let Wn=!1;const Fn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Vn(){if("loading"===document.readyState||!De||Wn)return;const{parent:e,top:t}=window;ue("ready"),re("Sending%c ready%c to parent from",n,o,window.location.href),Fn(e),e!==t&&Fn(t),Wn=!0}"iframeChildListener"in window?pe("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Dn({data:e,sameOrigin:!0})),q(window,d,Dn),q(document,w,Vn),setTimeout(Vn))}();
21
- //# sourceMappingURL=index.esm.js.map
20
+ import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as a}from"auto-console-group";const i="5.5.6",s="iframeResizer",c="beforeUnload",l="init",u="message",d="pageInfo",m="parentInfo",f="scrollToOffset",h="title",p=10,g="data-iframe-size",y="data-iframe-overflowed",b="data-iframe-ignore",v="height",z="width",w="readystatechange",$="bottom",S="right",O="autoResizeEnabled",E=Symbol("sizeChanged"),M="manualResize",k="parentResize",j={[M]:1,[k]:1},x="setOffsetSize",T="resizeObserver",A="overflowObserver",I="mutationObserver",N="visibilityObserver",C="[iFrameSizer]",P=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),R=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),L=["spjluzl","rlf","clyzpvu"],D=["<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."],W=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],F=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),V=e=>q(D[e]),H=e=>{const t=e[q(L[0])]||e[q(L[1])]||e[q(L[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(q(e));return n in F&&(t=F[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o},U=(e,...t)=>setTimeout(()=>e(...t),0),Z=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},J=e=>e,_=e=>Math.round(1e3*e)/1e3,Q=e=>e.charAt(0).toUpperCase()+e.slice(1),Y=e=>""!=`${e}`&&void 0!==e;const G=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Q(t)}`)};let X=!0,K=s;var ee;const te=(ee=e,ee?.__esModule?ee.default:ee)({label:`${s}(child)`,expand:!1});var ne;const oe=(ne="log",(...e)=>!X||te[ne](...e));const{assert:re,endAutoGroup:ae,error:ie,errorBoundary:se,event:ce,label:le,purge:ue,warn:de}=te,me=e=>{return te.warn((t=J,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},fe=me,he=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>me(t)),pe=he("Method"),ge=he("Method","replaced with"),ye=he("Option"),be=["min-height","min-width","max-height","max-width"],ve=new Set,ze=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),we=(e,t)=>{return(n=ze(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function $e({href:e}){ve.has(e)||ve.add(e)}const Se=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){$e(n)}return{source:"cross-origin stylesheet",value:ze(e,t)}}(e,t),Oe=(e,t)=>{const{source:n,value:o}=Se(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);me(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Ee(){for(const e of[document.documentElement,document.body])for(const t of be)we(e,t)&&Oe(e,t)}const Me=e=>t=>void 0===t?void 0:e(t),ke=Me(e=>"true"===e),je=Me(Number),xe=e=>e=>{e.size},Te=((e="")=>t=>n=>{n.size>0&&ie(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ae=e=>e=>{e.size},Ie=(e,o=!0)=>r=>{r>0&&oe(`${o?"At":"De"}tached ${e}Observer ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t)},Ne=(e,t,n,o)=>{const r=Ae(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},Ce=new Set,Pe=new Set,Re=new Set,Be=[],qe={attributes:!0,attributeFilter:[b,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Le,De=1,We=!1,Fe=0;const Ve=e=>{e.size},He=e=>{e.size},Ue=e=>{e.size},Ze=e=>e.nodeType!==Node.ELEMENT_NODE||P.has(e.tagName.toLowerCase());function Je(e){const t=e.addedNodes;for(const e of t)Ze(e)||Ce.add(e)}function _e(e){const t=e.removedNodes;for(const e of t)Ze(e)||(Ce.has(e)?(Ce.delete(e),Re.add(e)):Pe.add(e))}const Qe=e=>{oe("Mutations:",e);for(const t of e)Je(t),_e(t);Ve(Ce),He(Pe),Ue(Re),Re.clear()};const Ye=e=>()=>{const t=performance.now(),r=t-Fe,a=16*De+++2;if(r>a&&r<200)return ce("mutationThrottled"),oe("Update delayed due to heavy workload on the callStack"),oe(`EventLoop busy time: %c${_(r)}ms %c> Max wait: %c${a-2}ms`,n,o,n),setTimeout(Le,16*De),void(Fe=t);De=1,Be.forEach(Qe),Be.length=0,We=!1,Pe.size,Ce.size,e({addedNodes:Ce,removedNodes:Pe}),Ce.clear(),Pe.clear()};function Ge(e){Be.push(e),We||(Fe=performance.now(),We=!0,requestAnimationFrame(Le))}function Xe(e){const t=new window.MutationObserver(Ge),n=document.body||document.documentElement;return Le=Ye(e),t.observe(n,qe),oe("Attached MutationObserver to body"),{...t,disconnect:()=>{Ce.clear(),Pe.clear(),Be.length=0,t.disconnect(),oe("Detached MutationObserver")}}}const Ke="Overflow",et=Ie(Ke),tt=Ie(Ke,!1),nt=xe(Ke),ot=Te(Ke),rt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,at=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||J,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(y,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],c=i(a,o)&&!rt(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ot(t),nt(n),et(o),n.clear(),t.clear()},detachObservers:Ne(Ke,c,l,tt),disconnect:()=>{c.disconnect(),oe("Detached OverflowObserver")}}},it="--ifr-start",st="--ifr-end",ct="--ifr-measure",lt=[];let ut,dt={},mt=0;function ft(){try{performance.clearMarks(it),performance.clearMarks(st),performance.clearMeasures(ct)}catch{}}function ht(e){e.getEntries().forEach(e=>{if(e.name===st)try{const{duration:t}=performance.measure(ct,it,st);dt=e.detail,lt.push(t),lt.length>100&&lt.shift()}catch{}})}function pt(){oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(ht);return e.observe({entryTypes:["mark"]}),ut=setInterval(()=>{if(lt.length<10)return;if(dt.hasTags&&dt.len<25)return;lt.sort();const e=Math.min(lt.reduce((e,t)=>e+t,0)/lt.length,lt[Math.floor(lt.length/2)]),t=_(e);t>mt&&(mt=t,ce("performanceObserver")),ft(),e<=4||(clearInterval(ut),me(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${_(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${dt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ft(),clearInterval(ut),e.disconnect(),oe("Detached PerformanceObserver")}}}const gt="Resize",yt=Ie(gt),bt=Ie(gt,!1),vt=xe(gt),zt=Te(gt),wt=new WeakSet,$t=new Set,St=new Set;let Ot;function Et(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(wt.has(n)?$t.add(n):(Ot.observe(n),wt.add(n),St.add(n),t+=1))}zt($t),vt(St),yt(t),St.clear(),$t.clear()}function Mt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),oe("Detached VisibilityObserver")}}}const kt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},jt=kt("function"),xt=kt("number"),Tt=kt("string");"undefined"!=typeof window&&function(){const e={height:()=>(de("Custom height calculation function not defined"),Sn.auto()),width:()=>(de("Custom width calculation function not defined"),On.auto())},B={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},D={},F="auto",_=[],ee="scroll";let ne,he,be,ve,ze,we,$e,Se=!0,Oe="",Me=0,xe="",Te="",Ae=!1,Ie=!0,Ce=!1,Pe=!0,Re=!1,Be=!1,qe=!0,Le=!1,De=1,We=F,Fe="",Ve=!0,He={},Ue=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ye=0,Ge=0,Ke=new Set,et="",tt="child",nt=!1,ot="",rt=[],ct=window.parent,lt="*",ut=0,dt=!1,mt=1,ft=ee,ht=window,yt=()=>{de("onMessage function not defined")},vt=()=>{},zt=null,$t=null;function St(t){var o;!function(e){et=e[0]??et,Me=je(e[1])??Me,Ce=ke(e[2])??Ce,Je=ke(e[3])??Je,Se=ke(e[6])??Se,xe=e[7]??xe,We=e[8]??We,Oe=e[9]??Oe,Te=e[10]??Te,ut=je(e[11])??ut,He.enable=ke(e[12])??!1,tt=e[13]??tt,ft=e[14]??ft,Qe=ke(e[15])??Qe,Ye=je(e[16])??Ye,Ge=je(e[17])??Ge,Ie=ke(e[18])??Ie,ne=e[19]??ne,we=e[20]??we,_e=je(e[21])??_e,Ze=ke(e[23])??Ze}(t),K=(o={id:et,enabled:Je,expand:Ze}).id||s,te.label(`${K}`),te.expand(o.expand),X=o.enabled,function(){function t(e){$e=jt(e,"onBeforeResize")??$e,yt=jt(e,"onMessage")??yt,vt=jt(e,"onReady")??vt,"number"==typeof e?.offset&&(ye("offset","offsetSize"),Ie&&(Ye=xt(e,"offset")??Ye),Ce&&(Ge=xt(e,"offset")??Ge)),"number"==typeof e?.offsetSize&&(Ie&&(Ye=xt(e,"offsetSize")??Ye),Ce&&(Ge=xt(e,"offsetSize")??Ge)),he=Tt(e,q(L[0]))??he,Fe=Tt(e,"ignoreSelector")??Fe,ot=Tt(e,"sizeSelector")??ot,lt=Tt(e,"targetOrigin")??lt,We=e?.heightCalculationMethod||We,ft=e?.widthCalculationMethod||ft}function o(t,n){return"function"==typeof t&&(me(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===_e)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),We=o(We,v),ft=o(ft,z),oe(`Set targetOrigin for parent: %c${lt}`,n))}(),[Rt,qt,Yt,Ct,Bt,_t,Qt,Zt,Pt,It,Ae?J:Ee,Wt,tn,en,Kt,Ft,()=>Lt("background",Oe),()=>Lt("padding",Te),Ae?J:Vt,Xt,Gt,hn,kt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;me("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ie(e)}}),At(Z(vt)),An(l,"Init message from host page",void 0,void 0,`${i}:${_e}`),document.title&&""!==document.title&&Cn(0,0,h,document.title)}function kt(){R(window,c.toLowerCase(),()=>{_.forEach(e=>e()),Cn(0,0,c)})}function At(e){"complete"===document.readyState?U(e):R(document,w,()=>At(e))}function It(){rt=document.querySelectorAll(`[${g}]`),Le=rt.length>0}let Nt=0;function Ct(){const e=document.querySelectorAll(`*[${b}]`);return Re=e.length>0,Re&&e.length!==Nt&&(function(e){const n=1===e.length?"":"s";de(`%c[${b}]%c found on %c${e.length}%c element${n}`,a,t,a,t)}(e),Nt=e.length),Re}function Pt(){"BackCompat"===document.compatMode&&me("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Rt(){we&&""!==we&&"false"!==we?we!==i&&me(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${we} - Child page: ${i}.\n`):me("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function Bt(){try{nt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function qt(){Ce===Ie&&(Ae=!0)}function Lt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),oe(`Set body ${e}: %c${t}`,n))}function Dt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Wt(){Dt(0,g,ot),Dt(0,b,Fe)}function Ft(){var e,t;void 0===xe&&(xe=`${Me}px`),Lt("margin",(e="margin",(t=xe).includes("-")&&(de(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(v,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}D[t]=n,R(window,t,n,{passive:!0})},remove(e){const t=D[e];var n,o;delete D[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:w})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&me("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Jt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in B)&&me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${we?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function _t(){We=Jt(We,F,Sn)}function Qt(){ft=Jt(ft,ee,On)}function Yt(){const e=_e,n=H({key:ne}),o=H({key:he});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),ue(),me(`${V(_e+2)}${V(2)}`),Y(we))throw V(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!Y(we)||e>-1&&_e>e)&&(sessionStorage.getItem("ifr")!==i&&function(e,n){console.info(`${K} %ciframe-resizer ${e}`,X||n<1?"font-weight: bold;":t)}(`v${i} (${(e=>q(W[e]))(_e)})`,_e),_e<2&&fe(V(3)),sessionStorage.setItem("ifr",i))}function Gt(){Ut("add"),_.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,p)+parseInt(n.x,p),y:parseInt(t.top,p)+parseInt(n.y,p)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Cn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Cn(n.y,n.x,f)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}He.enable&&(1===_e?me("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&R(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),R(window,"hashchange",n),setTimeout(n,128))),He={findTarget:t}}function en(){function e(e){Cn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){R(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(ht.parentIframe=Object.freeze({autoResize:e=>(G(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ce&&!1===Ie?(ce(O),me("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Se?(Se=!0,queueMicrotask(()=>An(O,"Auto Resize enabled"))):!1===e&&!0===Se&&(Se=!1),Cn(0,0,"autoResize",JSON.stringify(Se)),Se)),close(){Cn(0,0,"close")},getId:()=>et,getOrigin:()=>(ce("getOrigin"),pe("getOrigin()","getParentOrigin()"),be),getParentOrigin:()=>be,getPageInfo(e){if("function"==typeof e)return zt=e,Cn(0,0,d),void ge("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");zt=null,Cn(0,0,"pageInfoStop")},getParentProps:e=>(G(e,"function","parentIframe.getParentProps(callback) callback"),$t=e,Cn(0,0,m),()=>{$t=null,Cn(0,0,"parentInfoStop")}),getParentProperties(e){pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){G(e,"string","parentIframe.moveToAnchor(anchor) anchor"),He.findTarget(e)},reset(){!function(){const e=We;We=F,dt||(dt=!0,requestAnimationFrame(()=>{dt=!1})),In("reset"),We=e}()},setOffsetSize(e){G(e,"number","parentIframe.setOffsetSize(offset) offset"),Ye=e,Ge=e,An(x,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){G(e,"number","parentIframe.scrollBy(x, y) x"),G(t,"number","parentIframe.scrollBy(x, y) y"),Cn(t,e,"scrollBy")},scrollTo(e,t){G(e,"number","parentIframe.scrollTo(x, y) x"),G(t,"number","parentIframe.scrollTo(x, y) y"),Cn(t,e,"scrollTo")},scrollToOffset(e,t){G(e,"number","parentIframe.scrollToOffset(x, y) x"),G(t,"number","parentIframe.scrollToOffset(x, y) y"),Cn(t,e,f)},sendMessage(e,t){t&&G(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Cn(0,0,u,JSON.stringify(e),t)},setHeightCalculationMethod(e){We=e,_t()},setWidthCalculationMethod(e){ft=e,Qt()},setTargetOrigin(e){G(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),lt=e},resize(e,t){void 0!==e&&G(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&G(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(M,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){pe("size()","resize()"),this.resize(e,t)}}),ht.parentIFrame=ht.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${y}]`);Ke=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${b}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ce("overflowIgnored"),oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),ae()}),t}(e),Be=Ke.size>0,"function"==typeof Set.prototype.symmetricDifference&&(qe=Ke.symmetricDifference(nn).size>0),nn=Ke}function rn(){switch(on(),!0){case!qe:return;case Ke.size>1:oe("Overflowed Elements:",Ke);break;case Be:break;default:oe("No overflow detected")}An(A,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Ie?$:S};return ve=at(rn,t),ve.attachObservers(e),ve}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(T,`Element resized <${function(e){switch(!0){case!Y(e):return"";case Y(e.id):return`${e.nodeName}#${e.id}`;case Y(e.name):return`${e.nodeName} (${e.name}`;case Y(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function cn(e){return Ot=new ResizeObserver(sn),Ot.observe(document.body),wt.add(document.body),oe("Attached ResizeObserver to body"),ze={attachObserverToNonStaticElements:Et,detachObservers:Ne(gt,Ot,wt,bt),disconnect:()=>{Ot.disconnect(),oe("Detached ResizeObserver")}},ze.attachObserverToNonStaticElements(e),ze}function ln(e){Ue=!e,An(N,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return oe("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;ce("addObservers");const t=un(e);ve.attachObservers(t),ze.attachObserverToNonStaticElements(t),ae()},mn=e=>{if(0===e.size)return;ce("removeObservers");const t=un(e);ve.detachObservers(t),ze.detachObservers(t),ae()};function fn(e){!function({addedNodes:e,removedNodes:t}){ce("contentMutated"),Wt(),It(),on(),ae(),mn(t),dn(e)}(e),An(I,"Mutation Observed")}function hn(){const e=bn(document.documentElement);var t;t=[Xe(fn),an(e),pt(),cn(e),Mt(ln)],_.push(...t.map(e=>e.disconnect))}function pn(e){performance.mark(it);const t=Q(e);let r=1,a=document.documentElement,i=Le?0:document.documentElement.getBoundingClientRect().bottom;const s=Le?rt:Be?Array.from(Ke):bn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>i&&(i=r,a=t);return oe(`${t} position calculated from:`,a),oe(`Checked %c${s.length}%c elements`,n,o),performance.mark(st,{detail:{hasTags:Le,len:s.length,logging:Je,Side:t}}),i}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(P).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},zn={height:0,width:0},wn=[n,o,n];function $n(e){function t(){return zn[r]=a,vn[r]=c,Math.max(a,1)}const o=e===Sn,r=e.label,a=e.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${a}px %cPage: %c${c}px`;let u=1;switch(!0){case!e.enabled():return Math.max(c,1);case Le:oe("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!Be&&Pe&&0===zn[r]&&0===vn[r]:oe(`Initial page size values: ${l}`,...wn),u=t();break;case dt&&a===zn[r]&&c===vn[r]:oe(`Size unchanged: ${l}`,...wn),u=Math.max(a,c);break;case 0===a&&0!==c:oe(`Page is hidden: ${l}`,...wn),u=c;break;case!Be&&a!==zn[r]&&c<=vn[r]:oe(`New <html> size: ${l} `,...wn),oe(`Previous <html> size: %c${zn[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!Be&&a<zn[r]:oe(`<html> size decreased: ${l}`,...wn),u=t();break;case c===s||c===i:oe(`<html> size equals page size: ${l}`,...wn),u=t();break;case a>c:oe(`Page size < <html> size: ${l}`,...wn),u=t();break;case Be:oe("Found elements possibly overflowing <html> "),u=e.taggedElement();break;default:oe(`Using <html> size: ${l}`,...wn),u=t()}return oe(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&oe(`Page offsetSize: %c${t}px`,n),t}(e),Math.max(u,1)}const Sn={label:v,enabled:()=>Ie,getOffset:()=>Ye,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,p)+parseInt(t.marginBottom,p)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>pn($),taggedElement:()=>pn($)},On={label:z,enabled:()=>Ce,getOffset:()=>Ge,auto:()=>$n(On),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>pn(S),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>pn(S)},En=(e,t)=>!(Math.abs(e-t)<=ut);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==$e?function(e){const t=$e(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return re(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=Z(()=>fe(V(4)));let xn,Tn=!1;const An=se((e,t,n,o,r)=>{switch(ce(e),!0){case!0===Ue:if(!0===Tn)break;Tn=!0,kn=!1,cancelAnimationFrame(xn);break;case!0===kn&&e!==A:ue();break;case!Se&&!(e in j):oe("Resizing disabled");break;default:Tn=!1,kn=!0,performance.now(),xn=requestAnimationFrame(()=>{kn=!1,ce("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Mn(Sn,We),i=o??Mn(On,ft);switch(Ie&&En(De,a)||Ce&&En(mt,i)?E:e){case l:case O:case E:De=a,mt=i;case x:Nn(De,mt,e,r);break;case A:case I:case T:case N:ue();break;default:ue(),oe("No change in content size detected")}}(e,0,n,o,r)}ae()});function In(e){De=Sn[We](),mt=On[ft](),Cn(De,mt,e)}function Nn(e,t,o,a,i){_e<-1||(void 0!==i||(i=lt),function(){const s=`${et}:${e}:${t}:${o}${void 0===a?"":`:${a}`}`;if(nt)try{window.parent.iframeParentListener(C+s)}catch(e){if(1!==_e)throw e;return void jn()}else ct.postMessage(C+s,i);oe(`Sending message to parent page via ${nt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Cn=se((e,t,n,o,r)=>{ce(n),Nn(e,t,n,o,r),ae()}),Pn=se(function(e){ce("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Cn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");ct=e.source,be=e.origin,St(t),Pe=!1,setTimeout(()=>{Ve=!1},128)},reset(){Ve||In("resetPage")},resize(){An(k,"Parent window requested size check")},moveToAnchor(){He.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();zt?U(zt,n(e)):o(d)},parentInfo(){const e=(r=i(),t(n(r)));var r;$t?U($t,e):o(m)},message(){const e=i();U(yt,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],i=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=a();ce(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||de(`Unexpected message (${e.data})`)}C===`${e.data}`.slice(0,13)&&function(){if(!1!==Pe)return s()?(le(a()),ce(l),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Pe||Rn)return;const{parent:e,top:t}=window;ce("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?de("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),R(window,u,Pn),R(document,w,qn),qn())}();
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.5.6-beta.1 (umd) - 2025-09-04
4
+ * @module iframe-resizer/child 5.5.6 (umd) - 2025-09-10
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:d}=Object,u=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(d(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.6-beta.1",b="iframeResizer",v="beforeUnload",w="init",z="message",$="pageInfo",S="parentInfo",O="scrollToOffset",M="title",E=10,k="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",I="height",j="width",A="readystatechange",C="bottom",P="right",N="autoResizeEnabled",R=Symbol("sizeChanged"),q="manualResize",L="parentResize",B={[q]:1,[L]:1},D="setOffsetSize",F="resizeObserver",W="overflowObserver",V="mutationObserver",H="visibilityObserver",U="No change in content size detected",Z="[iFrameSizer]",J=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),_=(e,t,n,o)=>e.addEventListener(t,n,o||!1),Q=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},G=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Y=["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."],K=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ee=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),te=e=>G(X[e]),ne=e=>{const t=e[G(Y[0])]||e[G(Y[1])]||e[G(Y[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=Q(G(e));return n in ee&&(t=ee[n]),t}(n[0]);return 0===o||(e=>e[2]===Q(e[0]+e[1]))(n)||(o=-2),o},oe=(e,...t)=>setTimeout(()=>e(...t),0),re=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},ie=e=>e,ae=e=>Math.round(1e3*e)/1e3,se=e=>e.charAt(0).toUpperCase()+e.slice(1),ce=e=>""!=`${e}`&&void 0!==e;const le=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${se(t)}`)};let de=!0,ue=b;const fe=(me=function(n={}){const l={},d={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function w(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function z(){""===g&&(g=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 $(e,...t){0===p.length&&(z(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,u),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),w()}return n},event:function(e){z(),h.event=e},purge:y,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:z}},me?.__esModule?me.default:me);var me;const pe=fe({label:`${b}(child)`,expand:!1});const he=e=>(...t)=>!de||pe[e](...t),ge=he("log"),ye=ge,be=he("debug");const{assert:ve,endAutoGroup:we,error:ze,errorBoundary:$e,event:Se,label:Oe,purge:Me,warn:Ee}=pe,ke=e=>{return pe.warn((t=ie,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},xe=ke,Te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>ke(t)),Ie=Te("Method"),je=Te("Method","replaced with"),Ae=Te("Option"),Ce=["min-height","min-width","max-height","max-width"],Pe=new Set,Ne=e=>e.tagName?e.tagName.toLowerCase():"unknown",Re=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),qe=(e,t)=>{return(n=Re(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Le({href:e}){Pe.has(e)||(ge("Unable to access stylesheet:",e),Pe.add(e))}const Be=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Le(n)}return{source:"cross-origin stylesheet",value:Re(e,t)}}(e,t),De=(e,t)=>{const{source:n,value:o}=Be(e,t),r=Ne(e);ke(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Fe(){for(const e of[document.documentElement,document.body])for(const t of Ce)ge(`Checking <${Ne(e)}> for blocking CSS: ${t}`),qe(e,t)&&De(e,t)}const We=e=>t=>void 0===t?void 0:e(t),Ve=We(e=>"true"===e),He=We(Number),Ue=(e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Ze=Ue("attached to"),Je=((e="")=>t=>n=>{n.size>0&&ze(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),_e=Ue("detached from"),Qe=(t,n=!0)=>o=>{o>0&&ye(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ge=(e,t,n,o)=>{const r=_e(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Ye="Mutation",Xe=new Set,Ke=new Set,et=new Set,tt=[],nt={attributes:!0,attributeFilter:[T,k],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let ot,rt=1,it=!1,at=0;const st=Ue("added")(Ye),ct=Ue("removed (page)")(Ye),lt=Ue("removed (added)")(Ye),dt=e=>e.nodeType!==Node.ELEMENT_NODE||J.has(e.tagName.toLowerCase());function ut(e){const t=e.addedNodes;for(const e of t)dt(e)||Xe.add(e)}function ft(e){const t=e.removedNodes;for(const e of t)dt(e)||(Xe.has(e)?(Xe.delete(e),et.add(e)):Ke.add(e))}const mt=e=>{ye("Mutations:",e);for(const t of e)ut(t),ft(t);st(Xe),ct(Ke),lt(et),et.clear()};const pt=e=>()=>{const t=performance.now(),n=t-at,o=16*rt+++2;if(n>o&&n<200)return Se("mutationThrottled"),ye("Update delayed due to heavy workload on the callStack"),ye(`EventLoop busy time: %c${ae(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(ot,16*rt),void(at=t);rt=1,tt.forEach(mt),tt.length=0,it=!1,Ke.size>0&&ge(`Detected %c${Ke.size} %cremoved element${Ke.size>1?"s":""}`,h,g),Xe.size>0&&ge(`Found %c${Xe.size} %cnew element${Xe.size>1?"s":""}`,h,g),e({addedNodes:Xe,removedNodes:Ke}),Xe.clear(),Ke.clear()};function ht(e){tt.push(e),it||(at=performance.now(),it=!0,requestAnimationFrame(ot))}function gt(e){const t=new window.MutationObserver(ht),n=document.body||document.documentElement;return ot=pt(e),t.observe(n,nt),ye("Attached MutationObserver to body"),{...t,disconnect:()=>{Xe.clear(),Ke.clear(),tt.length=0,t.disconnect(),ye("Detached MutationObserver")}}}const yt="Overflow",bt=Qe(yt),vt=Qe(yt,!1),wt=Ze(yt),zt=Je(yt),$t=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,St=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||ie,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(x,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!$t(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));zt(t),wt(n),bt(o),n.clear(),t.clear()},detachObservers:Ge(yt,c,l,vt),disconnect:()=>{c.disconnect(),ye("Detached OverflowObserver")}}},Ot="--ifr-start",Mt="--ifr-end",Et="--ifr-measure",kt=[];let xt,Tt={},It=0;function jt(){try{performance.clearMarks(Ot),performance.clearMarks(Mt),performance.clearMeasures(Et)}catch{}}function At(e){e.getEntries().forEach(e=>{if(e.name===Mt)try{const{duration:t}=performance.measure(Et,Ot,Mt);Tt=e.detail,kt.push(t),kt.length>100&&kt.shift()}catch{}})}function Ct(){ye("Attached PerformanceObserver to page");const e=new PerformanceObserver(At);return e.observe({entryTypes:["mark"]}),xt=setInterval(()=>{if(kt.length<10)return;if(Tt.hasTags&&Tt.len<25)return;kt.sort();const e=Math.min(kt.reduce((e,t)=>e+t,0)/kt.length,kt[Math.floor(kt.length/2)]),t=ae(e);t>It&&(It=t,Se("performanceObserver"),ge("Mean time:",ae(kt[Math.floor(kt.length/2)])),ge("Median time:",ae(kt.reduce((e,t)=>e+t,0)/kt.length)),ge("Average time:",t),ge("Max time:",ae(Math.max(...kt)))),jt(),e<=4||(clearInterval(xt),ke(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${ae(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Tt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{jt(),clearInterval(xt),e.disconnect(),ye("Detached PerformanceObserver")}}}const Pt="Resize",Nt=Qe(Pt),Rt=Qe(Pt,!1),qt=Ze(Pt),Lt=Je(Pt),Bt=new WeakSet,Dt=new Set,Ft=new Set;let Wt;function Vt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Bt.has(n)?Dt.add(n):(Wt.observe(n),Bt.add(n),Ft.add(n),t+=1))}Lt(Dt),qt(Ft),Nt(t),Ft.clear(),Dt.clear()}function Ht(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),ye("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),ye("Detached VisibilityObserver")}}}const Ut=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Zt=Ut("function"),Jt=Ut("number"),_t=Ut("string");"undefined"!=typeof window&&function(){const o={height:()=>(Ee("Custom height calculation function not defined"),xn.auto()),width:()=>(Ee("Custom width calculation function not defined"),Tn.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s=[],c="scroll";let l,d,u,f,m,p,Q,X,ee,fe=!0,me="",he=0,Me="",Te="",Ce=!1,Pe=!0,Ne=!1,Re=!0,qe=!1,Le=!1,Be=!0,De=!1,We=1,Ue=a,Ze="",Je=!0,_e={},Qe=!1,Ye=!1,Xe=!1,Ke=0,et=!1,tt=0,nt=0,ot=new Set,rt="",it="child",at=!1,st="",ct=[],lt=window.parent,dt="*",ut=0,ft=!1,mt=1,pt=c,ht=window,yt=()=>{Ee("onMessage function not defined")},bt=()=>{},vt=null,wt=null;function zt(e){var t;!function(e){rt=e[0]??rt,he=He(e[1])??he,Ne=Ve(e[2])??Ne,Xe=Ve(e[3])??Xe,fe=Ve(e[6])??fe,Me=e[7]??Me,Ue=e[8]??Ue,me=e[9]??me,Te=e[10]??Te,ut=He(e[11])??ut,_e.enable=Ve(e[12])??!1,it=e[13]??it,pt=e[14]??pt,et=Ve(e[15])??et,tt=He(e[16])??tt,nt=He(e[17])??nt,Pe=Ve(e[18])??Pe,l=e[19]??l,X=e[20]??X,Ke=He(e[21])??Ke,Ye=Ve(e[23])??Ye}(e),ue=(t={id:rt,enabled:Xe,expand:Ye}).id||b,pe.label(`${ue}`),pe.expand(t.expand),de=t.enabled,ge(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){ge("Reading data from page:",Object.keys(e)),ee=Zt(e,"onBeforeResize")??ee,yt=Zt(e,"onMessage")??yt,bt=Zt(e,"onReady")??bt,"number"==typeof e?.offset&&(Ae("offset","offsetSize"),Pe&&(tt=Jt(e,"offset")??tt),Ne&&(nt=Jt(e,"offset")??nt)),"number"==typeof e?.offsetSize&&(Pe&&(tt=Jt(e,"offsetSize")??tt),Ne&&(nt=Jt(e,"offsetSize")??nt)),d=_t(e,G(Y[0]))??d,Ze=_t(e,"ignoreSelector")??Ze,st=_t(e,"sizeSelector")??st,dt=_t(e,"targetOrigin")??dt,Ue=e?.heightCalculationMethod||Ue,pt=e?.widthCalculationMethod||pt}function t(e,t){return"function"==typeof e&&(ke(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===Ke)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ue=t(Ue,I),pt=t(pt,j),ye(`Set targetOrigin for parent: %c${dt}`,h))}(),[jt,Nt,tn,Tt,At,Kt,en,Yt,It,kt,Ce?ie:Fe,Dt,sn,an,rn,Ft,()=>qt("background",me),()=>qt("padding",Te),()=>qt("min-height","1px"),()=>qt("min-width","1px"),Ce?ie:Ut,on,nn,vn,$t].forEach(e=>{try{e()}catch(e){if(Ke<0)throw e;ke("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ze(e)}}),Et(re(bt)),ge("Initialization complete"),Rn(w,"Init message from host page",void 0,void 0,`${y}:${Ke}`),document.title&&""!==document.title&&Bn(0,0,M,document.title)}function $t(){_(window,v.toLowerCase(),()=>{s.forEach(e=>e()),Bn(0,0,v)})}function Et(e){"complete"===document.readyState?oe(e):_(document,A,()=>Et(e))}function kt(){ct=document.querySelectorAll(`[${k}]`),De=ct.length>0,ge(`Tagged elements found: %c${De}`,h)}let xt=0;function Tt(){const n=document.querySelectorAll(`*[${T}]`);return qe=n.length>0,qe&&n.length!==xt&&(function(n){const o=1===n.length?"":"s";Ee(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),xt=n.length),qe}function It(){"BackCompat"===document.compatMode&&ke("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function jt(){X&&""!==X&&"false"!==X?X!==y&&ke(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${X} - Child page: ${y}.\n`):ke("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function At(){try{at=1===Ke||"iframeParentListener"in window.parent}catch(e){ge("Cross domain iframe detected")}}function Nt(){Ne===Pe&&(Ce=!0)}function qt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ye(`Set body ${e}: %c${t}`,h))}function Lt(e,t,n){if(""!==n){ge(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))ge(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Dt(){Lt("sizeSelector",k,st),Lt("ignoreSelector",T,Ze)}function Ft(){var e,t;void 0===Me&&(Me=`${he}px`),qt("margin",(e="margin",(t=Me).includes("-")&&(Ee(`Negative CSS value ignored for ${e}`),t=""),t))}function Ut(){const e=e=>e.style.setProperty(I,"auto","important");e(document.documentElement),e(document.body),ge("Set HTML & body height: %cauto !important",h)}function Qt(e){({add(t){function n(){Rn(e.eventName,e.eventType)}i[t]=n,_(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),ge(`${se(e.method)} event listener: %c${e.eventType}`,h)}function Gt(e){Qt({method:e,eventType:"After Print",eventName:"afterprint"}),Qt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qt({method:e,eventType:"Ready State Change",eventName:A})}function Yt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(k,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&ke("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Xt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Ee(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ke(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${X?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),ge(`Set ${o} calculation method: %c${e}`,h),e}function Kt(){Ue=Xt(Ue,a,xn)}function en(){pt=Xt(pt,c,Tn)}function tn(){const t=Ke,n=ne({key:l}),o=ne({key:d});if(Ke=Math.max(n,o),Ke<0){if(Ke=Math.min(n,o),ke(`${te(Ke+2)}${te(2)}`),ce(X))throw te(Ke+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!ce(X)||t>-1&&Ke>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ue} %ciframe-resizer ${t}`,de||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>G(K[e]))(Ke)})`,Ke),Ke<2&&xe(te(3)),sessionStorage.setItem("ifr",y))}function nn(){!0!==fe&&ge("Auto Resize disabled"),Gt("add"),s.push(()=>Gt("remove"))}function on(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function rn(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,E)+parseInt(n.x,E),y:parseInt(t.top,E)+parseInt(n.y,E)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?(ge(`In page link (#${n}) not found in iframe, so sending to parent`),Bn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);ge(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),Bn(o.y,o.x,O)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}_e.enable?1===Ke?ke("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(ge("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&_(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),_(window,"hashchange",n),setTimeout(n,128)):ge("In page linking not enabled"),_e={findTarget:t}}function an(){function e(e){Bn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){ge(`Add event listener: %c${n}`,h),_(window.document,t,e)}!0===et&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function sn(){1!==Ke&&(ht.parentIframe=Object.freeze({autoResize:e=>(le(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ne&&!1===Pe?(Se(N),ke("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===fe?(fe=!0,queueMicrotask(()=>Rn(N,"Auto Resize enabled"))):!1===e&&!0===fe&&(fe=!1),Bn(0,0,"autoResize",JSON.stringify(fe)),fe)),close(){Bn(0,0,"close")},getId:()=>rt,getOrigin:()=>(Se("getOrigin"),Ie("getOrigin()","getParentOrigin()"),u),getParentOrigin:()=>u,getPageInfo(e){if("function"==typeof e)return vt=e,Bn(0,0,$),void je("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");vt=null,Bn(0,0,"pageInfoStop")},getParentProps:e=>(le(e,"function","parentIframe.getParentProps(callback) callback"),wt=e,Bn(0,0,S),()=>{wt=null,Bn(0,0,"parentInfoStop")}),getParentProperties(e){Ie("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){le(e,"string","parentIframe.moveToAnchor(anchor) anchor"),_e.findTarget(e)},reset(){!function(){const e=Ue;Ue=a,ge(`Reset trigger event: %c${"parentIframe.reset"}`,h),ft?ge("TriggerLock blocked calculation"):(ft=!0,be("Trigger event lock on"),requestAnimationFrame(()=>{ft=!1,be("Trigger event lock off")})),qn("reset"),Ue=e}()},setOffsetSize(e){le(e,"number","parentIframe.setOffsetSize(offset) offset"),tt=e,nt=e,Rn(D,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){le(e,"number","parentIframe.scrollBy(x, y) x"),le(t,"number","parentIframe.scrollBy(x, y) y"),Bn(t,e,"scrollBy")},scrollTo(e,t){le(e,"number","parentIframe.scrollTo(x, y) x"),le(t,"number","parentIframe.scrollTo(x, y) y"),Bn(t,e,"scrollTo")},scrollToOffset(e,t){le(e,"number","parentIframe.scrollToOffset(x, y) x"),le(t,"number","parentIframe.scrollToOffset(x, y) y"),Bn(t,e,O)},sendMessage(e,t){t&&le(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Bn(0,0,z,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ue=e,Kt()},setWidthCalculationMethod(e){pt=e,en()},setTargetOrigin(e){le(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ge(`Set targetOrigin: %c${e}`,h),dt=e},resize(e,t){void 0!==e&&le(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&le(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Rn(q,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Ie("size()","resize()"),this.resize(e,t)}}),ht.parentIFrame=ht.parentIframe)}let cn=new Set;function ln(){const e=document.querySelectorAll(`[${x}]`);ot=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${T}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{Se("overflowIgnored"),ye("Ignoring elements with [data-iframe-ignore] > *:\n",n),we()}),t}(e),Le=ot.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Be=ot.symmetricDifference(cn).size>0),cn=ot}function dn(){switch(ln(),!0){case!Be:return;case ot.size>1:ye("Overflowed Elements:",ot);break;case Le:break;default:ye("No overflow detected")}Rn(W,"Overflow updated")}function un(e){const t={root:document.documentElement,side:Pe?C:P};return f=St(dn,t),f.attachObservers(e),f}function fn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Rn(F,`Element resized <${function(e){switch(!0){case!ce(e):return"";case ce(e.id):return`${e.nodeName}#${e.id}`;case ce(e.name):return`${e.nodeName} (${e.name}`;case ce(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function mn(e){return Wt=new ResizeObserver(fn),Wt.observe(document.body),Bt.add(document.body),ye("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Vt,detachObservers:Ge(Pt,Wt,Bt,Rt),disconnect:()=>{Wt.disconnect(),ye("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function pn(e){ge(`Visible: %c${e}`,h),Qe=!e,Rn(H,"Visibility changed")}const hn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of Sn(n))t.add(e)}return ye("Inspecting:\n",t),t},gn=e=>{if(0===e.size)return;Se("addObservers");const t=hn(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),we()},yn=e=>{if(0===e.size)return;Se("removeObservers");const t=hn(e);f.detachObservers(t),m.detachObservers(t),we()};function bn(e){!function({addedNodes:e,removedNodes:t}){Se("contentMutated"),Dt(),kt(),ln(),we(),yn(t),gn(e)}(e),Rn(V,"Mutation Observed")}function vn(){const e=Sn(document.documentElement);var t;ge("Attaching Observers"),t=[gt(bn),un(e),Ct(),mn(e),Ht(pn)],s.push(...t.map(e=>e.disconnect))}function wn(e){performance.mark(Ot);const t=se(e);let n=1,o=document.documentElement,r=De?0:document.documentElement.getBoundingClientRect().bottom;const i=De?ct:Le?Array.from(ot):Sn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ye(`${t} position calculated from:`,o),ye(`Checked %c${i.length}%c elements`,h,g),performance.mark(Mt,{detail:{hasTags:De,len:i.length,logging:Xe,Side:t}}),r}const zn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],$n=`* ${Array.from(J).map(e=>`:not(${e})`).join("")}`,Sn=e=>e.querySelectorAll($n),On={height:0,width:0},Mn={height:0,width:0},En=[h,g,h];function kn(e){function t(){return Mn[o]=r,On[o]=s,Math.max(r,1)}const n=e===xn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=0;switch(!0){case!e.enabled():return Math.max(s,1);case De:ye("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Le&&Re&&0===Mn[o]&&0===On[o]:ye(`Initial page size values: ${c}`,...En),l=t();break;case ft&&r===Mn[o]&&s===On[o]:ye(`Size unchanged: ${c}`,...En),l=Math.max(r,s);break;case 0===r&&0!==s:ye(`Page is hidden: ${c}`,...En),l=s;break;case!Le&&r!==Mn[o]&&s<=On[o]:ye(`New <html> size: ${c} `,...En),ye(`Previous <html> size: %c${Mn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Le&&r<Mn[o]:ye(`<html> size decreased: ${c}`,...En),l=t();break;case s===a||s===i:ye(`<html> size equals page size: ${c}`,...En),l=t();break;case r>s:ye(`Page size < <html> size: ${c}`,...En),l=t();break;case Le:ye("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:ye(`Using <html> size: ${c}`,...En),l=t()}return ye(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&ye(`Page offsetSize: %c${t}px`,h),t}(e),l}const xn={label:I,enabled:()=>Pe,getOffset:()=>tt,auto:()=>kn(xn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,E)+parseInt(t.marginBottom,E)},bodyScroll:()=>document.body.scrollHeight,offset:()=>xn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...zn(xn)),min:()=>Math.min(...zn(xn)),grow:()=>xn.max(),lowestElement:()=>wn(C),taggedElement:()=>wn(C)},Tn={label:j,enabled:()=>Ne,getOffset:()=>nt,auto:()=>kn(Tn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...zn(Tn)),min:()=>Math.min(...zn(Tn)),rightMostElement:()=>wn(P),scroll:()=>Math.max(Tn.bodyScroll(),Tn.documentElementScroll()),taggedElement:()=>wn(P)},In=(e,t)=>!(Math.abs(e-t)<=ut);function jn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ee?function(e){const t=ee(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return ve(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let An=!1;const Cn=re(()=>xe(te(4)));let Pn,Nn=!1;const Rn=$e((e,t,n,o,r)=>{switch(Se(e),!0){case!0===Qe:if(!0===Nn)break;ge("Iframe hidden - Ignored resize request"),Nn=!0,An=!1,cancelAnimationFrame(Pn);break;case!0===An&&e!==W:ge("Resize already pending - Ignored resize request");break;case!fe&&!(e in B):ye("Resizing disabled");break;default:Nn=!1,An=!0,Q=performance.now(),p=!0,Pn=requestAnimationFrame(()=>{An=!1,Se("requestAnimationFrame"),be(`Reset sendPending: %c${e}`,h)}),function(e,t,n,o,r){const i=n??jn(xn,Ue),a=o??jn(Tn,pt),s=Pe&&In(We,i)||Ne&&In(mt,a)?R:e;switch(ge(`Resize event: %c${t}`,h),s){case w:case N:case R:We=i,mt=a;case D:Ln(We,mt,e,r);break;case W:case V:case F:case H:ge(U);break;default:ye(U)}p=!1}(e,t,n,o,r)}we()});function qn(e){We=xn[Ue](),mt=Tn[pt](),Bn(We,mt,e)}function Ln(e,t,o,r,i){Ke<-1||(void 0!==i?ge(`Message targetOrigin: %c${i}`,h):i=dt,function(){const a=`${rt}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(at)try{window.parent.iframeParentListener(Z+a)}catch(e){if(1!==Ke)throw e;return void Cn()}else lt.postMessage(Z+a,i);p&&ge(function(){const e=ae(performance.now()-Q);return o===w?`Initialised iframe in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),ye(`Sending message to parent page via ${at?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Bn=$e((e,t,n,o,r)=>{Se(n),Ln(e,t,n,o,r),we()}),Dn=$e(function(e){Se("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>Bn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void ge("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");lt=e.source,u=e.origin,zt(t),Re=!1,setTimeout(()=>{Je=!1},128)},reset(){Je?ge("Page reset ignored by init"):(ge("Page size reset by host page"),qn("resetPage"))},resize(){ge("Resize requested by host page"),Rn(L,"Parent window requested size check")},moveToAnchor(){_e.findTarget(s())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=s();ge("PageInfo received from parent:",o(e)),vt?oe(vt,n(e)):r($)},parentInfo(){const e=o(s());ge("ParentInfo received from parent:",e),wt?oe(wt,e):r(S)},message(){const e=s();ge("onMessage called from parent:%c",h,o(e)),oe(yt,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],s=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=a();Se(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||Ee(`Unexpected message (${e.data})`)}Z===`${e.data}`.slice(0,13)&&function(){if(!1!==Re)return c()?(Oe(a()),Se(w),void i.init()):void ge(`Ignored message of type "${a()}". Received before initialization.`);l()}()});let Fn=!1;const Wn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Vn(){if("loading"===document.readyState||!Re||Fn)return;const{parent:e,top:t}=window;Se("ready"),ge("Sending%c ready%c to parent from",h,g,window.location.href),Wn(e),e!==t&&Wn(t),Fn=!0}"iframeChildListener"in window?Ee("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Dn({data:e,sameOrigin:!0})),_(window,z,Dn),_(document,A,Vn),setTimeout(Vn))}()});
21
- //# sourceMappingURL=index.umd.js.map
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.6",b="iframeResizer",v="beforeUnload",w="init",z="message",$="pageInfo",S="parentInfo",O="scrollToOffset",E="title",M=10,k="data-iframe-size",j="data-iframe-overflowed",x="data-iframe-ignore",T="height",A="width",C="readystatechange",I="bottom",N="right",P="autoResizeEnabled",R=Symbol("sizeChanged"),B="manualResize",q="parentResize",L={[B]:1,[q]:1},D="setOffsetSize",F="resizeObserver",W="overflowObserver",V="mutationObserver",H="visibilityObserver",U="[iFrameSizer]",Z=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),J=(e,t,n,o)=>e.addEventListener(t,n,o||!1),_=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),G=["spjluzl","rlf","clyzpvu"],Y=["<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."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],K=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ee=e=>Q(Y[e]),te=e=>{const t=e[Q(G[0])]||e[Q(G[1])]||e[Q(G[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=_(Q(e));return n in K&&(t=K[n]),t}(n[0]);return 0===o||(e=>e[2]===_(e[0]+e[1]))(n)||(o=-2),o},ne=(e,...t)=>setTimeout(()=>e(...t),0),oe=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},re=e=>e,ie=e=>Math.round(1e3*e)/1e3,ae=e=>e.charAt(0).toUpperCase()+e.slice(1),se=e=>""!=`${e}`&&void 0!==e;const ce=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ae(t)}`)};let le=!0,ue=b;const de=(fe=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function w(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function z(){""===g&&(g=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 $(e,...t){0===p.length&&(z(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),w()}return n},event:function(e){z(),h.event=e},purge:y,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:z}},fe?.__esModule?fe.default:fe);var fe;const me=de({label:`${b}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!le||me[pe](...e));const{assert:ge,endAutoGroup:ye,error:be,errorBoundary:ve,event:we,label:ze,purge:$e,warn:Se}=me,Oe=e=>{return me.warn((t=re,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},Ee=Oe,Me=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Oe(t)),ke=Me("Method"),je=Me("Method","replaced with"),xe=Me("Option"),Te=["min-height","min-width","max-height","max-width"],Ae=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ie=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Ne({href:e}){Ae.has(e)||Ae.add(e)}const Pe=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ne(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Re=(e,t)=>{const{source:n,value:o}=Pe(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Oe(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Be(){for(const e of[document.documentElement,document.body])for(const t of Te)Ie(e,t)&&Re(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),Le=qe(e=>"true"===e),De=qe(Number),Fe=e=>e=>{e.size},We=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ve=e=>e=>{e.size},He=(t,n=!0)=>o=>{o>0&&he(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ue=(e,t,n,o)=>{const r=Ve(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Ze=new Set,Je=new Set,_e=new Set,Qe=[],Ge={attributes:!0,attributeFilter:[x,k],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ye,Xe=1,Ke=!1,et=0;const tt=e=>{e.size},nt=e=>{e.size},ot=e=>{e.size},rt=e=>e.nodeType!==Node.ELEMENT_NODE||Z.has(e.tagName.toLowerCase());function it(e){const t=e.addedNodes;for(const e of t)rt(e)||Ze.add(e)}function at(e){const t=e.removedNodes;for(const e of t)rt(e)||(Ze.has(e)?(Ze.delete(e),_e.add(e)):Je.add(e))}const st=e=>{he("Mutations:",e);for(const t of e)it(t),at(t);tt(Ze),nt(Je),ot(_e),_e.clear()};const ct=e=>()=>{const t=performance.now(),n=t-et,o=16*Xe+++2;if(n>o&&n<200)return we("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${ie(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Ye,16*Xe),void(et=t);Xe=1,Qe.forEach(st),Qe.length=0,Ke=!1,Je.size,Ze.size,e({addedNodes:Ze,removedNodes:Je}),Ze.clear(),Je.clear()};function lt(e){Qe.push(e),Ke||(et=performance.now(),Ke=!0,requestAnimationFrame(Ye))}function ut(e){const t=new window.MutationObserver(lt),n=document.body||document.documentElement;return Ye=ct(e),t.observe(n,Ge),he("Attached MutationObserver to body"),{...t,disconnect:()=>{Ze.clear(),Je.clear(),Qe.length=0,t.disconnect(),he("Detached MutationObserver")}}}const dt="Overflow",ft=He(dt),mt=He(dt,!1),pt=Fe(dt),ht=We(dt),gt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,yt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||re,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(j,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!gt(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ht(t),pt(n),ft(o),n.clear(),t.clear()},detachObservers:Ue(dt,c,l,mt),disconnect:()=>{c.disconnect(),he("Detached OverflowObserver")}}},bt="--ifr-start",vt="--ifr-end",wt="--ifr-measure",zt=[];let $t,St={},Ot=0;function Et(){try{performance.clearMarks(bt),performance.clearMarks(vt),performance.clearMeasures(wt)}catch{}}function Mt(e){e.getEntries().forEach(e=>{if(e.name===vt)try{const{duration:t}=performance.measure(wt,bt,vt);St=e.detail,zt.push(t),zt.length>100&&zt.shift()}catch{}})}function kt(){he("Attached PerformanceObserver to page");const e=new PerformanceObserver(Mt);return e.observe({entryTypes:["mark"]}),$t=setInterval(()=>{if(zt.length<10)return;if(St.hasTags&&St.len<25)return;zt.sort();const e=Math.min(zt.reduce((e,t)=>e+t,0)/zt.length,zt[Math.floor(zt.length/2)]),t=ie(e);t>Ot&&(Ot=t,we("performanceObserver")),Et(),e<=4||(clearInterval($t),Oe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${ie(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${St.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Et(),clearInterval($t),e.disconnect(),he("Detached PerformanceObserver")}}}const jt="Resize",xt=He(jt),Tt=He(jt,!1),At=Fe(jt),Ct=We(jt),It=new WeakSet,Nt=new Set,Pt=new Set;let Rt;function Bt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(It.has(n)?Nt.add(n):(Rt.observe(n),It.add(n),Pt.add(n),t+=1))}Ct(Nt),At(Pt),xt(t),Pt.clear(),Nt.clear()}function qt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),he("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),he("Detached VisibilityObserver")}}}const Lt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Dt=Lt("function"),Ft=Lt("number"),Wt=Lt("string");"undefined"!=typeof window&&function(){const o={height:()=>(Se("Custom height calculation function not defined"),Sn.auto()),width:()=>(Se("Custom width calculation function not defined"),On.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s=[],c="scroll";let l,u,d,f,m,p,_,Y=!0,K="",ie=0,de="",fe="",pe=!1,Me=!0,Te=!1,Ae=!0,Ce=!1,Ie=!1,Ne=!0,Pe=!1,Re=1,qe=a,Fe="",We=!0,Ve={},He=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ge=0,Ye=0,Xe=new Set,Ke="",et="child",tt=!1,nt="",ot=[],rt=window.parent,it="*",at=0,st=!1,ct=1,lt=c,dt=window,ft=()=>{Se("onMessage function not defined")},mt=()=>{},pt=null,ht=null;function gt(e){var t;!function(e){Ke=e[0]??Ke,ie=De(e[1])??ie,Te=Le(e[2])??Te,Je=Le(e[3])??Je,Y=Le(e[6])??Y,de=e[7]??de,qe=e[8]??qe,K=e[9]??K,fe=e[10]??fe,at=De(e[11])??at,Ve.enable=Le(e[12])??!1,et=e[13]??et,lt=e[14]??lt,Qe=Le(e[15])??Qe,Ge=De(e[16])??Ge,Ye=De(e[17])??Ye,Me=Le(e[18])??Me,l=e[19]??l,p=e[20]??p,_e=De(e[21])??_e,Ze=Le(e[23])??Ze}(e),ue=(t={id:Ke,enabled:Je,expand:Ze}).id||b,me.label(`${ue}`),me.expand(t.expand),le=t.enabled,function(){function e(e){_=Dt(e,"onBeforeResize")??_,ft=Dt(e,"onMessage")??ft,mt=Dt(e,"onReady")??mt,"number"==typeof e?.offset&&(xe("offset","offsetSize"),Me&&(Ge=Ft(e,"offset")??Ge),Te&&(Ye=Ft(e,"offset")??Ye)),"number"==typeof e?.offsetSize&&(Me&&(Ge=Ft(e,"offsetSize")??Ge),Te&&(Ye=Ft(e,"offsetSize")??Ye)),u=Wt(e,Q(G[0]))??u,Fe=Wt(e,"ignoreSelector")??Fe,nt=Wt(e,"sizeSelector")??nt,it=Wt(e,"targetOrigin")??it,qe=e?.heightCalculationMethod||qe,lt=e?.widthCalculationMethod||lt}function t(e,t){return"function"==typeof e&&(Oe(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===_e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),qe=t(qe,T),lt=t(lt,A),he(`Set targetOrigin for parent: %c${it}`,h))}(),[Mt,At,Gt,Ot,xt,_t,Qt,Zt,Et,$t,pe?re:Be,Pt,tn,en,Kt,Lt,()=>Ct("background",K),()=>Ct("padding",fe),pe?re:Vt,Xt,Yt,pn,wt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;Oe("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),be(e)}}),zt(oe(mt)),An(w,"Init message from host page",void 0,void 0,`${y}:${_e}`),document.title&&""!==document.title&&Nn(0,0,E,document.title)}function wt(){J(window,v.toLowerCase(),()=>{s.forEach(e=>e()),Nn(0,0,v)})}function zt(e){"complete"===document.readyState?ne(e):J(document,C,()=>zt(e))}function $t(){ot=document.querySelectorAll(`[${k}]`),Pe=ot.length>0}let St=0;function Ot(){const n=document.querySelectorAll(`*[${x}]`);return Ce=n.length>0,Ce&&n.length!==St&&(function(n){const o=1===n.length?"":"s";Se(`%c[${x}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),St=n.length),Ce}function Et(){"BackCompat"===document.compatMode&&Oe("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Mt(){p&&""!==p&&"false"!==p?p!==y&&Oe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):Oe("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function xt(){try{tt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function At(){Te===Me&&(pe=!0)}function Ct(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,h))}function Nt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Pt(){Nt(0,k,nt),Nt(0,x,Fe)}function Lt(){var e,t;void 0===de&&(de=`${ie}px`),Ct("margin",(e="margin",(t=de).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(T,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}i[t]=n,J(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:C})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(k,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Oe("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function Jt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Oe(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function _t(){qe=Jt(qe,a,Sn)}function Qt(){lt=Jt(lt,c,On)}function Gt(){const t=_e,n=te({key:l}),o=te({key:u});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),$e(),Oe(`${ee(_e+2)}${ee(2)}`),se(p))throw ee(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!se(p)||t>-1&&_e>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ue} %ciframe-resizer ${t}`,le||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>Q(X[e]))(_e)})`,_e),_e<2&&Ee(ee(3)),sessionStorage.setItem("ifr",y))}function Yt(){Ut("add"),s.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,M)+parseInt(n.x,M),y:parseInt(t.top,M)+parseInt(n.y,M)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Nn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Nn(n.y,n.x,O)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Ve.enable&&(1===_e?Oe("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&J(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),J(window,"hashchange",n),setTimeout(n,128))),Ve={findTarget:t}}function en(){function e(e){Nn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){J(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(dt.parentIframe=Object.freeze({autoResize:e=>(ce(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Te&&!1===Me?(we(P),Oe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Y?(Y=!0,queueMicrotask(()=>An(P,"Auto Resize enabled"))):!1===e&&!0===Y&&(Y=!1),Nn(0,0,"autoResize",JSON.stringify(Y)),Y)),close(){Nn(0,0,"close")},getId:()=>Ke,getOrigin:()=>(we("getOrigin"),ke("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return pt=e,Nn(0,0,$),void je("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");pt=null,Nn(0,0,"pageInfoStop")},getParentProps:e=>(ce(e,"function","parentIframe.getParentProps(callback) callback"),ht=e,Nn(0,0,S),()=>{ht=null,Nn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ce(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ve.findTarget(e)},reset(){!function(){const e=qe;qe=a,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Cn("reset"),qe=e}()},setOffsetSize(e){ce(e,"number","parentIframe.setOffsetSize(offset) offset"),Ge=e,Ye=e,An(D,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ce(e,"number","parentIframe.scrollBy(x, y) x"),ce(t,"number","parentIframe.scrollBy(x, y) y"),Nn(t,e,"scrollBy")},scrollTo(e,t){ce(e,"number","parentIframe.scrollTo(x, y) x"),ce(t,"number","parentIframe.scrollTo(x, y) y"),Nn(t,e,"scrollTo")},scrollToOffset(e,t){ce(e,"number","parentIframe.scrollToOffset(x, y) x"),ce(t,"number","parentIframe.scrollToOffset(x, y) y"),Nn(t,e,O)},sendMessage(e,t){t&&ce(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nn(0,0,z,JSON.stringify(e),t)},setHeightCalculationMethod(e){qe=e,_t()},setWidthCalculationMethod(e){lt=e,Qt()},setTargetOrigin(e){ce(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),it=e},resize(e,t){void 0!==e&&ce(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ce(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(B,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),dt.parentIFrame=dt.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${j}]`);Xe=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${x}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{we("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ye()}),t}(e),Ie=Xe.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ne=Xe.symmetricDifference(nn).size>0),nn=Xe}function rn(){switch(on(),!0){case!Ne:return;case Xe.size>1:he("Overflowed Elements:",Xe);break;case Ie:break;default:he("No overflow detected")}An(W,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Me?I:N};return f=yt(rn,t),f.attachObservers(e),f}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(F,`Element resized <${function(e){switch(!0){case!se(e):return"";case se(e.id):return`${e.nodeName}#${e.id}`;case se(e.name):return`${e.nodeName} (${e.name}`;case se(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function cn(e){return Rt=new ResizeObserver(sn),Rt.observe(document.body),It.add(document.body),he("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Bt,detachObservers:Ue(jt,Rt,It,Tt),disconnect:()=>{Rt.disconnect(),he("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function ln(e){He=!e,An(H,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return he("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;we("addObservers");const t=un(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),ye()},fn=e=>{if(0===e.size)return;we("removeObservers");const t=un(e);f.detachObservers(t),m.detachObservers(t),ye()};function mn(e){!function({addedNodes:e,removedNodes:t}){we("contentMutated"),Pt(),$t(),on(),ye(),fn(t),dn(e)}(e),An(V,"Mutation Observed")}function pn(){const e=bn(document.documentElement);var t;t=[ut(mn),an(e),kt(),cn(e),qt(ln)],s.push(...t.map(e=>e.disconnect))}function hn(e){performance.mark(bt);const t=ae(e);let n=1,o=document.documentElement,r=Pe?0:document.documentElement.getBoundingClientRect().bottom;const i=Pe?ot:Ie?Array.from(Xe):bn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return he(`${t} position calculated from:`,o),he(`Checked %c${i.length}%c elements`,h,g),performance.mark(vt,{detail:{hasTags:Pe,len:i.length,logging:Je,Side:t}}),r}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(Z).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},wn={height:0,width:0},zn=[h,g,h];function $n(e){function t(){return wn[o]=r,vn[o]=s,Math.max(r,1)}const n=e===Sn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case Pe:he("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&Ae&&0===wn[o]&&0===vn[o]:he(`Initial page size values: ${c}`,...zn),l=t();break;case st&&r===wn[o]&&s===vn[o]:he(`Size unchanged: ${c}`,...zn),l=Math.max(r,s);break;case 0===r&&0!==s:he(`Page is hidden: ${c}`,...zn),l=s;break;case!Ie&&r!==wn[o]&&s<=vn[o]:he(`New <html> size: ${c} `,...zn),he(`Previous <html> size: %c${wn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<wn[o]:he(`<html> size decreased: ${c}`,...zn),l=t();break;case s===a||s===i:he(`<html> size equals page size: ${c}`,...zn),l=t();break;case r>s:he(`Page size < <html> size: ${c}`,...zn),l=t();break;case Ie:he("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:he(`Using <html> size: ${c}`,...zn),l=t()}return he(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Sn={label:T,enabled:()=>Me,getOffset:()=>Ge,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,M)+parseInt(t.marginBottom,M)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>hn(I),taggedElement:()=>hn(I)},On={label:A,enabled:()=>Te,getOffset:()=>Ye,auto:()=>$n(On),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>hn(N),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>hn(N)},En=(e,t)=>!(Math.abs(e-t)<=at);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==_?function(e){const t=_(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return ge(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=oe(()=>Ee(ee(4)));let xn,Tn=!1;const An=ve((e,t,n,o,r)=>{switch(we(e),!0){case!0===He:if(!0===Tn)break;Tn=!0,kn=!1,cancelAnimationFrame(xn);break;case!0===kn&&e!==W:$e();break;case!Y&&!(e in L):he("Resizing disabled");break;default:Tn=!1,kn=!0,performance.now(),xn=requestAnimationFrame(()=>{kn=!1,we("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??Mn(Sn,qe),a=o??Mn(On,lt);switch(Me&&En(Re,i)||Te&&En(ct,a)?R:e){case w:case P:case R:Re=i,ct=a;case D:In(Re,ct,e,r);break;case W:case V:case F:case H:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ye()});function Cn(e){Re=Sn[qe](),ct=On[lt](),Nn(Re,ct,e)}function In(e,t,o,r,i){_e<-1||(void 0!==i||(i=it),function(){const a=`${Ke}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(tt)try{window.parent.iframeParentListener(U+a)}catch(e){if(1!==_e)throw e;return void jn()}else rt.postMessage(U+a,i);he(`Sending message to parent page via ${tt?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Nn=ve((e,t,n,o,r)=>{we(n),In(e,t,n,o,r),ye()}),Pn=ve(function(e){we("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Nn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,d=e.origin,gt(t),Ae=!1,setTimeout(()=>{We=!1},128)},reset(){We||Cn("resetPage")},resize(){An(q,"Parent window requested size check")},moveToAnchor(){Ve.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();pt?ne(pt,n(e)):o($)},parentInfo(){const e=(r=a(),t(n(r)));var r;ht?ne(ht,e):o(S)},message(){const e=a();ne(ft,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();we(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}U===`${e.data}`.slice(0,13)&&function(){if(!1!==Ae)return s()?(ze(i()),we(w),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Ae||Rn)return;const{parent:e,top:t}=window;we("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),J(window,z,Pn),J(document,C,qn),qn())}()});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/child",
3
- "version": "5.5.6-beta.1",
3
+ "version": "5.5.6",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {