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