iframe-resizer 5.4.5-beta.1 → 5.4.5-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.4.5-beta.1 (cjs) - 2025-04-08
4
+ * @module iframe-resizer/legacy 5.4.5-beta.2 (cjs) - 2025-04-08
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.4.5-beta.1 (esm) - 2025-04-08
4
+ * @module iframe-resizer/legacy 5.4.5-beta.2 (esm) - 2025-04-08
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.4.5-beta.1 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.5-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};const{fromEntries:l,keys:c}=Object,d=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(c(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",g=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.5-beta.1",y=10,b="data-iframe-size",v="data-iframe-overflowed",z="data-iframe-ignore",w="bottom",$="right",S="resizeParent",O="setOffsetSize",M="resizeObserver",E="overflowObserver",j="mutationObserver",k=(e,t,n,o)=>e.addEventListener(t,n,o||!1),I=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(I[e]),A=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},T=e=>e,x=e=>Math.round(1e3*e)/1e3,C=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>""!=`${e}`&&void 0!==e;function R(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${C(t)}`)};let L=!0;const B=(F=function(n={}){const l={},c={},f=[],p={...a,expand:!n.collapsed||a.expanded,...n};let g;function h(){f.length=0}function y(){delete p.event,h()}const b=()=>!!f.some((([e])=>e in i))||!!p.expand;function v(){if(0!==f.length){console[b()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?g:""}`,e,t,o);for(const[e,...t]of f)console[e](...t);console.groupEnd(),y()}else y()}function z(){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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function w(e,...t){0===f.length&&z(),f.push([e,...t])}function $(e=r,...t){w("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...m(p,u(p)),...m(console,(e=>[e,(...t)=>w(e,...t)])),...m(s,d),count:function(e=r){c[e]?c[e]+=1:c[e]=1,w("log",`${e}: ${c[e]}`)},countReset:function(e=r){delete c[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;w("error",e)}return n},purge:h,time:function(e=r){l[e]=performance.now()},timeEnd:function(e=r){$(e),delete l[e]},timeLog:$}},F?.__esModule?F.default:F);var F;const W=B({label:"iframeResizer(child)"});const D=(H="log",(...e)=>!L||W[H](...e));var H;const V=D,{assert:U,debug:Z,endAutoGroup:J,error:_,errorBoundary:Q,event:G,purge:X,warn:Y}=W,K=e=>{return W.warn((t=T,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",se=[],le=new WeakSet,ce=e=>"object"==typeof e&&le.add(e);let de={},ue=0;const me=setInterval((()=>{if(se.length<10)return;if(de.hasTags&&de.len<25)return;se.sort();const e=Math.min(se.reduce(((e,t)=>e+t),0)/se.length,se[Math.floor(se.length/2)]),t=x(e);t>ue&&(ue=t,G("performanceObserver"),D("Mean time:",x(se[Math.floor(se.length/2)])),D("Median time:",x(se.reduce(((e,t)=>e+t),0)/se.length)),D("Average time:",t),D("Max time:",x(Math.max(...se)))),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);de=e.detail,se.push(t),se.length>100&&se.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ft.auto()),width:()=>(Y("Custom width calculation function not defined"),pt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,I,N,B,F=!0,H="",_=0,X="",te="",se=!0,le=!1,ce=!0,de=!1,ue=!1,me=!1,fe=1,pe=l,ge="",he=!0,ye="",be={},ve=!0,ze=!1,we=0,$e=!1,Se="",Oe=T,Me=[],Ee="child",je=null,ke=!1,Ie="",Pe=[],Ae=window.parent,Te="*",xe=0,Ce=!1,Ne="",Re=1,qe=u,Le=window,Be=()=>{Y("onMessage function not defined")},Fe=()=>{},We=null,De=null;function He(){var e,t,n;!function(){const e=e=>"true"===e,t=ye.slice(13).split(":");Se=t[0],_=void 0===t[1]?_:Number(t[1]),le=void 0===t[2]?le:e(t[2]),ze=void 0===t[3]?ze:e(t[3]),F=void 0===t[6]?F:e(t[6]),X=t[7],pe=void 0===t[8]?pe:t[8],H=t[9],te=t[10],xe=void 0===t[11]?xe:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),Ee=void 0===t[13]?Ee:t[13],qe=void 0===t[14]?qe:t[14],$e=void 0===t[15]?$e:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),se=void 0===t[18]?se:e(t[18]),t[19],Ne=t[20]||Ne,we=void 0===t[21]?we:Number(t[21]),ve=void 0===t[23]?ve:e(t[23])}(),e={id:Se,enabled:ze,expand:ve},W.label(`${e.id}`),W.expand(e.expand),L=e.enabled,D(`Initialising iframe v${h} ${window.location.href}`),function(){function e(e){D("Reading data from page:",e),Be=e?.onMessage||Be,Fe=e?.onReady||Fe,"number"==typeof e?.offset&&(re("offset","offsetSize"),se&&(m=e?.offset),le&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(se&&(m=e?.offsetSize),le&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ie=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(ge=e.ignoreSelector),Te=e?.targetOrigin||Te,pe=e?.heightCalculationMethod||pe,qe=e?.widthCalculationMethod||qe}function t(e,t){return"function"==typeof e&&(D(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===we)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),pe=t(pe,"height"),qe=t(qe,"width"),V(`Set targetOrigin for parent: %c${Te}`,p))}(),Ye(),function(){try{ke=1===we||"iframeParentListener"in window.parent}catch(e){D("Cross domain iframe detected")}}(),we<0?ee(`${P(we+2)}${P(2)}`):Ne.codePointAt(0)>4||we<2&&ee(P(3)),Ne&&""!==Ne&&"false"!==Ne?Ne!==h&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ne} - Child page: ${h}.\n`):K("<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"),tt(),nt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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</>.")}(),"BackCompat"===document.compatMode&&K("<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"),Ze(),1!==we&&(Le.parentIframe=Object.freeze({autoResize:e=>(q(e,"bool","parentIframe.autoResize(enable) enable"),!0===e&&!1===F?(F=!0,vt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),$t(0,0,"autoResize",JSON.stringify(F)),F),close(){$t(0,0,"close")},getId:()=>Se,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return We=e,$t(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");We=null,$t(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),De=e,$t(0,0,"parentInfo"),()=>{De=null,$t(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){wt("parentIframe.reset")},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,vt(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),$t(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),$t(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),$t(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),$t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){pe=e,tt()},setWidthCalculationMethod(e){qe=e,nt()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),D(`Set targetOrigin: %c${e}`,p),Te=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),vt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),Le.parentIFrame=Le.parentIframe),function(){function e(e){$t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){D(`Add event listener: %c${n}`,p),k(window.document,t,e)}!0===$e&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);D(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,p,g,p,g,p),$t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(D(`In page link (#${o}) not found in iFrame, so sending to parent`),$t(0,0,"inPageLink",`#${o}`)):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&k(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){k(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){D("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===we?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():D("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${_}px`),Ge("margin",(t="margin",(n=X).includes("-")&&(Y(`Negative CSS value ignored for ${t}`),n=""),n)),Ge("background",H),Ge("padding",te),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),D("Set HTML & body height: %cauto !important",p)}(),!0!==F&&D("Auto Resize disabled"),function(e){Ke({method:e,eventType:"After Print",eventName:"afterprint"}),Ke({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ke({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{D("Mutations observed:",t.length);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){Ye(),Je(e),e.forEach(it),e.clear()}function d(){G("mutationObserver");const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return D(`MutationObserver delay: %c${m}ms > ${f}ms`,p),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Ze(),Ve(),n=!1,vt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return D("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),D("Setup ResizeObserver"),je=new ResizeObserver(ot),je.observe(document.body),rt.add(document.body),it(document.body),se!==le&&(D("Setup OverflowObserver"),Oe=(e=>{const t=e.side||w,n=e.onChange||T,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||T,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){G("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c),c&&D("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(){const e=new window.MutationObserver((()=>{V("Detected changes in element attributes"),i(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[z],subtree:!0};D("Setup OverflowMutationObserver"),e.observe(t,n)}(),function(e){D("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):U(!n,"Node already observed",t)}}})({onChange:Ue,root:document.documentElement,side:se?w:$})),Je(lt(document)()),queueMicrotask(Fe),D("Initialization complete"),vt("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&$t(0,0,"title",document.title)}function Ve(){Me=document.querySelectorAll(`[${v}]:not([${z}]):not([${z}] *)`),ue=Me.length>0}function Ue(e){Ve(),(ue||e)&&(D("Observed Elements:",Me.length),vt(E,"Overflow updated"))}function Ze(){Pe=document.querySelectorAll(`[${b}]`),me=Pe.length>0,D(`Tagged elements found: %c${me}`,me?p:g)}function Je(e){me||Oe(e)}let _e=0;function Qe(){const n=document.querySelectorAll(`*[${z}]`);de=n.length>0,de&&n.length!==_e&&(function(n){const o=1===n.length?"":"s";Y(`%c[${z}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),_e=n.length)}function Ge(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),V(`Set body ${e}: %c${t}`,p))}function Xe(e,t,n){if(""!==n){D(`${e}: %c${n}`,p);for(const e of document.querySelectorAll(n))D(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ye(){Xe("sizeSelector",b,Ie),Xe("ignoreSelector",z,ge)}function Ke(e){({add(t){function n(){vt(e.eventName,e.eventType)}a[t]=n,k(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),D(`${C(e.method)} event listener: %c${e.eventType}`,p)}function et(e,t,n,o){return t!==e&&(e in n||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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 remove this option.`),D(`Set ${o} calculation method: %c${e}`,p)),e}function tt(){pe=et(pe,l,ft,"height")}function nt(){qe=et(qe,u,pt,"width")}function ot(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;vt(M,`Element resized <${R(t)}>`)}const rt=new WeakSet;function it(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!rt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}const t=lt(e)();for(const e of t){if(rt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}}function at(e){performance.mark(ie);const t=C(e);let n=0,r=document.documentElement,i=me?0:document.documentElement.getBoundingClientRect().bottom;const a=me?Pe:ue?Me:lt(document)();let l=a.length;for(const t of a)me||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return V(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:l,hasTags:me,logging:ze}}),i}const st=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],lt=e=>()=>{Qe();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return de&&t.push(`not([${z}])`,`not([${z}] *)`),e.querySelectorAll(t.join(":"))},ct={height:0,width:0},dt={height:0,width:0},ut=[p,g,p];function mt(e){function t(){return dt[o]=r,ct[o]=s,r}const n=e===ft,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),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case me:V("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ue&&0===dt[o]&&0===ct[o]:V(`Initial page size values: ${l}`,...ut),c=t();break;case Ce&&r===dt[o]&&s===ct[o]:V(`Size unchanged: ${l}`,...ut),c=Math.max(r,s);break;case 0===r:V(`Page is hidden: ${l}`,...ut),c=s;break;case!ue&&r!==dt[o]&&s<=ct[o]:V(`New <html> size: ${l} `,...ut),V(`Previous <html> size: %c${dt[o]}px`,p),c=t();break;case!n:c=e.taggedElement();break;case!ue&&r<dt[o]:V(`<html> size decreased: ${l}`,...ut),c=t();break;case s===a||s===i:V(`<html> size equals page size: ${l}`,...ut),c=t();break;case r>s:V(`Page size < <html> size: ${l}`,...ut),c=t();break;case ue:V("Found element overflowing <html> "),c=e.taggedElement();break;default:V(`Using <html> size: ${l}`,...ut),c=t()}return V(`Content ${o}: %c${c}px`,p),c+=function(e){const t=e.getOffset();return 0!==t&&V(`Page offsetSize: %c${t}px`,p),t}(e),c}const ft={enabled:()=>se,getOffset:()=>m,auto:()=>mt(ft),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ft.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...st(ft)),min:()=>Math.min(...st(ft)),grow:()=>ft.max(),lowestElement:()=>at(w),taggedElement:()=>at(w)},pt={enabled:()=>le,getOffset:()=>f,auto:()=>mt(pt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...st(pt)),min:()=>Math.min(...st(pt)),rightMostElement:()=>at($),scroll:()=>Math.max(pt.bodyScroll(),pt.documentElementScroll()),taggedElement:()=>at($)},gt=(e,t)=>!(Math.abs(e-t)<=xe);function ht(e,t,n,o,r){const i=void 0===n?ft[pe]():n,a=void 0===o?pt[qe]():o;switch(!0){case se&&gt(fe,i)||le&&gt(Re,a)||"init"===e:fe=i,Re=a;case e===O:$t(fe,Re,e,r);break;case!e!==S&&(se&&pe in d||le&&qe in d):wt(t);break;case e===M:case e===E:case e===j:D("No change in content size detected");break;default:V("No change in content size detected")}N=!1}let yt=!1;const bt=A((()=>ee(P(4)))),vt=Q(((e,t,n,o,r)=>{B=performance.now(),G(e),F||e===S?document.hidden?D("Page hidden - Ignored resize request"):(yt||(D(`Resize event: %c${t}`,p),N=!0,ht(e,t,n,o,r),requestAnimationFrame((()=>{yt=!1}))),yt=!0):V("Resizing disabled")}));function zt(e){fe=ft[pe](),Re=pt[qe](),$t(fe,Re,e)}function wt(e){const t=pe;pe=l,D(`Reset trigger event: %c${e}`,p),Ce?D("TriggerLock blocked calculation"):(Ce=!0,Z("Trigger event lock on"),requestAnimationFrame((()=>{Ce=!1,Z("Trigger event lock off")}))),zt("reset"),pe=t}const $t=Q((function(e,t,o,r,i){we<-1||(G(o),void 0!==i?D(`Message targetOrigin: %c${i}`,p):i=Te,function(){const a=`${Se}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(ke)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==we)throw e;return void bt()}else Ae.postMessage(c+a,i);N&&V(function(){const e=x(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),p),V("Sending message to host page via "+(ke?"sameOrigin":"postMessage")),V(`%c${a}`,n)}(),J())})),St=Q((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>$t(0,0,`${e}Stop`),r={init:function(){ye=e.data,Ae=e.source,I=e.origin,He(),ce=!1,setTimeout((()=>{he=!1}),128)},reset(){he?D("Page reset ignored by init"):(D("Page size reset by host page"),zt("resetPage"))},resize(){vt(S,"Parent window requested size check")},moveToAnchor(){be.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();D(`PageInfo received from parent: ${e}`),We?setTimeout((()=>We(n(e)))):o("pageInfo")},parentInfo(){const e=a();D(`ParentInfo received from parent: ${e}`),De?setTimeout((()=>De(t(n(e))))):o("parentInfo")},message(){const e=a();D(`onMessage called from parent: ${e}`),setTimeout((()=>Be(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(G(i()),!1!==ce?s()?r.init():D(`Ignored message of type "${i()}". Received before initialization.`):l())}));function Ot(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>St({data:e,sameOrigin:!0}))),k(window,"message",St),k(window,"readystatechange",Ot),Ot())}()}();
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};const{fromEntries:l,keys:c}=Object,d=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(c(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",g=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.5-beta.2",y=10,b="data-iframe-size",v="data-iframe-overflowed",z="data-iframe-ignore",w="bottom",$="right",S="resizeParent",O="setOffsetSize",M="resizeObserver",E="overflowObserver",j="mutationObserver",k=(e,t,n,o)=>e.addEventListener(t,n,o||!1),I=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(I[e]),A=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},T=e=>e,x=e=>Math.round(1e3*e)/1e3,C=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>""!=`${e}`&&void 0!==e;function R(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${C(t)}`)};let L=!0;const B=(F=function(n={}){const l={},c={},f=[],p={...a,expand:!n.collapsed||a.expanded,...n};let g;function h(){f.length=0}function y(){delete p.event,h()}const b=()=>!!f.some((([e])=>e in i))||!!p.expand;function v(){if(0!==f.length){console[b()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?g:""}`,e,t,o);for(const[e,...t]of f)console[e](...t);console.groupEnd(),y()}else y()}function z(){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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function w(e,...t){0===f.length&&z(),f.push([e,...t])}function $(e=r,...t){w("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...m(p,u(p)),...m(console,(e=>[e,(...t)=>w(e,...t)])),...m(s,d),count:function(e=r){c[e]?c[e]+=1:c[e]=1,w("log",`${e}: ${c[e]}`)},countReset:function(e=r){delete c[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;w("error",e)}return n},purge:h,time:function(e=r){l[e]=performance.now()},timeEnd:function(e=r){$(e),delete l[e]},timeLog:$}},F?.__esModule?F.default:F);var F;const W=B({label:"iframeResizer(child)"});const D=(H="log",(...e)=>!L||W[H](...e));var H;const V=D,{assert:U,debug:Z,endAutoGroup:J,error:_,errorBoundary:Q,event:G,purge:X,warn:Y}=W,K=e=>{return W.warn((t=T,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",se=[],le=new WeakSet,ce=e=>"object"==typeof e&&le.add(e);let de={},ue=0;const me=setInterval((()=>{if(se.length<10)return;if(de.hasTags&&de.len<25)return;se.sort();const e=Math.min(se.reduce(((e,t)=>e+t),0)/se.length,se[Math.floor(se.length/2)]),t=x(e);t>ue&&(ue=t,G("performanceObserver"),D("Mean time:",x(se[Math.floor(se.length/2)])),D("Median time:",x(se.reduce(((e,t)=>e+t),0)/se.length)),D("Average time:",t),D("Max time:",x(Math.max(...se)))),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);de=e.detail,se.push(t),se.length>100&&se.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ft.auto()),width:()=>(Y("Custom width calculation function not defined"),pt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,I,N,B,F=!0,H="",_=0,X="",te="",se=!0,le=!1,ce=!0,de=!1,ue=!1,me=!1,fe=1,pe=l,ge="",he=!0,ye="",be={},ve=!0,ze=!1,we=0,$e=!1,Se="",Oe=T,Me=[],Ee="child",je=null,ke=!1,Ie="",Pe=[],Ae=window.parent,Te="*",xe=0,Ce=!1,Ne="",Re=1,qe=u,Le=window,Be=()=>{Y("onMessage function not defined")},Fe=()=>{},We=null,De=null;function He(){var e,t,n;!function(){const e=e=>"true"===e,t=ye.slice(13).split(":");Se=t[0],_=void 0===t[1]?_:Number(t[1]),le=void 0===t[2]?le:e(t[2]),ze=void 0===t[3]?ze:e(t[3]),F=void 0===t[6]?F:e(t[6]),X=t[7],pe=void 0===t[8]?pe:t[8],H=t[9],te=t[10],xe=void 0===t[11]?xe:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),Ee=void 0===t[13]?Ee:t[13],qe=void 0===t[14]?qe:t[14],$e=void 0===t[15]?$e:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),se=void 0===t[18]?se:e(t[18]),t[19],Ne=t[20]||Ne,we=void 0===t[21]?we:Number(t[21]),ve=void 0===t[23]?ve:e(t[23])}(),e={id:Se,enabled:ze,expand:ve},W.label(`${e.id}`),W.expand(e.expand),L=e.enabled,D(`Initialising iframe v${h} ${window.location.href}`),function(){function e(e){D("Reading data from page:",e),Be=e?.onMessage||Be,Fe=e?.onReady||Fe,"number"==typeof e?.offset&&(re("offset","offsetSize"),se&&(m=e?.offset),le&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(se&&(m=e?.offsetSize),le&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ie=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(ge=e.ignoreSelector),Te=e?.targetOrigin||Te,pe=e?.heightCalculationMethod||pe,qe=e?.widthCalculationMethod||qe}function t(e,t){return"function"==typeof e&&(D(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===we)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),pe=t(pe,"height"),qe=t(qe,"width"),V(`Set targetOrigin for parent: %c${Te}`,p))}(),Ye(),function(){try{ke=1===we||"iframeParentListener"in window.parent}catch(e){D("Cross domain iframe detected")}}(),we<0?ee(`${P(we+2)}${P(2)}`):Ne.codePointAt(0)>4||we<2&&ee(P(3)),Ne&&""!==Ne&&"false"!==Ne?Ne!==h&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ne} - Child page: ${h}.\n`):K("<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"),tt(),nt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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</>.")}(),"BackCompat"===document.compatMode&&K("<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"),Ze(),1!==we&&(Le.parentIframe=Object.freeze({autoResize:e=>(q(e,"bool","parentIframe.autoResize(enable) enable"),!0===e&&!1===F?(F=!0,vt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),$t(0,0,"autoResize",JSON.stringify(F)),F),close(){$t(0,0,"close")},getId:()=>Se,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return We=e,$t(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");We=null,$t(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),De=e,$t(0,0,"parentInfo"),()=>{De=null,$t(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){wt("parentIframe.reset")},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,vt(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),$t(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),$t(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),$t(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),$t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){pe=e,tt()},setWidthCalculationMethod(e){qe=e,nt()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),D(`Set targetOrigin: %c${e}`,p),Te=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),vt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),Le.parentIFrame=Le.parentIframe),function(){function e(e){$t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){D(`Add event listener: %c${n}`,p),k(window.document,t,e)}!0===$e&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);D(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,p,g,p,g,p),$t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(D(`In page link (#${o}) not found in iFrame, so sending to parent`),$t(0,0,"inPageLink",`#${o}`)):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&k(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){k(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){D("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===we?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():D("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${_}px`),Ge("margin",(t="margin",(n=X).includes("-")&&(Y(`Negative CSS value ignored for ${t}`),n=""),n)),Ge("background",H),Ge("padding",te),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),D("Set HTML & body height: %cauto !important",p)}(),!0!==F&&D("Auto Resize disabled"),function(e){Ke({method:e,eventType:"After Print",eventName:"afterprint"}),Ke({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ke({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{D("Mutations observed:",t.length);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){Ye(),Je(e),e.forEach(it),e.clear()}function d(){G("mutationObserver");const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return D(`MutationObserver delay: %c${m}ms > ${f}ms`,p),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Ze(),Ve(),n=!1,vt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return D("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),D("Setup ResizeObserver"),je=new ResizeObserver(ot),je.observe(document.body),rt.add(document.body),it(document.body),se!==le&&(D("Setup OverflowObserver"),Oe=(e=>{const t=e.side||w,n=e.onChange||T,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||T,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){G("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c),c&&D("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(){const e=new window.MutationObserver((()=>{V("Detected changes in element attributes"),i(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[z],subtree:!0};D("Setup OverflowMutationObserver"),e.observe(t,n)}(),function(e){D("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):U(!n,"Node already observed",t)}}})({onChange:Ue,root:document.documentElement,side:se?w:$})),Je(lt(document)()),queueMicrotask(Fe),D("Initialization complete"),vt("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&$t(0,0,"title",document.title)}function Ve(){Me=document.querySelectorAll(`[${v}]:not([${z}]):not([${z}] *)`),ue=Me.length>0}function Ue(e){Ve(),(ue||e)&&(D("Observed Elements:",Me.length),vt(E,"Overflow updated"))}function Ze(){Pe=document.querySelectorAll(`[${b}]`),me=Pe.length>0,D(`Tagged elements found: %c${me}`,me?p:g)}function Je(e){me||Oe(e)}let _e=0;function Qe(){const n=document.querySelectorAll(`*[${z}]`);de=n.length>0,de&&n.length!==_e&&(function(n){const o=1===n.length?"":"s";Y(`%c[${z}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),_e=n.length)}function Ge(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),V(`Set body ${e}: %c${t}`,p))}function Xe(e,t,n){if(""!==n){D(`${e}: %c${n}`,p);for(const e of document.querySelectorAll(n))D(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ye(){Xe("sizeSelector",b,Ie),Xe("ignoreSelector",z,ge)}function Ke(e){({add(t){function n(){vt(e.eventName,e.eventType)}a[t]=n,k(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),D(`${C(e.method)} event listener: %c${e.eventType}`,p)}function et(e,t,n,o){return t!==e&&(e in n||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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 remove this option.`),D(`Set ${o} calculation method: %c${e}`,p)),e}function tt(){pe=et(pe,l,ft,"height")}function nt(){qe=et(qe,u,pt,"width")}function ot(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;vt(M,`Element resized <${R(t)}>`)}const rt=new WeakSet;function it(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!rt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}const t=lt(e)();for(const e of t){if(rt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}}function at(e){performance.mark(ie);const t=C(e);let n=0,r=document.documentElement,i=me?0:document.documentElement.getBoundingClientRect().bottom;const a=me?Pe:ue?Me:lt(document)();let l=a.length;for(const t of a)me||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return V(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:l,hasTags:me,logging:ze}}),i}const st=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],lt=e=>()=>{Qe();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return de&&t.push(`not([${z}])`,`not([${z}] *)`),e.querySelectorAll(t.join(":"))},ct={height:0,width:0},dt={height:0,width:0},ut=[p,g,p];function mt(e){function t(){return dt[o]=r,ct[o]=s,r}const n=e===ft,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),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case me:V("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ue&&0===dt[o]&&0===ct[o]:V(`Initial page size values: ${l}`,...ut),c=t();break;case Ce&&r===dt[o]&&s===ct[o]:V(`Size unchanged: ${l}`,...ut),c=Math.max(r,s);break;case 0===r:V(`Page is hidden: ${l}`,...ut),c=s;break;case!ue&&r!==dt[o]&&s<=ct[o]:V(`New <html> size: ${l} `,...ut),V(`Previous <html> size: %c${dt[o]}px`,p),c=t();break;case!n:c=e.taggedElement();break;case!ue&&r<dt[o]:V(`<html> size decreased: ${l}`,...ut),c=t();break;case s===a||s===i:V(`<html> size equals page size: ${l}`,...ut),c=t();break;case r>s:V(`Page size < <html> size: ${l}`,...ut),c=t();break;case ue:V("Found element overflowing <html> "),c=e.taggedElement();break;default:V(`Using <html> size: ${l}`,...ut),c=t()}return V(`Content ${o}: %c${c}px`,p),c+=function(e){const t=e.getOffset();return 0!==t&&V(`Page offsetSize: %c${t}px`,p),t}(e),c}const ft={enabled:()=>se,getOffset:()=>m,auto:()=>mt(ft),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ft.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...st(ft)),min:()=>Math.min(...st(ft)),grow:()=>ft.max(),lowestElement:()=>at(w),taggedElement:()=>at(w)},pt={enabled:()=>le,getOffset:()=>f,auto:()=>mt(pt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...st(pt)),min:()=>Math.min(...st(pt)),rightMostElement:()=>at($),scroll:()=>Math.max(pt.bodyScroll(),pt.documentElementScroll()),taggedElement:()=>at($)},gt=(e,t)=>!(Math.abs(e-t)<=xe);function ht(e,t,n,o,r){const i=void 0===n?ft[pe]():n,a=void 0===o?pt[qe]():o;switch(!0){case se&&gt(fe,i)||le&&gt(Re,a)||"init"===e:fe=i,Re=a;case e===O:$t(fe,Re,e,r);break;case!e!==S&&(se&&pe in d||le&&qe in d):wt(t);break;case e===M:case e===E:case e===j:D("No change in content size detected");break;default:V("No change in content size detected")}N=!1}let yt=!1;const bt=A((()=>ee(P(4)))),vt=Q(((e,t,n,o,r)=>{B=performance.now(),G(e),F||e===S?document.hidden?D("Page hidden - Ignored resize request"):(yt||(D(`Resize event: %c${t}`,p),N=!0,ht(e,t,n,o,r),requestAnimationFrame((()=>{yt=!1}))),yt=!0):V("Resizing disabled")}));function zt(e){fe=ft[pe](),Re=pt[qe](),$t(fe,Re,e)}function wt(e){const t=pe;pe=l,D(`Reset trigger event: %c${e}`,p),Ce?D("TriggerLock blocked calculation"):(Ce=!0,Z("Trigger event lock on"),requestAnimationFrame((()=>{Ce=!1,Z("Trigger event lock off")}))),zt("reset"),pe=t}const $t=Q((function(e,t,o,r,i){we<-1||(G(o),void 0!==i?D(`Message targetOrigin: %c${i}`,p):i=Te,function(){const a=`${Se}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(ke)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==we)throw e;return void bt()}else Ae.postMessage(c+a,i);N&&V(function(){const e=x(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),p),V("Sending message to host page via "+(ke?"sameOrigin":"postMessage")),V(`%c${a}`,n)}(),J())})),St=Q((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>$t(0,0,`${e}Stop`),r={init:function(){ye=e.data,Ae=e.source,I=e.origin,He(),ce=!1,setTimeout((()=>{he=!1}),128)},reset(){he?D("Page reset ignored by init"):(D("Page size reset by host page"),zt("resetPage"))},resize(){vt(S,"Parent window requested size check")},moveToAnchor(){be.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();D(`PageInfo received from parent: ${e}`),We?setTimeout((()=>We(n(e)))):o("pageInfo")},parentInfo(){const e=a();D(`ParentInfo received from parent: ${e}`),De?setTimeout((()=>De(t(n(e))))):o("parentInfo")},message(){const e=a();D(`onMessage called from parent: ${e}`),setTimeout((()=>Be(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(G(i()),!1!==ce?s()?r.init():D(`Ignored message of type "${i()}". Received before initialization.`):l())}));function Ot(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>St({data:e,sameOrigin:!0}))),k(window,"message",St),k(window,"readystatechange",Ot),Ot())}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.4.5-beta.1 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.5-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};const{fromEntries:l,keys:c}=Object,d=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(c(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",g=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.5-beta.1",y=10,b="data-iframe-size",v="data-iframe-overflowed",z="data-iframe-ignore",w="bottom",$="right",S="resizeParent",O="setOffsetSize",M="resizeObserver",E="overflowObserver",j="mutationObserver",k=(e,t,n,o)=>e.addEventListener(t,n,o||!1),I=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(I[e]),A=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},T=e=>e,x=e=>Math.round(1e3*e)/1e3,C=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>""!=`${e}`&&void 0!==e;function R(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${C(t)}`)};let L=!0;const B=(F=function(n={}){const l={},c={},f=[],p={...a,expand:!n.collapsed||a.expanded,...n};let g;function h(){f.length=0}function y(){delete p.event,h()}const b=()=>!!f.some((([e])=>e in i))||!!p.expand;function v(){if(0!==f.length){console[b()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?g:""}`,e,t,o);for(const[e,...t]of f)console[e](...t);console.groupEnd(),y()}else y()}function z(){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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function w(e,...t){0===f.length&&z(),f.push([e,...t])}function $(e=r,...t){w("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...m(p,u(p)),...m(console,(e=>[e,(...t)=>w(e,...t)])),...m(s,d),count:function(e=r){c[e]?c[e]+=1:c[e]=1,w("log",`${e}: ${c[e]}`)},countReset:function(e=r){delete c[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;w("error",e)}return n},purge:h,time:function(e=r){l[e]=performance.now()},timeEnd:function(e=r){$(e),delete l[e]},timeLog:$}},F?.__esModule?F.default:F);var F;const W=B({label:"iframeResizer(child)"});const D=(H="log",(...e)=>!L||W[H](...e));var H;const V=D,{assert:U,debug:Z,endAutoGroup:J,error:_,errorBoundary:Q,event:G,purge:X,warn:Y}=W,K=e=>{return W.warn((t=T,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",se=[],le=new WeakSet,ce=e=>"object"==typeof e&&le.add(e);let de={},ue=0;const me=setInterval((()=>{if(se.length<10)return;if(de.hasTags&&de.len<25)return;se.sort();const e=Math.min(se.reduce(((e,t)=>e+t),0)/se.length,se[Math.floor(se.length/2)]),t=x(e);t>ue&&(ue=t,G("performanceObserver"),D("Mean time:",x(se[Math.floor(se.length/2)])),D("Median time:",x(se.reduce(((e,t)=>e+t),0)/se.length)),D("Average time:",t),D("Max time:",x(Math.max(...se)))),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);de=e.detail,se.push(t),se.length>100&&se.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ft.auto()),width:()=>(Y("Custom width calculation function not defined"),pt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,I,N,B,F=!0,H="",_=0,X="",te="",se=!0,le=!1,ce=!0,de=!1,ue=!1,me=!1,fe=1,pe=l,ge="",he=!0,ye="",be={},ve=!0,ze=!1,we=0,$e=!1,Se="",Oe=T,Me=[],Ee="child",je=null,ke=!1,Ie="",Pe=[],Ae=window.parent,Te="*",xe=0,Ce=!1,Ne="",Re=1,qe=u,Le=window,Be=()=>{Y("onMessage function not defined")},Fe=()=>{},We=null,De=null;function He(){var e,t,n;!function(){const e=e=>"true"===e,t=ye.slice(13).split(":");Se=t[0],_=void 0===t[1]?_:Number(t[1]),le=void 0===t[2]?le:e(t[2]),ze=void 0===t[3]?ze:e(t[3]),F=void 0===t[6]?F:e(t[6]),X=t[7],pe=void 0===t[8]?pe:t[8],H=t[9],te=t[10],xe=void 0===t[11]?xe:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),Ee=void 0===t[13]?Ee:t[13],qe=void 0===t[14]?qe:t[14],$e=void 0===t[15]?$e:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),se=void 0===t[18]?se:e(t[18]),t[19],Ne=t[20]||Ne,we=void 0===t[21]?we:Number(t[21]),ve=void 0===t[23]?ve:e(t[23])}(),e={id:Se,enabled:ze,expand:ve},W.label(`${e.id}`),W.expand(e.expand),L=e.enabled,D(`Initialising iframe v${h} ${window.location.href}`),function(){function e(e){D("Reading data from page:",e),Be=e?.onMessage||Be,Fe=e?.onReady||Fe,"number"==typeof e?.offset&&(re("offset","offsetSize"),se&&(m=e?.offset),le&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(se&&(m=e?.offsetSize),le&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ie=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(ge=e.ignoreSelector),Te=e?.targetOrigin||Te,pe=e?.heightCalculationMethod||pe,qe=e?.widthCalculationMethod||qe}function t(e,t){return"function"==typeof e&&(D(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===we)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),pe=t(pe,"height"),qe=t(qe,"width"),V(`Set targetOrigin for parent: %c${Te}`,p))}(),Ye(),function(){try{ke=1===we||"iframeParentListener"in window.parent}catch(e){D("Cross domain iframe detected")}}(),we<0?ee(`${P(we+2)}${P(2)}`):Ne.codePointAt(0)>4||we<2&&ee(P(3)),Ne&&""!==Ne&&"false"!==Ne?Ne!==h&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ne} - Child page: ${h}.\n`):K("<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"),tt(),nt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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</>.")}(),"BackCompat"===document.compatMode&&K("<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"),Ze(),1!==we&&(Le.parentIframe=Object.freeze({autoResize:e=>(q(e,"bool","parentIframe.autoResize(enable) enable"),!0===e&&!1===F?(F=!0,vt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),$t(0,0,"autoResize",JSON.stringify(F)),F),close(){$t(0,0,"close")},getId:()=>Se,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return We=e,$t(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");We=null,$t(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),De=e,$t(0,0,"parentInfo"),()=>{De=null,$t(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){wt("parentIframe.reset")},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,vt(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),$t(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),$t(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),$t(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),$t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){pe=e,tt()},setWidthCalculationMethod(e){qe=e,nt()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),D(`Set targetOrigin: %c${e}`,p),Te=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),vt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),Le.parentIFrame=Le.parentIframe),function(){function e(e){$t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){D(`Add event listener: %c${n}`,p),k(window.document,t,e)}!0===$e&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);D(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,p,g,p,g,p),$t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(D(`In page link (#${o}) not found in iFrame, so sending to parent`),$t(0,0,"inPageLink",`#${o}`)):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&k(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){k(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){D("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===we?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():D("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${_}px`),Ge("margin",(t="margin",(n=X).includes("-")&&(Y(`Negative CSS value ignored for ${t}`),n=""),n)),Ge("background",H),Ge("padding",te),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),D("Set HTML & body height: %cauto !important",p)}(),!0!==F&&D("Auto Resize disabled"),function(e){Ke({method:e,eventType:"After Print",eventName:"afterprint"}),Ke({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ke({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{D("Mutations observed:",t.length);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){Ye(),Je(e),e.forEach(it),e.clear()}function d(){G("mutationObserver");const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return D(`MutationObserver delay: %c${m}ms > ${f}ms`,p),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Ze(),Ve(),n=!1,vt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return D("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),D("Setup ResizeObserver"),je=new ResizeObserver(ot),je.observe(document.body),rt.add(document.body),it(document.body),se!==le&&(D("Setup OverflowObserver"),Oe=(e=>{const t=e.side||w,n=e.onChange||T,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||T,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){G("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c),c&&D("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(){const e=new window.MutationObserver((()=>{V("Detected changes in element attributes"),i(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[z],subtree:!0};D("Setup OverflowMutationObserver"),e.observe(t,n)}(),function(e){D("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):U(!n,"Node already observed",t)}}})({onChange:Ue,root:document.documentElement,side:se?w:$})),Je(lt(document)()),queueMicrotask(Fe),D("Initialization complete"),vt("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&$t(0,0,"title",document.title)}function Ve(){Me=document.querySelectorAll(`[${v}]:not([${z}]):not([${z}] *)`),ue=Me.length>0}function Ue(e){Ve(),(ue||e)&&(D("Observed Elements:",Me.length),vt(E,"Overflow updated"))}function Ze(){Pe=document.querySelectorAll(`[${b}]`),me=Pe.length>0,D(`Tagged elements found: %c${me}`,me?p:g)}function Je(e){me||Oe(e)}let _e=0;function Qe(){const n=document.querySelectorAll(`*[${z}]`);de=n.length>0,de&&n.length!==_e&&(function(n){const o=1===n.length?"":"s";Y(`%c[${z}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),_e=n.length)}function Ge(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),V(`Set body ${e}: %c${t}`,p))}function Xe(e,t,n){if(""!==n){D(`${e}: %c${n}`,p);for(const e of document.querySelectorAll(n))D(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ye(){Xe("sizeSelector",b,Ie),Xe("ignoreSelector",z,ge)}function Ke(e){({add(t){function n(){vt(e.eventName,e.eventType)}a[t]=n,k(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),D(`${C(e.method)} event listener: %c${e.eventType}`,p)}function et(e,t,n,o){return t!==e&&(e in n||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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 remove this option.`),D(`Set ${o} calculation method: %c${e}`,p)),e}function tt(){pe=et(pe,l,ft,"height")}function nt(){qe=et(qe,u,pt,"width")}function ot(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;vt(M,`Element resized <${R(t)}>`)}const rt=new WeakSet;function it(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!rt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}const t=lt(e)();for(const e of t){if(rt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}}function at(e){performance.mark(ie);const t=C(e);let n=0,r=document.documentElement,i=me?0:document.documentElement.getBoundingClientRect().bottom;const a=me?Pe:ue?Me:lt(document)();let l=a.length;for(const t of a)me||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return V(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:l,hasTags:me,logging:ze}}),i}const st=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],lt=e=>()=>{Qe();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return de&&t.push(`not([${z}])`,`not([${z}] *)`),e.querySelectorAll(t.join(":"))},ct={height:0,width:0},dt={height:0,width:0},ut=[p,g,p];function mt(e){function t(){return dt[o]=r,ct[o]=s,r}const n=e===ft,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),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case me:V("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ue&&0===dt[o]&&0===ct[o]:V(`Initial page size values: ${l}`,...ut),c=t();break;case Ce&&r===dt[o]&&s===ct[o]:V(`Size unchanged: ${l}`,...ut),c=Math.max(r,s);break;case 0===r:V(`Page is hidden: ${l}`,...ut),c=s;break;case!ue&&r!==dt[o]&&s<=ct[o]:V(`New <html> size: ${l} `,...ut),V(`Previous <html> size: %c${dt[o]}px`,p),c=t();break;case!n:c=e.taggedElement();break;case!ue&&r<dt[o]:V(`<html> size decreased: ${l}`,...ut),c=t();break;case s===a||s===i:V(`<html> size equals page size: ${l}`,...ut),c=t();break;case r>s:V(`Page size < <html> size: ${l}`,...ut),c=t();break;case ue:V("Found element overflowing <html> "),c=e.taggedElement();break;default:V(`Using <html> size: ${l}`,...ut),c=t()}return V(`Content ${o}: %c${c}px`,p),c+=function(e){const t=e.getOffset();return 0!==t&&V(`Page offsetSize: %c${t}px`,p),t}(e),c}const ft={enabled:()=>se,getOffset:()=>m,auto:()=>mt(ft),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ft.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...st(ft)),min:()=>Math.min(...st(ft)),grow:()=>ft.max(),lowestElement:()=>at(w),taggedElement:()=>at(w)},pt={enabled:()=>le,getOffset:()=>f,auto:()=>mt(pt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...st(pt)),min:()=>Math.min(...st(pt)),rightMostElement:()=>at($),scroll:()=>Math.max(pt.bodyScroll(),pt.documentElementScroll()),taggedElement:()=>at($)},gt=(e,t)=>!(Math.abs(e-t)<=xe);function ht(e,t,n,o,r){const i=void 0===n?ft[pe]():n,a=void 0===o?pt[qe]():o;switch(!0){case se&&gt(fe,i)||le&&gt(Re,a)||"init"===e:fe=i,Re=a;case e===O:$t(fe,Re,e,r);break;case!e!==S&&(se&&pe in d||le&&qe in d):wt(t);break;case e===M:case e===E:case e===j:D("No change in content size detected");break;default:V("No change in content size detected")}N=!1}let yt=!1;const bt=A((()=>ee(P(4)))),vt=Q(((e,t,n,o,r)=>{B=performance.now(),G(e),F||e===S?document.hidden?D("Page hidden - Ignored resize request"):(yt||(D(`Resize event: %c${t}`,p),N=!0,ht(e,t,n,o,r),requestAnimationFrame((()=>{yt=!1}))),yt=!0):V("Resizing disabled")}));function zt(e){fe=ft[pe](),Re=pt[qe](),$t(fe,Re,e)}function wt(e){const t=pe;pe=l,D(`Reset trigger event: %c${e}`,p),Ce?D("TriggerLock blocked calculation"):(Ce=!0,Z("Trigger event lock on"),requestAnimationFrame((()=>{Ce=!1,Z("Trigger event lock off")}))),zt("reset"),pe=t}const $t=Q((function(e,t,o,r,i){we<-1||(G(o),void 0!==i?D(`Message targetOrigin: %c${i}`,p):i=Te,function(){const a=`${Se}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(ke)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==we)throw e;return void bt()}else Ae.postMessage(c+a,i);N&&V(function(){const e=x(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),p),V("Sending message to host page via "+(ke?"sameOrigin":"postMessage")),V(`%c${a}`,n)}(),J())})),St=Q((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>$t(0,0,`${e}Stop`),r={init:function(){ye=e.data,Ae=e.source,I=e.origin,He(),ce=!1,setTimeout((()=>{he=!1}),128)},reset(){he?D("Page reset ignored by init"):(D("Page size reset by host page"),zt("resetPage"))},resize(){vt(S,"Parent window requested size check")},moveToAnchor(){be.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();D(`PageInfo received from parent: ${e}`),We?setTimeout((()=>We(n(e)))):o("pageInfo")},parentInfo(){const e=a();D(`ParentInfo received from parent: ${e}`),De?setTimeout((()=>De(t(n(e))))):o("parentInfo")},message(){const e=a();D(`onMessage called from parent: ${e}`),setTimeout((()=>Be(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(G(i()),!1!==ce?s()?r.init():D(`Ignored message of type "${i()}". Received before initialization.`):l())}));function Ot(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>St({data:e,sameOrigin:!0}))),k(window,"message",St),k(window,"readystatechange",Ot),Ot())}()}();
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};const{fromEntries:l,keys:c}=Object,d=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(c(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",g=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.5-beta.2",y=10,b="data-iframe-size",v="data-iframe-overflowed",z="data-iframe-ignore",w="bottom",$="right",S="resizeParent",O="setOffsetSize",M="resizeObserver",E="overflowObserver",j="mutationObserver",k=(e,t,n,o)=>e.addEventListener(t,n,o||!1),I=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(I[e]),A=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},T=e=>e,x=e=>Math.round(1e3*e)/1e3,C=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>""!=`${e}`&&void 0!==e;function R(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${C(t)}`)};let L=!0;const B=(F=function(n={}){const l={},c={},f=[],p={...a,expand:!n.collapsed||a.expanded,...n};let g;function h(){f.length=0}function y(){delete p.event,h()}const b=()=>!!f.some((([e])=>e in i))||!!p.expand;function v(){if(0!==f.length){console[b()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?g:""}`,e,t,o);for(const[e,...t]of f)console[e](...t);console.groupEnd(),y()}else y()}function z(){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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function w(e,...t){0===f.length&&z(),f.push([e,...t])}function $(e=r,...t){w("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...m(p,u(p)),...m(console,(e=>[e,(...t)=>w(e,...t)])),...m(s,d),count:function(e=r){c[e]?c[e]+=1:c[e]=1,w("log",`${e}: ${c[e]}`)},countReset:function(e=r){delete c[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;w("error",e)}return n},purge:h,time:function(e=r){l[e]=performance.now()},timeEnd:function(e=r){$(e),delete l[e]},timeLog:$}},F?.__esModule?F.default:F);var F;const W=B({label:"iframeResizer(child)"});const D=(H="log",(...e)=>!L||W[H](...e));var H;const V=D,{assert:U,debug:Z,endAutoGroup:J,error:_,errorBoundary:Q,event:G,purge:X,warn:Y}=W,K=e=>{return W.warn((t=T,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",se=[],le=new WeakSet,ce=e=>"object"==typeof e&&le.add(e);let de={},ue=0;const me=setInterval((()=>{if(se.length<10)return;if(de.hasTags&&de.len<25)return;se.sort();const e=Math.min(se.reduce(((e,t)=>e+t),0)/se.length,se[Math.floor(se.length/2)]),t=x(e);t>ue&&(ue=t,G("performanceObserver"),D("Mean time:",x(se[Math.floor(se.length/2)])),D("Median time:",x(se.reduce(((e,t)=>e+t),0)/se.length)),D("Average time:",t),D("Max time:",x(Math.max(...se)))),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);de=e.detail,se.push(t),se.length>100&&se.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ft.auto()),width:()=>(Y("Custom width calculation function not defined"),pt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,I,N,B,F=!0,H="",_=0,X="",te="",se=!0,le=!1,ce=!0,de=!1,ue=!1,me=!1,fe=1,pe=l,ge="",he=!0,ye="",be={},ve=!0,ze=!1,we=0,$e=!1,Se="",Oe=T,Me=[],Ee="child",je=null,ke=!1,Ie="",Pe=[],Ae=window.parent,Te="*",xe=0,Ce=!1,Ne="",Re=1,qe=u,Le=window,Be=()=>{Y("onMessage function not defined")},Fe=()=>{},We=null,De=null;function He(){var e,t,n;!function(){const e=e=>"true"===e,t=ye.slice(13).split(":");Se=t[0],_=void 0===t[1]?_:Number(t[1]),le=void 0===t[2]?le:e(t[2]),ze=void 0===t[3]?ze:e(t[3]),F=void 0===t[6]?F:e(t[6]),X=t[7],pe=void 0===t[8]?pe:t[8],H=t[9],te=t[10],xe=void 0===t[11]?xe:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),Ee=void 0===t[13]?Ee:t[13],qe=void 0===t[14]?qe:t[14],$e=void 0===t[15]?$e:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),se=void 0===t[18]?se:e(t[18]),t[19],Ne=t[20]||Ne,we=void 0===t[21]?we:Number(t[21]),ve=void 0===t[23]?ve:e(t[23])}(),e={id:Se,enabled:ze,expand:ve},W.label(`${e.id}`),W.expand(e.expand),L=e.enabled,D(`Initialising iframe v${h} ${window.location.href}`),function(){function e(e){D("Reading data from page:",e),Be=e?.onMessage||Be,Fe=e?.onReady||Fe,"number"==typeof e?.offset&&(re("offset","offsetSize"),se&&(m=e?.offset),le&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(se&&(m=e?.offsetSize),le&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ie=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(ge=e.ignoreSelector),Te=e?.targetOrigin||Te,pe=e?.heightCalculationMethod||pe,qe=e?.widthCalculationMethod||qe}function t(e,t){return"function"==typeof e&&(D(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===we)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),pe=t(pe,"height"),qe=t(qe,"width"),V(`Set targetOrigin for parent: %c${Te}`,p))}(),Ye(),function(){try{ke=1===we||"iframeParentListener"in window.parent}catch(e){D("Cross domain iframe detected")}}(),we<0?ee(`${P(we+2)}${P(2)}`):Ne.codePointAt(0)>4||we<2&&ee(P(3)),Ne&&""!==Ne&&"false"!==Ne?Ne!==h&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ne} - Child page: ${h}.\n`):K("<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"),tt(),nt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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</>.")}(),"BackCompat"===document.compatMode&&K("<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"),Ze(),1!==we&&(Le.parentIframe=Object.freeze({autoResize:e=>(q(e,"bool","parentIframe.autoResize(enable) enable"),!0===e&&!1===F?(F=!0,vt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),$t(0,0,"autoResize",JSON.stringify(F)),F),close(){$t(0,0,"close")},getId:()=>Se,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return We=e,$t(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");We=null,$t(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),De=e,$t(0,0,"parentInfo"),()=>{De=null,$t(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){wt("parentIframe.reset")},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,vt(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),$t(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),$t(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),$t(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),$t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){pe=e,tt()},setWidthCalculationMethod(e){qe=e,nt()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),D(`Set targetOrigin: %c${e}`,p),Te=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),vt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),Le.parentIFrame=Le.parentIframe),function(){function e(e){$t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){D(`Add event listener: %c${n}`,p),k(window.document,t,e)}!0===$e&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);D(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,p,g,p,g,p),$t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(D(`In page link (#${o}) not found in iFrame, so sending to parent`),$t(0,0,"inPageLink",`#${o}`)):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&k(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){k(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){D("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===we?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():D("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${_}px`),Ge("margin",(t="margin",(n=X).includes("-")&&(Y(`Negative CSS value ignored for ${t}`),n=""),n)),Ge("background",H),Ge("padding",te),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),D("Set HTML & body height: %cauto !important",p)}(),!0!==F&&D("Auto Resize disabled"),function(e){Ke({method:e,eventType:"After Print",eventName:"afterprint"}),Ke({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ke({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{D("Mutations observed:",t.length);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let l=1;function c(e){Ye(),Je(e),e.forEach(it),e.clear()}function d(){G("mutationObserver");const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return D(`MutationObserver delay: %c${m}ms > ${f}ms`,p),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Ze(),Ve(),n=!1,vt(j,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return D("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),D("Setup ResizeObserver"),je=new ResizeObserver(ot),je.observe(document.body),rt.add(document.body),it(document.body),se!==le&&(D("Setup OverflowObserver"),Oe=(e=>{const t=e.side||w,n=e.onChange||T,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||T,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){G("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c),c&&D("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(){const e=new window.MutationObserver((()=>{V("Detected changes in element attributes"),i(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[z],subtree:!0};D("Setup OverflowMutationObserver"),e.observe(t,n)}(),function(e){D("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):U(!n,"Node already observed",t)}}})({onChange:Ue,root:document.documentElement,side:se?w:$})),Je(lt(document)()),queueMicrotask(Fe),D("Initialization complete"),vt("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&$t(0,0,"title",document.title)}function Ve(){Me=document.querySelectorAll(`[${v}]:not([${z}]):not([${z}] *)`),ue=Me.length>0}function Ue(e){Ve(),(ue||e)&&(D("Observed Elements:",Me.length),vt(E,"Overflow updated"))}function Ze(){Pe=document.querySelectorAll(`[${b}]`),me=Pe.length>0,D(`Tagged elements found: %c${me}`,me?p:g)}function Je(e){me||Oe(e)}let _e=0;function Qe(){const n=document.querySelectorAll(`*[${z}]`);de=n.length>0,de&&n.length!==_e&&(function(n){const o=1===n.length?"":"s";Y(`%c[${z}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),_e=n.length)}function Ge(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),V(`Set body ${e}: %c${t}`,p))}function Xe(e,t,n){if(""!==n){D(`${e}: %c${n}`,p);for(const e of document.querySelectorAll(n))D(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ye(){Xe("sizeSelector",b,Ie),Xe("ignoreSelector",z,ge)}function Ke(e){({add(t){function n(){vt(e.eventName,e.eventType)}a[t]=n,k(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),D(`${C(e.method)} event listener: %c${e.eventType}`,p)}function et(e,t,n,o){return t!==e&&(e in n||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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 remove this option.`),D(`Set ${o} calculation method: %c${e}`,p)),e}function tt(){pe=et(pe,l,ft,"height")}function nt(){qe=et(qe,u,pt,"width")}function ot(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;vt(M,`Element resized <${R(t)}>`)}const rt=new WeakSet;function it(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!rt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}const t=lt(e)();for(const e of t){if(rt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(je.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}}function at(e){performance.mark(ie);const t=C(e);let n=0,r=document.documentElement,i=me?0:document.documentElement.getBoundingClientRect().bottom;const a=me?Pe:ue?Me:lt(document)();let l=a.length;for(const t of a)me||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return V(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:l,hasTags:me,logging:ze}}),i}const st=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],lt=e=>()=>{Qe();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return de&&t.push(`not([${z}])`,`not([${z}] *)`),e.querySelectorAll(t.join(":"))},ct={height:0,width:0},dt={height:0,width:0},ut=[p,g,p];function mt(e){function t(){return dt[o]=r,ct[o]=s,r}const n=e===ft,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),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case me:V("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ue&&0===dt[o]&&0===ct[o]:V(`Initial page size values: ${l}`,...ut),c=t();break;case Ce&&r===dt[o]&&s===ct[o]:V(`Size unchanged: ${l}`,...ut),c=Math.max(r,s);break;case 0===r:V(`Page is hidden: ${l}`,...ut),c=s;break;case!ue&&r!==dt[o]&&s<=ct[o]:V(`New <html> size: ${l} `,...ut),V(`Previous <html> size: %c${dt[o]}px`,p),c=t();break;case!n:c=e.taggedElement();break;case!ue&&r<dt[o]:V(`<html> size decreased: ${l}`,...ut),c=t();break;case s===a||s===i:V(`<html> size equals page size: ${l}`,...ut),c=t();break;case r>s:V(`Page size < <html> size: ${l}`,...ut),c=t();break;case ue:V("Found element overflowing <html> "),c=e.taggedElement();break;default:V(`Using <html> size: ${l}`,...ut),c=t()}return V(`Content ${o}: %c${c}px`,p),c+=function(e){const t=e.getOffset();return 0!==t&&V(`Page offsetSize: %c${t}px`,p),t}(e),c}const ft={enabled:()=>se,getOffset:()=>m,auto:()=>mt(ft),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ft.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...st(ft)),min:()=>Math.min(...st(ft)),grow:()=>ft.max(),lowestElement:()=>at(w),taggedElement:()=>at(w)},pt={enabled:()=>le,getOffset:()=>f,auto:()=>mt(pt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...st(pt)),min:()=>Math.min(...st(pt)),rightMostElement:()=>at($),scroll:()=>Math.max(pt.bodyScroll(),pt.documentElementScroll()),taggedElement:()=>at($)},gt=(e,t)=>!(Math.abs(e-t)<=xe);function ht(e,t,n,o,r){const i=void 0===n?ft[pe]():n,a=void 0===o?pt[qe]():o;switch(!0){case se&&gt(fe,i)||le&&gt(Re,a)||"init"===e:fe=i,Re=a;case e===O:$t(fe,Re,e,r);break;case!e!==S&&(se&&pe in d||le&&qe in d):wt(t);break;case e===M:case e===E:case e===j:D("No change in content size detected");break;default:V("No change in content size detected")}N=!1}let yt=!1;const bt=A((()=>ee(P(4)))),vt=Q(((e,t,n,o,r)=>{B=performance.now(),G(e),F||e===S?document.hidden?D("Page hidden - Ignored resize request"):(yt||(D(`Resize event: %c${t}`,p),N=!0,ht(e,t,n,o,r),requestAnimationFrame((()=>{yt=!1}))),yt=!0):V("Resizing disabled")}));function zt(e){fe=ft[pe](),Re=pt[qe](),$t(fe,Re,e)}function wt(e){const t=pe;pe=l,D(`Reset trigger event: %c${e}`,p),Ce?D("TriggerLock blocked calculation"):(Ce=!0,Z("Trigger event lock on"),requestAnimationFrame((()=>{Ce=!1,Z("Trigger event lock off")}))),zt("reset"),pe=t}const $t=Q((function(e,t,o,r,i){we<-1||(G(o),void 0!==i?D(`Message targetOrigin: %c${i}`,p):i=Te,function(){const a=`${Se}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(ke)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==we)throw e;return void bt()}else Ae.postMessage(c+a,i);N&&V(function(){const e=x(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),p),V("Sending message to host page via "+(ke?"sameOrigin":"postMessage")),V(`%c${a}`,n)}(),J())})),St=Q((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>$t(0,0,`${e}Stop`),r={init:function(){ye=e.data,Ae=e.source,I=e.origin,He(),ce=!1,setTimeout((()=>{he=!1}),128)},reset(){he?D("Page reset ignored by init"):(D("Page size reset by host page"),zt("resetPage"))},resize(){vt(S,"Parent window requested size check")},moveToAnchor(){be.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();D(`PageInfo received from parent: ${e}`),We?setTimeout((()=>We(n(e)))):o("pageInfo")},parentInfo(){const e=a();D(`ParentInfo received from parent: ${e}`),De?setTimeout((()=>De(t(n(e))))):o("parentInfo")},message(){const e=a();D(`onMessage called from parent: ${e}`),setTimeout((()=>Be(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(G(i()),!1!==ce?s()?r.init():D(`Ignored message of type "${i()}". Received before initialization.`):l())}));function Ot(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>St({data:e,sameOrigin:!0}))),k(window,"message",St),k(window,"readystatechange",Ot),Ot())}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.min.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.5-beta.1 (umd) - 2025-04-08
4
+ * @module iframe-resizer/legacy (parent) 5.4.5-beta.2 (umd) - 2025-04-08
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(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t="font-style: italic;",n=e+t,i="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),r={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:s,keys:l}=Object,c=e=>[e,console[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.1",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,M=(E=function(t={}){const s={},l={},f=[],p={...r,expand:!t.collapsed||r.expanded,...t};let h;function m(){f.length=0}function g(){delete p.event,m()}const y=()=>!!f.some((([e])=>e in o))||!!p.expand;function w(){if(0!==f.length){console[y()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?h:""}`,e,"font-weight: bold;",n);for(const[e,...t]of f)console[e](...t);console.groupEnd(),g()}else g()}function b(){h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(w)))}function v(e,...t){0===f.length&&b(),f.push([e,...t])}function z(e=i,...t){v("log",`${e}: ${performance.now()-s[e]} ms`,...t)}return{...u(p,d(p)),...u(console,(e=>[e,(...t)=>v(e,...t)])),...u(a,c),count:function(e=i){l[e]?l[e]+=1:l[e]=1,v("log",`${e}: ${l[e]}`)},countReset:function(e=i){delete l[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;v("error",e)}return n},purge:m,time:function(e=i){s[e]=performance.now()},timeEnd:function(e=i){z(e),delete s[e]},timeLog:z}},E?.__esModule?E.default:E);var E;let R={},I=!1;const O=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:I)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("errorBoundary");const H=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),B=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(H),D=B("Function"),q=B("Option"),U=(e,t,n,i)=>e.addEventListener(t,n,i||!1),J=(e,t,n)=>e.removeEventListener(t,n,!1),V=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Z=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),G=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Y=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),_=e=>Z(G[e]),Q=e=>{const t=e[Z("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=V(Z(e));return n in Y&&(t=Y[n]),t}(n[0]);return 0===i||(e=>e[2]===V(e[0]+e[1]))(n)||(i=-2),i},K={},ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof K[e.id].onInit&&(q("init()","onReady()","",e.id),K[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),te={position:null,version:m};function ne(e){function n(){de(x),le(M),j("onResized",x)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const r=e=>T.slice(T.indexOf(":")+7+e);const a=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){fe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},s=(e,t)=>()=>{let n=!1;const i=t=>()=>{K[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e} listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){a("Remove ",J),c.disconnect(),d.disconnect()}const l=M,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));a("Add ",U),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(K[l].iframe,{attributes:!0,childList:!1,subtree:!1}),K[l]&&(K[l][`stop${t}`]=s)},l=e=>()=>{e in K[M]&&(K[M][e](),delete K[M][e])},c=a("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),d=a("parentInfo",(function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=s(c,"PageInfo"),f=s(d,"ParentInfo"),g=l("stopPageInfo"),w=l("stopParentInfo");function b(e){const t=e.getBoundingClientRect();return ae(M),{x:Number(t.left)+Number(te.position.x),y:Number(t.top)+Number(te.position.y)}}function v(e){const t=e?b(x.iframe):{x:0,y:0};W(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){te.position=e,z(M)}(n)}function z(e){const{x:t,y:n}=te.position,i=K[e]?.iframe;!1!==j("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?le(e):se()}function $(e){let t={};if(0===x.width&&0===x.height){const e=r(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};j(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const j=(e,t)=>ie(M,e,t);function k(){switch(K[M]?.firstRun&&K[M]&&(K[M].firstRun=!1),x.type){case"close":re(x.iframe);break;case"message":i=r(6),C(M,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${i}}`,p,h,t),j("onMessage",{iframe:x.iframe,message:JSON.parse(i)});break;case"mouseenter":$("onMouseEnter");break;case"mouseleave":$("onMouseLeave");break;case"autoResize":K[M].autoResize=JSON.parse(r(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;W(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":v(!1);break;case"scrollToOffset":v(!0);break;case"pageInfo":c("start",M),u();break;case"parentInfo":d("start",M),f();break;case"pageInfoStop":g();break;case"parentInfoStop":w();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=b(i);W(M,`Moving to in page link: %c#${t}`,p),te.position={x:e.x,y:e.y},z(M),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(M,`In page link #${t} not found and window.parentIframe not found`)}():C(M,`In page link #${t} not found`)}(r(9));break;case"title":!function(e,t){K[t]?.syncTitle&&(K[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(x.msg,M);break;case"reset":ce(x);break;case"init":n(),function(e){try{K[e].sameOrigin=!!K[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){K[e].sameOrigin=!1}C(e,`sameOrigin: %c${K[e].sameOrigin}`,p)}(M),(e=x.msg)!==m&&(void 0!==e?C(M,`Version mismatch (Child: %c${e}%c !== Parent: %c${m})`,p,h,p):H(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),me=!0,j("onReady",x.iframe);break;default:if(0===x.width&&0===x.height)return void F(M,`Unsupported message received (${x.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===x.width||0===x.height)return void C(M,"Ignoring message with 0 height or width");if(document.hidden)return void C(M,"Page hidden - ignored resize request");n()}var e,i}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?y===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in K?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,n=K[e[0]]?.iframe,r=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),M=x.id,M?(N(M,x.type),P(M,(function(){!function(e){if(!K[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&C(M,"Ignoring init message from meta parent page"),e}()||(C(M,`Received: %c${T}`,t),K[M].loaded=!0,(null!==x.iframe||(F(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=K[M]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(M,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=K[M]?.remoteHost;return C(M,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&k())}))()):F("","iframeResizer received messageData without id, message was: ",T)):null!==M&&C(M,"Ignored:",T):Object.keys(K).forEach((e=>{K[e].mode>=0&&fe("iFrame requested init",pe(e),e)}))}function ie(e,t,n){let i=null,o=null;if(K[e]){if(i=K[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function oe(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete K[t],delete e.iframeResizer}function re(e){const{id:t}=e;if(!1!==ie(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}ie(t,"onClosed",t),oe(e)}else C(t,"Close iframe cancelled by onClose event")}function ae(e){null===te.position&&(te.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p))}function se(){te.position=null}function le(e){null!==te.position&&(window.scrollTo(te.position.x,te.position.y),W(e,`Set page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p),se())}function ce(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),ae(e.id),de(e),fe("reset","reset",e.id)}function de(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=K[n];i&&t("height"),o&&t("width")}R=K;const ue=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function fe(e,n,i,o){function r(o){const r=e in z?ue(n):n;W(i,o,p,h,p),W(i,`%c${r}`,t)}N(i,e),K[i]&&(K[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:o,targetOrigin:a}=K[i];if(o)try{return e.contentWindow.iframeChildListener(y+n),void r(`Sending message to iframe %c${i}%c via sameOrigin`)}catch(e){C(i,"Same domain connection failed. Trying cross domain%c")}r(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),t.postMessage(y+n,a)}():F(i,`Iframe(${i}) not found`),o&&K[i]?.warningTimeout&&(K[i].msgTimeout=setTimeout((function(){if(void 0===K[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=K[i],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||n||(K[i].loadErrorShown=!0,H(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${K[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),K[i].warningTimeout)))}function pe(e){const t=K[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,te.version,t.mode,"",t.logExpand].join(":")}let he=0,me=!1,ge=!1;const ye=t=>n=>{function i(){if(K[u]){const{iframe:e}=K[u],t={close:re.bind(null,e),disconnect:oe.bind(null,e),removeListeners(){H(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:fe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),fe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){fe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=K[t];-1!==i&&-2!==i&&(U(n,"load",(function(){fe(b,`${e}:${me}`,t,!0),function(){const e=K[u]?.firstRun,t=K[u]?.heightCalculationMethod in w;!e&&t&&ce({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&fe(v,`${e}:${me}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&H(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=K[u];n<0?H("Parent",`${_(n+2)}${_(2)}`):(ge||n>0&&t.vInfoDisable||(ge=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,I||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>Z(X[e]))(n)})`,n)),n<1&&H("Parent",_(3)))}function s(e){const t=K[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;K[u]={...K[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...ee,...r(e),mouseEvents:l(e),mode:Q(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=K[u];if("horizontal"===e)return K[u].sizeWidth=!0,K[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return K[u].sizeWidth=!1,K[u].sizeHeight=!1,K[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===K[u].direction?(K[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(K[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&H(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===K[u].postMessageTarget&&(K[u].postMessageTarget=n.contentWindow),K[u].targetOrigin=!0===K[u].checkOrigin?""===(i=K[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||ee.id+he++;return null!==document.getElementById(e)&&(e+=he++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:ee.log;t.logExpand=n&&i?t.log===$:ee.logExpand,function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=M({expand:t,label:O(n)});I=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),P(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),be(),function(){switch(C(u,`Iframe scrolling ${K[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===K[u]?.scrolling?"hidden":"auto",K[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=K[u]?K[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=K[u];"number"!=typeof e&&"0"!==e||(K[u].bodyMargin=`${e}px`)}(),o(pe(u)),i())}))(t),n?.iFrameResizer};function we(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>K[e]?.autoResize&&!K[e]?.firstRun;Object.keys(K).forEach((function(i){n(i)&&fe(e,t,i)}))}("Tab Visible","resize"))}const be=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{U(window,"message",ne),U(document,"visibilitychange",we),window.iframeParentListener=e=>setTimeout((()=>ne({data:e,sameOrigin:!0})))})),ve=`[${g}] `;const ze=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ve}iframe is not defined`);case!e.tagName:throw new TypeError(`${ve}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ve}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=ye(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ve}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){D("iFrameResize()","iframeResize()","","parent"),ze(...e)}),ze}));
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t="font-style: italic;",n=e+t,i="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),r={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:s,keys:l}=Object,c=e=>[e,console[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.2",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,M=(E=function(t={}){const s={},l={},f=[],p={...r,expand:!t.collapsed||r.expanded,...t};let h;function m(){f.length=0}function g(){delete p.event,m()}const y=()=>!!f.some((([e])=>e in o))||!!p.expand;function w(){if(0!==f.length){console[y()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?h:""}`,e,"font-weight: bold;",n);for(const[e,...t]of f)console[e](...t);console.groupEnd(),g()}else g()}function b(){h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(w)))}function v(e,...t){0===f.length&&b(),f.push([e,...t])}function z(e=i,...t){v("log",`${e}: ${performance.now()-s[e]} ms`,...t)}return{...u(p,d(p)),...u(console,(e=>[e,(...t)=>v(e,...t)])),...u(a,c),count:function(e=i){l[e]?l[e]+=1:l[e]=1,v("log",`${e}: ${l[e]}`)},countReset:function(e=i){delete l[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;v("error",e)}return n},purge:m,time:function(e=i){s[e]=performance.now()},timeEnd:function(e=i){z(e),delete s[e]},timeLog:z}},E?.__esModule?E.default:E);var E;let R={},I=!1;const O=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:I)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("errorBoundary");const H=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),B=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(H),D=B("Function"),q=B("Option"),U=(e,t,n,i)=>e.addEventListener(t,n,i||!1),J=(e,t,n)=>e.removeEventListener(t,n,!1),V=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Z=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),G=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Y=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),_=e=>Z(G[e]),Q=e=>{const t=e[Z("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=V(Z(e));return n in Y&&(t=Y[n]),t}(n[0]);return 0===i||(e=>e[2]===V(e[0]+e[1]))(n)||(i=-2),i},K={},ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof K[e.id].onInit&&(q("init()","onReady()","",e.id),K[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),te={position:null,version:m};function ne(e){function n(){de(x),le(M),j("onResized",x)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const r=e=>T.slice(T.indexOf(":")+7+e);const a=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){fe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},s=(e,t)=>()=>{let n=!1;const i=t=>()=>{K[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e} listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){a("Remove ",J),c.disconnect(),d.disconnect()}const l=M,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));a("Add ",U),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(K[l].iframe,{attributes:!0,childList:!1,subtree:!1}),K[l]&&(K[l][`stop${t}`]=s)},l=e=>()=>{e in K[M]&&(K[M][e](),delete K[M][e])},c=a("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),d=a("parentInfo",(function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=s(c,"PageInfo"),f=s(d,"ParentInfo"),g=l("stopPageInfo"),w=l("stopParentInfo");function b(e){const t=e.getBoundingClientRect();return ae(M),{x:Number(t.left)+Number(te.position.x),y:Number(t.top)+Number(te.position.y)}}function v(e){const t=e?b(x.iframe):{x:0,y:0};W(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){te.position=e,z(M)}(n)}function z(e){const{x:t,y:n}=te.position,i=K[e]?.iframe;!1!==j("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?le(e):se()}function $(e){let t={};if(0===x.width&&0===x.height){const e=r(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};j(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const j=(e,t)=>ie(M,e,t);function k(){switch(K[M]?.firstRun&&K[M]&&(K[M].firstRun=!1),x.type){case"close":re(x.iframe);break;case"message":i=r(6),C(M,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${i}}`,p,h,t),j("onMessage",{iframe:x.iframe,message:JSON.parse(i)});break;case"mouseenter":$("onMouseEnter");break;case"mouseleave":$("onMouseLeave");break;case"autoResize":K[M].autoResize=JSON.parse(r(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;W(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":v(!1);break;case"scrollToOffset":v(!0);break;case"pageInfo":c("start",M),u();break;case"parentInfo":d("start",M),f();break;case"pageInfoStop":g();break;case"parentInfoStop":w();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=b(i);W(M,`Moving to in page link: %c#${t}`,p),te.position={x:e.x,y:e.y},z(M),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(M,`In page link #${t} not found and window.parentIframe not found`)}():C(M,`In page link #${t} not found`)}(r(9));break;case"title":!function(e,t){K[t]?.syncTitle&&(K[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(x.msg,M);break;case"reset":ce(x);break;case"init":n(),function(e){try{K[e].sameOrigin=!!K[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){K[e].sameOrigin=!1}C(e,`sameOrigin: %c${K[e].sameOrigin}`,p)}(M),(e=x.msg)!==m&&(void 0!==e?C(M,`Version mismatch (Child: %c${e}%c !== Parent: %c${m})`,p,h,p):H(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),me=!0,j("onReady",x.iframe);break;default:if(0===x.width&&0===x.height)return void F(M,`Unsupported message received (${x.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===x.width||0===x.height)return void C(M,"Ignoring message with 0 height or width");if(document.hidden)return void C(M,"Page hidden - ignored resize request");n()}var e,i}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?y===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in K?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,n=K[e[0]]?.iframe,r=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),M=x.id,M?(N(M,x.type),P(M,(function(){!function(e){if(!K[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&C(M,"Ignoring init message from meta parent page"),e}()||(C(M,`Received: %c${T}`,t),K[M].loaded=!0,(null!==x.iframe||(F(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=K[M]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(M,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=K[M]?.remoteHost;return C(M,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&k())}))()):F("","iframeResizer received messageData without id, message was: ",T)):null!==M&&C(M,"Ignored:",T):Object.keys(K).forEach((e=>{K[e].mode>=0&&fe("iFrame requested init",pe(e),e)}))}function ie(e,t,n){let i=null,o=null;if(K[e]){if(i=K[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function oe(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete K[t],delete e.iframeResizer}function re(e){const{id:t}=e;if(!1!==ie(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}ie(t,"onClosed",t),oe(e)}else C(t,"Close iframe cancelled by onClose event")}function ae(e){null===te.position&&(te.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p))}function se(){te.position=null}function le(e){null!==te.position&&(window.scrollTo(te.position.x,te.position.y),W(e,`Set page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p),se())}function ce(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),ae(e.id),de(e),fe("reset","reset",e.id)}function de(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=K[n];i&&t("height"),o&&t("width")}R=K;const ue=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function fe(e,n,i,o){function r(o){const r=e in z?ue(n):n;W(i,o,p,h,p),W(i,`%c${r}`,t)}N(i,e),K[i]&&(K[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:o,targetOrigin:a}=K[i];if(o)try{return e.contentWindow.iframeChildListener(y+n),void r(`Sending message to iframe %c${i}%c via sameOrigin`)}catch(e){C(i,"Same domain connection failed. Trying cross domain%c")}r(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),t.postMessage(y+n,a)}():F(i,`Iframe(${i}) not found`),o&&K[i]?.warningTimeout&&(K[i].msgTimeout=setTimeout((function(){if(void 0===K[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=K[i],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||n||(K[i].loadErrorShown=!0,H(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${K[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),K[i].warningTimeout)))}function pe(e){const t=K[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,te.version,t.mode,"",t.logExpand].join(":")}let he=0,me=!1,ge=!1;const ye=t=>n=>{function i(){if(K[u]){const{iframe:e}=K[u],t={close:re.bind(null,e),disconnect:oe.bind(null,e),removeListeners(){H(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:fe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),fe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){fe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=K[t];-1!==i&&-2!==i&&(U(n,"load",(function(){fe(b,`${e}:${me}`,t,!0),function(){const e=K[u]?.firstRun,t=K[u]?.heightCalculationMethod in w;!e&&t&&ce({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&fe(v,`${e}:${me}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&H(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=K[u];n<0?H("Parent",`${_(n+2)}${_(2)}`):(ge||n>0&&t.vInfoDisable||(ge=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,I||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>Z(X[e]))(n)})`,n)),n<1&&H("Parent",_(3)))}function s(e){const t=K[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;K[u]={...K[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...ee,...r(e),mouseEvents:l(e),mode:Q(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=K[u];if("horizontal"===e)return K[u].sizeWidth=!0,K[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return K[u].sizeWidth=!1,K[u].sizeHeight=!1,K[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===K[u].direction?(K[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(K[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&H(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===K[u].postMessageTarget&&(K[u].postMessageTarget=n.contentWindow),K[u].targetOrigin=!0===K[u].checkOrigin?""===(i=K[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||ee.id+he++;return null!==document.getElementById(e)&&(e+=he++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:ee.log;t.logExpand=n&&i?t.log===$:ee.logExpand,function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=M({expand:t,label:O(n)});I=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),P(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),be(),function(){switch(C(u,`Iframe scrolling ${K[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===K[u]?.scrolling?"hidden":"auto",K[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=K[u]?K[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=K[u];"number"!=typeof e&&"0"!==e||(K[u].bodyMargin=`${e}px`)}(),o(pe(u)),i())}))(t),n?.iFrameResizer};function we(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>K[e]?.autoResize&&!K[e]?.firstRun;Object.keys(K).forEach((function(i){n(i)&&fe(e,t,i)}))}("Tab Visible","resize"))}const be=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{U(window,"message",ne),U(document,"visibilitychange",we),window.iframeParentListener=e=>setTimeout((()=>ne({data:e,sameOrigin:!0})))})),ve=`[${g}] `;const ze=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ve}iframe is not defined`);case!e.tagName:throw new TypeError(`${ve}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ve}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=ye(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ve}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){D("iFrameResize()","iframeResize()","","parent"),ze(...e)}),ze}));
21
21
  //# sourceMappingURL=iframeResizer.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.5-beta.1 (umd) - 2025-04-08
4
+ * @module iframe-resizer/legacy (parent) 5.4.5-beta.2 (umd) - 2025-04-08
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(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t="font-style: italic;",n=e+t,i="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),r={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:s,keys:l}=Object,c=e=>[e,console[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.1",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,M=(E=function(t={}){const s={},l={},f=[],p={...r,expand:!t.collapsed||r.expanded,...t};let h;function m(){f.length=0}function g(){delete p.event,m()}const y=()=>!!f.some((([e])=>e in o))||!!p.expand;function w(){if(0!==f.length){console[y()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?h:""}`,e,"font-weight: bold;",n);for(const[e,...t]of f)console[e](...t);console.groupEnd(),g()}else g()}function b(){h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(w)))}function v(e,...t){0===f.length&&b(),f.push([e,...t])}function z(e=i,...t){v("log",`${e}: ${performance.now()-s[e]} ms`,...t)}return{...u(p,d(p)),...u(console,(e=>[e,(...t)=>v(e,...t)])),...u(a,c),count:function(e=i){l[e]?l[e]+=1:l[e]=1,v("log",`${e}: ${l[e]}`)},countReset:function(e=i){delete l[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;v("error",e)}return n},purge:m,time:function(e=i){s[e]=performance.now()},timeEnd:function(e=i){z(e),delete s[e]},timeLog:z}},E?.__esModule?E.default:E);var E;let R={},I=!1;const O=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:I)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("errorBoundary");const H=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),B=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(H),D=B("Function"),q=B("Option"),U=(e,t,n,i)=>e.addEventListener(t,n,i||!1),J=(e,t,n)=>e.removeEventListener(t,n,!1),V=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Z=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),G=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Y=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),_=e=>Z(G[e]),Q=e=>{const t=e[Z("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=V(Z(e));return n in Y&&(t=Y[n]),t}(n[0]);return 0===i||(e=>e[2]===V(e[0]+e[1]))(n)||(i=-2),i},K={},ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof K[e.id].onInit&&(q("init()","onReady()","",e.id),K[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),te={position:null,version:m};function ne(e){function n(){de(x),le(M),j("onResized",x)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const r=e=>T.slice(T.indexOf(":")+7+e);const a=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){fe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},s=(e,t)=>()=>{let n=!1;const i=t=>()=>{K[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e} listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){a("Remove ",J),c.disconnect(),d.disconnect()}const l=M,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));a("Add ",U),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(K[l].iframe,{attributes:!0,childList:!1,subtree:!1}),K[l]&&(K[l][`stop${t}`]=s)},l=e=>()=>{e in K[M]&&(K[M][e](),delete K[M][e])},c=a("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),d=a("parentInfo",(function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=s(c,"PageInfo"),f=s(d,"ParentInfo"),g=l("stopPageInfo"),w=l("stopParentInfo");function b(e){const t=e.getBoundingClientRect();return ae(M),{x:Number(t.left)+Number(te.position.x),y:Number(t.top)+Number(te.position.y)}}function v(e){const t=e?b(x.iframe):{x:0,y:0};W(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){te.position=e,z(M)}(n)}function z(e){const{x:t,y:n}=te.position,i=K[e]?.iframe;!1!==j("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?le(e):se()}function $(e){let t={};if(0===x.width&&0===x.height){const e=r(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};j(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const j=(e,t)=>ie(M,e,t);function k(){switch(K[M]?.firstRun&&K[M]&&(K[M].firstRun=!1),x.type){case"close":re(x.iframe);break;case"message":i=r(6),C(M,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${i}}`,p,h,t),j("onMessage",{iframe:x.iframe,message:JSON.parse(i)});break;case"mouseenter":$("onMouseEnter");break;case"mouseleave":$("onMouseLeave");break;case"autoResize":K[M].autoResize=JSON.parse(r(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;W(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":v(!1);break;case"scrollToOffset":v(!0);break;case"pageInfo":c("start",M),u();break;case"parentInfo":d("start",M),f();break;case"pageInfoStop":g();break;case"parentInfoStop":w();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=b(i);W(M,`Moving to in page link: %c#${t}`,p),te.position={x:e.x,y:e.y},z(M),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(M,`In page link #${t} not found and window.parentIframe not found`)}():C(M,`In page link #${t} not found`)}(r(9));break;case"title":!function(e,t){K[t]?.syncTitle&&(K[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(x.msg,M);break;case"reset":ce(x);break;case"init":n(),function(e){try{K[e].sameOrigin=!!K[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){K[e].sameOrigin=!1}C(e,`sameOrigin: %c${K[e].sameOrigin}`,p)}(M),(e=x.msg)!==m&&(void 0!==e?C(M,`Version mismatch (Child: %c${e}%c !== Parent: %c${m})`,p,h,p):H(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),me=!0,j("onReady",x.iframe);break;default:if(0===x.width&&0===x.height)return void F(M,`Unsupported message received (${x.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===x.width||0===x.height)return void C(M,"Ignoring message with 0 height or width");if(document.hidden)return void C(M,"Page hidden - ignored resize request");n()}var e,i}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?y===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in K?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,n=K[e[0]]?.iframe,r=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),M=x.id,M?(N(M,x.type),P(M,(function(){!function(e){if(!K[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&C(M,"Ignoring init message from meta parent page"),e}()||(C(M,`Received: %c${T}`,t),K[M].loaded=!0,(null!==x.iframe||(F(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=K[M]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(M,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=K[M]?.remoteHost;return C(M,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&k())}))()):F("","iframeResizer received messageData without id, message was: ",T)):null!==M&&C(M,"Ignored:",T):Object.keys(K).forEach((e=>{K[e].mode>=0&&fe("iFrame requested init",pe(e),e)}))}function ie(e,t,n){let i=null,o=null;if(K[e]){if(i=K[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function oe(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete K[t],delete e.iframeResizer}function re(e){const{id:t}=e;if(!1!==ie(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}ie(t,"onClosed",t),oe(e)}else C(t,"Close iframe cancelled by onClose event")}function ae(e){null===te.position&&(te.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p))}function se(){te.position=null}function le(e){null!==te.position&&(window.scrollTo(te.position.x,te.position.y),W(e,`Set page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p),se())}function ce(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),ae(e.id),de(e),fe("reset","reset",e.id)}function de(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=K[n];i&&t("height"),o&&t("width")}R=K;const ue=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function fe(e,n,i,o){function r(o){const r=e in z?ue(n):n;W(i,o,p,h,p),W(i,`%c${r}`,t)}N(i,e),K[i]&&(K[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:o,targetOrigin:a}=K[i];if(o)try{return e.contentWindow.iframeChildListener(y+n),void r(`Sending message to iframe %c${i}%c via sameOrigin`)}catch(e){C(i,"Same domain connection failed. Trying cross domain%c")}r(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),t.postMessage(y+n,a)}():F(i,`Iframe(${i}) not found`),o&&K[i]?.warningTimeout&&(K[i].msgTimeout=setTimeout((function(){if(void 0===K[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=K[i],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||n||(K[i].loadErrorShown=!0,H(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${K[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),K[i].warningTimeout)))}function pe(e){const t=K[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,te.version,t.mode,"",t.logExpand].join(":")}let he=0,me=!1,ge=!1;const ye=t=>n=>{function i(){if(K[u]){const{iframe:e}=K[u],t={close:re.bind(null,e),disconnect:oe.bind(null,e),removeListeners(){H(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:fe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),fe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){fe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=K[t];-1!==i&&-2!==i&&(U(n,"load",(function(){fe(b,`${e}:${me}`,t,!0),function(){const e=K[u]?.firstRun,t=K[u]?.heightCalculationMethod in w;!e&&t&&ce({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&fe(v,`${e}:${me}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&H(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=K[u];n<0?H("Parent",`${_(n+2)}${_(2)}`):(ge||n>0&&t.vInfoDisable||(ge=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,I||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>Z(X[e]))(n)})`,n)),n<1&&H("Parent",_(3)))}function s(e){const t=K[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;K[u]={...K[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...ee,...r(e),mouseEvents:l(e),mode:Q(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=K[u];if("horizontal"===e)return K[u].sizeWidth=!0,K[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return K[u].sizeWidth=!1,K[u].sizeHeight=!1,K[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===K[u].direction?(K[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(K[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&H(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===K[u].postMessageTarget&&(K[u].postMessageTarget=n.contentWindow),K[u].targetOrigin=!0===K[u].checkOrigin?""===(i=K[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||ee.id+he++;return null!==document.getElementById(e)&&(e+=he++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:ee.log;t.logExpand=n&&i?t.log===$:ee.logExpand,function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=M({expand:t,label:O(n)});I=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),P(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),be(),function(){switch(C(u,`Iframe scrolling ${K[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===K[u]?.scrolling?"hidden":"auto",K[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=K[u]?K[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=K[u];"number"!=typeof e&&"0"!==e||(K[u].bodyMargin=`${e}px`)}(),o(pe(u)),i())}))(t),n?.iFrameResizer};function we(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>K[e]?.autoResize&&!K[e]?.firstRun;Object.keys(K).forEach((function(i){n(i)&&fe(e,t,i)}))}("Tab Visible","resize"))}const be=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{U(window,"message",ne),U(document,"visibilitychange",we),window.iframeParentListener=e=>setTimeout((()=>ne({data:e,sameOrigin:!0})))})),ve=`[${g}] `;const ze=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ve}iframe is not defined`);case!e.tagName:throw new TypeError(`${ve}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ve}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=ye(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ve}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){D("iFrameResize()","iframeResize()","","parent"),ze(...e)}),ze}));
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t="font-style: italic;",n=e+t,i="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),r={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:s,keys:l}=Object,c=e=>[e,console[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.2",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),x=e=>e,M=(E=function(t={}){const s={},l={},f=[],p={...r,expand:!t.collapsed||r.expanded,...t};let h;function m(){f.length=0}function g(){delete p.event,m()}const y=()=>!!f.some((([e])=>e in o))||!!p.expand;function w(){if(0!==f.length){console[y()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?h:""}`,e,"font-weight: bold;",n);for(const[e,...t]of f)console[e](...t);console.groupEnd(),g()}else g()}function b(){h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(w)))}function v(e,...t){0===f.length&&b(),f.push([e,...t])}function z(e=i,...t){v("log",`${e}: ${performance.now()-s[e]} ms`,...t)}return{...u(p,d(p)),...u(console,(e=>[e,(...t)=>v(e,...t)])),...u(a,c),count:function(e=i){l[e]?l[e]+=1:l[e]=1,v("log",`${e}: ${l[e]}`)},countReset:function(e=i){delete l[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;v("error",e)}return n},purge:m,time:function(e=i){s[e]=performance.now()},timeEnd:function(e=i){z(e),delete s[e]},timeLog:z}},E?.__esModule?E.default:E);var E;let R={},I=!1;const O=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:I)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("errorBoundary");const H=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),B=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(H),D=B("Function"),q=B("Option"),U=(e,t,n,i)=>e.addEventListener(t,n,i||!1),J=(e,t,n)=>e.removeEventListener(t,n,!1),V=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Z=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),G=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Y=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),_=e=>Z(G[e]),Q=e=>{const t=e[Z("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=V(Z(e));return n in Y&&(t=Y[n]),t}(n[0]);return 0===i||(e=>e[2]===V(e[0]+e[1]))(n)||(i=-2),i},K={},ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof K[e.id].onInit&&(q("init()","onReady()","",e.id),K[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),te={position:null,version:m};function ne(e){function n(){de(x),le(M),j("onResized",x)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const r=e=>T.slice(T.indexOf(":")+7+e);const a=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){fe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},s=(e,t)=>()=>{let n=!1;const i=t=>()=>{K[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e} listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){a("Remove ",J),c.disconnect(),d.disconnect()}const l=M,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));a("Add ",U),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(K[l].iframe,{attributes:!0,childList:!1,subtree:!1}),K[l]&&(K[l][`stop${t}`]=s)},l=e=>()=>{e in K[M]&&(K[M][e](),delete K[M][e])},c=a("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),d=a("parentInfo",(function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=s(c,"PageInfo"),f=s(d,"ParentInfo"),g=l("stopPageInfo"),w=l("stopParentInfo");function b(e){const t=e.getBoundingClientRect();return ae(M),{x:Number(t.left)+Number(te.position.x),y:Number(t.top)+Number(te.position.y)}}function v(e){const t=e?b(x.iframe):{x:0,y:0};W(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){te.position=e,z(M)}(n)}function z(e){const{x:t,y:n}=te.position,i=K[e]?.iframe;!1!==j("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?le(e):se()}function $(e){let t={};if(0===x.width&&0===x.height){const e=r(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};j(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const j=(e,t)=>ie(M,e,t);function k(){switch(K[M]?.firstRun&&K[M]&&(K[M].firstRun=!1),x.type){case"close":re(x.iframe);break;case"message":i=r(6),C(M,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${i}}`,p,h,t),j("onMessage",{iframe:x.iframe,message:JSON.parse(i)});break;case"mouseenter":$("onMouseEnter");break;case"mouseleave":$("onMouseLeave");break;case"autoResize":K[M].autoResize=JSON.parse(r(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;W(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":v(!1);break;case"scrollToOffset":v(!0);break;case"pageInfo":c("start",M),u();break;case"parentInfo":d("start",M),f();break;case"pageInfoStop":g();break;case"parentInfoStop":w();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=b(i);W(M,`Moving to in page link: %c#${t}`,p),te.position={x:e.x,y:e.y},z(M),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(M,`In page link #${t} not found and window.parentIframe not found`)}():C(M,`In page link #${t} not found`)}(r(9));break;case"title":!function(e,t){K[t]?.syncTitle&&(K[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(x.msg,M);break;case"reset":ce(x);break;case"init":n(),function(e){try{K[e].sameOrigin=!!K[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){K[e].sameOrigin=!1}C(e,`sameOrigin: %c${K[e].sameOrigin}`,p)}(M),(e=x.msg)!==m&&(void 0!==e?C(M,`Version mismatch (Child: %c${e}%c !== Parent: %c${m})`,p,h,p):H(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),me=!0,j("onReady",x.iframe);break;default:if(0===x.width&&0===x.height)return void F(M,`Unsupported message received (${x.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===x.width||0===x.height)return void C(M,"Ignoring message with 0 height or width");if(document.hidden)return void C(M,"Page hidden - ignored resize request");n()}var e,i}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?y===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in K?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,n=K[e[0]]?.iframe,r=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),M=x.id,M?(N(M,x.type),P(M,(function(){!function(e){if(!K[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&C(M,"Ignoring init message from meta parent page"),e}()||(C(M,`Received: %c${T}`,t),K[M].loaded=!0,(null!==x.iframe||(F(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=K[M]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(M,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=K[M]?.remoteHost;return C(M,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&k())}))()):F("","iframeResizer received messageData without id, message was: ",T)):null!==M&&C(M,"Ignored:",T):Object.keys(K).forEach((e=>{K[e].mode>=0&&fe("iFrame requested init",pe(e),e)}))}function ie(e,t,n){let i=null,o=null;if(K[e]){if(i=K[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function oe(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete K[t],delete e.iframeResizer}function re(e){const{id:t}=e;if(!1!==ie(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}ie(t,"onClosed",t),oe(e)}else C(t,"Close iframe cancelled by onClose event")}function ae(e){null===te.position&&(te.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p))}function se(){te.position=null}function le(e){null!==te.position&&(window.scrollTo(te.position.x,te.position.y),W(e,`Set page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p),se())}function ce(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),ae(e.id),de(e),fe("reset","reset",e.id)}function de(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=K[n];i&&t("height"),o&&t("width")}R=K;const ue=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function fe(e,n,i,o){function r(o){const r=e in z?ue(n):n;W(i,o,p,h,p),W(i,`%c${r}`,t)}N(i,e),K[i]&&(K[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:o,targetOrigin:a}=K[i];if(o)try{return e.contentWindow.iframeChildListener(y+n),void r(`Sending message to iframe %c${i}%c via sameOrigin`)}catch(e){C(i,"Same domain connection failed. Trying cross domain%c")}r(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),t.postMessage(y+n,a)}():F(i,`Iframe(${i}) not found`),o&&K[i]?.warningTimeout&&(K[i].msgTimeout=setTimeout((function(){if(void 0===K[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=K[i],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||n||(K[i].loadErrorShown=!0,H(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${K[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),K[i].warningTimeout)))}function pe(e){const t=K[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,te.version,t.mode,"",t.logExpand].join(":")}let he=0,me=!1,ge=!1;const ye=t=>n=>{function i(){if(K[u]){const{iframe:e}=K[u],t={close:re.bind(null,e),disconnect:oe.bind(null,e),removeListeners(){H(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:fe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),fe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){fe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=K[t];-1!==i&&-2!==i&&(U(n,"load",(function(){fe(b,`${e}:${me}`,t,!0),function(){const e=K[u]?.firstRun,t=K[u]?.heightCalculationMethod in w;!e&&t&&ce({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&fe(v,`${e}:${me}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&H(u,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=K[u];n<0?H("Parent",`${_(n+2)}${_(2)}`):(ge||n>0&&t.vInfoDisable||(ge=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,I||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>Z(X[e]))(n)})`,n)),n<1&&H("Parent",_(3)))}function s(e){const t=K[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;K[u]={...K[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...ee,...r(e),mouseEvents:l(e),mode:Q(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=K[u];if("horizontal"===e)return K[u].sizeWidth=!0,K[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return K[u].sizeWidth=!1,K[u].sizeHeight=!1,K[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===K[u].direction?(K[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(K[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&H(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===K[u].postMessageTarget&&(K[u].postMessageTarget=n.contentWindow),K[u].targetOrigin=!0===K[u].checkOrigin?""===(i=K[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||ee.id+he++;return null!==document.getElementById(e)&&(e+=he++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:ee.log;t.logExpand=n&&i?t.log===$:ee.logExpand,function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=M({expand:t,label:O(n)});I=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),P(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),be(),function(){switch(C(u,`Iframe scrolling ${K[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===K[u]?.scrolling?"hidden":"auto",K[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=K[u]?K[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=K[u];"number"!=typeof e&&"0"!==e||(K[u].bodyMargin=`${e}px`)}(),o(pe(u)),i())}))(t),n?.iFrameResizer};function we(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>K[e]?.autoResize&&!K[e]?.firstRun;Object.keys(K).forEach((function(i){n(i)&&fe(e,t,i)}))}("Tab Visible","resize"))}const be=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{U(window,"message",ne),U(document,"visibilitychange",we),window.iframeParentListener=e=>setTimeout((()=>ne({data:e,sameOrigin:!0})))})),ve=`[${g}] `;const ze=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ve}iframe is not defined`);case!e.tagName:throw new TypeError(`${ve}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ve}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=ye(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ve}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){D("iFrameResize()","iframeResize()","","parent"),ze(...e)}),ze}));
21
21
  //# sourceMappingURL=iframeResizer.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iframe-resizer",
3
- "version": "5.4.5-beta.1",
3
+ "version": "5.4.5-beta.2",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -38,8 +38,8 @@
38
38
  "legacy"
39
39
  ],
40
40
  "dependencies": {
41
- "@iframe-resizer/child": "5.4.5-beta.1",
42
- "@iframe-resizer/jquery": "5.4.5-beta.1",
43
- "@iframe-resizer/parent": "5.4.5-beta.1"
41
+ "@iframe-resizer/child": "5.4.5-beta.2",
42
+ "@iframe-resizer/jquery": "5.4.5-beta.2",
43
+ "@iframe-resizer/parent": "5.4.5-beta.2"
44
44
  }
45
45
  }