@iframe-resizer/child 6.0.0-beta.2 → 6.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +14 -27
- package/index.cjs.js.map +1 -1
- package/index.d.ts +94 -0
- package/index.esm.js +723 -807
- package/index.esm.js.map +1 -1
- package/index.umd.js +16 -29
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/iframe-resizer.child.d.ts +0 -168
package/README.md
CHANGED
package/index.cjs.js
CHANGED
|
@@ -1,43 +1,30 @@
|
|
|
1
|
-
"use strict";const
|
|
2
|
-
`,K="string",
|
|
1
|
+
"use strict";const r=require("auto-console-group"),Q="6.0.0-beta.3",$e="iframeResizer",he=":",Sn="[iFrameResizerChild]Ready",Rn="autoResize",Tn="beforeUnload",Hn="close",kn="inPageLink",ge="init",Re="message",Mn="mouseenter",Ln="mouseleave",Lt="pageHide",An="pageInfo",At="parentInfo",$n="parentInfoStop",Nn="scrollBy",Gn="scrollTo",$t="scrollToOffset",Cn="title",q=1,Ne="data-iframe-size",Nt="data-iframe-overflowed",J="data-iframe-ignore",pe="height",Gt="width",nt="offsetSize",Ge=`
|
|
2
|
+
`,K="string",C="number",jn="boolean",Pn="object",Ce="function",Dn="undefined",_n="false",Fn="null",Z="auto",Ct="readystatechange",jt="bottom",Pt="right",Te="autoResizeEnabled",ot=Symbol("sizeChanged"),je="manualResize",Pe="parentResize",be={[je]:1,[Pe]:1},Dt="setOffsetSize",_t="resizeObserver",De="overflowObserver",Ft="mutationObserver",xt="visibilityObserver",xn="font-weight: bold;",_e="none",st="No change in content size detected",ce="[iFrameSizer]",Bt=ce.length,Bn=Z,Ut=128,Vt=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),Un=e=>typeof e===K,ye=(e,...t)=>setTimeout(()=>e(...t),0),Wt=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},ae=e=>e,rt=1e3,G=e=>Math.round(e*rt)/rt,qt=e=>e.charAt(0).toUpperCase()+e.slice(1),L=e=>`${e}`!=""&&e!==void 0,Vn=e=>e(),Wn=e=>e.toLowerCase();function qn(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}}const Zn=e=>e?.__esModule?e.default:e,S=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${qt(t)}`)},Zt={br:`
|
|
3
|
+
`,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},Yn=Object.keys(Zt),Qn=new RegExp(`<(${Yn.join("|")})>`,"gi"),Jn=(e,t)=>Zt[t]??"",Kn=e=>e.replace(Qn,Jn),Xn=e=>e.replaceAll("<br>",Ge).replaceAll(/<\/?[^>]+>/gi,""),eo=e=>t=>e(Un(t)?window.chrome?Kn(t):Xn(t):t);let Fe=!0,it=$e;const to=Zn(r),Y=to({label:`${$e}(child)`,expand:!1});function no(e){it=e.id||$e,Y.label(`${it}`),Y.expand(e.expand),Fe=e.enabled}const Yt=e=>(...t)=>Fe?Y[e](...t):!0,l=Yt("log"),u=l,le=Yt("debug");function oo(e,t){console.info(`%ciframe-resizer ${e}`,Fe||t<1?xn:r.NORMAL)}const{assert:so,endAutoGroup:j,error:Qt,errorBoundary:xe,event:h,label:ci,purge:ai,warn:F}=Y,Jt=eo(ae),b=(...e)=>Y.warn(...e.map(Jt)),ro=(...e)=>console.warn(...e.map(Jt)),Be=[];function Kt(e,t){l(`${e} event listener: %c${t}`,r.HIGHLIGHT)}const Xt=(e,t,n,o)=>{e.removeEventListener(t,n,o),Kt("Removed",t)},$=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Be.push(()=>Xt(e,t,n,o)),Kt("Added",t)},i={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let ct=!1;function at(e){const t=window?.iframeResizer?.targetOrigin||"*",n=Array.isArray(t)?t:[t];for(const o of n)e.postMessage(Sn,o)}function lt(){if(document.readyState==="loading"||!i.firstRun||ct)return;const{parent:e,top:t}=window;h("ready"),l("Sending%c ready%c to parent from",r.HIGHLIGHT,r.FOREGROUND,window.location.href),at(e),e!==t&&at(t),ct=!0}const ut="iframeResize",io=e=>ce===`${e.data}`.slice(0,Bt),co=()=>ut in window||window.jQuery!==void 0&&ut in window.jQuery.prototype,ao=e=>e.data.split(he)[2]in{true:1,false:1},lo=()=>[document.documentElement,document.body],uo=["min-height","min-width","max-height","max-width"],dt=new Set,fo=e=>!!e&&e!=="0px"&&e!==Z&&e!==_e,en=e=>e.tagName?e.tagName.toLowerCase():"unknown",tn=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),mo=(e,t)=>fo(tn(e,t));function ho(e,t){const n=e.style.getPropertyValue(t);return n?{source:"an inline style attribute",value:n}:null}function go({href:e}){dt.has(e)||(l("Unable to access stylesheet:",e),dt.add(e))}function po(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[]){if(!("selectorText"in o))continue;const s=o;if(!e.matches(s.selectorText))continue;const d=s.style.getPropertyValue(t);if(!d)continue;const{ownerNode:a}=n;return{source:a instanceof Element&&a.tagName==="STYLE"?"an inline <style> block":`stylesheet (${n.href})`,value:d}}}catch{go(n)}return{source:"cross-origin stylesheet",value:tn(e,t)}}const yo=(e,t)=>ho(e,t)||po(e,t),vo=(e,t)=>{const{source:n,value:o}=yo(e,t),s=en(e);b(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${s}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
`,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},to=Object.keys(Jt),no=new RegExp(`<(${to.join("|")})>`,"gi"),oo=(e,t)=>Jt[t]??"",ro=e=>e.replace(no,oo),so=e=>e.replaceAll("<br>",xe).replaceAll(/<\/?[^>]+>/gi,""),io=e=>t=>e(Qn(t)?window.chrome?ro(t):so(t):t);let qe=!0,Ge=Fe;const co=eo(s),Q=co({label:`${Fe}(child)`,expand:!1});function ao(e){Ge=e.id||Fe,Q.label(`${Ge}`),Q.expand(e.expand),qe=e.enabled}const Kt=e=>(...t)=>qe?Q[e](...t):!0,l=Kt("log"),u=l,de=Kt("debug");function lo(e,t){console.info(`${Ge} %ciframe-resizer ${e}`,qe||t<1?qn:s.NORMAL)}const{assert:uo,endAutoGroup:_,error:Xt,errorBoundary:Ze,event:h,label:Ei,purge:Si,warn:D}=Q,fo=io(le),p=(...e)=>Q.warn(...e.map(fo)),Ye=Yn((e,t)=>p(t)),en=Ye("Method"),mo=Ye("Method","replaced with"),ho=Ye("Option"),Qe=[];function tn(e,t){l(`${e} event listener: %c${t}`,s.HIGHLIGHT)}const nn=(e,t,n,o)=>{e.removeEventListener(t,n,o),tn("Removed",t)},G=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Qe.push(()=>nn(e,t,n,o)),tn("Added",t)},i={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let dt=!1;function ut(e){const t=window?.iframeResizer?.targetOrigin||"*",n=Array.isArray(t)?t:[t];for(const o of n)e.postMessage($n,o)}function ft(){if(document.readyState==="loading"||!i.firstRun||dt)return;const{parent:e,top:t}=window;h("ready"),l("Sending%c ready%c to parent from",s.HIGHLIGHT,s.FOREGROUND,window.location.href),ut(e),e!==t&&ut(t),dt=!0}const mt="iframeResize",go=e=>ae===`${e.data}`.slice(0,Wt),po=()=>mt in window||window.jQuery!==void 0&&mt in window.jQuery.prototype,yo=e=>e.data.split(ge)[2]in{true:1,false:1},vo=()=>[document.documentElement,document.body],bo=["min-height","min-width","max-height","max-width"],ht=new Set,zo=e=>!!e&&e!=="0px"&&e!==L&&e!==We,on=e=>e.tagName?e.tagName.toLowerCase():"unknown",rn=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),wo=(e,t)=>zo(rn(e,t));function Io(e,t){const n=e.style.getPropertyValue(t);return n?{source:"an inline style attribute",value:n}:null}function Oo({href:e}){ht.has(e)||(l("Unable to access stylesheet:",e),ht.add(e))}function Eo(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[]){if(!("selectorText"in o))continue;const r=o;if(!e.matches(r.selectorText))continue;const d=r.style.getPropertyValue(t);if(!d)continue;const{ownerNode:a}=n;return{source:a instanceof Element&&a.tagName==="STYLE"?"an inline <style> block":`stylesheet (${n.href})`,value:d}}}catch{Oo(n)}return{source:"cross-origin stylesheet",value:rn(e,t)}}const So=(e,t)=>Io(e,t)||Eo(e,t),To=(e,t)=>{const{source:n,value:o}=So(e,t),r=on(e);p(`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</>.
|
|
6
|
-
|
|
7
|
-
If 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 Ro(){for(const e of vo())for(const t of bo)l(`Checking <${on(e)}> for blocking CSS: ${t}`),wo(e,t)&&To(e,t)}const Ho=({calculateWidth:e,calculateHeight:t})=>e===t,c={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:L,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:L,onBeforeResize:void 0,onMessage:()=>{D("onMessage function not defined")},onReady:()=>{}},M=[s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT],ie={height:0,width:0},x={height:0,width:0};function F(e,t,n){return x[e]=t,ie[e]=n,t}function Mo(e){const t=e.getOffset();return t!==0&&u(`Page offsetSize: %c${t}px`,s.HIGHLIGHT),t}const $o=e=>e.documentElementScroll()+Math.max(0,e.getOffset());function sn(e){const{hasOverflow:t,hasTags:n,triggerLocked:o}=i,r=e.label,d=r===ve,a=e.boundingClientRect(),f=Math.ceil(a),b=Math.floor(a),m=$o(e),z=`HTML: %c${a}px %cPage: %c${m}px`;let g;switch(!0){case!e.enabled():return Math.max(m,Y);case n:u("Found element with data-iframe-size attribute"),g=e.taggedElement();break;case(!t&&i.firstRun&&x[r]===0&&ie[r]===0):u(`Initial page size values: ${z}`,...M),g=F(r,a,m);break;case(o&&a===x[r]&&m===ie[r]):u(`Size unchanged: ${z}`,...M),g=Math.max(a,m);break;case(a===0&&m!==0):u(`Page is hidden: ${z}`,...M),g=m;break;case(!t&&a!==x[r]&&m<=ie[r]):u(`New <html> size: ${z} `,...M),u(`Previous <html> size: %c${x[r]}px`,s.HIGHLIGHT),g=F(r,a,m);break;case!d:g=e.taggedElement();break;case(!t&&a<x[r]):u(`<html> size decreased: ${z}`,...M),g=F(r,a,m);break;case(m===b||m===f):u(`<html> size equals page size: ${z}`,...M),g=F(r,a,m);break;case a>m:u(`Page size < <html> size: ${z}`,...M),g=F(r,a,m);break;case t:u("Found elements possibly overflowing <html> "),g=e.taggedElement();break;default:u(`Using <html> size: ${z}`,...M),g=F(r,a,m)}return u(`Content ${r}: %c${g}px`,s.HIGHLIGHT),g+=Mo(e),Math.max(g,Y)}const Ao=1e3,Lo=5*Ao,ko=4,No=10,Go=100,Je="--ifr-start",ue="--ifr-end",cn="--ifr-measure",v=[];let ce={},gt=0,Pe;function an(){try{performance.clearMarks(Je),performance.clearMarks(ue),performance.clearMeasures(cn)}catch{}}function Po(){Pe=setInterval(()=>{if(v.length<No||ce.hasTags&&ce.len<25)return;v.sort();const e=Math.min(v.reduce((n,o)=>n+o,0)/v.length,v[Math.floor(v.length/2)]),t=C(e);t>gt&&(gt=t,h("performanceObserver"),l("Mean time:",C(v[Math.floor(v.length/2)])),l("Median time:",C(v.reduce((n,o)=>n+o,0)/v.length)),l("Average time:",t),l("Max time:",C(Math.max(...v)))),an(),!(e<=ko)&&(clearInterval(Pe),p(`<rb>Performance Warning</>
|
|
8
|
-
|
|
9
|
-
Calculating the page size is taking an excessive amount of time (${C(e)}ms).
|
|
10
|
-
|
|
11
|
-
To improve performance add the <b>data-iframe-size</> attribute to the ${ce.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},Lo)}function Co(e){e.getEntries().forEach(t=>{if(t.name===ue)try{const{duration:n}=performance.measure(cn,Je,ue);ce=t.detail,v.push(n),v.length>Go&&v.shift()}catch{}})}function jo(){u("Attached%c PerformanceObserver%c to page",s.HIGHLIGHT,s.FOREGROUND);const e=new PerformanceObserver(Co);return e.observe({entryTypes:["mark"]}),Po(),{disconnect:()=>{an(),clearInterval(Pe),e.disconnect(),u("Detached%c PerformanceObserver",s.HIGHLIGHT)}}}const Do=e=>`:not(${e})`,_o=`* ${Array.from(Zt).map(Do).join("")}`,Ke=e=>e.querySelectorAll(_o);function Fo(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:n,taggedElements:o}=i;return t?o:e?Array.from(n):Ke(document.documentElement)}function xo(e,t){const n=`margin-${t}`;let o,r=document.documentElement,d=i.hasTags?Y:document.documentElement.getBoundingClientRect().bottom;for(const a of e)o=a.getBoundingClientRect()[t]+parseFloat(getComputedStyle(a).getPropertyValue(n)),o>d&&(d=o,r=a);return{maxEl:r,maxVal:d}}function ln(e){performance.mark(Je);const t=Qt(e),{logging:n}=c,{hasTags:o}=i,r=Fo(),{maxEl:d,maxVal:a}=xo(r,e);return u(`${t} position calculated from:`,d),u(`Checked %c${r.length}%c elements`,s.HIGHLIGHT,s.FOREGROUND),performance.mark(ue,{detail:{hasTags:o,len:r.length,logging:n,Side:t}}),a}const we={label:ve,enabled:()=>c.calculateHeight,getOffset:()=>c.offsetHeight,auto:()=>sn(we),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>ln(_t)},Ie={label:jt,enabled:()=>c.calculateWidth,getOffset:()=>c.offsetWidth,auto:()=>sn(Ie),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>ln(Ft)};function dn(e,t){const{label:n}=t;return e&&e!==L&&p(`<rb>Ignored ${n}CalculationMethod (${e})</>
|
|
12
|
-
|
|
13
|
-
This version of <i>iframe-resizer</> auto detects the most suitable ${n} calculation method. The <b>${n}CalculationMethod</> option is no longer supported and has been ignored.
|
|
14
|
-
|
|
15
|
-
To remove this warning, delete the <b>${n}CalculationMethod</> option from your parent page config and/or the <i>window.iframeResizer</> config on the child page.
|
|
16
|
-
`),l(`Set ${n} calculation method: %c${L}`,s.HIGHLIGHT),L}function Bo(){c.heightCalcMode=dn(c.heightCalcMode,we)}function Uo(){c.widthCalcMode=dn(c.widthCalcMode,Ie)}function Vo(){try{i.sameOrigin=c.mode===1||"iframeParentListener"in window.parent}catch{l("Cross domain iframe detected")}}const Wo=`<rb>Deprecated Attributes</>
|
|
17
|
-
|
|
18
|
-
The <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`;function qo(){let e=!1;const t=n=>document.querySelectorAll(`[${n}]`).forEach(o=>{o.toggleAttribute(ye,!0),o.removeAttribute(n),e=!0});t("data-iframe-height"),t("data-iframe-width"),e&&p(Wo)}let pt=0;function Zo(e){const t=e.length===1?"":"s";D(`%c[${J}]%c found on %c${e.length}%c element${t}`,s.BOLD,s.NORMAL,s.BOLD,s.NORMAL)}function Yo(){const e=document.querySelectorAll(`*[${J}]`),t=e.length>0;return t&&e.length!==pt&&(Zo(e),pt=e.length),t}const fe=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)},H=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),Qo=new Date,un=e=>new Set(Array.from({length:9},e)),yt=" - lewpylk",B=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],Jo=["<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.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz."],Ko=e=>[e[0],...e.slice(1).map(t=>`${t}${yt}`),`${e[4]}${yt}`,...e.slice(1)],Xo=Ko(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),vt=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),er=new Set([1,6]),fn=Qo[H(B[4])](),tr=un((e,t)=>fe(`${fn+t}`)),nr=un((e,t)=>fe(`${fn-++t}`)),or=e=>tr.has(e)?9:nr.has(e)?5:-2,Xe=e=>er.has(e),$=e=>H(Jo[e]),rr=e=>H(Xo[e]),bt=e=>H(B[e]),zt=e=>{const t=e[H(B[0])]||e[H(B[1])]||e[H(B[2])]||e[H(B[3])];if(!t)return-1;const n=t.split("-");let o=(function(r="",d=""){let a=-2;const f=fe(H(r));return f in vt&&(a=vt[f]),a===9?or(d):a})(...n);return o===0||(r=>r[2]===fe(r[0]+r[1]))(n)||(o=-2),o};function sr(e,t,n){if(!A(n)||t>-1&&e>t){try{if(sessionStorage.getItem("ifr")===j)return}catch{}lo(`v${j} (${rr(e)})`,e),e<2&&p($(3));try{sessionStorage.setItem("ifr",j)}catch{}}}function ir({key:e,key2:t,mode:n,version:o}){const r=n,d=A(e)?zt({key:e}):-1,a=A(t)?zt({key:t}):-1;let f;switch(n=Math.max(d,a),n){case-2:case-1:f=`${$(Math.min(d,a)+2)}${$(2)}`,i.firstRun=!1;break;case 1:case 2:case 3:f=$(6);break;case 4:f=$(7);break;case 5:f=$(8);break}if(sr(n,r,o),(!A(o)||!i.firstRun)&&(f&&p(f),n<0))throw f.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi,"");c.mode=n}const cr="BackCompat",ar=`<rb>Quirks Mode Detected</>
|
|
5
|
+
If 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 zo(){for(const e of lo())for(const t of uo)l(`Checking <${en(e)}> for blocking CSS: ${t}`),mo(e,t)&&vo(e,t)}const bo=({calculateWidth:e,calculateHeight:t})=>e===t,c={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:Z,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:Z,onBeforeResize:void 0,onMessage:()=>{F("onMessage function not defined")},onReady:()=>{}};function wo(){try{i.sameOrigin=c.mode===1||"iframeParentListener"in window.parent}catch{l("Cross domain iframe detected")}}let ft=0;function Oo(e){const t=e.length===1?"":"s";F(`%c[${J}]%c found on %c${e.length}%c element${t}`,r.BOLD,r.NORMAL,r.BOLD,r.NORMAL)}function Io(){const e=document.querySelectorAll(`*[${J}]`),t=e.length>0;return t&&e.length!==ft&&(Oo(e),ft=e.length),t}const ue=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,s=0;s<e.length;s++)o=e.codePointAt(s),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},k=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),Eo=new Date,nn=e=>new Set(Array.from({length:9},e)),mt=" - lewpylk",_=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],So=["<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</>. 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.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi>Bzl dpao slnhjf jspluaz</><iy><iy>Dolu bzpun <p>pmyhtl-ylzpgly</> jopsk whjrhnl dpao hu vskly clyzpvu vm aol whylua, fvb jhu zla aol spjluzl rlf pu aol pmyhtl. Mvy klahpsz vu ovd av zla aopz bw, wslhzl zll aol kvjbtluahapvu ha:<iy><iy>oaawz://pmyhtl-ylzpgly.jvt/zlabw/jopsk/#spjluzl"],Ro=e=>[e[0],...e.slice(1).map(t=>`${t}${mt}`),`${e[4]}${mt}`,...e.slice(1)],To=Ro(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),ht=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),Ho=new Set([1,6]),on=Eo[k(_[4])](),ko=nn((e,t)=>ue(`${on+t}`)),Mo=nn((e,t)=>ue(`${on-++t}`)),Lo=e=>ko.has(e)?9:Mo.has(e)?5:-2,Ue=e=>Ho.has(e),H=e=>k(So[e]),Ao=e=>k(To[e]),gt=e=>k(_[e]),pt=e=>{const t=e[k(_[0])]||e[k(_[1])]||e[k(_[2])]||e[k(_[3])];if(!t)return-1;const n=t.split("-");let o=(function(s="",d=""){let a=-2;const f=ue(k(s));return f in ht&&(a=ht[f]),a===9?Lo(d):a})(...n);return o===0||(s=>s[2]===ue(s[0]+s[1]))(n)||(o=-2),o};function $o(e,t,n){(!L(n)||t>-1&&e>t)&&(oo(`v${Q} (${Ao(e)})`,e),e===0&&ro(H(3)))}function No({key:e,key2:t,mode:n,version:o}){const s=n,d=L(e)?pt({key:e}):-1,a=L(t)?pt({key:t}):-1;let f;switch(n=Math.max(d,a),n){case-2:case-1:f=`${H(Math.min(d,a)+2)}${H(2)}`,i.firstRun=!1;break;case 1:case 2:case 3:f=H(6);break;case 4:f=H(7);break;case 5:f=H(8);break}if(n>=0&&$o(n,s,o),(!L(o)||!i.firstRun)&&(f&&b(f),n<0))throw b(H(9)),f.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi,"");c.mode=n}const Go="BackCompat",Co=`<rb>Quirks Mode Detected</>
|
|
19
6
|
|
|
20
7
|
This 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</>.
|
|
21
8
|
|
|
22
9
|
For more information see <u>https://iframe-resizer.com/quirks-mode</>.
|
|
23
|
-
`;function
|
|
10
|
+
`;function jo(){document.compatMode===Go&&b(Co)}const Po="complete";let yt=!1;function sn(e){document.readyState===Po?ye(e):yt||$(document,Ct,()=>sn(e)),yt=!0}const Do=()=>{u(`Set targetOrigin for parent: %c${c.targetOrigin}`,r.HIGHLIGHT),c.autoResize!==!0&&l("Auto Resize disabled")};function rn(){i.taggedElements=document.querySelectorAll(`[${Ne}]`),i.hasTags=i.taggedElements.length>0,l(`Tagged elements found: %c${i.hasTags}`,r.HIGHLIGHT)}const _o=`<rb>Legacy version detected on parent page</>
|
|
24
11
|
|
|
25
12
|
Detected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.
|
|
26
13
|
|
|
27
14
|
See <u>https://iframe-resizer.com/setup/</> for more details.
|
|
28
|
-
`,
|
|
15
|
+
`,Fo=e=>`<b>Version mismatch</>
|
|
29
16
|
|
|
30
17
|
The parent and child pages are running different versions of <i>iframe resizer</>.
|
|
31
18
|
|
|
32
|
-
Parent page: ${e} - Child page: ${
|
|
33
|
-
`;function
|
|
34
|
-
|
|
19
|
+
Parent page: ${e} - Child page: ${Q}.
|
|
20
|
+
`;function xo({version:e}){!e||e===""||e===_n?b(_o):e!==Q&&b(Fo(e))}const Bo=Wt(()=>b(H(4)));function Uo(e){if(!i.timerActive)return;const t=G(performance.now()-i.totalTime),n=e===ge?`Initialised iframe in %c${t}ms`:`Size calculated in %c${t}ms`;l(n,r.HIGHLIGHT)}function Vo(e){return e===void 0?e=c.targetOrigin:l(`Message targetOrigin: %c${e}`,r.HIGHLIGHT),e}function Wo(e,t){const{mode:n}=c,{sameOrigin:o,target:s}=i;if(o)try{window.parent.iframeParentListener(ce+e)}catch(d){if(Ue(n))Bo();else throw new Error(d);return!1}else{so(s,"Internal error: postMessage target is undefined");const d=Vo(t),a=Array.isArray(d)?d:[d];for(const f of a)s.postMessage(ce+e,f)}return!0}function cn(e,t,n,o,s){const{parentId:d}=c,{sameOrigin:a}=i,f=`${e}:${t}`,y=`${d}:${f}:${n}${o===void 0?"":`:${o}`}`;c.mode<-1||!Wo(y,s)||(Uo(n),u(`Sending message to parent page via ${a?"sameOrigin":"postMessage"}: %c%c${y}`,r.ITALIC,r.HIGHLIGHT))}const v=xe((e,t,n,o,s)=>{h(n),cn(e,t,n,o,s),j()}),qo=e=>v(0,0,e.type,`${e.screenY}:${e.screenX}`);function vt(e,t){l(`Add event listener: %c${t}`,r.HIGHLIGHT),$(window.document,e,qo)}function Zo({mouseEvents:e}){e===!0&&(vt(Mn,"Mouse Enter"),vt(Ln,"Mouse Leave"))}const Yo=()=>v(0,0,Tn);function Qo({persisted:e}){e||Yo(),h(Lt),u("Page persisted:",e),!e&&Be.forEach(Vn)}const Jo=()=>$(window,Wn(Lt),Qo),zt=(e,t)=>!(Math.abs(e-t)<=c.tolerance);function Ko(e,t){const{calculateHeight:n,calculateWidth:o}=c,{height:s,width:d}=i;return n&&zt(s,e)||o&&zt(d,t)}const M=[r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT],re={height:0,width:0},D={height:0,width:0};function P(e,t,n){return D[e]=t,re[e]=n,t}function Xo(e){const t=e.getOffset();return t!==0&&u(`Page offsetSize: %c${t}px`,r.HIGHLIGHT),t}const es=e=>e.documentElementScroll()+Math.max(0,e.getOffset());function an(e){const{hasOverflow:t,hasTags:n,triggerLocked:o}=i,s=e.label,d=s===pe,a=e.boundingClientRect(),f=Math.ceil(a),y=Math.floor(a),m=es(e),z=`HTML: %c${a}px %cPage: %c${m}px`;let g;switch(!0){case!e.enabled():return Math.max(m,q);case n:u("Found element with data-iframe-size attribute"),g=e.taggedElement();break;case(!t&&i.firstRun&&D[s]===0&&re[s]===0):u(`Initial page size values: ${z}`,...M),g=P(s,a,m);break;case(o&&a===D[s]&&m===re[s]):u(`Size unchanged: ${z}`,...M),g=Math.max(a,m);break;case(a===0&&m!==0):u(`Page is hidden: ${z}`,...M),g=m;break;case(!t&&a!==D[s]&&m<=re[s]):u(`New <html> size: ${z} `,...M),u(`Previous <html> size: %c${D[s]}px`,r.HIGHLIGHT),g=P(s,a,m);break;case!d:g=e.taggedElement();break;case(!t&&a<D[s]):u(`<html> size decreased: ${z}`,...M),g=P(s,a,m);break;case(m===y||m===f):u(`<html> size equals page size: ${z}`,...M),g=P(s,a,m);break;case a>m:u(`Page size < <html> size: ${z}`,...M),g=P(s,a,m);break;case t:u("Found elements possibly overflowing <html> "),g=e.taggedElement();break;default:u(`Using <html> size: ${z}`,...M),g=P(s,a,m)}return u(`Content ${s}: %c${g}px`,r.HIGHLIGHT),g+=Xo(e),Math.max(g,q)}const ts=1e3,ns=5*ts,os=4,ss=10,rs=100,Ve="--ifr-start",de="--ifr-end",ln="--ifr-measure",p=[];let ie={},bt=0,He;function un(){try{performance.clearMarks(Ve),performance.clearMarks(de),performance.clearMeasures(ln)}catch{}}function is(){He=setInterval(()=>{if(p.length<ss||ie.hasTags&&ie.len<25)return;p.sort();const e=Math.min(p.reduce((n,o)=>n+o,0)/p.length,p[Math.floor(p.length/2)]),t=G(e);t>bt&&(bt=t,h("performanceObserver"),l("Mean time:",G(p[Math.floor(p.length/2)])),l("Median time:",G(p.reduce((n,o)=>n+o,0)/p.length)),l("Average time:",t),l("Max time:",G(Math.max(...p)))),un(),!(e<=os)&&(clearInterval(He),b(`<rb>Performance Warning</>
|
|
21
|
+
|
|
22
|
+
Calculating the page size is taking an excessive amount of time (${G(e)}ms).
|
|
35
23
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`,
|
|
39
|
-
`,t),t},bs=e=>{if(e.size===0)return;h("addObservers");const t=En(e);E.overflow.attachObservers(t),E.resize.attachObserverToNonStaticElements(t),_()},zs=e=>{if(e.size===0)return;h("removeObservers");const t=En(e);E.overflow.detachObservers(t),E.resize.detachObservers(t),_()};function ws({addedNodes:e,removedNodes:t}){h("contentMutated"),i.applySelectors(),hn(),On(),_(),zs(t),bs(e)}function Is(e){ws(e),T(Ut,"Mutation Observed")}const ee="Overflow",Os=Oe(ee),Es=Oe(ee,!1),Ss=bn(ee),Ts=zn(ee),Rs=e=>e instanceof HTMLElement&&(!!e.hidden||e.offsetParent===null||e.style.display===We),Hs=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||le,d=(w=!1)=>e(w),a=(w,R)=>w===0||w>R[n],f=(w,R)=>{w.toggleAttribute(Ct,R)};function b(w){for(const R of w){const{boundingClientRect:U,rootBounds:V,target:I}=R;if(!V)continue;const Hn=U[n],Mn=a(Hn,V)&&!(I instanceof HTMLElement&&Rs(I));f(I,Mn)}r(d)}const m=new IntersectionObserver(b,o),z=new WeakSet;function g(w){const R=new Set,U=new Set;let V=0;for(const I of w)if(I instanceof Element){if(z.has(I)){R.add(I);continue}m.observe(I),z.add(I),U.add(I),V+=1}Ts(R),Ss(U),Os(V),U.clear(),R.clear()}return{attachObservers:g,detachObservers:wn(ee,m,z,Es),disconnect:()=>{m.disconnect(),u("Detached%c OverflowObserver",s.HIGHLIGHT)}}};function Ms(){const{hasOverflow:e}=i,{hasOverflowUpdated:t,overflowedNodeSet:n}=On();switch(!0){case!t:return;case n.size>1:u("Overflowed Elements:",n);break;case e:break;default:u("No overflow detected")}T(Ve,"Overflow updated")}function $s(e){const t={root:document.documentElement,side:c.calculateHeight?_t:Ft};return E.overflow=Hs(Ms,t),E.overflow.attachObservers(e),E.overflow}const te="Resize",As=Oe(te),Ls=Oe(te,!1),ks=bn(te),Ns=zn(te),he=new WeakSet,$e=new Set,Ae=new Set;let Z;function Gs(e){let t=0;for(const n of e){if(!(n instanceof Element))continue;const o=getComputedStyle(n)?.position;if(!(o===""||o==="static")){if(he.has(n)){$e.add(n);continue}Z.observe(n),he.add(n),Ae.add(n),t+=1}}Ns($e),ks(Ae),As(t),Ae.clear(),$e.clear()}const Ps=e=>(Z=new ResizeObserver(e),Z.observe(document.body),he.add(document.body),u("Attached%c ResizeObserver%c to body",s.HIGHLIGHT,s.FOREGROUND),{attachObserverToNonStaticElements:Gs,detachObservers:wn(te,Z,he,Ls),disconnect:()=>{Z.disconnect(),u("Detached%c ResizeObserver",s.HIGHLIGHT)}});function Cs(e){if(!Array.isArray(e)||e.length===0)return;const t=e[0].target;T(Bt,`Element resized <${Xn(t)}>`)}function js(e){return E.resize=Ps(Cs),E.resize.attachObserverToNonStaticElements(e),E.resize}let Ht;function Ds(){const e=document.title;e!==Ht&&(Ht=e,l(`Title: %c${e}`,s.HIGHLIGHT),e&&y(0,0,Fn,e))}function _s(e){l(`Visible: %c${e}`,s.HIGHLIGHT),i.isHidden=!e,T(Vt,"Visibility changed")}function Fs(e){Qe.push(...e.map(t=>t.disconnect))}function xs(){h("attachObservers");const e=Ke(document.documentElement),t=[hs(Is),$s(e),jo(),js(e),ps(Ds),ys(_s)];Fs(t)}const Mt=(e,t,n)=>{if(n!==""){l(`${e}: %c${n}`,s.HIGHLIGHT);for(const o of document.querySelectorAll(n))l(`Applying ${t} to:`,o),o.toggleAttribute(t,!0)}};function Bs({sizeSelector:e,ignoreSelector:t}){return()=>{Mt("sizeSelector",ye,e),Mt("ignoreSelector",J,t)}}function Us(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Vs(e,t){return t.includes("-")&&(D(`Negative CSS value ignored for ${e}`),t=""),t}function _e(e,t){t===void 0||t===""||t===Wn||(document.body.style.setProperty(e,t),u(`Set body ${e}: %c${t}`,s.HIGHLIGHT))}function Ws({bodyMarginStr:e,bodyMargin:t}){e===void 0&&(e=`${t}px`),_e("margin",Vs("margin",e))}const qs=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function Zs(e){const t=e.getBoundingClientRect(),n=qs();return{x:Math.round(t.left+n.x),y:Math.round(t.top+n.y)}}function Ys(e,t){const n=Zs(t);l(`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),y(n.y,n.x,Pt)}function ot(e){const t=e.split("#")[1]||e,n=decodeURIComponent(t),o=document.getElementById(n)||document.getElementsByName(n)[0];if(o!==void 0){Ys(t,o);return}l(`In page link (#${t}) not found in iframe, so sending to parent`),y(0,0,Nn,`#${t}`)}function Sn(){const{hash:e,href:t}=window.location;e!==""&&e!=="#"&&ot(t)}function Qs(){for(const e of document.querySelectorAll('a[href^="#"]'))e.getAttribute("href")!=="#"&&G(e,"click",t=>{t.preventDefault(),ot(e.getAttribute("href"))})}function Js(){G(window,"hashchange",Sn)}function Ks(){setTimeout(Sn,qt)}function Xs(){l("Setting up location.hash handlers"),Qs(),Js(),Ks(),i.inPageLinks={findTarget:ot}}function ei(e){const{mode:t}=c;e?Xe(t)?p($(5)):Xs():l("In page linking not enabled")}const ti="important";function ni(){const e=t=>t.style.setProperty(ve,L,ti);e(document.documentElement),e(document.body),l("Set HTML & body height: %cauto !important",s.HIGHLIGHT)}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}.`)}},Le=rt(be),oe=rt(N),re=rt(K),oi=e=>e!==null&&typeof e===Bn&&!Array.isArray(e);function ri(e){const{calculateHeight:t,calculateWidth:n}=c;let o,r;return typeof e?.offset===N&&(ho(Se,Te),t&&(o=oe(e,Se)),n&&(r=oe(e,Se))),typeof e?.offsetSize===N&&(t&&(o=oe(e,Te)),n&&(r=oe(e,Te))),{offsetHeight:o,offsetWidth:r}}function si(e){l("Reading data from page:",Object.keys(e));const{offsetHeight:t,offsetWidth:n}=ri(e);return{offsetHeight:t,offsetWidth:n,ignoreSelector:re(e,"ignoreSelector"),[bt(3)]:re(e,bt(0)),sizeSelector:re(e,"sizeSelector"),targetOrigin:re(e,"targetOrigin"),onBeforeResize:Le(e,"onBeforeResize"),onMessage:Le(e,"onMessage"),onReady:Le(e,"onReady")}}function ii(){const{mode:e}=c;if(Xe(e))return{};const t=window.iframeResizer||window.iFrameResizer;return oi(t)?si(t):{}}const ci=e=>e==="true",Tn=e=>t=>t===void 0?void 0:e(t),P=Tn(ci),q=Tn(Number),ai=e=>({parentId:e[0],bodyMargin:q(e[1]),calculateWidth:P(e[2]),logging:P(e[3]),autoResize:P(e[6]),bodyMarginStr:e[7],heightCalcMode:e[8],bodyBackground:e[9],bodyPadding:e[10],tolerance:q(e[11]),inPageLinks:P(e[12]),widthCalcMode:e[14],mouseEvents:P(e[15]),offsetHeight:q(e[16]),offsetWidth:q(e[17]),calculateHeight:P(e[18]),key:e[19],version:e[20],mode:q(e[21]),logExpand:P(e[23])});function li(e){const{mode:t}=c;e.forEach(n=>{try{n()}catch(o){if(t<0)throw o;p(`<rb>Error in setup function</>
|
|
24
|
+
To improve performance add the <b>data-iframe-size</> attribute to the ${ie.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},ns)}function cs(e){e.getEntries().forEach(t=>{if(t.name===de)try{const{duration:n}=performance.measure(ln,Ve,de);ie=t.detail,p.push(n),p.length>rs&&p.shift()}catch{}})}function as(){u("Attached%c PerformanceObserver%c to page",r.HIGHLIGHT,r.FOREGROUND);const e=new PerformanceObserver(cs);return e.observe({entryTypes:["mark"]}),is(),{disconnect:()=>{un(),clearInterval(He),e.disconnect(),u("Detached%c PerformanceObserver",r.HIGHLIGHT)}}}const ls=e=>`:not(${e})`,us=`* ${Array.from(Vt).map(ls).join("")}`,We=e=>e.querySelectorAll(us);function ds(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:n,taggedElements:o}=i;return t?o:e?Array.from(n):We(document.documentElement)}function fs(e,t){const n=`margin-${t}`;let o,s=document.documentElement,d=i.hasTags?q:document.documentElement.getBoundingClientRect().bottom;for(const a of e)o=a.getBoundingClientRect()[t]+parseFloat(getComputedStyle(a).getPropertyValue(n)),o>d&&(d=o,s=a);return{maxEl:s,maxVal:d}}function dn(e){performance.mark(Ve);const t=qt(e),{logging:n}=c,{hasTags:o}=i,s=ds(),{maxEl:d,maxVal:a}=fs(s,e);return u(`${t} position calculated from:`,d),u(`Checked %c${s.length}%c elements`,r.HIGHLIGHT,r.FOREGROUND),performance.mark(de,{detail:{hasTags:o,len:s.length,logging:n,Side:t}}),a}const qe={label:pe,enabled:()=>c.calculateHeight,getOffset:()=>c.offsetHeight,auto:()=>an(qe),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>dn(jt)},Ze={label:Gt,enabled:()=>c.calculateWidth,getOffset:()=>c.offsetWidth,auto:()=>an(Ze),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>dn(Pt)};function ms(e,t,n){const o=c.onBeforeResize(e,t,n);if(o===void 0)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(o))throw new TypeError(`Invalid value returned from onBeforeResize(): ${o}, expected Number`);if(o<q)throw new RangeError(`Out of range value returned from onBeforeResize(): ${o}, must be at least ${q}`);return o}const fn=(e,t)=>(n,o)=>{const s=e[n]();return e.enabled()&&c.onBeforeResize!==void 0?ms(s,o,t):s},hs=fn(qe,pe),gs=fn(Ze,Gt);function ps(){(window.scrollY!==0||window.scrollX!==0)&&(u("Reset iframe scroll position to (0, 0)"),window.scrollTo(0,0))}function ys(e,t,n,o){const{heightCalcMode:s,widthCalcMode:d}=c;ps();const a=n??hs(s,e),f=o??gs(d,e),y=Ko(a,f)?ot:e;switch(l(`Resize event: %c${t}`,r.HIGHLIGHT),y){case ge:case Te:case ot:case je:case Pe:i.height=a,i.width=f;case Dt:return i;case De:case Ft:case _t:case xt:{l(st);break}default:u(st)}return null}let ne=!1,we=!1,U=null;function vs(e,t,n,o,s){const{autoResize:d}=c,{isHidden:a}=i;switch(h(e),!0){case(a===!0&&!(e in be)):{if(we===!0)break;l("Iframe hidden - Ignored resize request"),we=!0,ne=!1,cancelAnimationFrame(U),U=null;break}case(ne===!0&&e!==De&&!(e in be)):{l("Resize already pending - Ignored resize request");break}case(!d&&!(e in be)):{u("Resizing disabled");break}default:{we=!1,ne=!0,i.totalTime=performance.now(),i.timerActive=!0;const f=ys(e,t,n,o);f&&cn(f.height,f.width,e,s),U||(U=requestAnimationFrame(()=>{ne=!1,U=null,h("requestAnimationFrame"),le(`Reset sendPending: %c${e}`,r.HIGHLIGHT)})),i.timerActive=!1}}j()}const R=xe(vs);function wt({eventType:e,eventName:t}){$(window,t,()=>R(t,e),{passive:!0})}function zs(){wt({eventType:"After Print",eventName:"afterprint"}),wt({eventType:"Before Print",eventName:"beforeprint"})}function bs(){if(i.triggerLocked){l("TriggerLock blocked calculation");return}i.triggerLocked=!0,le("Trigger event lock on"),requestAnimationFrame(()=>{i.triggerLocked=!1,le("Trigger event lock off")})}function mn(e){const{heightCalcMode:t,widthCalcMode:n}=c,o=qe[t](),s=Ze[n]();l(`Reset trigger event: %c${e}`,r.HIGHLIGHT),v(o,s,e)}function ws(e){const t=c.heightCalcMode;l(`Reset trigger event: %c${e}`,r.HIGHLIGHT),c.heightCalcMode=Bn,bs(),mn("reset"),c.heightCalcMode=t}const Os=`Auto Resize can not be changed when <b>direction</> is set to '${_e}'.`;function Is(e){S(e,jn,"parentIframe.autoResize(enable) enable");const{autoResize:t,calculateHeight:n,calculateWidth:o}=c;return o===!1&&n===!1?(h(Te),b(Os),!1):(e===!0&&t===!1?(c.autoResize=!0,queueMicrotask(()=>R(Te,"Auto Resize enabled"))):e===!1&&t===!0&&(c.autoResize=!1),v(0,0,Rn,JSON.stringify(c.autoResize)),c.autoResize)}function Es(e){S(e,K,"parentIframe.moveToAnchor(anchor) anchor"),i.inPageLinks.findTarget(e)}function Ss(e){S(e,C,"parentIframe.setOffsetSize(offset) offset"),c.offsetHeight=e,c.offsetWidth=e,R(Dt,`parentIframe.setOffsetSize(${e})`)}const Rs=()=>i.origin;function Ts(e){S(e,K,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),l(`Set targetOrigin: %c${e}`,r.HIGHLIGHT),c.targetOrigin=e}function Hs(e){return S(e,Ce,"parentIframe.getParentProps(callback) callback"),i.onParentInfo=e,v(0,0,At),()=>{i.onParentInfo=null,v(0,0,$n)}}function ks(e,t){e!==void 0&&S(e,C,"parentIframe.resize(customHeight, customWidth) customHeight"),t!==void 0&&S(t,C,"parentIframe.resize(customHeight, customWidth) customWidth");const n=e===void 0?"":e,o=t===void 0?"":`,${t}`,s=`${n}${o}`;R(je,`parentIframe.resize(${s})`,e,t)}const Ye=e=>(t,n)=>{S(t,C,`parentIframe.${e}(x, y) x`),S(n,C,`parentIframe.${e}(x, y) y`),v(n,t,e)},Ms=Ye(Nn),Ls=Ye(Gn),As=Ye($t);function $s(e,t){t&&S(t,K,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),v(0,0,Re,JSON.stringify(e),t)}const Ns=()=>v(0,0,Hn),Gs=()=>c.parentId,Cs=()=>ws("parentIframe.reset");function js(){const{win:e}=i;c.mode!==1&&(e.parentIframe=Object.freeze({autoResize:Is,close:Ns,getId:Gs,getParentOrigin:Rs,getParentProps:Hs,moveToAnchor:Es,reset:Cs,setOffsetSize:Ss,scrollBy:Ms,scrollTo:Ls,scrollToOffset:As,sendMessage:$s,setTargetOrigin:Ts,resize:ks}))}const X=(e="")=>t=>n=>{n.size>0&&le(`${t}Observer ${e}:`,...Array.from(n).flatMap(o=>[Ge,o]))},Ps=(e="")=>t=>n=>{n.size>0&&Qt(`${t}Observer ${e}:`,...Array.from(n).flatMap(o=>[Ge,o]))},hn=X("attached to"),gn=Ps("already attached"),Ds=X("detached from"),ve=(e,t=!0)=>n=>{n>0&&u(`${t?"At":"De"}tached %c${e}Observer%c ${t?"to":"from"} %c${n}%c element${n===1?"":"s"}`,r.HIGHLIGHT,r.NORMAL,r.HIGHLIGHT,r.NORMAL)},pn=(e,t,n,o)=>{const s=Ds(e);return d=>{const a=new Set;let f=0;for(const y of d)n.has(y)&&(t.unobserve(y),n.delete(y),a.add(y),f+=1);s(a),o(f),a.clear()}},Ot=16,It=2,_s=200,Qe="Mutation",I=new Set,A=new Set,ke=new Set,fe=[],Fs={attributes:!0,attributeFilter:[J,Ne],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Oe=1,Je,Me=!1,Le=0;const xs=X("added")(Qe),Bs=X("removed (page)")(Qe),Us=X("removed (added)")(Qe),yn=e=>e.nodeType!==Node.ELEMENT_NODE||Vt.has(e.tagName.toLowerCase());function Vs(e){const t=e.addedNodes;for(const n of t)yn(n)||I.add(n)}function Ws(e){const t=e.removedNodes;for(const n of t)yn(n)||(I.has(n)?(I.delete(n),ke.add(n)):A.add(n))}const qs=e=>{u("Mutations:",e);for(const t of e)Vs(t),Ws(t);xs(I),Bs(A),Us(ke),ke.clear()};function Zs(){A.size>0&&l(`Detected %c${A.size} %cremoved element${A.size>1?"s":""}`,r.HIGHLIGHT,r.FOREGROUND),I.size>0&&l(`Found %c${I.size} %cnew element${I.size>1?"s":""}`,r.HIGHLIGHT,r.FOREGROUND)}const Ys=e=>()=>{const t=performance.now(),n=t-Le,o=Ot*Oe+++It;if(n>o&&n<_s){h("mutationThrottled"),u("Update delayed due to heavy workload on the callStack"),u(`EventLoop busy time: %c${G(n)}ms %c> Max wait: %c${o-It}ms`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),setTimeout(Je,Ot*Oe),Le=t;return}Oe=1,fe.forEach(qs),fe.length=0,Me=!1,Zs(),e({addedNodes:I,removedNodes:A}),I.clear(),A.clear()};function Qs(e){fe.push(e),!Me&&(Le=performance.now(),Me=!0,requestAnimationFrame(Je))}function Js(e){const t=new window.MutationObserver(Qs),n=document.body||document.documentElement;return Je=Ys(e),t.observe(n,Fs),u("Attached%c MutationObserver%c to body",r.HIGHLIGHT,r.FOREGROUND),{disconnect:()=>{I.clear(),A.clear(),fe.length=0,t.disconnect(),u("Detached%c MutationObserver",r.HIGHLIGHT)}}}const Ks={characterData:!0,childList:!0,subtree:!0};function Xs(e){const t=document.querySelector("title")??document.head??document.documentElement,n=new MutationObserver(e);return n.observe(t,Ks),u("Attached%c TitleObserver%c to head",r.HIGHLIGHT,r.FOREGROUND),setTimeout(e),{disconnect:()=>{n.disconnect(),u("Detached%c TitleObserver",r.HIGHLIGHT)}}}function er(e){const t=new IntersectionObserver(o=>e(o.at(-1)?.isIntersecting??!1),{threshold:0}),n=document.documentElement;return t.observe(n),u("Attached%c VisibilityObserver%c to page",r.HIGHLIGHT,r.FOREGROUND),{disconnect:()=>{t.disconnect(),u("Detached%c VisibilityObserver",r.HIGHLIGHT)}}}let Et=new Set;function tr(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${J}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{h("overflowIgnored"),u(`Ignoring elements with [data-iframe-ignore] > *:
|
|
25
|
+
`,n),j()}),t}function vn(){const e=document.querySelectorAll(`[${Nt}]`),t=tr(e);let n=!0;return typeof Set.prototype.symmetricDifference===Ce&&(n=t.symmetricDifference(Et).size>0),Et=t,i.overflowedNodeSet=t,i.hasOverflow=t.size>0,{hasOverflowUpdated:n,overflowedNodeSet:t}}const E={},zn=e=>{const t=new Set;for(const n of e)if(n instanceof Element){t.add(n);for(const o of We(n))t.add(o)}return u(`Inspecting:
|
|
26
|
+
`,t),t},nr=e=>{if(e.size===0)return;h("addObservers");const t=zn(e);E.overflow.attachObservers(t),E.resize.attachObserverToNonStaticElements(t),j()},or=e=>{if(e.size===0)return;h("removeObservers");const t=zn(e);E.overflow.detachObservers(t),E.resize.detachObservers(t),j()};function sr({addedNodes:e,removedNodes:t}){h("contentMutated"),i.applySelectors(),rn(),vn(),j(),or(t),nr(e)}function rr(e){sr(e),R(Ft,"Mutation Observed")}const ee="Overflow",ir=ve(ee),cr=ve(ee,!1),ar=hn(ee),lr=gn(ee),ur=e=>e instanceof HTMLElement&&(!!e.hidden||e.offsetParent===null||e.style.display===_e),dr=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},s=window?.requestAnimationFrame||ae,d=(w=!1)=>e(w),a=(w,T)=>w===0||w>T[n],f=(w,T)=>{w.toggleAttribute(Nt,T)};function y(w){for(const T of w){const{boundingClientRect:x,rootBounds:B,target:O}=T;if(!B)continue;const In=x[n],En=a(In,B)&&!(O instanceof HTMLElement&&ur(O));f(O,En)}s(d)}const m=new IntersectionObserver(y,o),z=new WeakSet;function g(w){const T=new Set,x=new Set;let B=0;for(const O of w)if(O instanceof Element){if(z.has(O)){T.add(O);continue}m.observe(O),z.add(O),x.add(O),B+=1}lr(T),ar(x),ir(B),x.clear(),T.clear()}return{attachObservers:g,detachObservers:pn(ee,m,z,cr),disconnect:()=>{m.disconnect(),u("Detached%c OverflowObserver",r.HIGHLIGHT)}}};function fr(){const{hasOverflow:e}=i,{hasOverflowUpdated:t,overflowedNodeSet:n}=vn();switch(!0){case!t:return;case n.size>1:u("Overflowed Elements:",n);break;case e:break;default:u("No overflow detected")}R(De,"Overflow updated")}function mr(e){const t={root:document.documentElement,side:c.calculateHeight?jt:Pt};return E.overflow=dr(fr,t),E.overflow.attachObservers(e),E.overflow}const te="Resize",hr=ve(te),gr=ve(te,!1),pr=hn(te),yr=gn(te),me=new WeakSet,Ie=new Set,Ee=new Set;let W;function vr(e){let t=0;for(const n of e){if(!(n instanceof Element))continue;const o=getComputedStyle(n)?.position;if(!(o===""||o==="static")){if(me.has(n)){Ie.add(n);continue}W.observe(n),me.add(n),Ee.add(n),t+=1}}yr(Ie),pr(Ee),hr(t),Ee.clear(),Ie.clear()}const zr=e=>(W=new ResizeObserver(e),W.observe(document.body),me.add(document.body),u("Attached%c ResizeObserver%c to body",r.HIGHLIGHT,r.FOREGROUND),{attachObserverToNonStaticElements:vr,detachObservers:pn(te,W,me,gr),disconnect:()=>{W.disconnect(),u("Detached%c ResizeObserver",r.HIGHLIGHT)}});function br(e){if(!Array.isArray(e)||e.length===0)return;const t=e[0].target;R(_t,`Element resized <${qn(t)}>`)}function wr(e){return E.resize=zr(br),E.resize.attachObserverToNonStaticElements(e),E.resize}let St;function Or(){const e=document.title;e!==St&&(St=e,l(`Title: %c${e}`,r.HIGHLIGHT),e&&v(0,0,Cn,e))}function Ir(e){l(`Visible: %c${e}`,r.HIGHLIGHT),i.isHidden=!e,R(xt,"Visibility changed")}function Er(e){Be.push(...e.map(t=>t.disconnect))}function Sr(){h("attachObservers");const e=We(document.documentElement),t=[Js(rr),mr(e),as(),wr(e),Xs(Or),er(Ir)];Er(t)}const Rt=(e,t,n)=>{if(n!==""){l(`${e}: %c${n}`,r.HIGHLIGHT);for(const o of document.querySelectorAll(n))l(`Applying ${t} to:`,o),o.toggleAttribute(t,!0)}};function Rr({sizeSelector:e,ignoreSelector:t}){return()=>{Rt("sizeSelector",Ne,e),Rt("ignoreSelector",J,t)}}function Tr(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Hr(e,t){return t.includes("-")&&(F(`Negative CSS value ignored for ${e}`),t=""),t}function Ae(e,t){t===void 0||t===""||t===Fn||(document.body.style.setProperty(e,t),u(`Set body ${e}: %c${t}`,r.HIGHLIGHT))}function kr({bodyMarginStr:e,bodyMargin:t}){e===void 0&&(e=`${t}px`),Ae("margin",Hr("margin",e))}const Mr=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function Lr(e){const t=e.getBoundingClientRect(),n=Mr();return{x:Math.round(t.left+n.x),y:Math.round(t.top+n.y)}}function Ar(e,t){const n=Lr(t);l(`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),v(n.y,n.x,$t)}function Ke(e){const t=e.split("#")[1]||e,n=decodeURIComponent(t),o=document.getElementById(n)||document.getElementsByName(n)[0];if(o!==void 0){Ar(t,o);return}l(`In page link (#${t}) not found in iframe, so sending to parent`),v(0,0,kn,`#${t}`)}function bn(){const{hash:e,href:t}=window.location;e!==""&&e!=="#"&&Ke(t)}function $r(){for(const e of document.querySelectorAll('a[href^="#"]'))e.getAttribute("href")!=="#"&&$(e,"click",t=>{t.preventDefault(),Ke(e.getAttribute("href"))})}function Nr(){$(window,"hashchange",bn)}function Gr(){setTimeout(bn,Ut)}function Cr(){l("Setting up location.hash handlers"),$r(),Nr(),Gr(),i.inPageLinks={findTarget:Ke}}function jr(e){const{mode:t}=c;e?Ue(t)?b(H(5)):Cr():l("In page linking not enabled")}const Pr="important";function Dr(){const e=t=>t.style.setProperty(pe,Z,Pr);e(document.documentElement),e(document.body),l("Set HTML & body height: %cauto !important",r.HIGHLIGHT)}const Xe=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Se=Xe(Ce),Tt=Xe(C),oe=Xe(K),_r=e=>e!==null&&typeof e===Pn&&!Array.isArray(e);function Fr(e){const{calculateHeight:t,calculateWidth:n}=c;let o,s;return typeof e?.offsetSize===C&&(t&&(o=Tt(e,nt)),n&&(s=Tt(e,nt))),{offsetHeight:o,offsetWidth:s}}function xr(e){l("Reading data from page:",Object.keys(e));const{offsetHeight:t,offsetWidth:n}=Fr(e);return{offsetHeight:t,offsetWidth:n,ignoreSelector:oe(e,"ignoreSelector"),[gt(3)]:oe(e,gt(0)),sizeSelector:oe(e,"sizeSelector"),targetOrigin:oe(e,"targetOrigin"),onBeforeResize:Se(e,"onBeforeResize"),onMessage:Se(e,"onMessage"),onReady:Se(e,"onReady")}}function Br(){const{mode:e}=c;if(Ue(e))return{};const t=window.iframeResizer||window.iFrameResizer;return _r(t)?xr(t):{}}const Ur=e=>e==="true",wn=e=>t=>t===void 0?void 0:e(t),N=wn(Ur),V=wn(Number),Vr=e=>({parentId:e[0],bodyMargin:V(e[1]),calculateWidth:N(e[2]),logging:N(e[3]),autoResize:N(e[6]),bodyMarginStr:e[7],bodyBackground:e[9],bodyPadding:e[10],tolerance:V(e[11]),inPageLinks:N(e[12]),mouseEvents:N(e[15]),offsetHeight:V(e[16]),offsetWidth:V(e[17]),calculateHeight:N(e[18]),key:e[19],version:e[20],mode:V(e[21]),logExpand:N(e[23])});function Wr(e){const{mode:t}=c;e.forEach(n=>{try{n()}catch(o){if(t<0)throw o;b(`<rb>Error in setup function</>
|
|
40
27
|
<i>iframe-resizer</> detected an error during setup.
|
|
41
28
|
|
|
42
|
-
Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`),
|
|
29
|
+
Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`),Qt(o)}})}function Ht(e){for(const[t,n]of Object.entries(e))n!==void 0&&(c[t]=n)}function qr({logExpand:e,logging:t,parentId:n=""}){no({id:n,enabled:t,expand:e}),h("initReceived"),l(`Initialising iframe v${Q} ${window.location.href}`)}function Zr(e){h("ready"),sn(Wt(e)),l("Initialization complete",(({key:t,key2:n,...o})=>o)(c))}function Yr({bodyBackground:e,bodyPadding:t,inPageLinks:n,onReady:o}){const s=bo(c),d=[Io,wo,jo,rn,Do,s?ae:zo,()=>kr(c),()=>Ae("background",e),()=>Ae("padding",t),s?ae:Dr,Tr,i.applySelectors,()=>jr(n),zs,()=>Zo(c),Jo,()=>js(),()=>R(ge,"Init message from host page",void 0,void 0,`${Q}:${c.mode}`),Sr,j];xo(c),No(c),Wr(d),Zr(o)}function Qr(e){i.firstRun&&(Ht(Vr(e)),qr(c),Ht(Br()),i.applySelectors=Rr(c),Yr(c))}function Jr(e){if(document.readyState==="loading"){l("Page not ready, ignoring init message");return}const t=e.data.slice(Bt).split(he);i.target=e.source,i.origin=e.origin,Qr(t),i.firstRun=!1,setTimeout(()=>{i.initLock=!1},Ut)}const{freeze:Kr}=Object,{parse:et}=JSON,tt=e=>Kr(et(e)),On=e=>v(0,0,`${e}Stop`),ze=e=>e.data.slice(e.data.indexOf(he)+1),Xr=e=>ao(e)?ge:e.data.split("]")[1].split(he)[0];function ei(e){const t=ze(e);l("onMessage called from parent:%c",r.HIGHLIGHT,tt(t)),ye(c.onMessage,et(t))}function ti(e){const{onPageInfo:t}=i,n=ze(e);l("PageInfo received from parent:",tt(n)),t?ye(t,et(n)):On(An)}function ni(e){const{onParentInfo:t}=i,n=tt(ze(e));l("ParentInfo received from parent:",n),t?ye(t,n):On(At)}function oi(){if(i.initLock){l("Page reset ignored by init");return}l("Page size reset by host page"),mn("resetPage")}function si(){l("Resize requested by host page"),R(Pe,"Parent window requested size check")}const kt=e=>i.inPageLinks.findTarget(ze(e)),Mt={init:Jr,reset:oi,resize:si,moveToAnchor:kt,inPageLink:kt,pageInfo:ti,parentInfo:ni,message:ei};function ri(e){const{firstRun:t}=i,n=Xr(e);switch(h(n),!0){case n in Mt:Mt[n](e);break;case(t&&co()):F(`Ignored message of type "${n}". Received before initialization.`);break;default:F(`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`)}}const se=xe(e=>{io(e)&&ri(e)});function ii(){if("iframeChildListener"in window){F("Already setup");return}window.iframeChildListener=(t=>{setTimeout(()=>se({data:t,sameOrigin:!0}))}),h("listen"),$(window,Re,se),$(document,Ct,lt),lt();function e(t){return se(t),i.win}try{top?.document?.getElementById("banner")&&(i.win={},window.mockMsgListener=e,Xt(window,Re,se),typeof window.define=="function"&&window.define([],()=>e))}catch{}}typeof window!==Dn&&ii();
|
|
43
30
|
//# sourceMappingURL=index.cjs.js.map
|