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