iframe-resizer 5.5.2-beta.3 → 5.5.2-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.2-beta.3 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.2-beta.5 (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.2-beta.3",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",N="No change in content size detected",P="init",C=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),Ne=new Set,Pe=new Set,Ce=[],Re={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Le,qe=1,Be=!1,Fe=0;const We=e=>e.nodeType!==Node.ELEMENT_NODE||C.has(e.tagName.toLowerCase());function De(e){const t=e.addedNodes;for(const e of t)We(e)||Ne.add(e)}function He(e){const t=e.removedNodes;for(const e of t)We(e)||(Ne.has(e)?(Ne.delete(e),se("Removed (Added):",e)):Pe.add(e))}const Ve=e=>{ie("Mutations:",e);for(const t of e)De(t),He(t)};const Ue=e=>()=>{const t=performance.now(),n=t-Fe,o=16*qe+++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(Le,16*qe),void(Fe=t);qe=1,Ce.forEach(Ve),Ce.length=0,Be=!1,Pe.size>0&&oe(`Detected %c${Pe.size} %cremoved element${Pe.size>1?"s":""}`,h,g),Ne.size>0&&oe(`Found %c${Ne.size} %cnew element${Ne.size>1?"s":""}`,h,g),oe("addedNodes:",...Ne),oe("removedNodes:",...Pe),e({addedNodes:Ne,removedNodes:Pe}),Ne.clear(),Pe.clear()};function Ze(e){Ce.push(e),Be||(Fe=performance.now(),Be=!0,requestAnimationFrame(Le))}function Je(e){const t=new window.MutationObserver(Ze),n=document.body||document.documentElement;return Le=Ue(e),t.observe(n,Re),ie("Attached MutationObserver to body"),t}const _e=(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)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},Ge=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Ye=(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)&&!Ge(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=l.has(n);e&&(ae(!o,"Node already observed for overflow",n),o||(c.observe(n),l.add(n),t+=1))}return t},detachObservers:Qe(0,c,l)}},Xe="--ifr-start",Ke="--ifr-end",et=[],tt=new WeakSet,nt=e=>"object"==typeof e&&tt.add(e);let ot={},rt=0;function it(e){e.getEntries().forEach(e=>{if(e.name===Ke){const{duration:t}=performance.measure("--ifr-measure",Xe,Ke);ot=e.detail,et.push(t),et.length>100&&et.shift()}})}function at(){ie("Attached PerformanceObserver to page");new PerformanceObserver(it).observe({entryTypes:["mark"]}),nt(document.documentElement),nt(document.body),function(){const e=setInterval(()=>{if(et.length<10)return;if(ot.hasTags&&ot.len<25)return;et.sort();const t=Math.min(et.reduce((e,t)=>e+t,0)/et.length,et[Math.floor(et.length/2)]),n=_(t);n>rt&&(rt=n,de("performanceObserver"),oe("Mean time:",_(et[Math.floor(et.length/2)])),oe("Median time:",_(et.reduce((e,t)=>e+t,0)/et.length)),oe("Average time:",n),oe("Max time:",_(Math.max(...et)))),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 ${ot.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const st=new WeakSet;let ct;function lt(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=st.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(ae(!o,"Node already observed for resize",n),o||(ct.observe(n),st.add(n),t+=1))}return t}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}.`)}},dt=ut("function"),ft=ut("number"),mt=ut("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,Ne=a,Pe="",Ce=!0,Re={},Le=!1,qe=!0,Be=!1,Fe=0,We=!1,De=[],He="",Ve="child",Ue=!1,Ze="",Ge=[],et=window.parent,tt="*",nt=0,ot=!1,rt=1,it=c,ut=window,pt=()=>{pe("onMessage function not defined")},ht=()=>{},gt=null,yt=null;function vt(e){var t;!function(e){He=e[0]??He,me=xe(e[1])??me,Oe=Ae(e[2])??Oe,Be=Ae(e[3])??Be,re=Ae(e[6])??re,ye=e[7]??ye,Ne=e[8]??Ne,ae=e[9]??ae,we=e[10]??we,nt=xe(e[11])??nt,Re.enable=Ae(e[12])??!1,Ve=e[13]??Ve,it=e[14]??it,We=Ae(e[15])??We,d=xe(e[16])??d,f=xe(e[17])??f,Se=Ae(e[18])??Se,l=e[19]??l,ee=e[20]??ee,Fe=xe(e[21])??Fe,qe=Ae(e[23])??qe}(e),K=(t={id:He,enabled:Be,expand:qe}).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=dt(e,"onBeforeResize")??te,pt=dt(e,"onMessage")??pt,ht=dt(e,"onReady")??ht,"number"==typeof e?.offset&&(ze("offset","offsetSize"),Se&&(d=ft(e,"offset")??d),Oe&&(f=ft(e,"offset")??f)),"number"==typeof e?.offsetSize&&(Se&&(d=ft(e,"offsetSize")??d),Oe&&(f=ft(e,"offsetSize")??f)),u=mt(e,q(B[0]))??u,Pe=mt(e,"ignoreSelector")??Pe,Ze=mt(e,"sizeSelector")??Ze,tt=mt(e,"targetOrigin")??tt,Ne=e?.heightCalculationMethod||Ne,it=e?.widthCalculationMethod||it}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===Fe)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ne=t(Ne,"height"),it=t(it,"width"),ie(`Set targetOrigin for parent: %c${tt}`,h))}(),[Ot,Et,Lt,$t,Mt,Ct,Rt,Nt,St,zt,$e?J:Te,Tt,Dt,Wt,Ft,It,()=>kt("background",ae),()=>kt("padding",we),$e?J:At,Bt,qt,Kt].forEach(e=>{try{e()}catch(e){if(Fe<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)}}),bt(Z(ht)),oe("Initialization complete"),gn(P,"Init message from host page",void 0,void 0,`${y}:${Fe}`),document.title&&""!==document.title&&vn(0,0,"title",document.title)}function bt(e){"complete"===document.readyState?U(e):R(document,"readystatechange",()=>bt(e))}function zt(){Ge=document.querySelectorAll(`[${z}]`),je=Ge.length>0,oe(`Tagged elements found: %c${je}`,h)}let wt=0;function $t(){const n=document.querySelectorAll(`*[${$}]`);return Ee=n.length>0,Ee&&n.length!==wt&&(function(n){const o=1===n.length?"":"s";pe(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),wt=n.length),Ee}function St(){"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 Ot(){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 Mt(){try{Ue=1===Fe||"iframeParentListener"in window.parent}catch(e){oe("Cross domain iframe detected")}}function Et(){Oe===Se&&($e=!0)}function kt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ie(`Set body ${e}: %c${t}`,h))}function jt(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 Tt(){jt("sizeSelector",z,Ze),jt("ignoreSelector",$,Pe)}function It(){var e,t;void 0===ye&&(ye=`${me}px`),kt("margin",(e="margin",(t=ye).includes("-")&&(pe(`Negative CSS value ignored for ${e}`),t=""),t))}function At(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),oe("Set HTML & body height: %cauto !important",h)}function xt(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 Nt(){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 Pt(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 Ct(){Ne=Pt(Ne,a,ln,"height")}function Rt(){it=Pt(it,c,un,"width")}function Lt(){const t=Fe,n=V({key:l}),o=V({key:u});if(Fe=Math.max(n,o),Fe<0){if(Fe=Math.min(n,o),he(`${H(Fe+2)}${H(2)}`),G(ee))throw H(Fe+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(ee)||t>-1&&Fe>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]))(Fe)})`,Fe),Fe<2&&ge(H(3)),sessionStorage.setItem("ifr",y))}function qt(){!0!==re&&oe("Auto Resize disabled"),function(e){xt({method:e,eventType:"After Print",eventName:"afterprint"}),xt({method:e,eventType:"Before Print",eventName:"beforeprint"}),xt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add")}function Bt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Ft(){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===Fe?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 Wt(){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===We&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Dt(){1!==Fe&&(ut.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:()=>He,getOrigin:()=>(ve("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return gt=e,vn(0,0,"pageInfo"),void be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");gt=null,vn(0,0,"pageInfoStop")},getParentProps:e=>(Y(e,"function","parentIframe.getParentProps(callback) callback"),yt=e,vn(0,0,"parentInfo"),()=>{yt=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=Ne;Ne=a,oe(`Reset trigger event: %c${"parentIframe.reset"}`,h),ot?oe("TriggerLock blocked calculation"):(ot=!0,se("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,se("Trigger event lock off")})),yn("reset"),Ne=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){Ne=e,Ct()},setWidthCalculationMethod(e){it=e,Rt()},setTargetOrigin(e){Y(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),oe(`Set targetOrigin: %c${e}`,h),tt=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)}}),ut.parentIFrame=ut.parentIframe)}const Ht=_e("Overflow"),Vt=_e("Overflow",!1),Ut=_e("Resize"),Zt=_e("Resize",!1);function Jt(){const e=document.querySelectorAll(`[${w}]`);De=Array.from(e).filter(e=>!e.closest(`[${$}]`)),ke=De.length>0}function _t(e){Jt(),(ke||e)&&(De.length>1?ie("Overflowed Elements:",...De):ke||ie("No overflow detected"),gn(I,"Overflow updated"))}function Qt(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 Gt(e){ct=new ResizeObserver(Qt),ct.observe(document.body),st.add(document.body),ie("Attached ResizeObserver to body"),L={attachObserverToNonStaticElements:lt,detachObservers:Qe(0,ct,st)};const t=L.attachObserverToNonStaticElements(e);Ut(t)}function Yt(e){oe(`Visible: %c${e}`,h),Le=!e,gn(x,"Visibility changed")}function Xt(e){!function({addedNodes:e,removedNodes:t}){de("contentMutated"),Tt(),zt(),Jt();let n=0,o=0,r=0,i=0;for(const e of t){const t=on(e)();o+=p.detachObservers(t),i+=L.detachObservers(t)}for(const t of e){const e=on(t)();n+=p.attachObservers(e),r+=L.attachObserverToNonStaticElements(e)}Vt(o),Ht(n),Zt(i),Ut(r),ce()}(e),gn(A,"Mutation Observed")}function Kt(){const e=on(document.documentElement)();oe("Attaching Observers"),Je(Xt),function(e){const t={root:document.documentElement,side:Se?S:O};p=Ye(_t,t);const n=p.attachObservers(e);Ht(n)}(e),at(),Gt(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")}(Yt)}function en(e){performance.mark(Xe);const t=Q(e);let n=0,o=document.documentElement,r=je?0:document.documentElement.getBoundingClientRect().bottom;const i=je?Ge:ke?De:on(document)();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(Ke,{detail:{hasTags:je,len:i.length,logging:Be,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(`* ${[...C].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 ot&&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)<=nt);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,Ne),a=o??fn(un,it),s=Se&&dn(Ie,i)||Oe&&dn(rt,a)?E:e;switch(oe(`Resize event: %c${t}`,h),s){case P:case M:case E:Ie=i,rt=a;case j:vn(Ie,rt,e,r);break;case I:case A:case T:case x:oe(N);break;default:ie(N)}F=!1}(e,t,n,o,r)}});function yn(e){Ie=ln[Ne](),rt=un[it](),vn(Ie,rt,e)}const vn=ue(function(e,t,o,r,i){Fe<0||(de(o),void 0!==i?oe(`Message targetOrigin: %c${i}`,h):i=tt,function(){const a=`${He}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ue)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Fe)throw e;return void pn()}else et.postMessage(s+a,i);F&&oe(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 ${Ue?"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(":");et=e.source,m=e.origin,vt(t),Me=!1,setTimeout(()=>{Ce=!1},128)},reset(){Ce?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)),gt?U(gt,n(e)):r("pageInfo")},parentInfo(){const e=o(c());oe("ParentInfo received from parent:",e),yt?U(yt,e):r("parentInfo")},message(){const e=c();oe("onMessage called from parent:%c",h,o(e)),U(pt,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(P),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: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.2-beta.5",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",N="No change in content size detected",P="init",C=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),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)oe(`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),Ne=new Set,Pe=new Set,Ce=[],Re={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Le,qe=1,Be=!1,Fe=0;const We=e=>e.nodeType!==Node.ELEMENT_NODE||C.has(e.tagName.toLowerCase());function De(e){const t=e.addedNodes;for(const e of t)We(e)||(Ne.add(e),se("Added:",e))}function He(e){const t=e.removedNodes;for(const e of t)We(e)||(Ne.has(e)?(Ne.delete(e),se("Removed (Added):",e)):(Pe.add(e),se("Removed (Page):",e)))}const Ve=e=>{ie("Mutations:",e);for(const t of e)De(t),He(t)};const Ue=e=>()=>{const t=performance.now(),n=t-Fe,o=16*qe+++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(Le,16*qe),void(Fe=t);qe=1,Ce.forEach(Ve),Ce.length=0,Be=!1,Pe.size>0&&oe(`Detected %c${Pe.size} %cremoved element${Pe.size>1?"s":""}`,h,g),Ne.size>0&&oe(`Found %c${Ne.size} %cnew element${Ne.size>1?"s":""}`,h,g),e({addedNodes:Ne,removedNodes:Pe}),Ne.clear(),Pe.clear()};function Ze(e){Ce.push(e),Be||(Fe=performance.now(),Be=!0,requestAnimationFrame(Le))}function Je(e){const t=new window.MutationObserver(Ze),n=document.body||document.documentElement;return Le=Ue(e),t.observe(n,Re),ie("Attached MutationObserver to body"),t}const _e=(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=>{let r=0;for(const i of o)n.has(i)&&(se(`Detaching ${e}Observer from:`,i),t.unobserve(i),n.delete(i),r+=1);return r},Ge=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Ye=(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)&&!Ge(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=l.has(n);e&&(ae(!o,"Node already observed for overflow",n),o||(se("Observing overflow on:",n),c.observe(n),l.add(n),t+=1))}return t},detachObservers:Qe("Overflow",c,l)}},Xe="--ifr-start",Ke="--ifr-end",et=[],tt=new WeakSet,nt=e=>"object"==typeof e&&tt.add(e);let ot={},rt=0;function it(e){e.getEntries().forEach(e=>{if(e.name===Ke){const{duration:t}=performance.measure("--ifr-measure",Xe,Ke);ot=e.detail,et.push(t),et.length>100&&et.shift()}})}function at(){ie("Attached PerformanceObserver to page");new PerformanceObserver(it).observe({entryTypes:["mark"]}),nt(document.documentElement),nt(document.body),function(){const e=setInterval(()=>{if(et.length<10)return;if(ot.hasTags&&ot.len<25)return;et.sort();const t=Math.min(et.reduce((e,t)=>e+t,0)/et.length,et[Math.floor(et.length/2)]),n=_(t);n>rt&&(rt=n,de("performanceObserver"),oe("Mean time:",_(et[Math.floor(et.length/2)])),oe("Median time:",_(et.reduce((e,t)=>e+t,0)/et.length)),oe("Average time:",n),oe("Max time:",_(Math.max(...et)))),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 ${ot.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const st=new WeakSet;let ct;function lt(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=st.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(o?pe("Node already observed for resize, skipping:",n):(se("Observing resize on:",n),ct.observe(n),st.add(n),t+=1))}return t}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}.`)}},dt=ut("function"),ft=ut("number"),mt=ut("string");"undefined"!=typeof window&&function(){const o={height:()=>(pe("Custom height calculation function not defined"),dn.auto()),width:()=>(pe("Custom width calculation function not defined"),fn.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,Te=!1,Ie=1,Ne=a,Pe="",Ce=!0,Re={},Le=!1,qe=!0,Be=!1,Fe=0,We=!1,De=[],He="",Ve="child",Ue=!1,Ze="",Ge=[],et=window.parent,tt="*",nt=0,ot=!1,rt=1,it=c,ut=window,pt=()=>{pe("onMessage function not defined")},ht=()=>{},gt=null,yt=null;function vt(e){var t;!function(e){He=e[0]??He,me=xe(e[1])??me,Oe=Ae(e[2])??Oe,Be=Ae(e[3])??Be,re=Ae(e[6])??re,ye=e[7]??ye,Ne=e[8]??Ne,ae=e[9]??ae,we=e[10]??we,nt=xe(e[11])??nt,Re.enable=Ae(e[12])??!1,Ve=e[13]??Ve,it=e[14]??it,We=Ae(e[15])??We,d=xe(e[16])??d,f=xe(e[17])??f,Se=Ae(e[18])??Se,l=e[19]??l,ee=e[20]??ee,Fe=xe(e[21])??Fe,qe=Ae(e[23])??qe}(e),K=(t={id:He,enabled:Be,expand:qe}).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=dt(e,"onBeforeResize")??te,pt=dt(e,"onMessage")??pt,ht=dt(e,"onReady")??ht,"number"==typeof e?.offset&&(ze("offset","offsetSize"),Se&&(d=ft(e,"offset")??d),Oe&&(f=ft(e,"offset")??f)),"number"==typeof e?.offsetSize&&(Se&&(d=ft(e,"offsetSize")??d),Oe&&(f=ft(e,"offsetSize")??f)),u=mt(e,q(B[0]))??u,Pe=mt(e,"ignoreSelector")??Pe,Ze=mt(e,"sizeSelector")??Ze,tt=mt(e,"targetOrigin")??tt,Ne=e?.heightCalculationMethod||Ne,it=e?.widthCalculationMethod||it}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===Fe)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ne=t(Ne,"height"),it=t(it,"width"),ie(`Set targetOrigin for parent: %c${tt}`,h))}(),[Ot,Et,Lt,$t,Mt,Ct,Rt,Nt,St,zt,$e?J:je,jt,Dt,Wt,Ft,It,()=>kt("background",ae),()=>kt("padding",we),$e?J:At,Bt,qt,tn].forEach(e=>{try{e()}catch(e){if(Fe<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)}}),bt(Z(ht)),oe("Initialization complete"),vn(P,"Init message from host page",void 0,void 0,`${y}:${Fe}`),document.title&&""!==document.title&&zn(0,0,"title",document.title)}function bt(e){"complete"===document.readyState?U(e):R(document,"readystatechange",()=>bt(e))}function zt(){Ge=document.querySelectorAll(`[${z}]`),Te=Ge.length>0,oe(`Tagged elements found: %c${Te}`,h)}let wt=0;function $t(){const n=document.querySelectorAll(`*[${$}]`);return Ee=n.length>0,Ee&&n.length!==wt&&(function(n){const o=1===n.length?"":"s";pe(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),wt=n.length),Ee}function St(){"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 Ot(){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 Mt(){try{Ue=1===Fe||"iframeParentListener"in window.parent}catch(e){oe("Cross domain iframe detected")}}function Et(){Oe===Se&&($e=!0)}function kt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ie(`Set body ${e}: %c${t}`,h))}function Tt(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 jt(){Tt("sizeSelector",z,Ze),Tt("ignoreSelector",$,Pe)}function It(){var e,t;void 0===ye&&(ye=`${me}px`),kt("margin",(e="margin",(t=ye).includes("-")&&(pe(`Negative CSS value ignored for ${e}`),t=""),t))}function At(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),oe("Set HTML & body height: %cauto !important",h)}function xt(e){({add(t){function n(){vn(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 Nt(){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 Pt(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 Ct(){Ne=Pt(Ne,a,dn,"height")}function Rt(){it=Pt(it,c,fn,"width")}function Lt(){const t=Fe,n=V({key:l}),o=V({key:u});if(Fe=Math.max(n,o),Fe<0){if(Fe=Math.min(n,o),he(`${H(Fe+2)}${H(2)}`),G(ee))throw H(Fe+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(ee)||t>-1&&Fe>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]))(Fe)})`,Fe),Fe<2&&ge(H(3)),sessionStorage.setItem("ifr",y))}function qt(){!0!==re&&oe("Auto Resize disabled"),function(e){xt({method:e,eventType:"After Print",eventName:"afterprint"}),xt({method:e,eventType:"Before Print",eventName:"beforeprint"}),xt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add")}function Bt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Ft(){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`),zn(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),zn(o.y,o.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Re.enable?1===Fe?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 Wt(){function e(e){zn(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===We&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Dt(){1!==Fe&&(ut.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(()=>vn(M,"Auto Resize enabled"))):!1===e&&!0===re&&(re=!1),zn(0,0,"autoResize",JSON.stringify(re)),re)),close(){zn(0,0,"close")},getId:()=>He,getOrigin:()=>(ve("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return gt=e,zn(0,0,"pageInfo"),void be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");gt=null,zn(0,0,"pageInfoStop")},getParentProps:e=>(Y(e,"function","parentIframe.getParentProps(callback) callback"),yt=e,zn(0,0,"parentInfo"),()=>{yt=null,zn(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=Ne;Ne=a,oe(`Reset trigger event: %c${"parentIframe.reset"}`,h),ot?oe("TriggerLock blocked calculation"):(ot=!0,se("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,se("Trigger event lock off")})),bn("reset"),Ne=e}()},setOffsetSize(e){Y(e,"number","parentIframe.setOffsetSize(offset) offset"),d=e,f=e,vn(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Y(e,"number","parentIframe.scrollBy(x, y) x"),Y(t,"number","parentIframe.scrollBy(x, y) y"),zn(t,e,"scrollBy")},scrollTo(e,t){Y(e,"number","parentIframe.scrollTo(x, y) x"),Y(t,"number","parentIframe.scrollTo(x, y) y"),zn(t,e,"scrollTo")},scrollToOffset(e,t){Y(e,"number","parentIframe.scrollToOffset(x, y) x"),Y(t,"number","parentIframe.scrollToOffset(x, y) y"),zn(t,e,"scrollToOffset")},sendMessage(e,t){t&&Y(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),zn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Ne=e,Ct()},setWidthCalculationMethod(e){it=e,Rt()},setTargetOrigin(e){Y(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),oe(`Set targetOrigin: %c${e}`,h),tt=e},resize(e,t){e&&Y(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Y(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),vn("manualResize",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ve("size()","resize()"),this.resize(e,t)}}),ut.parentIFrame=ut.parentIframe)}const Ht=_e("Overflow"),Vt=_e("Overflow",!1),Ut=_e("Resize"),Zt=_e("Resize",!1);function Jt(){const e=document.querySelectorAll(`[${w}]`);De=Array.from(e).filter(e=>!e.closest(`[${$}]`)),ke=De.length>0}function _t(e){Jt(),(ke||e)&&(De.length>1?ie("Overflowed Elements:",...De):ke||ie("No overflow detected"),vn(I,"Overflow updated"))}function Qt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;vn(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 Gt(e){ct=new ResizeObserver(Qt),ct.observe(document.body),st.add(document.body),ie("Attached ResizeObserver to body"),L={attachObserverToNonStaticElements:lt,detachObservers:Qe("Resize",ct,st)};const t=L.attachObserverToNonStaticElements(e);Ut(t)}function Yt(e){oe(`Visible: %c${e}`,h),Le=!e,vn(x,"Visibility changed")}const Xt=e=>()=>{if(0===e.size)return;let t=0,n=0;de("addObservers"),oe(e);for(const o of e){const e=an(o)();t+=p.attachObservers(e),n+=L.attachObserverToNonStaticElements(e)}Ht(t),Ut(n),ce()},Kt=e=>()=>{if(0===e.size)return;let t=0,n=0;de("removeObservers"),oe(e);for(const o of e){const e=an(o)();t+=p.detachObservers(e),n+=L.detachObservers(e)}Vt(t),Zt(n),ce()};function en(e){!function({addedNodes:e,removedNodes:t}){de("contentMutated"),jt(),zt(),Jt(),oe(">>",e.values()),ce(),setTimeout(Kt(new Set(t.values()))),setTimeout(Xt(new Set(e.values())),1)}(e),vn(A,"Mutation Observed")}function tn(){const e=an(document.documentElement)();oe("Attaching Observers"),Je(en),function(e){const t={root:document.documentElement,side:Se?S:O};p=Ye(_t,t);const n=p.attachObservers(e);Ht(n)}(e),at(),Gt(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")}(Yt)}function nn(e){performance.mark(Xe);const t=Q(e);let n=0,o=document.documentElement,r=Te?0:document.documentElement.getBoundingClientRect().bottom;const i=Te?Ge:ke?De:an(document)();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(Ke,{detail:{hasTags:Te,len:i.length,logging:Be,Side:t}}),r}const on=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],rn=e=>`:not(${e})`,an=e=>()=>[e,...e.querySelectorAll(`* ${[...C].map(rn).join("")}`)],sn={height:0,width:0},cn={height:0,width:0},ln=[h,g,h];function un(e){function t(){return cn[o]=r,sn[o]=s,r}const n=e===dn,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===cn[o]&&0===sn[o]:ie(`Initial page size values: ${c}`,...ln),l=t();break;case ot&&r===cn[o]&&s===sn[o]:ie(`Size unchanged: ${c}`,...ln),l=Math.max(r,s);break;case 0===r:ie(`Page is hidden: ${c}`,...ln),l=s;break;case!ke&&r!==cn[o]&&s<=sn[o]:ie(`New <html> size: ${c} `,...ln),ie(`Previous <html> size: %c${cn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!ke&&r<cn[o]:ie(`<html> size decreased: ${c}`,...ln),l=t();break;case s===a||s===i:ie(`<html> size equals page size: ${c}`,...ln),l=t();break;case r>s:ie(`Page size < <html> size: ${c}`,...ln),l=t();break;case ke:ie("Found element overflowing <html> "),l=e.taggedElement();break;default:ie(`Using <html> size: ${c}`,...ln),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 dn={enabled:()=>Se,getOffset:()=>d,auto:()=>un(dn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>dn.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(...on(dn)),min:()=>Math.min(...on(dn)),grow:()=>dn.max(),lowestElement:()=>nn(S),taggedElement:()=>nn(S)},fn={enabled:()=>Oe,getOffset:()=>f,auto:()=>un(fn),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(...on(fn)),min:()=>Math.min(...on(fn)),rightMostElement:()=>nn(O),scroll:()=>Math.max(fn.bodyScroll(),fn.documentElementScroll()),taggedElement:()=>nn(O)},mn=(e,t)=>!(Math.abs(e-t)<=nt);function pn(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 hn=!1;const gn=Z(()=>ge(H(4)));let yn=!1;const vn=ue((e,t,n,o,r)=>{if(D=performance.now(),F=!0,de(e),!0!==hn){if(!re&&!(e in k))return ie("Resizing disabled"),void ce();if(Le){if(!0===yn)return;return oe("Iframe hidden - Ignored resize request"),void(yn=!0)}yn=!1,hn=!0,requestAnimationFrame(()=>{hn=!1}),function(e,t,n,o,r){const i=n??pn(dn,Ne),a=o??pn(fn,it),s=Se&&mn(Ie,i)||Oe&&mn(rt,a)?E:e;switch(oe(`Resize event: %c${t}`,h),s){case P:case M:case E:Ie=i,rt=a;case T:zn(Ie,rt,e,r);break;case I:case A:case j:case x:oe(N);break;default:ie(N)}F=!1}(e,t,n,o,r)}});function bn(e){Ie=dn[Ne](),rt=fn[it](),zn(Ie,rt,e)}const zn=ue(function(e,t,o,r,i){Fe<0||(de(o),void 0!==i?oe(`Message targetOrigin: %c${i}`,h):i=tt,function(){const a=`${He}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ue)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Fe)throw e;return void gn()}else et.postMessage(s+a,i);F&&oe(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 ${Ue?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ce())}),wn=ue(function(e){de("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>zn(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(":");et=e.source,m=e.origin,vt(t),Me=!1,setTimeout(()=>{Ce=!1},128)},reset(){Ce?oe("Page reset ignored by init"):(oe("Page size reset by host page"),bn("resetPage"))},resize(){oe("Resize requested by host page"),vn("parentResize","Parent window requested size check")},moveToAnchor(){Re.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();oe("PageInfo received from parent:",o(e)),gt?U(gt,n(e)):r("pageInfo")},parentInfo(){const e=o(c());oe("ParentInfo received from parent:",e),yt?U(yt,e):r("parentInfo")},message(){const e=c();oe("onMessage called from parent:%c",h,o(e)),U(pt,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(P),void i.init()):void oe(`Ignored message of type "${a()}". Received before initialization.`);u()}()});function $n(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?pe("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>wn({data:e,sameOrigin:!0})),R(window,"message",wn),R(window,"readystatechange",$n),$n())}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.min.js.map