@iframe-resizer/core 6.0.0-beta.1 → 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/index.umd.js CHANGED
@@ -1,38 +1,32 @@
1
- (function(b,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("auto-console-group")):typeof define=="function"&&define.amd?define(["exports","auto-console-group"],r):(b=typeof globalThis<"u"?globalThis:b||self,r(b.connectResizer={},b.acg))})(this,(function(b,r){"use strict";const G="6.0.0-beta.1",te="iframeResizer",Ze="[iFrameResizerChild]Ready",ne="autoResize",Je="beforeUnload",Ye="close",Xe="inPageLink",H="init",oe="iframeReady",Ke="lazy",F="load",k="message",Qe="mouseenter",et="mouseleave",ie="onload",se="pageInfo",re="parentInfo",tt="pageInfoStop",nt="parentInfoStop",D="reset",B="resize",ot="scrollBy",it="scrollTo",st="scrollToOffset",rt="title",ct="height",lt="width",at="offset",ut="offsetSize",ce="scroll",ft="hidden",pt="child",W="parent",U="string",dt="number",le="object",ae="function",V="auto",ht="font-weight: bold;",ue="none",fe="both",P="vertical",pe="horizontal",gt="omit",mt=k.length,N="[iFrameSizer]",q=N.length,yt=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),de=Object.freeze({[ie]:1,[H]:1,[oe]:1}),R="expanded",S="collapsed",Z=0,J=1,Y=2,bt=Object.freeze({[R]:1,[S]:1}),he="Use of the old name will be removed in a future version of <i>iframe-resizer</>.",ge=e=>typeof e===le&&e!==null,X=e=>typeof e===U;function vt(e){if(!ge(e))return!1;try{return e.tagName==="IFRAME"||e instanceof HTMLIFrameElement}catch{return!1}}const wt=(e,...t)=>setTimeout(()=>e(...t),0),zt=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},It=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),$=(e,t)=>Object.hasOwn?Object.hasOwn(e,t):It(e,t),Et=e=>e,Tt=e=>e.charAt(0).toUpperCase()+e.slice(1),Ot=e=>e?.__esModule?e.default:e,Lt=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Tt(t)}`)},Ht=e=>(t,n="renamed to")=>(o,s,l="",c="")=>e(c,`<rb>Deprecated ${t}(${o.replace("()","")})</>
2
-
3
- The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${l}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`),me={br:`
4
- `,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},Rt=Object.keys(me),St=new RegExp(`<(${Rt.join("|")})>`,"gi"),Mt=(e,t)=>me[t]??"",kt=e=>e.replace(St,Mt),$t=e=>e.replaceAll("<br>",`
5
- `).replaceAll(/<\/?[^>]+>/gi,""),ye=e=>t=>e(X(t)?window.chrome?kt(t):$t(t):t),i={},be=Ot(r);let K=!0;const At=be({expand:!1,label:W}),jt=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`,Gt=e=>i[e]?i[e].log:K;function Pt({enabled:e,expand:t,iframeId:n}){const o=be({expand:t,label:jt(n)});K=e,i[n]||(i[n]={console:o})}const I=e=>(t,...n)=>i[t]?i[t].console[e](...n):At[e](...n),ve=e=>(t,...n)=>Gt(t)===!0?I(e)(t,...n):null,u=ve("log"),y=u,Nt=ve("debug"),w=I("warn"),Ct=I("error"),v=I("event"),_t=I("purge"),xt=I("endAutoGroup"),we=I("errorBoundary");function Ft(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,K||t<1?ht:r.NORMAL))}const Dt=e=>(...t)=>[`${te}(${e})`,...t].join(" "),Bt=ye(Et),m=(e,...t)=>i[e]?i[e].console.warn(...t.map(Bt)):queueMicrotask(()=>{const n=ye(Dt(e));console?.warn(...t.map(n))}),Wt=Ht(m)("Option"),C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:P,firstRun:!0,inPageLinks:!1,heightCalculationMethod:V,id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:V,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof i[e.id].onInit===ae&&(Wt("init()","onReady()","",e.id),i[e.id].onInit(e))},onResized(){},onScroll:()=>!0});let ze=0;function Ut(e){const t=e?.id||C.id+ze++;return document.getElementById(t)===null?t:`${t}${ze++}`}function Vt(e,t){let{id:n}=e;if(n&&!X(n))throw new TypeError("Invalid id for iFrame. Expected String");return(!n||n==="")&&(n=Ut(t),e.id=n,v(n,"assignId"),u(n,`Added missing iframe ID: ${n} (${e.src})`)),n}function qt(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(Z):{e.log=!1;break}case R:case String(Y):{e.log=R;break}case S:case String(J):{e.log=S;break}default:e.log=S}}const A=(e,t,n,o)=>e.addEventListener(t,n,o||!1),Ie=(e,t,n)=>e.removeEventListener(t,n,!1),Zt=e=>e.split(":").filter((t,n)=>n!==19).join(":");function Jt(e,t,n){function o(f){const p=e in de?Zt(t):t;y(n,f,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),y(n,`Message data: %c${p}`,r.HIGHLIGHT)}const{iframe:s,postMessageTarget:l,sameOrigin:c,targetOrigin:a}=i[n];if(c)try{s.contentWindow.iframeChildListener(N+t),o(`Sending message to iframe %c${n}%c via same origin%c`);return}catch{e in de?(i[n].sameOrigin=!1,u(n,"New iframe does not support same origin")):w(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a.join(", ")}`);for(const f of a)l.postMessage(N+t,f)}function E(e,t,n){if(v(n,e),!i[n]?.postMessageTarget){w(n,"Iframe not found");return}Jt(e,t,n)}const Yt=(e,t)=>Object.values(i).filter(({autoResize:n,firstRun:o})=>n&&!o).forEach(({iframe:n})=>E(e,t,n.id));function Xt(){document.hidden!==!0&&Yt("tabVisible",B)}function Kt(e){if(e.boxSizing!=="border-box")return 0;const t=e.paddingTop?parseInt(e.paddingTop,10):0,n=e.paddingBottom?parseInt(e.paddingBottom,10):0;return t+n}function Qt(e){if(e.boxSizing!=="border-box")return 0;const t=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,n=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return t+n}function en(e){const t=e.slice(q).split(":"),n=t[1]?Number(t[1]):0,o=i[t[0]]?.iframe,s=getComputedStyle(o),l={iframe:o,id:t[0],height:n+Kt(s)+Qt(s),width:Number(t[2]),type:t[3],msg:t[4],message:t[4]};return t[5]&&(l.mode=t[5]),l}const tn={true:1,false:1,undefined:1};function nn(e){const{id:t,msg:n,iframe:o}=e,s=vt(o);return s||(u(t,`Received: %c${n}`,r.HIGHLIGHT),w(t,"The target iframe was not found.")),s}function on(e,t){const{id:n}=e,{data:o,origin:s}=t;if("sameOrigin"in t&&t.sameOrigin)return!0;const c=i[n]?.checkOrigin;function a(){function f(){u(n,`Checking connection is from allowed list of origins: %c${c}`,r.HIGHLIGHT);for(const h of c)if(h===s)return!0;return!1}function p(){const h=i[n]?.remoteHost;return u(n,`Checking connection is from: %c${h}`,r.HIGHLIGHT),s===h}return c.constructor===Array?f():p()}if(c&&`${s}`!="null"&&!a())throw new Error(`Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`);return!0}const sn=e=>N===`${e}`.slice(0,q)&&e.slice(q).split(":")[0]in i;function rn(e){const{id:t,type:n}=e,o=n in tn;return o&&u(t,"Ignoring init message from meta parent page"),o}function cn(e){try{i[e].sameOrigin=!!i[e]?.iframe?.contentWindow?.iframeChildListener}catch{i[e].sameOrigin=!1}u(e,`sameOrigin: %c${i[e].sameOrigin}`,r.HIGHLIGHT)}function ln(e,t){if(t!==G){if(t===void 0){m(e,`<rb>Legacy version detected in iframe</>
1
+ (function(m,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("auto-console-group")):typeof define=="function"&&define.amd?define(["exports","auto-console-group"],r):(m=typeof globalThis<"u"?globalThis:m||self,r(m.connectResizer={},m.acg))})(this,(function(m,r){"use strict";const G="6.0.0-beta.3",ee="iframeResizer",qe="[iFrameResizerChild]Ready",te="autoResize",Ze="beforeUnload",Je="close",Ye="inPageLink",H="init",ne="iframeReady",Xe="lazy",F="load",R="message",Ke="mouseenter",Qe="mouseleave",oe="onload",ie="pageInfo",se="parentInfo",et="pageInfoStop",tt="parentInfoStop",D="reset",re="resize",nt="scrollBy",ot="scrollTo",it="scrollToOffset",st="title",rt="height",lt="width",at="offset",ct="offsetSize",le="scroll",ut="hidden",ft="child",B="parent",W="string",pt="number",ae="object",ht="function",U="auto",dt="font-weight: bold;",ce="none",ue="both",P="vertical",fe="horizontal",yt="omit",gt=R.length,N="[iFrameSizer]",V=N.length,mt=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),pe=Object.freeze({[oe]:1,[H]:1,[ne]:1}),L="expanded",k="collapsed",q=0,Z=1,J=2,bt=Object.freeze({[L]:1,[k]:1}),vt="Use of the old name will be removed in a future version of <i>iframe-resizer</>.",he=e=>typeof e===ae&&e!==null,Y=e=>typeof e===W;function zt(e){if(!he(e))return!1;try{return e.tagName==="IFRAME"||e instanceof HTMLIFrameElement}catch{return!1}}const wt=(e,...t)=>setTimeout(()=>e(...t),0),It=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},Et=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),M=(e,t)=>Object.hasOwn?Object.hasOwn(e,t):Et(e,t),Tt=e=>e,Ot=e=>e.charAt(0).toUpperCase()+e.slice(1),Ht=e=>e?.__esModule?e.default:e,Lt=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Ot(t)}`)},de={br:`
2
+ `,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},kt=Object.keys(de),St=new RegExp(`<(${kt.join("|")})>`,"gi"),jt=(e,t)=>de[t]??"",Rt=e=>e.replace(St,jt),Mt=e=>e.replaceAll("<br>",`
3
+ `).replaceAll(/<\/?[^>]+>/gi,""),ye=e=>t=>e(Y(t)?window.chrome?Rt(t):Mt(t):t),i={},ge=Ht(r);let X=!0;const $t=ge({expand:!1,label:B}),At=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`,Gt=e=>i[e]?i[e].log:X;function Pt({enabled:e,expand:t,iframeId:n}){const o=ge({expand:t,label:At(n)});X=e,i[n]||(i[n]={console:o})}const I=e=>(t,...n)=>i[t]?i[t].console[e](...n):$t[e](...n),me=e=>(t,...n)=>Gt(t)===!0?I(e)(t,...n):null,u=me("log"),g=u,Nt=me("debug"),z=I("warn"),Ct=I("error"),v=I("event"),_t=I("purge"),xt=I("endAutoGroup"),be=I("errorBoundary");function Ft(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,X||t<1?dt:r.NORMAL))}const Dt=e=>(...t)=>[`${ee}(${e})`,...t].join(" "),Bt=ye(Tt),b=(e,...t)=>i[e]?i[e].console.warn(...t.map(Bt)):queueMicrotask(()=>{const n=ye(Dt(e));console?.warn(...t.map(n))}),C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:P,firstRun:!0,inPageLinks:!1,heightCalculationMethod:U,id:"iframeResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:U,onBeforeClose:()=>!0,onAfterClose(){},onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady(){},onResized(){},onScroll:()=>!0});let ve=0;function Wt(e){const t=e?.id||C.id+ve++;return document.getElementById(t)===null?t:`${t}${ve++}`}function Ut(e,t){let{id:n}=e;if(n&&!Y(n))throw new TypeError("Invalid id for iframe. Expected String");return(!n||n==="")&&(n=Wt(t),e.id=n,v(n,"assignId"),u(n,`Added missing iframe ID: ${n} (${e.src})`)),n}function Vt(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(q):{e.log=!1;break}case L:case String(J):{e.log=L;break}case k:case String(Z):{e.log=k;break}default:e.log=k}}const $=(e,t,n,o)=>e.addEventListener(t,n,o||!1),ze=(e,t,n)=>e.removeEventListener(t,n,!1),qt=e=>e.split(":").filter((t,n)=>n!==19).join(":");function Zt(e,t,n){function o(f){const p=e in pe?qt(t):t;g(n,f,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),g(n,`Message data: %c${p}`,r.HIGHLIGHT)}const{iframe:s,postMessageTarget:c,sameOrigin:l,targetOrigin:a}=i[n];if(l)try{s.contentWindow.iframeChildListener(N+t),o(`Sending message to iframe %c${n}%c via same origin%c`);return}catch{e in pe?(i[n].sameOrigin=!1,u(n,"New iframe does not support same origin")):z(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a.join(", ")}`);for(const f of a)c.postMessage(N+t,f)}function S(e,t,n){if(v(n,e),!i[n]?.postMessageTarget){z(n,"Iframe not found");return}Zt(e,t,n)}const Jt=(e,t)=>Object.values(i).filter(({autoResize:n,firstRun:o})=>n&&!o).forEach(({iframe:n})=>S(e,t,n.id));function Yt(){document.hidden!==!0&&Jt("tabVisible",re)}function Xt(e){if(e.boxSizing!=="border-box")return 0;const t=e.paddingTop?parseInt(e.paddingTop,10):0,n=e.paddingBottom?parseInt(e.paddingBottom,10):0;return t+n}function Kt(e){if(e.boxSizing!=="border-box")return 0;const t=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,n=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return t+n}function Qt(e){const t=e.slice(V).split(":"),n=t[1]?Number(t[1]):0,o=i[t[0]]?.iframe,s=o?getComputedStyle(o):null,c=s?Xt(s)+Kt(s):0,l={iframe:o,id:t[0],height:n+c,width:Number(t[2]),type:t[3],msg:t[4],message:t[4]};return t[5]&&(l.mode=t[5]),l}const en={true:1,false:1,undefined:1};function tn(e){const{id:t,msg:n,iframe:o}=e,s=zt(o);return s||(u(t,`Received: %c${n}`,r.HIGHLIGHT),z(t,"The target iframe was not found.")),s}function nn(e,t){const{id:n}=e,{data:o,origin:s}=t;if("sameOrigin"in t&&t.sameOrigin)return!0;const l=i[n]?.checkOrigin;function a(){function f(){u(n,`Checking connection is from allowed list of origins: %c${l}`,r.HIGHLIGHT);for(const h of l)if(h===s)return!0;return!1}function p(){const h=i[n]?.remoteHost;return u(n,`Checking connection is from: %c${h}`,r.HIGHLIGHT),s===h}return l.constructor===Array?f():p()}if(l&&`${s}`!="null"&&!a())throw new Error(`Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`);return!0}const on=e=>N===`${e}`.slice(0,V)&&e.slice(V).split(":")[0]in i;function sn(e){const{id:t,type:n}=e,o=n in en;return o&&u(t,"Ignoring init message from meta parent page"),o}function rn(e){try{i[e].sameOrigin=!!i[e]?.iframe?.contentWindow?.iframeChildListener}catch{i[e].sameOrigin=!1}u(e,`sameOrigin: %c${i[e].sameOrigin}`,r.HIGHLIGHT)}function ln(e,t){if(t!==G){if(t===void 0){b(e,`<rb>Legacy version detected in iframe</>
6
4
 
7
5
  Detected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.
8
6
 
9
7
  See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
10
- `);return}u(e,`Version mismatch (Child: %c${t}%c !== Parent: %c${G})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT)}}function T(e,t,n){if(!i[e])return null;const o=i[e][t];if(typeof o!==ae)throw new TypeError(`${t} on iframe[${e}] is not a function`);if(t!=="onBeforeClose"&&t!=="onScroll")return wt(o,n);try{return o(n)}catch(s){return console.error(s),w(e,`Error in ${t} callback`),null}}function an(e,t){const{id:n,iframe:o}=e;u(n,`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT,r.FOREGROUND),T(n,"onMessage",{iframe:o,message:JSON.parse(t)})}function _(e,t){const{lastMessage:n}=i[e];return n.slice(n.indexOf(":")+mt+t)}function Ee(e,t){const{id:n,iframe:o,height:s,type:l,width:c}=t;let a={x:0,y:0};if(c===0&&s===0){const f=_(n,9).split(":");a={x:f[1],y:f[0]}}else a={x:c,y:s};T(n,e,{iframe:o,screenX:Number(a.x),screenY:Number(a.y),type:l})}const d={position:null,version:G};function Te(){d.position=null}const un=()=>d.position;function fn(e){d.position=e}function Oe(e){return d.position===null&&(d.position={x:window.scrollX,y:window.scrollY}),u(e,`Get page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),d.position}function Le(e){d.position!==null&&(window.scrollTo(d.position.x,d.position.y),y(e,`Set page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),Te())}function He(e,t){const{id:n}=t,o=`${t[e]}px`;i[n].iframe.style[e]=o,y(n,`Set ${e}: %c${o}`,r.HIGHLIGHT)}function Re(e){const{id:t}=e,{sizeHeight:n,sizeWidth:o}=i[t];n&&He(ct,e),o&&He(lt,e)}function Se(e){const{id:t}=e;Re(e),Le(t),T(t,"onResized",e)}function Me(e){const{id:t}=e;u(t,"Disconnected from iframe"),delete i[t],delete e.iframeResizer}function ke(e){const{id:t}=e;if(T(t,"onBeforeClose",t)===!1){u(t,"Close iframe cancelled by onBeforeClose");return}u(t,`Removing iFrame: %c${t}`,r.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(n){w(t,n)}T(t,"onAfterClose",t),Me(e)}function $e(e){const{id:t,type:n}=e;u(t,`Size reset requested by ${n===H?"parent page":"child page"}`),Oe(t),Re(e),E(D,D,t)}const Ae=(e,t)=>{const n={};return(o,s)=>{const{iframe:l}=i[s];function c(f,p){n[p]||(f(),n[p]=requestAnimationFrame(()=>{n[p]=null}))}function a(){E(`${o} (${e})`,`${e}:${t(l)}`,s)}c(a,s)}},je=e=>t=>{e in i[t]&&(i[t][e](),delete i[t][e])},Ge=((e,t)=>n=>{let o=!1;const s=g=>()=>{i[n]?(!o||o===g)&&(e(g,n),o=g,requestAnimationFrame(()=>{o=!1})):h()},l=s(ce),c=s("resize window"),a=new ResizeObserver(s("pageObserver")),f=new ResizeObserver(s("iframeObserver"));function p(g,L){u(n,`${g}listeners for send${t}`),L(window,ce,l),L(window,B,c)}function h(){v(n,`stop${t}`),p("Remove ",Ie),a.disconnect(),f.disconnect(),i[n]&&Ie(i[n].iframe,F,h)}function M(){p("Add ",A),a.observe(document.body),f.observe(i[n].iframe)}i[n]&&(i[n][`stop${t}`]=h,A(i[n].iframe,F,h),M())});function pn(e){const t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),{scrollY:o,scrollX:s,innerHeight:l,innerWidth:c}=window,{clientHeight:a,clientWidth:f}=document.documentElement;return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(a,l||0),clientWidth:Math.max(f,c||0),offsetTop:Math.trunc(n.top-t.top),offsetLeft:Math.trunc(n.left-t.left),scrollTop:o,scrollLeft:s,documentHeight:a,documentWidth:f,windowHeight:l,windowWidth:c})}const dn=Ae(se,pn),hn=Ge(dn,"PageInfo"),gn=je("stopPageInfo");function mn(e){const{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:s,offsetLeft:l,offsetTop:c,pageLeft:a,pageTop:f,scale:p}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:s,offsetLeft:l,offsetTop:c,pageLeft:a,pageTop:f,scale:p}})}const yn=Ae(re,mn),bn=Ge(yn,"ParentInfo"),vn=je("stopParentInfo");function Pe(e){const t=e.getBoundingClientRect(),n=Oe(e.id);return{x:Number(t.left)+Number(n.x),y:Number(t.top)+Number(n.y)}}function Ne(e){const{x:t,y:n}=un(),o=i[e]?.iframe;if(T(e,"onScroll",{iframe:o,top:n,left:t,x:t,y:n})===!1){Te();return}Le(e)}function wn(e){const{id:t,height:n,width:o}=e,s=window.parentIframe||window.parentIFrame||window;y(t,`scrollBy: x: %c${o}%c y: %c${n}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),s.scrollBy(o,n)}const Ce=e=>t=>{const{id:n,iframe:o,height:s,width:l}=t;function c(g){fn(g),Ne(n)}function a(g,L){g[`scrollTo${e?"Offset":""}`](L.x,L.y)}const f=g=>({x:l+g.x,y:s+g.y}),p=e?Pe(o):{x:0,y:0},h=f(p),M=window.parentIframe||window.parentIFrame;y(n,`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),M?a(M,h):c(h)},zn=Ce(!1),In=Ce(!0);function En(e,t,n){const{x:o,y:s}=Pe(n);y(e,`Moving to in page link: %c#${t}`,r.HIGHLIGHT),d.position={x:o,y:s},Ne(e),window.location.hash=t}function Tn(e,t){const n=window.parentIframe||window.parentIFrame;if(!n){u(e,`In page link #${t} not found`);return}n.moveToAnchor(t)}function On(e,t){const n=t.split("#")[1]||"",o=decodeURIComponent(n),s=document.getElementById(o)||document.getElementsByName(o)[0];if(s){En(e,n,s);return}if(window.top===window.self){u(e,`In page link #${n} not found`);return}Tn(e,n)}function Ln(e){const t=i[e]?.iframe?.title;return t===""||t===void 0}function Hn(e,t){i[e]?.syncTitle&&(i[e].iframe.title=t,y(e,`Set iframe title attribute: %c${t}`,r.HIGHLIGHT))}const x=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)},z=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),Rn=new Date,_e=e=>new Set(Array.from({length:9},e)),Sn=e=>[e[0],...e.slice(1).map(t=>`${t} - lewpylk`),`${e[4]} - lewpylk`,...e.slice(1)],j=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],Mn=["<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>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> fvb jhu bzl aol mpyza 11 johyhjalyz vm fvb spjlujl rlf av nla h 60% kpzjvbua ha <ii>oaaw://pmyhtl-ylzpgly.jvt</>.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Av bwnyhkl av clyzpvu 6 vm<p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt sltvu-zxbllgf.jvt.","<yi>VLT rlf lewpylk</><iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt sltvu-zxbllgf.jvt."],kn=Sn(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),xe=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),Fe=Rn[z(j[4])](),$n=_e((e,t)=>x(`${Fe+t}`)),An=_e((e,t)=>x(`${Fe-++t}`)),jn=e=>$n.has(e)?9:An.has(e)?5:-2,O=e=>z(Mn[e]),Gn=e=>z(kn[e]),Pn=e=>{const t=e[z(j[0])]||e[z(j[1])]||e[z(j[2])]||e[z(j[3])];if(!t)return-1;const n=t.split("-");let o=(function(s="",l=""){let c=-2;const a=x(z(s));return a in xe&&(c=xe[a]),c===9?jn(l):c})(...n);return o===0||(s=>s[2]===x(s[0]+s[1]))(n)||(o=-2),o};let Q=!1,De=!1;function Be(e,t=-3){if(Q)return;const n=Math.max(i[e].mode,t);if(n>i[e].mode&&(i[e].mode=n),n<0)throw _t(e),i[e].vAdvised||m(e||"Parent",`${O(n+2)}${O(2)}`),i[e].vAdvised=!0,O(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(n>5&&De||Ft(`v${G} (${Gn(n)})`,n),n){case 1:case 2:case 3:m(e,O(6));break;case 4:m(e,O(7));break;case 5:m(e,O(8));break;default:n<1&&m("Parent",O(3))}Q=!0}function Nn(e){if(Q)return;const{mode:t}=i[e];t>5&&Be(e,t)}function Cn(e){e?.log===-1&&(e.log=!1,De=!0)}function _n(e,t){i[e]&&(u(e,`First run for ${e}`),Be(e,t===void 0?void 0:Number(t)),i[e].firstRun=!1)}function xn(e){const{height:t,id:n,iframe:o,mode:s,message:l,type:c,width:a}=e,{lastMessage:f}=i[n];switch(i[n]?.firstRun&&_n(n,s),u(n,`Received: %c${f}`,r.HIGHLIGHT),c){case ne:i[n].autoResize=JSON.parse(_(n,9));break;case Je:y(n,"Ready state reset"),i[n].initialised=!1;break;case Ye:ke(o);break;case Xe:On(n,_(n,9));break;case H:Se(e),cn(n),ln(n,l),i[n].initialised=!0,T(n,"onReady",o);break;case k:an(e,_(n,6));break;case Qe:Ee("onMouseEnter",e);break;case et:Ee("onMouseLeave",e);break;case se:hn(n);break;case re:bn(n);break;case tt:gn(n);break;case nt:vn(n);break;case D:$e(e);break;case ot:wn(e);break;case it:zn(e);break;case st:In(e);break;case rt:Hn(n,l);break;default:if(a===0&&t===0){w(n,`Unsupported message received (${c}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);return}if(a===0||t===0){u(n,"Ignoring message with 0 height or width");return}if(document.hidden){u(n,"Page hidden - ignored resize request");return}Se(e)}}const Fn=e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()},Dn=e=>Object.values(i).forEach(Fn(e));function We(e){const t=e.data;if(t===Ze){Dn(e.source);return}if(!sn(t)){if(typeof t!==U)return;v(W,"ignoredMessage"),Nt(W,t);return}const n=en(t),{id:o,type:s}=n;switch(v(o,s),!0){case!i[o]:throw new Error(`${s} No settings for ${o}. Message was: ${t}`);case!nn(n):case rn(n):case!on(n,e):return;default:i[o].lastMessage=e.data,we(o,xn)(n)}}const Bn=zt(()=>{A(window,k,We),A(document,"visibilitychange",Xt),window.iframeParentListener=e=>setTimeout(()=>We({data:e,sameOrigin:!0}))}),Ue={};function Wn(e){if(Ue[e]===!0)return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;Ue[e]=!0;const n=Array.from(t).flatMap(o=>[`
8
+ `);return}u(e,`Version mismatch (Child: %c${t}%c !== Parent: %c${G})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT)}}function E(e,t,n){if(!i[e])return null;const o=i[e][t];if(typeof o!==ht)throw new TypeError(`${t} on iframe[${e}] is not a function`);if(t!=="onBeforeClose"&&t!=="onScroll")return wt(o,n);try{return o(n)}catch(s){return console.error(s),z(e,`Error in ${t} callback`),null}}function an(e,t){const{id:n,iframe:o}=e;u(n,`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT,r.FOREGROUND),E(n,"onMessage",{iframe:o,message:JSON.parse(t)})}function _(e,t){const{lastMessage:n}=i[e];return n.slice(n.indexOf(":")+gt+t)}function we(e,t){const{id:n,iframe:o,height:s,type:c,width:l}=t;let a={x:0,y:0};if(l===0&&s===0){const f=_(n,9).split(":");a={x:f[1],y:f[0]}}else a={x:l,y:s};E(n,e,{iframe:o,screenX:Number(a.x),screenY:Number(a.y),type:c})}const d={position:null,version:G};function Ie(){d.position=null}const cn=()=>d.position;function un(e){d.position=e}function Ee(e){return d.position===null&&(d.position={x:window.scrollX,y:window.scrollY}),u(e,`Get page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),d.position}function Te(e){d.position!==null&&(window.scrollTo(d.position.x,d.position.y),g(e,`Set page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),Ie())}function Oe(e,t){const{id:n}=t,o=`${t[e]}px`;i[n].iframe.style[e]=o,g(n,`Set ${e}: %c${o}`,r.HIGHLIGHT)}function He(e){const{id:t}=e,{sizeHeight:n,sizeWidth:o}=i[t];n&&Oe(rt,e),o&&Oe(lt,e)}function Le(e){const{id:t}=e;He(e),Te(t),E(t,"onResized",e)}function ke(e){const{id:t}=e;u(t,"Disconnected from iframe"),delete i[t],delete e.iframeResizer}function Se(e){const{id:t}=e;if(E(t,"onBeforeClose",t)===!1){u(t,"Close iframe cancelled by onBeforeClose");return}u(t,`Removing iframe: %c${t}`,r.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(n){z(t,n)}E(t,"onAfterClose",t),ke(e)}function je(e){const{id:t,type:n}=e;u(t,`Size reset requested by ${n===H?"parent page":"child page"}`),Ee(t),He(e),S(D,D,t)}const Re=(e,t)=>{const n={};return(o,s)=>{const{iframe:c}=i[s];function l(f,p){n[p]||(f(),n[p]=requestAnimationFrame(()=>{n[p]=null}))}function a(){S(`${o} (${e})`,`${e}:${t(c)}`,s)}l(a,s)}},Me=e=>t=>{e in i[t]&&(i[t][e](),delete i[t][e])},$e=((e,t)=>n=>{let o=!1;const s=y=>()=>{i[n]?(!o||o===y)&&(e(y,n),o=y,requestAnimationFrame(()=>{o=!1})):h()},c=s(le),l=s("resize window"),a=new ResizeObserver(s("pageObserver")),f=new ResizeObserver(s("iframeObserver"));function p(y,O){u(n,`${y}listeners for send${t}`),O(window,le,c),O(window,re,l)}function h(){v(n,`stop${t}`),p("Remove ",ze),a.disconnect(),f.disconnect(),i[n]&&ze(i[n].iframe,F,h)}function j(){p("Add ",$),a.observe(document.body),f.observe(i[n].iframe)}i[n]&&(i[n][`stop${t}`]=h,$(i[n].iframe,F,h),j())});function fn(e){const t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),{scrollY:o,scrollX:s,innerHeight:c,innerWidth:l}=window,{clientHeight:a,clientWidth:f}=document.documentElement;return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(a,c||0),clientWidth:Math.max(f,l||0),offsetTop:Math.trunc(n.top-t.top),offsetLeft:Math.trunc(n.left-t.left),scrollTop:o,scrollLeft:s,documentHeight:a,documentWidth:f,windowHeight:c,windowWidth:l})}const pn=Re(ie,fn),hn=$e(pn,"PageInfo"),dn=Me("stopPageInfo");function yn(e){const{scrollWidth:t,scrollHeight:n}=document.documentElement,o=typeof window<"u"&&window.visualViewport?window.visualViewport:{},{width:s=0,height:c=0,offsetLeft:l=0,offsetTop:a=0,pageLeft:f=0,pageTop:p=0,scale:h=1}=o;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:s,height:c,offsetLeft:l,offsetTop:a,pageLeft:f,pageTop:p,scale:h}})}const gn=Re(se,yn),mn=$e(gn,"ParentInfo"),bn=Me("stopParentInfo");function Ae(e){const t=e.getBoundingClientRect(),n=Ee(e.id);return{x:Number(t.left)+Number(n.x),y:Number(t.top)+Number(n.y)}}function Ge(e){const{x:t,y:n}=cn(),o=i[e]?.iframe;if(E(e,"onScroll",{iframe:o,top:n,left:t,x:t,y:n})===!1){Ie();return}Te(e)}function vn(e){const{id:t,height:n,width:o}=e,s=window.parentIframe||window.parentIFrame||window;g(t,`scrollBy: x: %c${o}%c y: %c${n}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),s.scrollBy(o,n)}const Pe=e=>t=>{const{id:n,iframe:o,height:s,width:c}=t;function l(y){un(y),Ge(n)}function a(y,O){y[`scrollTo${e?"Offset":""}`](O.x,O.y)}const f=y=>({x:c+y.x,y:s+y.y}),p=e?Ae(o):{x:0,y:0},h=f(p),j=window.parentIframe||window.parentIFrame;g(n,`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),j?a(j,h):l(h)},zn=Pe(!1),wn=Pe(!0);function In(e,t,n){const{x:o,y:s}=Ae(n);g(e,`Moving to in page link: %c#${t}`,r.HIGHLIGHT),d.position={x:o,y:s},Ge(e),window.location.hash=t}function En(e,t){const n=window.parentIframe||window.parentIFrame;if(!n){u(e,`In page link #${t} not found`);return}n.moveToAnchor(t)}function Tn(e,t){const n=t.split("#")[1]||"",o=decodeURIComponent(n),s=document.getElementById(o)||document.getElementsByName(o)[0];if(s){In(e,n,s);return}if(window.top===window.self){u(e,`In page link #${n} not found`);return}En(e,n)}function On(e){const t=i[e]?.iframe?.title;return t===""||t===void 0}function Hn(e,t){i[e]?.syncTitle&&(i[e].iframe.title=t,g(e,`Set iframe title attribute: %c${t}`,r.HIGHLIGHT))}const x=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)},w=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),Ln=new Date,Ne=e=>new Set(Array.from({length:9},e)),Ce=" - lewpylk",A=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],kn=["<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"],Sn=e=>[e[0],...e.slice(1).map(t=>`${t}${Ce}`),`${e[4]}${Ce}`,...e.slice(1)],jn=Sn(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),_e=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),xe=Ln[w(A[4])](),Rn=Ne((e,t)=>x(`${xe+t}`)),Mn=Ne((e,t)=>x(`${xe-++t}`)),$n=e=>Rn.has(e)?9:Mn.has(e)?5:-2,T=e=>w(kn[e]),An=e=>w(jn[e]),Gn=e=>{const t=e[w(A[0])]||e[w(A[1])]||e[w(A[2])]||e[w(A[3])];if(!t)return-1;const n=t.split("-");let o=(function(s="",c=""){let l=-2;const a=x(w(s));return a in _e&&(l=_e[a]),l===9?$n(c):l})(...n);return o===0||(s=>s[2]===x(s[0]+s[1]))(n)||(o=-2),o};let K=!1,Fe=!1;function De(e,t=-3){if(K)return;const n=Math.max(i[e].mode,t);if(n>i[e].mode&&(i[e].mode=n),n<0)throw _t(e),i[e].vAdvised||b(e||"Parent",`${T(n+2)}${T(2)}`),i[e].vAdvised=!0,T(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(n>5&&Fe||Ft(`v${G} (${An(n)})`,n),n){case 1:case 2:case 3:b("Parent",T(6));break;case 4:b("Parent",T(7));break;case 5:b("Parent",T(8));break;default:n<1&&b("Parent",T(3))}K=!0}function Pn(e){if(K)return;const{mode:t}=i[e];t>5&&De(e,t)}function Nn(e){e?.log===-1&&(e.log=!1,Fe=!0)}function Cn(e,t){i[e]&&(u(e,`First run for ${e}`),De(e,t===void 0?void 0:Number(t)),i[e].firstRun=!1)}function _n(e){const{height:t,id:n,iframe:o,mode:s,message:c,type:l,width:a}=e,{lastMessage:f}=i[n];switch(i[n]?.firstRun&&Cn(n,s),u(n,`Received: %c${f}`,r.HIGHLIGHT),l){case te:i[n].autoResize=JSON.parse(_(n,9));break;case Ze:g(n,"Ready state reset"),i[n].initialised=!1;break;case Je:Se(o);break;case Ye:Tn(n,_(n,9));break;case H:Le(e),rn(n),ln(n,c),i[n].initialised=!0,E(n,"onReady",o);break;case R:an(e,_(n,6));break;case Ke:we("onMouseEnter",e);break;case Qe:we("onMouseLeave",e);break;case ie:hn(n);break;case se:mn(n);break;case et:dn(n);break;case tt:bn(n);break;case D:je(e);break;case nt:vn(e);break;case ot:zn(e);break;case it:wn(e);break;case st:Hn(n,c);break;default:if(a===0&&t===0){z(n,`Unsupported message received (${l}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);return}if(a===0||t===0){u(n,"Ignoring message with 0 height or width");return}if(document.hidden){u(n,"Page hidden - ignored resize request");return}Le(e)}}const xn=e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()},Fn=e=>Object.values(i).forEach(xn(e));function Be(e){const t=e.data;if(t===qe){Fn(e.source);return}if(!on(t)){if(typeof t!==W)return;v(B,"ignoredMessage"),Nt(B,t);return}const n=Qt(t),{id:o,type:s}=n;switch(v(o,s),!0){case!i[o]:throw new Error(`${s} No settings for ${o}. Message was: ${t}`);case!tn(n):case sn(n):case!nn(n,e):return;default:i[o].lastMessage=e.data,be(o,_n)(n)}}const Dn=It(()=>{$(window,R,Be),$(document,"visibilitychange",Yt),window.iframeParentListener=e=>setTimeout(()=>Be({data:e,sameOrigin:!0}))}),We={};function Bn(e){if(We[e]===!0)return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;We[e]=!0;const n=Array.from(t).flatMap(o=>[`
11
9
  `,o,`
12
- `]);return m(e,`<rb>Duplicate ID attributes detected</>
10
+ `]);return b(e,`<rb>Duplicate ID attributes detected</>
13
11
 
14
12
  The <b>${e}</> ID is not unique. Having multiple iframes on the same page with the same ID causes problems with communication between the iframe and parent page. Please ensure that the ID of each iframe has a unique value.
15
13
 
16
14
  Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...n,`
17
- `),!1}const Un=`<rb>Deprecated Method Name</>
18
-
19
- The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${he}`,Vn=`<rb>Deprecated Method</>
20
-
21
- Use of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As there are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code.`;function qn(e){if(i[e]){const{iframe:t}=i[e],n={close:ke.bind(null,t),disconnect:Me.bind(null,t),moveToAnchor(o){Lt(o,U,"moveToAnchor(anchor) anchor"),E("Move to anchor",`moveToAnchor:${o}`,e)},removeListeners(){m(e,Un),this.disconnect()},resize(){m(e,Vn),E("Window resize",B,e)},sendMessage(o){o=JSON.stringify(o),E(k,`${k}:${o}`,e)}};t.iframeResizer=n,t.iFrameResizer=n}}const Zn="8",Jn="32",Yn=pt,Xn=!0;function Kn(e){const{autoResize:t,bodyBackground:n,bodyMargin:o,bodyPadding:s,heightCalculationMethod:l,inPageLinks:c,license:a,log:f,logExpand:p,mouseEvents:h,offsetHeight:M,offsetWidth:g,mode:L,sizeHeight:So,sizeWidth:Mo,tolerance:ko,widthCalculationMethod:$o}=i[e];return[e,Zn,Mo,f,Jn,Xn,t,o,l,n,s,ko,c,Yn,$o,h,M,g,So,a,d.version,L,"",p].join(":")}const Qn="0";function eo(e){const{bodyMargin:t}=i[e];(typeof t===dt||t===Qn)&&(i[e].bodyMargin=`${t}px`)}const to=e=>{try{return new URL(e).origin}catch{return null}},no=e=>typeof e===le&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function oo(e,t){const{checkOrigin:n,iframe:{src:o,sandbox:s},initialisedFirstPage:l,waitForLoad:c}=t[e],a=to(o);v(e,"noResponse"),m(e,`<rb>No response from iframe</>
15
+ `),!1}function Wn(e){if(i[e]){const{iframe:t}=i[e];t.iframeResizer={close:Se.bind(null,t),disconnect:ke.bind(null,t),moveToAnchor(n){Lt(n,W,"moveToAnchor(anchor) anchor"),S("Move to anchor",`moveToAnchor:${n}`,e)},sendMessage(n){n=JSON.stringify(n),S(R,`${R}:${n}`,e)}}}}const Un="8",Vn="32",qn=ft,Zn=!0;function Jn(e){const{autoResize:t,bodyBackground:n,bodyMargin:o,bodyPadding:s,heightCalculationMethod:c,inPageLinks:l,license:a,log:f,logExpand:p,mouseEvents:h,offsetHeight:j,offsetWidth:y,mode:O,sizeHeight:Ho,sizeWidth:Lo,tolerance:ko,widthCalculationMethod:So}=i[e];return[e,Un,Lo,f,Vn,Zn,t,o,c,n,s,ko,l,qn,So,h,j,y,Ho,a,d.version,O,"",p].join(":")}const Yn="0";function Xn(e){const{bodyMargin:t}=i[e];(typeof t===pt||t===Yn)&&(i[e].bodyMargin=`${t}px`)}const Kn=e=>{try{return new URL(e).origin}catch{return null}},Qn=e=>typeof e===ae&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function eo(e,t){const{checkOrigin:n,iframe:{src:o,sandbox:s},initialisedFirstPage:c,waitForLoad:l}=t[e],a=Kn(o);v(e,"noResponse"),b(e,`<rb>No response from iframe</>
22
16
 
23
17
  The iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.
24
18
  ${n&&a?`
25
19
  The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${a}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.
26
- `:""}${c&&!l?`
20
+ `:""}${l&&!c?`
27
21
  The <b>waitForLoad</> option is currently set to <bb>true</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <bb>false</>.
28
- `:""}${no(s)?`
22
+ `:""}${Qn(s)?`
29
23
  The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
30
24
  `:""}
31
25
  This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.
32
- `)}function io(e,t){function n(){if(t[e]===void 0)return;const{initialised:l,loadErrorShown:c}=t[e];if(t[e].msgTimeout=void 0,l){t[e].initialisedFirstPage=!0;return}c||(t[e].loadErrorShown=!0,oo(e,t))}const{msgTimeout:o,warningTimeout:s}=t[e];s&&(o&&clearTimeout(o),t[e].msgTimeout=setTimeout(n,s))}const so=1,ro=e=>e.loading===Ke,co=e=>e===H;function lo(e){i[e]?.heightCalculationMethod in yt&&$e({id:e,iframe:i[e].iframe,height:1,width:1,type:H})}function ao(e,t){A(e,F,()=>setTimeout(t,so))}const uo=e=>{const{src:t,srcdoc:n}=e;return!n&&(t==null||t===""||t==="about:blank")};function fo(e,t){const{iframe:n,waitForLoad:o}=i[e];if(o!==!0){if(uo(n)){setTimeout(()=>{v(e,"noContent"),y(e,"No content detected in the iframe, delaying initialisation")});return}setTimeout(t)}}function po(e,t){const n=s=>()=>{if(!i[e])return;const{firstRun:l,iframe:c}=i[e];E(s,t,e),co(s)&&ro(c)||io(e,i),l||lo(e)},{iframe:o}=i[e];i[e].initChild=n(oe),ao(o,n(ie)),fo(e,n(H))}function ho(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||ne in t)&&m(e,`<rb>Deprecated Option</>
26
+ `)}function to(e,t){function n(){if(t[e]===void 0)return;const{initialised:c,loadErrorShown:l}=t[e];if(t[e].msgTimeout=void 0,c){t[e].initialisedFirstPage=!0;return}l||(t[e].loadErrorShown=!0,eo(e,t))}const{msgTimeout:o,warningTimeout:s}=t[e];s&&(o&&clearTimeout(o),t[e].msgTimeout=setTimeout(n,s))}const no=1,oo=e=>e.loading===Xe,io=e=>e===H;function so(e){i[e]?.heightCalculationMethod in mt&&je({id:e,iframe:i[e].iframe,height:1,width:1,type:H})}function ro(e,t){$(e,F,()=>setTimeout(t,no))}const lo=e=>{const{src:t,srcdoc:n}=e;return!n&&(t==null||t===""||t==="about:blank")};function ao(e,t){const{iframe:n,waitForLoad:o}=i[e];if(o!==!0){if(lo(n)){setTimeout(()=>{v(e,"noContent"),g(e,"No content detected in the iframe, delaying initialisation")});return}setTimeout(t)}}function co(e,t){const n=s=>()=>{if(!i[e])return;const{firstRun:c,iframe:l}=i[e];S(s,t,e),io(s)&&oo(l)||to(e,i),c||so(e)},{iframe:o}=i[e];i[e].initChild=n(ne),ro(o,n(oe)),ao(e,n(H))}function uo(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||te in t)&&b(e,`<rb>Deprecated Option</>
33
27
 
34
- The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${P}</>, <bb>${pe}</>, <bb>${fe}</> or <bb>${ue}</>.
35
- `),t):{}}function go(e){i[e].warningTimeout||y(e,"warningTimeout:%c disabled",r.HIGHLIGHT)}function mo(e,{offset:t,offsetSize:n}){const o=n||t;o&&(i[e].direction===P?(i[e].offsetHeight=o,u(e,`Offset height: %c${o}`,r.HIGHLIGHT)):(i[e].offsetWidth=o,u(e,`Offset width: %c${o}`,r.HIGHLIGHT)))}function yo(e){const{direction:t}=i[e];switch(t){case P:break;case pe:i[e].sizeHeight=!1;case fe:i[e].sizeWidth=!0;break;case ue:i[e].sizeWidth=!1,i[e].sizeHeight=!1,i[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${t}" is not valid`)}u(e,`direction: %c${t}`,r.HIGHLIGHT)}const Ve=e=>e===""||e.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":e;function bo(e){const{checkOrigin:t,remoteHost:n}=i[e];Array.isArray(t)&&t.length===0&&w(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),i[e].targetOrigin=Array.isArray(t)?t.map(Ve):[t===!1?"*":Ve(n)]}function vo(e){const{id:t}=e;i[t].postMessageTarget===null&&(i[t].postMessageTarget=e.contentWindow)}function ee(e,t,n){$(i[e],t)&&(m(e,`<rb>Deprecated option</>
28
+ The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${P}</>, <bb>${fe}</>, <bb>${ue}</> or <bb>${ce}</>.
29
+ `),t):{}}function fo(e){i[e].warningTimeout||g(e,"warningTimeout:%c disabled",r.HIGHLIGHT)}function po(e,{offset:t,offsetSize:n}){const o=n||t;o&&(i[e].direction===P?(i[e].offsetHeight=o,u(e,`Offset height: %c${o}`,r.HIGHLIGHT)):(i[e].offsetWidth=o,u(e,`Offset width: %c${o}`,r.HIGHLIGHT)))}function ho(e){const{direction:t}=i[e];switch(t){case P:break;case fe:i[e].sizeHeight=!1;case ue:i[e].sizeWidth=!0;break;case ce:i[e].sizeWidth=!1,i[e].sizeHeight=!1,i[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${t}" is not valid`)}u(e,`direction: %c${t}`,r.HIGHLIGHT)}const Ue=e=>e===""||e.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":e;function yo(e){const{checkOrigin:t,remoteHost:n}=i[e];Array.isArray(t)&&t.length===0&&z(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),i[e].targetOrigin=Array.isArray(t)?t.map(Ue):[t===!1?"*":Ue(n)]}function go(e){const{id:t}=e;i[t].postMessageTarget===null&&(i[t].postMessageTarget=e.contentWindow)}function Q(e,t,n){M(i[e],t)&&(b(e,`<rb>Deprecated option</>
36
30
 
37
- The <b>${t}</> option has been renamed to <b>${n}</>. ${he}`),i[e][n]=i[e][t],delete i[e][t])}function wo(e){ee(e,at,ut),ee(e,"onClose","onBeforeClose"),ee(e,"onClosed","onAfterClose")}const zo=e=>$(e,"onMouseEnter")||$(e,"onMouseLeave");function Io(e,t){const{id:n}=e;i[n]={...i[n],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...C,...ho(n,t),mouseEvents:zo(t),mode:Pn(t),syncTitle:Ln(n)},wo(n),yo(n),mo(n,t),go(n),vo(e),bo(n)}const Eo="yes",qe="no";function To(e){const{id:t}=e;switch(u(t,`Iframe scrolling ${i[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=i[t]?.scrolling===!1?ft:V,i[t]?.scrolling){case gt:break;case!0:e.scrolling=Eo;break;case!1:e.scrolling=qe;break;default:e.scrolling=i[t]?.scrolling||qe}}function Oo(e,t,n){Io(t,n),u(e,`src: %c${t.srcdoc||t.src}`,r.HIGHLIGHT),Nn(e),To(t),eo(e),po(e,Kn(e)),qn(e),u(e,"Setup complete")}function Lo(e,t){const{id:n}=e;v(n,"setup"),Wn(n)&&Oo(n,e,t),xt(n)}function Ho(e,t){t.log===Z?t.log=!1:t.log===J?t.log=S:t.log===Y&&(t.log=R);const n=$(t,"log"),o=X(t.log),s=n?o?!0:t.log:C.log;$(t,"logExpand")||(t.logExpand=n&&o?t.log===R:C.logExpand),Cn(t),Pt({enabled:s,expand:t.logExpand,iframeId:e}),o&&!(t.log in bt)&&Ct(e,`Invalid value for options.log: Accepted values are "${R}" and "${S}"`),t.log=s}function Ro(e){if(!ge(e))throw new TypeError("Options is not an object");return Bn(),qt(e),t=>{const n=Vt(t,e);return te in t?(v(n,"alreadySetup"),w(n,`Ignored iframe (${n}), already setup.`)):(Ho(n,e),we(n,Lo)(t,e)),t?.iframeResizer}}b.LOG_COLLAPSED=J,b.LOG_DISABLED=Z,b.LOG_EXPANDED=Y,b.default=Ro,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
31
+ The <b>${t}</> option has been renamed to <b>${n}</>. ${vt}`),i[e][n]=i[e][t],delete i[e][t])}function mo(e){Q(e,at,ct),Q(e,"onClose","onBeforeClose"),Q(e,"onClosed","onAfterClose")}const bo=e=>M(e,"onMouseEnter")||M(e,"onMouseLeave");function vo(e,t){const{id:n}=e;i[n]={...i[n],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...C,...uo(n,t),mouseEvents:bo(t),mode:Gn(t),syncTitle:On(n)},mo(n),ho(n),po(n,t),fo(n),go(e),yo(n)}const zo="yes",Ve="no";function wo(e){const{id:t}=e;switch(u(t,`Iframe scrolling ${i[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=i[t]?.scrolling===!1?ut:U,i[t]?.scrolling){case yt:break;case!0:e.scrolling=zo;break;case!1:e.scrolling=Ve;break;default:e.scrolling=i[t]?.scrolling||Ve}}function Io(e,t,n){vo(t,n),u(e,`src: %c${t.srcdoc||t.src}`,r.HIGHLIGHT),Pn(e),wo(t),Xn(e),co(e,Jn(e)),Wn(e),u(e,"Setup complete")}function Eo(e,t){const{id:n}=e;v(n,"setup"),Bn(n)&&Io(n,e,t),xt(n)}function To(e,t){t.log===q?t.log=!1:t.log===Z?t.log=k:t.log===J&&(t.log=L);const n=M(t,"log"),o=Y(t.log),s=n?o?!0:t.log:C.log;M(t,"logExpand")||(t.logExpand=n&&o?t.log===L:C.logExpand),Nn(t),Pt({enabled:s,expand:t.logExpand,iframeId:e}),o&&!(t.log in bt)&&Ct(e,`Invalid value for options.log: Accepted values are "${L}" and "${k}"`),t.log=s}function Oo(e){if(!he(e))throw new TypeError("Options is not an object");return Dn(),Vt(e),t=>{const n=Ut(t,e);return ee in t?(v(n,"alreadySetup"),z(n,`Ignored iframe (${n}), already setup.`)):(To(n,e),be(n,Eo)(t,e)),t?.iframeResizer}}m.LOG_COLLAPSED=Z,m.LOG_DISABLED=q,m.LOG_EXPANDED=J,m.default=Oo,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
38
32
  //# sourceMappingURL=index.umd.js.map