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