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