iframe-resizer 5.5.3-beta.1 → 5.5.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.3-beta.1 (cjs) - 2025-08-14
4
+ * @module iframe-resizer/legacy 5.5.3-beta.2 (cjs) - 2025-08-15
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.3-beta.1 (esm) - 2025-08-14
4
+ * @module iframe-resizer/legacy 5.5.3-beta.2 (esm) - 2025-08-15
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.3-beta.1 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.3-beta.2 (iife)
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,5 @@
17
17
  */
18
18
 
19
19
 
20
- !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:!0,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.3-beta.1",v="iframeResizer",b=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),k={},j="setOffsetSize",T="resizeObserver",I="overflowObserver",A="mutationObserver",x="visibilityObserver",P="No change in content size detected",C="init",N=new Set(["head","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),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)},q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),B=["spjluzl","rlf","clyzpvu"],F=["<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"],D=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>q(F[e]);var V=e=>{const t=e[q(B[0])]||e[q(B[1])]||e[q(B[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=L(q(e));return n in D&&(t=D[n]),t}(n[0]);return 0===o||(e=>e[2]===L(e[0]+e[1]))(n)||(o=-2),o};const 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),G=e=>""!=`${e}`&&void 0!==e;const Y=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Q(t)}`)};let X=!0,K=v;const ee=(te=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function v(){delete h.event,y()}const b=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){c[b()?"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(),v()}else v()}function w(){""===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&&(w(),queueMicrotask(()=>queueMicrotask(z))),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:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},te?.__esModule?te.default:te);var te;const ne=ee({label:`${v}(child)`});const oe=(re="log",(...e)=>!X||ne[re](...e));var re;const ie=oe;const{assert:ae,debug:se,endAutoGroup:ce,error:le,errorBoundary:ue,event:de,label:fe,purge:me,warn:pe}=ne,he=e=>{return ne.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},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)),ve=ye("Method"),be=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 Ee({href:e}){$e.has(e)||(oe("Unable to access stylesheet:",e),$e.add(e))}const ke=(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){Ee(n)}return{source:"cross-origin stylesheet",value:Oe(e,t)}}(e,t),je=(e,t)=>{const{source:n,value:o}=ke(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)oe(`Checking <${Se(e)}> for blocking CSS: ${t}`),Me(e,t)&&je(e,t)}const Ie=e=>t=>void 0===t?void 0:e(t),Ae=Ie(e=>"true"===e),xe=Ie(Number),Pe=(e="")=>t=>n=>{n.size>0&&se(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Ce=Pe("attached to"),Ne=((e="")=>t=>n=>{n.size>0&&le(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Re=Pe("detached from"),Le=(t,n=!0)=>o=>{o>0&&ie(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},qe=(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",Fe=new Set,We=new Set,De=new Set,He=[],Ve={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ue,Ze=1,Je=!1,_e=0;const Qe=Pe("added")(Be),Ge=Pe("removed (page)")(Be),Ye=Pe("removed (added)")(Be),Xe=e=>e.nodeType!==Node.ELEMENT_NODE||N.has(e.tagName.toLowerCase());function Ke(e){const t=e.addedNodes;for(const e of t)Xe(e)||Fe.add(e)}function et(e){const t=e.removedNodes;for(const e of t)Xe(e)||(Fe.has(e)?(Fe.delete(e),De.add(e)):We.add(e))}const tt=e=>{ie("Mutations:",e);for(const t of e)Ke(t),et(t);Qe(Fe),Ge(We),Ye(De),De.clear()};const nt=e=>()=>{const t=performance.now(),n=t-_e,o=16*Ze+++2;if(n>o&&n<200)return de("mutationThrottled"),ie("Update delayed due to heavy workload on the callStack"),ie(`EventLoop busy time: %c${_(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Ue,16*Ze),void(_e=t);Ze=1,He.forEach(tt),He.length=0,Je=!1,We.size>0&&oe(`Detected %c${We.size} %cremoved element${We.size>1?"s":""}`,h,g),Fe.size>0&&oe(`Found %c${Fe.size} %cnew element${Fe.size>1?"s":""}`,h,g),e({addedNodes:Fe,removedNodes:We}),Fe.clear(),We.clear()};function ot(e){He.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,Ve),ie("Attached MutationObserver to body"),t}const it="Overflow",at=Le(it),st=Le(it,!1),ct=Ce(it),lt=Ne(it),ut=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,dt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||J,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],c=a(i,o)&&!ut(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:qe(it,c,l,st)}},ft="--ifr-start",mt="--ifr-end",pt=[],ht=new WeakSet,gt=e=>"object"==typeof e&&ht.add(e);let yt={},vt=0;function bt(e){e.getEntries().forEach(e=>{if(e.name===mt){const{duration:t}=performance.measure("--ifr-measure",ft,mt);yt=e.detail,pt.push(t),pt.length>100&&pt.shift()}})}function zt(){ie("Attached PerformanceObserver to page");new PerformanceObserver(bt).observe({entryTypes:["mark"]}),gt(document.documentElement),gt(document.body),function(){const e=setInterval(()=>{if(pt.length<10)return;if(yt.hasTags&&yt.len<25)return;pt.sort();const t=Math.min(pt.reduce((e,t)=>e+t,0)/pt.length,pt[Math.floor(pt.length/2)]),n=_(t);n>vt&&(vt=n,de("performanceObserver"),oe("Mean time:",_(pt[Math.floor(pt.length/2)])),oe("Median time:",_(pt.reduce((e,t)=>e+t,0)/pt.length)),oe("Average time:",n),oe("Max time:",_(Math.max(...pt)))),t<=4||(clearInterval(e),he(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${_(t)}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)}()}const wt="Resize",$t=Le(wt),St=Le(wt,!1),Ot=Ce(wt),Mt=Ne(wt),Et=new WeakSet;let kt;function jt(e){const t=new Set,n=new Set;let o=0;for(const r of e){if(r.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(r)?.position;""!==e&&"static"!==e&&(Et.has(r)?t.add(r):(kt.observe(r),Et.add(r),n.add(r),o+=1))}Mt(t),Ot(n),$t(o),n.clear(),t.clear()}const Tt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},It=Tt("function"),At=Tt("number"),xt=Tt("string");"undefined"!=typeof window&&function(){const o={height:()=>(pe("Custom height calculation function not defined"),ln.auto()),width:()=>(pe("Custom width calculation function not defined"),un.auto())},r={},i={},a="auto",s="[iFrameSizer]",c="scroll";let l,u,d,f,m,p,L,F,D,ee,te,re=!0,ae="",me=0,ye="",we="",$e=!1,Se=!0,Oe=!1,Me=!0,Ee=!1,ke=!1,je=!1,Ie=1,Pe=a,Ce="",Ne=!0,Re={},Le=!1,Be=!0,Fe=!1,We=0,De=!1,He=[],Ve="",Ue="child",Ze=!1,Je="",_e=[],Qe=window.parent,Ge="*",Ye=0,Xe=!1,Ke=1,et=c,tt=window,nt=()=>{pe("onMessage function not defined")},ot=()=>{},it=null,at=null;function st(e){var t;!function(e){Ve=e[0]??Ve,me=xe(e[1])??me,Oe=Ae(e[2])??Oe,Fe=Ae(e[3])??Fe,re=Ae(e[6])??re,ye=e[7]??ye,Pe=e[8]??Pe,ae=e[9]??ae,we=e[10]??we,Ye=xe(e[11])??Ye,Re.enable=Ae(e[12])??!1,Ue=e[13]??Ue,et=e[14]??et,De=Ae(e[15])??De,d=xe(e[16])??d,f=xe(e[17])??f,Se=Ae(e[18])??Se,l=e[19]??l,ee=e[20]??ee,We=xe(e[21])??We,Be=Ae(e[23])??Be}(e),K=(t={id:Ve,enabled:Fe,expand:Be}).id||v,ne.label(`${K}`),ne.expand(t.expand),X=t.enabled,oe(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){oe("Reading data from page:",Object.keys(e)),te=It(e,"onBeforeResize")??te,nt=It(e,"onMessage")??nt,ot=It(e,"onReady")??ot,"number"==typeof e?.offset&&(ze("offset","offsetSize"),Se&&(d=At(e,"offset")??d),Oe&&(f=At(e,"offset")??f)),"number"==typeof e?.offsetSize&&(Se&&(d=At(e,"offsetSize")??d),Oe&&(f=At(e,"offsetSize")??f)),u=xt(e,q(B[0]))??u,Ce=xt(e,"ignoreSelector")??Ce,Je=xt(e,"sizeSelector")??Je,Ge=xt(e,"targetOrigin")??Ge,Pe=e?.heightCalculationMethod||Pe,et=e?.widthCalculationMethod||et}function t(e,t){return"function"==typeof e&&(he(`<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===We)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Pe=t(Pe,"height"),et=t(et,"width"),ie(`Set targetOrigin for parent: %c${Ge}`,h))}(),[gt,vt,qt,pt,yt,Rt,Lt,Ct,ht,lt,$e?J:Te,Ot,Ht,Dt,Wt,Mt,()=>bt("background",ae),()=>bt("padding",we),$e?J:Tt,Ft,Bt,Kt].forEach(e=>{try{e()}catch(e){if(We<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)}}),ct(Z(ot)),oe("Initialization complete"),gn(C,"Init message from host page",void 0,void 0,`${y}:${We}`),document.title&&""!==document.title&&vn(0,0,"title",document.title)}function ct(e){"complete"===document.readyState?U(e):R(document,"readystatechange",()=>ct(e))}function lt(){_e=document.querySelectorAll(`[${z}]`),je=_e.length>0,oe(`Tagged elements found: %c${je}`,h)}let ut=0;function pt(){const n=document.querySelectorAll(`*[${$}]`);return Ee=n.length>0,Ee&&n.length!==ut&&(function(n){const o=1===n.length?"":"s";pe(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),ut=n.length),Ee}function ht(){"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 gt(){ee&&""!==ee&&"false"!==ee?ee!==y&&he(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ee} - Child page: ${y}.\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 yt(){try{Ze=1===We||"iframeParentListener"in window.parent}catch(e){oe("Cross domain iframe detected")}}function vt(){Oe===Se&&($e=!0)}function bt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ie(`Set body ${e}: %c${t}`,h))}function $t(e,t,n){if(""!==n){oe(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))oe(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ot(){$t("sizeSelector",z,Je),$t("ignoreSelector",$,Ce)}function Mt(){var e,t;void 0===ye&&(ye=`${me}px`),bt("margin",(e="margin",(t=ye).includes("-")&&(pe(`Negative CSS value ignored for ${e}`),t=""),t))}function Tt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),oe("Set HTML & body height: %cauto !important",h)}function Pt(e){({add(t){function n(){gn(e.eventName,e.eventType)}i[t]=n,R(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),oe(`${Q(e.method)} event listener: %c${e.eventType}`,h)}function Ct(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!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 Nt(e,t,n,o){return t!==e&&(e in n||(pe(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&he(`<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 ${ee?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),oe(`Set ${o} calculation method: %c${e}`,h),e}function Rt(){Pe=Nt(Pe,a,ln,"height")}function Lt(){et=Nt(et,c,un,"width")}function qt(){const t=We,n=V({key:l}),o=V({key:u});if(We=Math.max(n,o),We<0){if(We=Math.min(n,o),he(`${H(We+2)}${H(2)}`),G(ee))throw H(We+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(ee)||t>-1&&We>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${K} %ciframe-resizer ${t}`,X||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>q(W[e]))(We)})`,We),We<2&&ge(H(3)),sessionStorage.setItem("ifr",y))}function Bt(){!0!==re&&oe("Auto Resize disabled"),function(e){Pt({method:e,eventType:"After Print",eventName:"afterprint"}),Pt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Pt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add")}function Ft(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Wt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,b)+parseInt(n.x,b),y:parseInt(t.top,b)+parseInt(n.y,b)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?(oe(`In page link (#${n}) not found in iFrame, so sending to parent`),vn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);oe(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),vn(o.y,o.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Re.enable?1===We?he("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(oe("Setting up location.hash handlers"),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)):oe("In page linking not enabled"),Re={findTarget:t}}function Dt(){function e(e){vn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){oe(`Add event listener: %c${n}`,h),R(window.document,t,e)}!0===De&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Ht(){1!==We&&(tt.parentIframe=Object.freeze({autoResize:e=>(Y(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Oe&&!1===Se?(de(M),he("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===re?(re=!0,queueMicrotask(()=>gn(M,"Auto Resize enabled"))):!1===e&&!0===re&&(re=!1),vn(0,0,"autoResize",JSON.stringify(re)),re)),close(){vn(0,0,"close")},getId:()=>Ve,getOrigin:()=>(ve("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return it=e,vn(0,0,"pageInfo"),void be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");it=null,vn(0,0,"pageInfoStop")},getParentProps:e=>(Y(e,"function","parentIframe.getParentProps(callback) callback"),at=e,vn(0,0,"parentInfo"),()=>{at=null,vn(0,0,"parentInfoStop")}),getParentProperties(e){ve("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Y(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Re.findTarget(e)},reset(){!function(){const e=Pe;Pe=a,oe(`Reset trigger event: %c${"parentIframe.reset"}`,h),Xe?oe("TriggerLock blocked calculation"):(Xe=!0,se("Trigger event lock on"),requestAnimationFrame(()=>{Xe=!1,se("Trigger event lock off")})),yn("reset"),Pe=e}()},setOffsetSize(e){Y(e,"number","parentIframe.setOffsetSize(offset) offset"),d=e,f=e,gn(j,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Y(e,"number","parentIframe.scrollBy(x, y) x"),Y(t,"number","parentIframe.scrollBy(x, y) y"),vn(t,e,"scrollBy")},scrollTo(e,t){Y(e,"number","parentIframe.scrollTo(x, y) x"),Y(t,"number","parentIframe.scrollTo(x, y) y"),vn(t,e,"scrollTo")},scrollToOffset(e,t){Y(e,"number","parentIframe.scrollToOffset(x, y) x"),Y(t,"number","parentIframe.scrollToOffset(x, y) y"),vn(t,e,"scrollToOffset")},sendMessage(e,t){t&&Y(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),vn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Pe=e,Rt()},setWidthCalculationMethod(e){et=e,Lt()},setTargetOrigin(e){Y(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),oe(`Set targetOrigin: %c${e}`,h),Ge=e},resize(e,t){e&&Y(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Y(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),gn("manualResize",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ve("size()","resize()"),this.resize(e,t)}}),tt.parentIFrame=tt.parentIframe)}function Vt(){const e=document.querySelectorAll(`[${w}]`);He=Array.from(e).filter(e=>!e.closest(`[${$}]`)),ke=He.length>0}function Ut(e){Vt(),(ke||e)&&(He.length>1?ie("Overflowed Elements:",...He):ke||ie("No overflow detected"),gn(I,"Overflow updated"))}function Zt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;gn(T,`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 Jt(e){kt=new ResizeObserver(Zt),kt.observe(document.body),Et.add(document.body),ie("Attached ResizeObserver to body"),L={attachObserverToNonStaticElements:jt,detachObservers:qe(wt,kt,Et,St)},L.attachObserverToNonStaticElements(e)}function _t(e){oe(`Visible: %c${e}`,h),Le=!e,gn(x,"Visibility changed")}const Qt=e=>{const t=new Set;for(const n of e)for(const e of on(n))t.add(e);return ie("Inspecting:\n",t),t},Gt=e=>{if(0===e.size)return;de("addObservers");const t=Qt(e);p.attachObservers(t),L.attachObserverToNonStaticElements(t),ce()},Yt=e=>{if(0===e.size)return;de("removeObservers");const t=Qt(e);p.detachObservers(t),L.detachObservers(t),ce()};function Xt(e){!function({addedNodes:e,removedNodes:t}){de("contentMutated"),Ot(),lt(),Vt(),ce(),Yt(t),Gt(e)}(e),gn(A,"Mutation Observed")}function Kt(){const e=on(document.documentElement);oe("Attaching Observers"),rt(Xt),function(e){const t={root:document.documentElement,side:Se?S:O};p=dt(Ut,t),p.attachObservers(e)}(e),zt(),Jt(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),ie("Attached VisibilityObserver to page")}(_t)}function en(e){performance.mark(ft);const t=Q(e);let n=0,o=document.documentElement,r=je?0:document.documentElement.getBoundingClientRect().bottom;const i=je?_e:ke?He:on(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ie(`${t} position calculated from:`,o),performance.mark(mt,{detail:{hasTags:je,len:i.length,logging:Fe,Side:t}}),r}const tn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],nn=e=>`:not(${e})`,on=e=>[e,...e.querySelectorAll(`* ${[...N].map(nn).join("")}`)],rn={height:0,width:0},an={height:0,width:0},sn=[h,g,h];function cn(e){function t(){return an[o]=r,rn[o]=s,r}const n=e===ln,o=n?"height":"width",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 s;case je:ie("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!ke&&0===an[o]&&0===rn[o]:ie(`Initial page size values: ${c}`,...sn),l=t();break;case Xe&&r===an[o]&&s===rn[o]:ie(`Size unchanged: ${c}`,...sn),l=Math.max(r,s);break;case 0===r:ie(`Page is hidden: ${c}`,...sn),l=s;break;case!ke&&r!==an[o]&&s<=rn[o]:ie(`New <html> size: ${c} `,...sn),ie(`Previous <html> size: %c${an[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!ke&&r<an[o]:ie(`<html> size decreased: ${c}`,...sn),l=t();break;case s===a||s===i:ie(`<html> size equals page size: ${c}`,...sn),l=t();break;case r>s:ie(`Page size < <html> size: ${c}`,...sn),l=t();break;case ke:ie("Found element overflowing <html> "),l=e.taggedElement();break;default:ie(`Using <html> size: ${c}`,...sn),l=t()}return ie(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&ie(`Page offsetSize: %c${t}px`,h),t}(e),l}const ln={enabled:()=>Se,getOffset:()=>d,auto:()=>cn(ln),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ln.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(...tn(ln)),min:()=>Math.min(...tn(ln)),grow:()=>ln.max(),lowestElement:()=>en(S),taggedElement:()=>en(S)},un={enabled:()=>Oe,getOffset:()=>f,auto:()=>cn(un),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(...tn(un)),min:()=>Math.min(...tn(un)),rightMostElement:()=>en(O),scroll:()=>Math.max(un.bodyScroll(),un.documentElementScroll()),taggedElement:()=>en(O)},dn=(e,t)=>!(Math.abs(e-t)<=Ye);function fn(e,t){const n=e[t]();return e.enabled()&&void 0!==te?function(e){const t=te(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`);return t}(n):n}let mn=!1;const pn=Z(()=>ge(H(4)));let hn=!1;const gn=ue((e,t,n,o,r)=>{if(D=performance.now(),F=!0,de(e),!0!==mn){if(!re&&!(e in k))return ie("Resizing disabled"),void ce();if(Le){if(!0===hn)return;return oe("Iframe hidden - Ignored resize request"),void(hn=!0)}hn=!1,mn=!0,requestAnimationFrame(()=>{mn=!1}),function(e,t,n,o,r){const i=n??fn(ln,Pe),a=o??fn(un,et),s=Se&&dn(Ie,i)||Oe&&dn(Ke,a)?E:e;switch(oe(`Resize event: %c${t}`,h),s){case C:case M:case E:Ie=i,Ke=a;case j:vn(Ie,Ke,e,r);break;case I:case A:case T:case x:oe(P);break;default:ie(P)}F=!1}(e,t,n,o,r)}});function yn(e){Ie=ln[Pe](),Ke=un[et](),vn(Ie,Ke,e)}const vn=ue(function(e,t,o,r,i){We<0||(de(o),void 0!==i?oe(`Message targetOrigin: %c${i}`,h):i=Ge,function(){const a=`${Ve}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ze)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==We)throw e;return void pn()}else Qe.postMessage(s+a,i);F&&oe(function(){const e=_(performance.now()-D);return o===C?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),ie(`Sending message to parent page via ${Ze?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ce())}),bn=ue(function(e){de("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>vn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void oe("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Qe=e.source,m=e.origin,st(t),Me=!1,setTimeout(()=>{Ne=!1},128)},reset(){Ne?oe("Page reset ignored by init"):(oe("Page size reset by host page"),yn("resetPage"))},resize(){oe("Resize requested by host page"),gn("parentResize","Parent window requested size check")},moveToAnchor(){Re.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();oe("PageInfo received from parent:",o(e)),it?U(it,n(e)):r("pageInfo")},parentInfo(){const e=o(c());oe("ParentInfo received from parent:",e),at?U(at,e):r("parentInfo")},message(){const e=c();oe("onMessage called from parent:%c",h,o(e)),U(nt,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],c=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=a();de(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||pe(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==Me)return l()?(fe(a()),de(C),void i.init()):void oe(`Ignored message of type "${a()}". Received before initialization.`);u()}()});function zn(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?pe("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>bn({data:e,sameOrigin:!0})),R(window,"message",bn),R(window,"readystatechange",zn),zn())}()}();
20
+ !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:!0,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.3-beta.2",v="iframeResizer",b=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),k={},T="setOffsetSize",j="resizeObserver",I="overflowObserver",A="mutationObserver",x="visibilityObserver",C="No change in content size detected",P="init",N=new Set(["head","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),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)},q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),B=["spjluzl","rlf","clyzpvu"],F=["<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"],D=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>q(F[e]);var V=e=>{const t=e[q(B[0])]||e[q(B[1])]||e[q(B[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=L(q(e));return n in D&&(t=D[n]),t}(n[0]);return 0===o||(e=>e[2]===L(e[0]+e[1]))(n)||(o=-2),o};const 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),G=e=>""!=`${e}`&&void 0!==e;const Y=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Q(t)}`)};let X=!0,K=v;const ee=(te=function(n={}){const l={},d={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function v(){delete h.event,y()}const b=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){c[b()?"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(),v()}else v()}function w(){""===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&&(w(),queueMicrotask(()=>queueMicrotask(z))),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:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},te?.__esModule?te.default:te);var te;const ne=ee({label:`${v}(child)`});const oe=e=>(...t)=>!X||ne[e](...t),re=oe("log"),ie=re,ae=oe("debug");const{assert:se,endAutoGroup:ce,error:le,errorBoundary:de,event:ue,label:fe,purge:me,warn:pe}=ne,he=e=>{return ne.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},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)),ve=ye("Method"),be=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 Ee({href:e}){$e.has(e)||(re("Unable to access stylesheet:",e),$e.add(e))}const ke=(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){Ee(n)}return{source:"cross-origin stylesheet",value:Oe(e,t)}}(e,t),Te=(e,t)=>{const{source:n,value:o}=ke(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 je(){for(const e of[document.documentElement,document.body])for(const t of we)re(`Checking <${Se(e)}> for blocking CSS: ${t}`),Me(e,t)&&Te(e,t)}const Ie=e=>t=>void 0===t?void 0:e(t),Ae=Ie(e=>"true"===e),xe=Ie(Number),Ce=(e="")=>t=>n=>{n.size>0&&ae(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Pe=Ce("attached to"),Ne=((e="")=>t=>n=>{n.size>0&&le(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Re=Ce("detached from"),Le=(t,n=!0)=>o=>{o>0&&ie(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},qe=(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",Fe=new Set,We=new Set,De=new Set,He=[],Ve={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ue,Ze=1,Je=!1,_e=0;const Qe=Ce("added")(Be),Ge=Ce("removed (page)")(Be),Ye=Ce("removed (added)")(Be),Xe=e=>e.nodeType!==Node.ELEMENT_NODE||N.has(e.tagName.toLowerCase());function Ke(e){const t=e.addedNodes;for(const e of t)Xe(e)||Fe.add(e)}function et(e){const t=e.removedNodes;for(const e of t)Xe(e)||(Fe.has(e)?(Fe.delete(e),De.add(e)):We.add(e))}const tt=e=>{ie("Mutations:",e);for(const t of e)Ke(t),et(t);Qe(Fe),Ge(We),Ye(De),De.clear()};const nt=e=>()=>{const t=performance.now(),n=t-_e,o=16*Ze+++2;if(n>o&&n<200)return ue("mutationThrottled"),ie("Update delayed due to heavy workload on the callStack"),ie(`EventLoop busy time: %c${_(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Ue,16*Ze),void(_e=t);Ze=1,He.forEach(tt),He.length=0,Je=!1,We.size>0&&re(`Detected %c${We.size} %cremoved element${We.size>1?"s":""}`,h,g),Fe.size>0&&re(`Found %c${Fe.size} %cnew element${Fe.size>1?"s":""}`,h,g),e({addedNodes:Fe,removedNodes:We}),Fe.clear(),We.clear()};function ot(e){He.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,Ve),ie("Attached MutationObserver to body"),t}const it="Overflow",at=Le(it),st=Le(it,!1),ct=Pe(it),lt=Ne(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||J,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,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:qe(it,c,l,st)}},ft="--ifr-start",mt="--ifr-end",pt=[],ht=new WeakSet,gt=e=>"object"==typeof e&&ht.add(e);let yt={},vt=0;function bt(e){e.getEntries().forEach(e=>{if(e.name===mt){const{duration:t}=performance.measure("--ifr-measure",ft,mt);yt=e.detail,pt.push(t),pt.length>100&&pt.shift()}})}function zt(){ie("Attached PerformanceObserver to page");new PerformanceObserver(bt).observe({entryTypes:["mark"]}),gt(document.documentElement),gt(document.body),function(){const e=setInterval(()=>{if(pt.length<10)return;if(yt.hasTags&&yt.len<25)return;pt.sort();const t=Math.min(pt.reduce((e,t)=>e+t,0)/pt.length,pt[Math.floor(pt.length/2)]),n=_(t);n>vt&&(vt=n,ue("performanceObserver"),re("Mean time:",_(pt[Math.floor(pt.length/2)])),re("Median time:",_(pt.reduce((e,t)=>e+t,0)/pt.length)),re("Average time:",n),re("Max time:",_(Math.max(...pt)))),t<=4||(clearInterval(e),he(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${_(t)}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)}()}const wt="Resize",$t=Le(wt),St=Le(wt,!1),Ot=Pe(wt),Mt=Ne(wt),Et=new WeakSet;let kt;function Tt(e){const t=new Set,n=new Set;let o=0;for(const r of e){if(r.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(r)?.position;""!==e&&"static"!==e&&(Et.has(r)?t.add(r):(kt.observe(r),Et.add(r),n.add(r),o+=1))}Mt(t),Ot(n),$t(o),n.clear(),t.clear()}const jt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},It=jt("function"),At=jt("number"),xt=jt("string");"undefined"!=typeof window&&function(){const o={height:()=>(pe("Custom height calculation function not defined"),ln.auto()),width:()=>(pe("Custom width calculation function not defined"),dn.auto())},r={},i={},a="auto",s="[iFrameSizer]",c="scroll";let l,d,u,f,m,p,L,F,D,ee,te,oe=!0,se="",me=0,ye="",we="",$e=!1,Se=!0,Oe=!1,Me=!0,Ee=!1,ke=!1,Te=!1,Ie=1,Ce=a,Pe="",Ne=!0,Re={},Le=!1,Be=!0,Fe=!1,We=0,De=!1,He=[],Ve="",Ue="child",Ze=!1,Je="",_e=[],Qe=window.parent,Ge="*",Ye=0,Xe=!1,Ke=1,et=c,tt=window,nt=()=>{pe("onMessage function not defined")},ot=()=>{},it=null,at=null;function st(e){var t;!function(e){Ve=e[0]??Ve,me=xe(e[1])??me,Oe=Ae(e[2])??Oe,Fe=Ae(e[3])??Fe,oe=Ae(e[6])??oe,ye=e[7]??ye,Ce=e[8]??Ce,se=e[9]??se,we=e[10]??we,Ye=xe(e[11])??Ye,Re.enable=Ae(e[12])??!1,Ue=e[13]??Ue,et=e[14]??et,De=Ae(e[15])??De,u=xe(e[16])??u,f=xe(e[17])??f,Se=Ae(e[18])??Se,l=e[19]??l,ee=e[20]??ee,We=xe(e[21])??We,Be=Ae(e[23])??Be}(e),K=(t={id:Ve,enabled:Fe,expand:Be}).id||v,ne.label(`${K}`),ne.expand(t.expand),X=t.enabled,re(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){re("Reading data from page:",Object.keys(e)),te=It(e,"onBeforeResize")??te,nt=It(e,"onMessage")??nt,ot=It(e,"onReady")??ot,"number"==typeof e?.offset&&(ze("offset","offsetSize"),Se&&(u=At(e,"offset")??u),Oe&&(f=At(e,"offset")??f)),"number"==typeof e?.offsetSize&&(Se&&(u=At(e,"offsetSize")??u),Oe&&(f=At(e,"offsetSize")??f)),d=xt(e,q(B[0]))??d,Pe=xt(e,"ignoreSelector")??Pe,Je=xt(e,"sizeSelector")??Je,Ge=xt(e,"targetOrigin")??Ge,Ce=e?.heightCalculationMethod||Ce,et=e?.widthCalculationMethod||et}function t(e,t){return"function"==typeof e&&(he(`<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===We)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ce=t(Ce,"height"),et=t(et,"width"),ie(`Set targetOrigin for parent: %c${Ge}`,h))}(),[gt,vt,qt,pt,yt,Rt,Lt,Pt,ht,lt,$e?J:je,Ot,Ht,Dt,Wt,Mt,()=>bt("background",se),()=>bt("padding",we),$e?J:jt,Ft,Bt,Kt].forEach(e=>{try{e()}catch(e){if(We<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)}}),ct(Z(ot)),re("Initialization complete"),gn(P,"Init message from host page",void 0,void 0,`${y}:${We}`),document.title&&""!==document.title&&vn(0,0,"title",document.title)}function ct(e){"complete"===document.readyState?U(e):R(document,"readystatechange",()=>ct(e))}function lt(){_e=document.querySelectorAll(`[${z}]`),Te=_e.length>0,re(`Tagged elements found: %c${Te}`,h)}let dt=0;function pt(){const n=document.querySelectorAll(`*[${$}]`);return Ee=n.length>0,Ee&&n.length!==dt&&(function(n){const o=1===n.length?"":"s";pe(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),dt=n.length),Ee}function ht(){"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 gt(){ee&&""!==ee&&"false"!==ee?ee!==y&&he(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ee} - Child page: ${y}.\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 yt(){try{Ze=1===We||"iframeParentListener"in window.parent}catch(e){re("Cross domain iframe detected")}}function vt(){Oe===Se&&($e=!0)}function bt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ie(`Set body ${e}: %c${t}`,h))}function $t(e,t,n){if(""!==n){re(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))re(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ot(){$t("sizeSelector",z,Je),$t("ignoreSelector",$,Pe)}function Mt(){var e,t;void 0===ye&&(ye=`${me}px`),bt("margin",(e="margin",(t=ye).includes("-")&&(pe(`Negative CSS value ignored for ${e}`),t=""),t))}function jt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),re("Set HTML & body height: %cauto !important",h)}function Ct(e){({add(t){function n(){gn(e.eventName,e.eventType)}i[t]=n,R(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),re(`${Q(e.method)} event listener: %c${e.eventType}`,h)}function Pt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!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 Nt(e,t,n,o){return t!==e&&(e in n||(pe(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&he(`<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 ${ee?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),re(`Set ${o} calculation method: %c${e}`,h),e}function Rt(){Ce=Nt(Ce,a,ln,"height")}function Lt(){et=Nt(et,c,dn,"width")}function qt(){const t=We,n=V({key:l}),o=V({key:d});if(We=Math.max(n,o),We<0){if(We=Math.min(n,o),he(`${H(We+2)}${H(2)}`),G(ee))throw H(We+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(ee)||t>-1&&We>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${K} %ciframe-resizer ${t}`,X||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>q(W[e]))(We)})`,We),We<2&&ge(H(3)),sessionStorage.setItem("ifr",y))}function Bt(){var e;!0!==oe&&re("Auto Resize disabled"),Ct({method:e="add",eventType:"After Print",eventName:"afterprint"}),Ct({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ct({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Ft(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Wt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,b)+parseInt(n.x,b),y:parseInt(t.top,b)+parseInt(n.y,b)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?(re(`In page link (#${n}) not found in iFrame, so sending to parent`),vn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);re(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),vn(o.y,o.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Re.enable?1===We?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")&&R(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),R(window,"hashchange",n),setTimeout(n,128)):re("In page linking not enabled"),Re={findTarget:t}}function Dt(){function e(e){vn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){re(`Add event listener: %c${n}`,h),R(window.document,t,e)}!0===De&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Ht(){1!==We&&(tt.parentIframe=Object.freeze({autoResize:e=>(Y(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Oe&&!1===Se?(ue(M),he("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===oe?(oe=!0,queueMicrotask(()=>gn(M,"Auto Resize enabled"))):!1===e&&!0===oe&&(oe=!1),vn(0,0,"autoResize",JSON.stringify(oe)),oe)),close(){vn(0,0,"close")},getId:()=>Ve,getOrigin:()=>(ve("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return it=e,vn(0,0,"pageInfo"),void be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");it=null,vn(0,0,"pageInfoStop")},getParentProps:e=>(Y(e,"function","parentIframe.getParentProps(callback) callback"),at=e,vn(0,0,"parentInfo"),()=>{at=null,vn(0,0,"parentInfoStop")}),getParentProperties(e){ve("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Y(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Re.findTarget(e)},reset(){!function(){const e=Ce;Ce=a,re(`Reset trigger event: %c${"parentIframe.reset"}`,h),Xe?re("TriggerLock blocked calculation"):(Xe=!0,ae("Trigger event lock on"),requestAnimationFrame(()=>{Xe=!1,ae("Trigger event lock off")})),yn("reset"),Ce=e}()},setOffsetSize(e){Y(e,"number","parentIframe.setOffsetSize(offset) offset"),u=e,f=e,gn(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Y(e,"number","parentIframe.scrollBy(x, y) x"),Y(t,"number","parentIframe.scrollBy(x, y) y"),vn(t,e,"scrollBy")},scrollTo(e,t){Y(e,"number","parentIframe.scrollTo(x, y) x"),Y(t,"number","parentIframe.scrollTo(x, y) y"),vn(t,e,"scrollTo")},scrollToOffset(e,t){Y(e,"number","parentIframe.scrollToOffset(x, y) x"),Y(t,"number","parentIframe.scrollToOffset(x, y) y"),vn(t,e,"scrollToOffset")},sendMessage(e,t){t&&Y(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),vn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Ce=e,Rt()},setWidthCalculationMethod(e){et=e,Lt()},setTargetOrigin(e){Y(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),re(`Set targetOrigin: %c${e}`,h),Ge=e},resize(e,t){e&&Y(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Y(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),gn("manualResize",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ve("size()","resize()"),this.resize(e,t)}}),tt.parentIFrame=tt.parentIframe)}function Vt(){const e=document.querySelectorAll(`[${w}]`);He=Array.from(e).filter(e=>!e.closest(`[${$}]`)),ke=He.length>0}function Ut(e){Vt(),(ke||e)&&(He.length>1?ie("Overflowed Elements:",...He):ke||ie("No overflow detected"),gn(I,"Overflow updated"))}function Zt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;gn(j,`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 Jt(e){kt=new ResizeObserver(Zt),kt.observe(document.body),Et.add(document.body),ie("Attached ResizeObserver to body"),L={attachObserverToNonStaticElements:Tt,detachObservers:qe(wt,kt,Et,St)},L.attachObserverToNonStaticElements(e)}function _t(e){re(`Visible: %c${e}`,h),Le=!e,gn(x,"Visibility changed")}const Qt=e=>{const t=new Set;for(const n of e)for(const e of on(n))t.add(e);return ie("Inspecting:\n",t),t},Gt=e=>{if(0===e.size)return;ue("addObservers");const t=Qt(e);p.attachObservers(t),L.attachObserverToNonStaticElements(t),ce()},Yt=e=>{if(0===e.size)return;ue("removeObservers");const t=Qt(e);p.detachObservers(t),L.detachObservers(t),ce()};function Xt(e){!function({addedNodes:e,removedNodes:t}){ue("contentMutated"),Ot(),lt(),Vt(),ce(),Yt(t),Gt(e)}(e),gn(A,"Mutation Observed")}function Kt(){const e=on(document.documentElement);re("Attaching Observers"),rt(Xt),function(e){const t={root:document.documentElement,side:Se?S:O};p=ut(Ut,t),p.attachObservers(e)}(e),zt(),Jt(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),ie("Attached VisibilityObserver to page")}(_t)}function en(e){performance.mark(ft);const t=Q(e);let n=0,o=document.documentElement,r=Te?0:document.documentElement.getBoundingClientRect().bottom;const i=Te?_e:ke?He:on(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ie(`${t} position calculated from:`,o),performance.mark(mt,{detail:{hasTags:Te,len:i.length,logging:Fe,Side:t}}),r}const tn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],nn=e=>`:not(${e})`,on=e=>[e,...e.querySelectorAll(`* ${[...N].map(nn).join("")}`)],rn={height:0,width:0},an={height:0,width:0},sn=[h,g,h];function cn(e){function t(){return an[o]=r,rn[o]=s,r}const n=e===ln,o=n?"height":"width",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 s;case Te:ie("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!ke&&0===an[o]&&0===rn[o]:ie(`Initial page size values: ${c}`,...sn),l=t();break;case Xe&&r===an[o]&&s===rn[o]:ie(`Size unchanged: ${c}`,...sn),l=Math.max(r,s);break;case 0===r:ie(`Page is hidden: ${c}`,...sn),l=s;break;case!ke&&r!==an[o]&&s<=rn[o]:ie(`New <html> size: ${c} `,...sn),ie(`Previous <html> size: %c${an[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!ke&&r<an[o]:ie(`<html> size decreased: ${c}`,...sn),l=t();break;case s===a||s===i:ie(`<html> size equals page size: ${c}`,...sn),l=t();break;case r>s:ie(`Page size < <html> size: ${c}`,...sn),l=t();break;case ke:ie("Found element overflowing <html> "),l=e.taggedElement();break;default:ie(`Using <html> size: ${c}`,...sn),l=t()}return ie(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&ie(`Page offsetSize: %c${t}px`,h),t}(e),l}const ln={enabled:()=>Se,getOffset:()=>u,auto:()=>cn(ln),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ln.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(...tn(ln)),min:()=>Math.min(...tn(ln)),grow:()=>ln.max(),lowestElement:()=>en(S),taggedElement:()=>en(S)},dn={enabled:()=>Oe,getOffset:()=>f,auto:()=>cn(dn),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(...tn(dn)),min:()=>Math.min(...tn(dn)),rightMostElement:()=>en(O),scroll:()=>Math.max(dn.bodyScroll(),dn.documentElementScroll()),taggedElement:()=>en(O)},un=(e,t)=>!(Math.abs(e-t)<=Ye);function fn(e,t){const n=e[t]();return e.enabled()&&void 0!==te?function(e){const t=te(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`);return t}(n):n}let mn=!1;const pn=Z(()=>ge(H(4)));let hn=!1;const gn=de((e,t,n,o,r)=>{if(D=performance.now(),F=!0,ue(e),!0!==mn){if(!oe&&!(e in k))return ie("Resizing disabled"),void ce();if(Le){if(!0===hn)return;return re("Iframe hidden - Ignored resize request"),void(hn=!0)}hn=!1,mn=!0,requestAnimationFrame(()=>{mn=!1}),function(e,t,n,o,r){const i=n??fn(ln,Ce),a=o??fn(dn,et),s=Se&&un(Ie,i)||Oe&&un(Ke,a)?E:e;switch(re(`Resize event: %c${t}`,h),s){case P:case M:case E:Ie=i,Ke=a;case T:vn(Ie,Ke,e,r);break;case I:case A:case j:case x:re(C);break;default:ie(C)}F=!1}(e,t,n,o,r)}});function yn(e){Ie=ln[Ce](),Ke=dn[et](),vn(Ie,Ke,e)}const vn=de(function(e,t,o,r,i){We<0||(ue(o),void 0!==i?re(`Message targetOrigin: %c${i}`,h):i=Ge,function(){const a=`${Ve}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ze)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==We)throw e;return void pn()}else Qe.postMessage(s+a,i);F&&re(function(){const e=_(performance.now()-D);return o===P?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),ie(`Sending message to parent page via ${Ze?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ce())}),bn=de(function(e){ue("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>vn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void re("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Qe=e.source,m=e.origin,st(t),Me=!1,setTimeout(()=>{Ne=!1},128)},reset(){Ne?re("Page reset ignored by init"):(re("Page size reset by host page"),yn("resetPage"))},resize(){re("Resize requested by host page"),gn("parentResize","Parent window requested size check")},moveToAnchor(){Re.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();re("PageInfo received from parent:",o(e)),it?U(it,n(e)):r("pageInfo")},parentInfo(){const e=o(c());re("ParentInfo received from parent:",e),at?U(at,e):r("parentInfo")},message(){const e=c();re("onMessage called from parent:%c",h,o(e)),U(nt,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],c=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();ue(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||pe(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==Me)return l()?(fe(a()),ue(P),void i.init()):void re(`Ignored message of type "${a()}". Received before initialization.`);d()}()});function zn(){"loading"===document.readyState||Me||(re("[iFrameResizerChild]Ready"),window.parent.postMessage("[iFrameResizerChild]Ready","*"))}"iframeChildListener"in window?pe("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>bn({data:e,sameOrigin:!0})),R(window,"message",bn),R(window,"readystatechange",zn),setTimeout(zn))}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.js.map