@iframe-resizer/child 5.5.2-beta.2 → 5.5.2-beta.3
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 +1 -1
- package/index.cjs.js +2 -2
- package/index.cjs.js.map +1 -1
- package/index.esm.js +2 -2
- package/index.esm.js.map +1 -1
- package/index.umd.js +2 -2
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.5.2-beta.
|
|
4
|
+
* @module iframe-resizer/child 5.5.2-beta.3 (esm) - 2025-08-03
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
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.2",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",v="resizeObserver",b="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)),T=["spjluzl","rlf","clyzpvu"],j=["<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."],I=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],N=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),A=e=>k(j[e]),x=e=>{const t=e[k(T[0])]||e[k(T[1])]||e[k(T[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=E(k(e));return n in N&&(t=N[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 ve=e=>t=>void 0===t?void 0:e(t),be=ve(e=>"true"===e),ze=ve(Number),we=new Set,$e=new Set,Se=[],Oe={attributes:!0,attributeFilter:[u,c],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Me,Ee=1,ke=!1,Te=0;const je=e=>e.nodeType!==Node.ELEMENT_NODE||O.has(e.tagName.toLowerCase());function Ie(e){const t=e.addedNodes;for(const e of t)je(e)||(we.add(e),Q(`Added: %c${e.tagName.toLowerCase()}%c ${e.id||""}`,n,o,e))}function Ne(e){const t=e.removedNodes;for(const e of t)je(e)||(we.has(e)?(we.delete(e),Q(`Removed (Added): %c${e.tagName.toLowerCase()}%c ${e.id||""}`,n,o,e)):($e.add(e),Q(`Removed (page): %c${e.tagName.toLowerCase()}%c ${e.id||""}`,n,o,e)))}const Ae=e=>{J("Mutations:",e);for(const t of e)Ie(t),Ne(t)};const xe=e=>()=>{const t=performance.now(),r=t-Te,i=16*Ee+++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(Me,16*Ee),void(Te=t);Ee=1,Se.forEach(Ae),Se.length=0,ke=!1,$e.size>0&&U(`Detected %c${$e.size} %cremoved element${$e.size>1?"s":""}`,n,o),we.size>0&&U(`Found %c${we.size} %cnew element${we.size>1?"s":""}`,n,o),e({addedNodes:we,removedNodes:$e}),we.clear(),$e.clear()};function Pe(e){Se.push(e),ke||(Te=performance.now(),ke=!0,requestAnimationFrame(Me))}function Ce(e){const t=new window.MutationObserver(Pe),n=document.body||document.documentElement;return Me=xe(e),t.observe(n,Oe),J("Attached MutationObserver to body"),t}const Re=(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)},Le=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},Be=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,qe=(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)&&!Be(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(_(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:Le(0,l,c)}},We="--ifr-start",Fe="--ifr-end",De=[],Ve=new WeakSet,He=e=>"object"==typeof e&&Ve.add(e);let Ue={},Ze=0;function Je(e){e.getEntries().forEach(e=>{if(e.name===Fe){const{duration:t}=performance.measure("--ifr-measure",We,Fe);Ue=e.detail,De.push(t),De.length>100&&De.shift()}})}function _e(){J("Attached PerformanceObserver to page");new PerformanceObserver(Je).observe({entryTypes:["mark"]}),He(document.documentElement),He(document.body),function(){const e=setInterval(()=>{if(De.length<10)return;if(Ue.hasTags&&Ue.len<25)return;De.sort();const t=Math.min(De.reduce((e,t)=>e+t,0)/De.length,De[Math.floor(De.length/2)]),n=L(t);n>Ze&&(Ze=n,K("performanceObserver"),U("Mean time:",L(De[Math.floor(De.length/2)])),U("Median time:",L(De.reduce((e,t)=>e+t,0)/De.length)),U("Average time:",n),U("Max time:",L(Math.max(...De)))),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 ${Ue.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const Qe=new WeakSet;let Ye;function Ge(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=Qe.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(_(!o,"Node already observed for resize",n),o||(Ye.observe(n),Qe.add(n),t+=1))}return t}const Xe=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ke=Xe("function"),et=Xe("number"),tt=Xe("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={},j={},N="auto",V="[iFrameSizer]",Z="scroll";let _,te,ie,ce,de,ue,me,fe,pe,he,ge,ve=!0,we="",$e=0,Se="",Oe="",Me=!1,Ee=!0,ke=!1,Te=!0,je=!1,Ie=!1,Ne=!1,Ae=1,xe=N,Pe="",Be=!0,De={},Ve=!1,He=!0,Ue=!1,Ze=0,Je=!1,Xe=[],nt="",ot="child",rt=!1,it="",at=[],st=window.parent,lt="*",ct=0,dt=!1,ut=1,mt=Z,ft=window,pt=()=>{ne("onMessage function not defined")},ht=()=>{},gt=null,yt=null;function vt(t){var o;!function(e){nt=e[0]??nt,$e=ze(e[1])??$e,ke=be(e[2])??ke,Ue=be(e[3])??Ue,ve=be(e[6])??ve,Se=e[7]??Se,xe=e[8]??xe,we=e[9]??we,Oe=e[10]??Oe,ct=ze(e[11])??ct,De.enable=be(e[12])??!1,ot=e[13]??ot,mt=e[14]??mt,Je=be(e[15])??Je,ie=ze(e[16])??ie,ce=ze(e[17])??ce,Ee=be(e[18])??Ee,_=e[19]??_,he=e[20]??he,Ze=ze(e[21])??Ze,He=be(e[23])??He}(t),D=(o={id:nt,enabled:Ue,expand:He}).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=Ke(e,"onBeforeResize")??ge,pt=Ke(e,"onMessage")??pt,ht=Ke(e,"onReady")??ht,"number"==typeof e?.offset&&(le("offset","offsetSize"),Ee&&(ie=et(e,"offset")??ie),ke&&(ce=et(e,"offset")??ce)),"number"==typeof e?.offsetSize&&(Ee&&(ie=et(e,"offsetSize")??ie),ke&&(ce=et(e,"offsetSize")??ce)),te=tt(e,k(T[0]))??te,Pe=tt(e,"ignoreSelector")??Pe,it=tt(e,"sizeSelector")??it,lt=tt(e,"targetOrigin")??lt,xe=e?.heightCalculationMethod||xe,mt=e?.widthCalculationMethod||mt}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===Ze)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),xe=o(xe,"height"),mt=o(mt,"width"),J(`Set targetOrigin for parent: %c${lt}`,n))}(),[Ot,Et,Lt,$t,Mt,Ct,Rt,xt,St,zt,Me?R:ye,jt,Dt,Ft,Wt,It,()=>kt("background",we),()=>kt("padding",Oe),Me?R:Nt,qt,Bt,Kt].forEach(e=>{try{e()}catch(e){if(Ze<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)}}),bt(C(ht)),U("Initialization complete"),gn(S,"Init message from host page",void 0,void 0,`${a}:${Ze}`),document.title&&""!==document.title&&vn(0,0,"title",document.title)}function bt(e){"complete"===document.readyState?P(e):M(document,"readystatechange",()=>bt(e))}function zt(){at=document.querySelectorAll(`[${c}]`),Ne=at.length>0,U(`Tagged elements found: %c${Ne}`,n)}let wt=0;function $t(){const e=document.querySelectorAll(`*[${u}]`);return je=e.length>0,je&&e.length!==wt&&(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),wt=e.length),je}function St(){"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 Ot(){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 Mt(){try{rt=1===Ze||"iframeParentListener"in window.parent}catch(e){U("Cross domain iframe detected")}}function Et(){ke===Ee&&(Me=!0)}function kt(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,it),Tt("ignoreSelector",u,Pe)}function It(){var e,t;void 0===Se&&(Se=`${$e}px`),kt("margin",(e="margin",(t=Se).includes("-")&&(ne(`Negative CSS value ignored for ${e}`),t=""),t))}function Nt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),U("Set HTML & body height: %cauto !important",n)}function At(e){({add(t){function n(){gn(e.eventName,e.eventType)}j[t]=n,M(window,t,n,{passive:!0})},remove(e){const t=j[e];var n,o;delete j[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 xt(){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 Pt(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 Ct(){xe=Pt(xe,N,cn,"height")}function Rt(){mt=Pt(mt,Z,dn,"width")}function Lt(){const e=Ze,n=x({key:_}),o=x({key:te});if(Ze=Math.max(n,o),Ze<0){if(Ze=Math.min(n,o),oe(`${A(Ze+2)}${A(2)}`),q(he))throw A(Ze+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!q(he)||e>-1&&Ze>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(I[e]))(Ze)})`,Ze),Ze<2&&re(A(3)),sessionStorage.setItem("ifr",a))}function Bt(){!0!==ve&&U("Auto Resize disabled"),function(e){At({method:e,eventType:"After Print",eventName:"afterprint"}),At({method:e,eventType:"Before Print",eventName:"beforeprint"}),At({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add")}function qt(){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,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`),vn(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),vn(i.y,i.x,"scrollToOffset")}(a)}function r(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}De.enable?1===Ze?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"),De={findTarget:t}}function Ft(){function e(e){vn(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===Je&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Dt(){1!==Ze&&(ft.parentIframe=Object.freeze({autoResize:e=>(W(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ke&&!1===Ee?(K(p),oe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ve?(ve=!0,queueMicrotask(()=>gn(p,"Auto Resize enabled"))):!1===e&&!0===ve&&(ve=!1),vn(0,0,"autoResize",JSON.stringify(ve)),ve)),close(){vn(0,0,"close")},getId:()=>nt,getOrigin:()=>(ae("getOrigin()","getParentOrigin()"),de),getParentOrigin:()=>de,getPageInfo(e){if("function"==typeof e)return gt=e,vn(0,0,"pageInfo"),void se("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");gt=null,vn(0,0,"pageInfoStop")},getParentProps:e=>(W(e,"function","parentIframe.getParentProps(callback) callback"),yt=e,vn(0,0,"parentInfo"),()=>{yt=null,vn(0,0,"parentInfoStop")}),getParentProperties(e){ae("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){W(e,"string","parentIframe.moveToAnchor(anchor) anchor"),De.findTarget(e)},reset(){!function(){const e=xe;xe=N,U(`Reset trigger event: %c${"parentIframe.reset"}`,n),dt?U("TriggerLock blocked calculation"):(dt=!0,Q("Trigger event lock on"),requestAnimationFrame(()=>{dt=!1,Q("Trigger event lock off")})),yn("reset"),xe=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"),vn(t,e,"scrollBy")},scrollTo(e,t){W(e,"number","parentIframe.scrollTo(x, y) x"),W(t,"number","parentIframe.scrollTo(x, y) y"),vn(t,e,"scrollTo")},scrollToOffset(e,t){W(e,"number","parentIframe.scrollToOffset(x, y) x"),W(t,"number","parentIframe.scrollToOffset(x, y) y"),vn(t,e,"scrollToOffset")},sendMessage(e,t){t&&W(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),vn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){xe=e,Ct()},setWidthCalculationMethod(e){mt=e,Rt()},setTargetOrigin(e){W(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),U(`Set targetOrigin: %c${e}`,n),lt=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)}}),ft.parentIFrame=ft.parentIframe)}const Vt=Re("Overflow"),Ht=Re("Overflow",!1),Ut=Re("Resize"),Zt=Re("Resize",!1);function Jt(){const e=document.querySelectorAll(`[${d}]`);Xe=Array.from(e).filter(e=>!e.closest(`[${u}]`)),Ie=Xe.length>0}function _t(e){Jt(),(Ie||e)&&(Xe.length>1?J("Overflowed Elements:",...Xe):Ie||J("No overflow detected"),gn(b,"Overflow updated"))}function Qt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;gn(v,`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 Yt(e){Ye=new ResizeObserver(Qt),Ye.observe(document.body),Qe.add(document.body),J("Attached ResizeObserver to body"),me={attachObserverToNonStaticElements:Ge,detachObservers:Le(0,Ye,Qe)};const t=me.attachObserverToNonStaticElements(e);Ut(t)}function Gt(e){U(`Visible: %c${e}`,n),Ve=!e,gn(w,"Visibility changed")}function Xt(e){!function({addedNodes:e,removedNodes:t}){K("contentMutated"),jt(),zt(),Jt();let n=0,o=0,r=0,i=0;U("removedNodes:",t);for(const e of t){const t=on(e)();o+=ue.detachObservers(t),i+=me.detachObservers(t)}U("addedNodes:",e);for(const t of e){const e=on(t)();n+=ue.attachObservers(e),r+=me.attachObserverToNonStaticElements(e)}Ht(o),Vt(n),Zt(i),Ut(r),Y()}(e),gn(z,"Mutation Observed")}function Kt(){const e=on(document.documentElement)();U("Attaching Observers"),Ce(Xt),function(e){const t={root:document.documentElement,side:Ee?m:f};ue=qe(_t,t);const n=ue.attachObservers(e);Vt(n)}(e),_e(),Yt(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")}(Gt)}function en(e){performance.mark(We);const t=B(e);let n=0,o=document.documentElement,r=Ne?0:document.documentElement.getBoundingClientRect().bottom;const i=Ne?at:Ie?Xe: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(Fe,{detail:{hasTags:Ne,len:i.length,logging:Ue,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 Ne:J("Found element with data-iframe-size attribute"),d=e.taggedElement();break;case!Ie&&0===an[r]&&0===rn[r]:J(`Initial page size values: ${c}`,...sn),d=t();break;case dt&&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!Ie&&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!Ie&&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 Ie: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:()=>Ee,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:()=>ke,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)<=ct);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(A(4)));let hn=!1;const gn=X((e,t,o,r,i)=>{if(pe=performance.now(),fe=!0,K(e),!0!==fn){if(!ve&&!(e in g))return J("Resizing disabled"),void Y();if(Ve){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,xe),s=r??mn(dn,mt),l=Ee&&un(Ae,a)||ke&&un(ut,s)?h:e;switch(U(`Resize event: %c${t}`,n),l){case S:case p:case h:Ae=a,ut=s;case y:vn(Ae,ut,e,i);break;case b:case z:case v:case w:U($);break;default:J($)}fe=!1}(e,t,o,r,i)}});function yn(e){Ae=cn[xe](),ut=dn[mt](),vn(Ae,ut,e)}const vn=X(function(e,t,o,i,a){Ze<0||(K(o),void 0!==a?U(`Message targetOrigin: %c${a}`,n):a=lt,function(){const s=`${nt}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(rt)try{window.parent.iframeParentListener(V+s)}catch(e){if(1!==Ze)throw e;return void pn()}else st.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 ${rt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}(),Y())}),bn=X(function(e){K("onMessage");const{freeze:t}=Object,{parse:o}=JSON,r=e=>t(o(e)),i=e=>vn(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(":");st=e.source,de=e.origin,vt(t),Te=!1,setTimeout(()=>{Be=!1},128)},reset(){Be?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(){De.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();U("PageInfo received from parent:",r(e)),gt?P(gt,o(e)):i("pageInfo")},parentInfo(){const e=r(l());U("ParentInfo received from parent:",e),yt?P(yt,e):i("parentInfo")},message(){const e=l();U("onMessage called from parent:%c",n,r(e)),P(pt,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(()=>bn({data:e,sameOrigin:!0})),M(window,"message",bn),M(window,"readystatechange",zn),zn())}();
|
|
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.3",s="iframeResizer",l=10,c="data-iframe-size",u="data-iframe-overflowed",d="data-iframe-ignore",m="bottom",f="right",p="autoResizeEnabled",h=Symbol("sizeChanged"),g={},y="setOffsetSize",v="resizeObserver",b="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)),T=["spjluzl","rlf","clyzpvu"],j=["<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."],I=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],N=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),A=e=>k(j[e]),x=e=>{const t=e[k(T[0])]||e[k(T[1])]||e[k(T[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=E(k(e));return n in N&&(t=N[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"],ue=new Set,de=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}){ue.has(e)||(U("Unable to access stylesheet:",e),ue.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=de(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 <${de(e)}> for blocking CSS: ${t}`),fe(e,t)&&ge(e,t)}const ve=e=>t=>void 0===t?void 0:e(t),be=ve(e=>"true"===e),ze=ve(Number),we=new Set,$e=new Set,Se=[],Oe={attributes:!0,attributeFilter:[d,c],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Me,Ee=1,ke=!1,Te=0;const je=e=>e.nodeType!==Node.ELEMENT_NODE||O.has(e.tagName.toLowerCase());function Ie(e){const t=e.addedNodes;for(const e of t)je(e)||we.add(e)}function Ne(e){const t=e.removedNodes;for(const e of t)je(e)||(we.has(e)?(we.delete(e),Q("Removed (Added):",e)):$e.add(e))}const Ae=e=>{J("Mutations:",e);for(const t of e)Ie(t),Ne(t)};const xe=e=>()=>{const t=performance.now(),r=t-Te,i=16*Ee+++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(Me,16*Ee),void(Te=t);Ee=1,Se.forEach(Ae),Se.length=0,ke=!1,$e.size>0&&U(`Detected %c${$e.size} %cremoved element${$e.size>1?"s":""}`,n,o),we.size>0&&U(`Found %c${we.size} %cnew element${we.size>1?"s":""}`,n,o),U("addedNodes:",...we),U("removedNodes:",...$e),e({addedNodes:we,removedNodes:$e}),we.clear(),$e.clear()};function Pe(e){Se.push(e),ke||(Te=performance.now(),ke=!0,requestAnimationFrame(Me))}function Ce(e){const t=new window.MutationObserver(Pe),n=document.body||document.documentElement;return Me=xe(e),t.observe(n,Oe),J("Attached MutationObserver to body"),t}const Re=(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)},Le=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},Be=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,qe=(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(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)&&!Be(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(_(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:Le(0,l,c)}},We="--ifr-start",Fe="--ifr-end",De=[],Ve=new WeakSet,He=e=>"object"==typeof e&&Ve.add(e);let Ue={},Ze=0;function Je(e){e.getEntries().forEach(e=>{if(e.name===Fe){const{duration:t}=performance.measure("--ifr-measure",We,Fe);Ue=e.detail,De.push(t),De.length>100&&De.shift()}})}function _e(){J("Attached PerformanceObserver to page");new PerformanceObserver(Je).observe({entryTypes:["mark"]}),He(document.documentElement),He(document.body),function(){const e=setInterval(()=>{if(De.length<10)return;if(Ue.hasTags&&Ue.len<25)return;De.sort();const t=Math.min(De.reduce((e,t)=>e+t,0)/De.length,De[Math.floor(De.length/2)]),n=L(t);n>Ze&&(Ze=n,K("performanceObserver"),U("Mean time:",L(De[Math.floor(De.length/2)])),U("Median time:",L(De.reduce((e,t)=>e+t,0)/De.length)),U("Average time:",n),U("Max time:",L(Math.max(...De)))),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 ${Ue.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const Qe=new WeakSet;let Ye;function Ge(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=Qe.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(_(!o,"Node already observed for resize",n),o||(Ye.observe(n),Qe.add(n),t+=1))}return t}const Xe=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ke=Xe("function"),et=Xe("number"),tt=Xe("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"),un.auto())},E={},j={},N="auto",V="[iFrameSizer]",Z="scroll";let _,te,ie,ce,ue,de,me,fe,pe,he,ge,ve=!0,we="",$e=0,Se="",Oe="",Me=!1,Ee=!0,ke=!1,Te=!0,je=!1,Ie=!1,Ne=!1,Ae=1,xe=N,Pe="",Be=!0,De={},Ve=!1,He=!0,Ue=!1,Ze=0,Je=!1,Xe=[],nt="",ot="child",rt=!1,it="",at=[],st=window.parent,lt="*",ct=0,ut=!1,dt=1,mt=Z,ft=window,pt=()=>{ne("onMessage function not defined")},ht=()=>{},gt=null,yt=null;function vt(t){var o;!function(e){nt=e[0]??nt,$e=ze(e[1])??$e,ke=be(e[2])??ke,Ue=be(e[3])??Ue,ve=be(e[6])??ve,Se=e[7]??Se,xe=e[8]??xe,we=e[9]??we,Oe=e[10]??Oe,ct=ze(e[11])??ct,De.enable=be(e[12])??!1,ot=e[13]??ot,mt=e[14]??mt,Je=be(e[15])??Je,ie=ze(e[16])??ie,ce=ze(e[17])??ce,Ee=be(e[18])??Ee,_=e[19]??_,he=e[20]??he,Ze=ze(e[21])??Ze,He=be(e[23])??He}(t),D=(o={id:nt,enabled:Ue,expand:He}).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=Ke(e,"onBeforeResize")??ge,pt=Ke(e,"onMessage")??pt,ht=Ke(e,"onReady")??ht,"number"==typeof e?.offset&&(le("offset","offsetSize"),Ee&&(ie=et(e,"offset")??ie),ke&&(ce=et(e,"offset")??ce)),"number"==typeof e?.offsetSize&&(Ee&&(ie=et(e,"offsetSize")??ie),ke&&(ce=et(e,"offsetSize")??ce)),te=tt(e,k(T[0]))??te,Pe=tt(e,"ignoreSelector")??Pe,it=tt(e,"sizeSelector")??it,lt=tt(e,"targetOrigin")??lt,xe=e?.heightCalculationMethod||xe,mt=e?.widthCalculationMethod||mt}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===Ze)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),xe=o(xe,"height"),mt=o(mt,"width"),J(`Set targetOrigin for parent: %c${lt}`,n))}(),[Ot,Et,Lt,$t,Mt,Ct,Rt,xt,St,zt,Me?R:ye,jt,Dt,Ft,Wt,It,()=>kt("background",we),()=>kt("padding",Oe),Me?R:Nt,qt,Bt,Kt].forEach(e=>{try{e()}catch(e){if(Ze<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)}}),bt(C(ht)),U("Initialization complete"),gn(S,"Init message from host page",void 0,void 0,`${a}:${Ze}`),document.title&&""!==document.title&&vn(0,0,"title",document.title)}function bt(e){"complete"===document.readyState?P(e):M(document,"readystatechange",()=>bt(e))}function zt(){at=document.querySelectorAll(`[${c}]`),Ne=at.length>0,U(`Tagged elements found: %c${Ne}`,n)}let wt=0;function $t(){const e=document.querySelectorAll(`*[${d}]`);return je=e.length>0,je&&e.length!==wt&&(function(e){const n=1===e.length?"":"s";ne(`%c[${d}]%c found on %c${e.length}%c element${n}`,i,t,i,t)}(e),wt=e.length),je}function St(){"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 Ot(){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 Mt(){try{rt=1===Ze||"iframeParentListener"in window.parent}catch(e){U("Cross domain iframe detected")}}function Et(){ke===Ee&&(Me=!0)}function kt(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,it),Tt("ignoreSelector",d,Pe)}function It(){var e,t;void 0===Se&&(Se=`${$e}px`),kt("margin",(e="margin",(t=Se).includes("-")&&(ne(`Negative CSS value ignored for ${e}`),t=""),t))}function Nt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),U("Set HTML & body height: %cauto !important",n)}function At(e){({add(t){function n(){gn(e.eventName,e.eventType)}j[t]=n,M(window,t,n,{passive:!0})},remove(e){const t=j[e];var n,o;delete j[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 xt(){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 Pt(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 Ct(){xe=Pt(xe,N,cn,"height")}function Rt(){mt=Pt(mt,Z,un,"width")}function Lt(){const e=Ze,n=x({key:_}),o=x({key:te});if(Ze=Math.max(n,o),Ze<0){if(Ze=Math.min(n,o),oe(`${A(Ze+2)}${A(2)}`),q(he))throw A(Ze+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!q(he)||e>-1&&Ze>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(I[e]))(Ze)})`,Ze),Ze<2&&re(A(3)),sessionStorage.setItem("ifr",a))}function Bt(){!0!==ve&&U("Auto Resize disabled"),function(e){At({method:e,eventType:"After Print",eventName:"afterprint"}),At({method:e,eventType:"Before Print",eventName:"beforeprint"}),At({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add")}function qt(){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,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`),vn(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),vn(i.y,i.x,"scrollToOffset")}(a)}function r(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}De.enable?1===Ze?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"),De={findTarget:t}}function Ft(){function e(e){vn(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===Je&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Dt(){1!==Ze&&(ft.parentIframe=Object.freeze({autoResize:e=>(W(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ke&&!1===Ee?(K(p),oe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ve?(ve=!0,queueMicrotask(()=>gn(p,"Auto Resize enabled"))):!1===e&&!0===ve&&(ve=!1),vn(0,0,"autoResize",JSON.stringify(ve)),ve)),close(){vn(0,0,"close")},getId:()=>nt,getOrigin:()=>(ae("getOrigin()","getParentOrigin()"),ue),getParentOrigin:()=>ue,getPageInfo(e){if("function"==typeof e)return gt=e,vn(0,0,"pageInfo"),void se("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");gt=null,vn(0,0,"pageInfoStop")},getParentProps:e=>(W(e,"function","parentIframe.getParentProps(callback) callback"),yt=e,vn(0,0,"parentInfo"),()=>{yt=null,vn(0,0,"parentInfoStop")}),getParentProperties(e){ae("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){W(e,"string","parentIframe.moveToAnchor(anchor) anchor"),De.findTarget(e)},reset(){!function(){const e=xe;xe=N,U(`Reset trigger event: %c${"parentIframe.reset"}`,n),ut?U("TriggerLock blocked calculation"):(ut=!0,Q("Trigger event lock on"),requestAnimationFrame(()=>{ut=!1,Q("Trigger event lock off")})),yn("reset"),xe=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"),vn(t,e,"scrollBy")},scrollTo(e,t){W(e,"number","parentIframe.scrollTo(x, y) x"),W(t,"number","parentIframe.scrollTo(x, y) y"),vn(t,e,"scrollTo")},scrollToOffset(e,t){W(e,"number","parentIframe.scrollToOffset(x, y) x"),W(t,"number","parentIframe.scrollToOffset(x, y) y"),vn(t,e,"scrollToOffset")},sendMessage(e,t){t&&W(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),vn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){xe=e,Ct()},setWidthCalculationMethod(e){mt=e,Rt()},setTargetOrigin(e){W(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),U(`Set targetOrigin: %c${e}`,n),lt=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)}}),ft.parentIFrame=ft.parentIframe)}const Vt=Re("Overflow"),Ht=Re("Overflow",!1),Ut=Re("Resize"),Zt=Re("Resize",!1);function Jt(){const e=document.querySelectorAll(`[${u}]`);Xe=Array.from(e).filter(e=>!e.closest(`[${d}]`)),Ie=Xe.length>0}function _t(e){Jt(),(Ie||e)&&(Xe.length>1?J("Overflowed Elements:",...Xe):Ie||J("No overflow detected"),gn(b,"Overflow updated"))}function Qt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;gn(v,`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 Yt(e){Ye=new ResizeObserver(Qt),Ye.observe(document.body),Qe.add(document.body),J("Attached ResizeObserver to body"),me={attachObserverToNonStaticElements:Ge,detachObservers:Le(0,Ye,Qe)};const t=me.attachObserverToNonStaticElements(e);Ut(t)}function Gt(e){U(`Visible: %c${e}`,n),Ve=!e,gn(w,"Visibility changed")}function Xt(e){!function({addedNodes:e,removedNodes:t}){K("contentMutated"),jt(),zt(),Jt();let n=0,o=0,r=0,i=0;for(const e of t){const t=on(e)();o+=de.detachObservers(t),i+=me.detachObservers(t)}for(const t of e){const e=on(t)();n+=de.attachObservers(e),r+=me.attachObserverToNonStaticElements(e)}Ht(o),Vt(n),Zt(i),Ut(r),Y()}(e),gn(z,"Mutation Observed")}function Kt(){const e=on(document.documentElement)();U("Attaching Observers"),Ce(Xt),function(e){const t={root:document.documentElement,side:Ee?m:f};de=qe(_t,t);const n=de.attachObservers(e);Vt(n)}(e),_e(),Yt(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")}(Gt)}function en(e){performance.mark(We);const t=B(e);let n=0,o=document.documentElement,r=Ne?0:document.documentElement.getBoundingClientRect().bottom;const i=Ne?at:Ie?Xe: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(Fe,{detail:{hasTags:Ne,len:i.length,logging:Ue,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 u=0;switch(!0){case!e.enabled():return l;case Ne:J("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!Ie&&0===an[r]&&0===rn[r]:J(`Initial page size values: ${c}`,...sn),u=t();break;case ut&&i===an[r]&&l===rn[r]:J(`Size unchanged: ${c}`,...sn),u=Math.max(i,l);break;case 0===i:J(`Page is hidden: ${c}`,...sn),u=l;break;case!Ie&&i!==an[r]&&l<=rn[r]:J(`New <html> size: ${c} `,...sn),J(`Previous <html> size: %c${an[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!Ie&&i<an[r]:J(`<html> size decreased: ${c}`,...sn),u=t();break;case l===s||l===a:J(`<html> size equals page size: ${c}`,...sn),u=t();break;case i>l:J(`Page size < <html> size: ${c}`,...sn),u=t();break;case Ie:J("Found element overflowing <html> "),u=e.taggedElement();break;default:J(`Using <html> size: ${c}`,...sn),u=t()}return J(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&J(`Page offsetSize: %c${t}px`,n),t}(e),u}const cn={enabled:()=>Ee,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)},un={enabled:()=>ke,getOffset:()=>ce,auto:()=>ln(un),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(un)),min:()=>Math.min(...tn(un)),rightMostElement:()=>en(f),scroll:()=>Math.max(un.bodyScroll(),un.documentElementScroll()),taggedElement:()=>en(f)},dn=(e,t)=>!(Math.abs(e-t)<=ct);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(A(4)));let hn=!1;const gn=X((e,t,o,r,i)=>{if(pe=performance.now(),fe=!0,K(e),!0!==fn){if(!ve&&!(e in g))return J("Resizing disabled"),void Y();if(Ve){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,xe),s=r??mn(un,mt),l=Ee&&dn(Ae,a)||ke&&dn(dt,s)?h:e;switch(U(`Resize event: %c${t}`,n),l){case S:case p:case h:Ae=a,dt=s;case y:vn(Ae,dt,e,i);break;case b:case z:case v:case w:U($);break;default:J($)}fe=!1}(e,t,o,r,i)}});function yn(e){Ae=cn[xe](),dt=un[mt](),vn(Ae,dt,e)}const vn=X(function(e,t,o,i,a){Ze<0||(K(o),void 0!==a?U(`Message targetOrigin: %c${a}`,n):a=lt,function(){const s=`${nt}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(rt)try{window.parent.iframeParentListener(V+s)}catch(e){if(1!==Ze)throw e;return void pn()}else st.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 ${rt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}(),Y())}),bn=X(function(e){K("onMessage");const{freeze:t}=Object,{parse:o}=JSON,r=e=>t(o(e)),i=e=>vn(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(":");st=e.source,ue=e.origin,vt(t),Te=!1,setTimeout(()=>{Be=!1},128)},reset(){Be?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(){De.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();U("PageInfo received from parent:",r(e)),gt?P(gt,o(e)):i("pageInfo")},parentInfo(){const e=r(l());U("ParentInfo received from parent:",e),yt?P(yt,e):i("parentInfo")},message(){const e=l();U("onMessage called from parent:%c",n,r(e)),P(pt,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 u(){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.`);u()}()});function zn(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ne("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>bn({data:e,sameOrigin:!0})),M(window,"message",bn),M(window,"readystatechange",zn),zn())}();
|
|
21
21
|
//# sourceMappingURL=index.esm.js.map
|