Fork of bibtexbrowser for static publications lists on the website of the ZRD Saar
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
22 KiB

/*!
* @preserve
*
* @module iframe-resizer/parent 5.5.2 (iife)
*
* @license GPL-3.0 for non-commercial use only.
* For commercial use, you must purchase a license from
* https://iframe-resizer.com/pricing
*
* @description Keep same and cross domain iFrames sized to their content
*
* @author David J. Bradshaw <info@iframe-resizer.com>
*
* @see {@link https://iframe-resizer.com}
*
* @copyright (c) 2013 - 2025, David J. Bradshaw. All rights reserved.
*/
!function(){"use strict";const e="font-weight: normal;",t=e+"font-style: italic;",o="default",n=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(o){e[t]=o}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.5.2",g="iframeResizer",y="none",w="vertical",b="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),x="expanded",T="collapsed",M=Object.freeze({[x]:1,[T]:1});var E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t));const O=e=>e,R=(S=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some(([e])=>e in n)||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,o)=>e[t]().toString().padStart(o,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(b))),p.push([e,...t])}function $(e=o,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=o){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=o){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let o;try{o=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),b()}return o},event:function(e){v(),h.event=e},purge:g,time:function(e=o){v(),l[e]=performance.now()},timeEnd:function(e=o){$(e),delete l[e]},timeLog:$,touch:v}},S?.__esModule?S.default:S);var S;let I={},A=!1;const C=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const W=e=>(t,...o)=>I[t]?.console[e](...o);var L;const N=(L="log",(e,...t)=>!0===(e=>I[e]?I[e].log:A)(e)?W(L)(e,...t):null),F=W("warn"),B=W("error"),H=W("event"),P=W("purge"),q=W("errorBoundary");const D=(e,...t)=>I[e]?I[e].console.warn(E(O)(...t)):queueMicrotask(()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),U=(e=>(t,o="renamed to")=>(n,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${n.replace("()","")})</>\n\nThe <b>${n}</> ${t.toLowerCase()} has been ${o} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(D),J=U("Function"),Z=U("Option"),V=(e,t,o,n)=>e.addEventListener(t,o,n||!1),X=(e,t,o)=>e.removeEventListener(t,o,!1),Y=e=>{if(!e)return"";let t=-559038744,o=1103547984;for(let n,i=0;i<e.length;i++)n=e.codePointAt(i),t=Math.imul(t^n,2246822519),o=Math.imul(o^n,3266489917);return t^=Math.imul(t^o>>>15,1935289751),o^=Math.imul(o^t>>>15,3405138345),t^=o>>>16,o^=t>>>16,(2097152*(o>>>0)+(t>>>11)).toString(36)},G=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),_=["spjluzl","rlf","clyzpvu"],K=["<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."],Q=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ee=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),te=e=>G(K[e]);var oe=e=>{const t=e[G(_[0])]||e[G(_[1])]||e[G(_[2])];if(!t)return-1;const o=t.split("-");let n=function(e=""){let t=-2;const o=Y(G(e));return o in ee&&(t=ee[o]),t}(o[0]);return 0===n||(e=>e[2]===Y(e[0]+e[1]))(o)||(n=-2),n};function ne(e,t){const{warningTimeout:o}=t[e];0!==o&&(t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{loaded:o,loadErrorShown:n}=t[e];o||n||(t[e].loadErrorShown=!0,function(e,t){const{iframe:o,waitForLoad:n}=t[e],{sandbox:i}=o,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));D(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${n?"\nThe <b>waitForLoad</> option is currently set to <b>'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 <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis 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.\n`)}(e,t))},o))}var ie={};var re=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:w,inPageLinks:!1,heightCalculationMethod:"auto",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:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ie[e.id].onInit&&(Z("init()","onReady()","",e.id),ie[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ae={position:null,version:m};function se(e){function t(){me(x),pe(T),$("onResized",x)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(o,n)=>{const i={};var r,a;r=function(){ye(`${o} (${e})`,`${e}:${t()}`,n)},i[a=n]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let o=!1;const n=t=>()=>{ie[l]?o&&o!==t||(e(t,l),o=t,requestAnimationFrame(()=>{o=!1})):s()},i=n("scroll"),r=n("resize window");function a(e,t){t(window,"scroll",i),t(window,"resize",r)}function s(){H(l,`stop${t}`),a(0,X),c.disconnect(),u.disconnect(),X(ie[l].iframe,"load",s)}const l=T,c=new ResizeObserver(n("pageObserver")),u=new ResizeObserver(n("iframeObserver"));ie[l]&&(ie[l][`stop${t}`]=s,V(ie[l].iframe,"load",s),a(0,V),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ie[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ie[T]&&(ie[T][e](),delete ie[T][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:o,scrollX:n,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:o,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:o}=document.documentElement,{width:n,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:o},viewport:{width:n,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return de(),{x:Number(t.left)+Number(ae.position.x),y:Number(t.top)+Number(ae.position.y)}}function w(e){const t=e?y(x.iframe):{x:0,y:0};N(T,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const o=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),n=window.parentIframe||window.parentIFrame;n?function(t,o){t["scrollTo"+(e?"Offset":"")](o.x,o.y)}(n,o):function(e){ae.position=e,b(T)}(o)}function b(e){const{x:t,y:o}=ae.position,n=ie[e]?.iframe;!1!==$("onScroll",{iframe:n,top:o,left:t,x:t,y:o})?pe(e):fe()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>le(T,e,t);function j(){const{height:e,iframe:o,msg:n,type:r,width:a}=x;switch(ie[T]?.firstRun&&function(){if(!ie[T])return;je(T,x.mode),ie[T].firstRun=!1}(),r){case"close":ue(o);break;case"message":l=i(6),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":ie[T].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,o=window.parentIframe||window.parentIFrame||window;N(T,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),o.scrollBy(e,t)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":u();break;case"parentInfo":d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",o=decodeURIComponent(t);let n=document.getElementById(o)||document.getElementsByName(o)[0];n?function(){const e=y(n);N(T,`Moving to in page link: %c#${t}`,p),ae.position={x:e.x,y:e.y},b(T),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){ie[t]?.syncTitle&&(ie[t].iframe.title=e,N(t,`Set iframe title attribute: %c${e}`,p))}(n,T);break;case"reset":he(x);break;case"init":t(),function(e){try{ie[e].sameOrigin=!!ie[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ie[e].sameOrigin=!1}}(T),(s=n)!==m&&(void 0!==s||D(T,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ve=!0,$("onReady",o);break;default:if(0===a&&0===e)return void F(T,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}let k=e.data,x={},T=null;"[iFrameResizerChild]Ready"!==k?v===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in ie&&(x=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=ie[e[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:e[0],height:t+o(r)+n(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(a.mode=e[5]),a}(),T=x.id,T?(H(T,x.type),q(T,function(){!function(e){if(!ie[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${k}`)}(T),x.type in{}||(ie[T].loaded=!0,(null!==x.iframe||(F(T,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:o}=e;if(o)return!0;let n=ie[T]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,o=!1;for(;e<n.length;e++)if(n[e]===t){o=!0;break}return o}():function(){const e=ie[T]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):F("","iframeResizer received messageData without id, message was: ",k)):Object.keys(ie).forEach(e=>{ye("iFrame requested init",we(e),e)})}function le(e,t,o){let n=null,i=null;if(ie[e]){if(n=ie[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=n(o)}catch(o){console.error(o),F(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(n,o)}return i}function ce(e){const{id:t}=e;delete ie[t],delete e.iframeResizer}function ue(e){const{id:t}=e;if(!1!==le(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){F(t,e)}le(t,"onAfterClose",t),ce(e)}}function de(e){null===ae.position&&(ae.position={x:window.scrollX,y:window.scrollY})}function fe(){ae.position=null}function pe(e){null!==ae.position&&(window.scrollTo(ae.position.x,ae.position.y),N(e,`Set page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,h,p),fe())}function he(e){de(e.id),me(e),ye("reset","reset",e.id)}function me(e){function t(t){const n=`${e[t]}px`;e.iframe.style[t]=n,N(o,`Set ${t}: %c${n}`,p)}const{id:o}=e,{sizeHeight:n,sizeWidth:i}=ie[o];n&&t("height"),i&&t("width")}I=ie;const ge=e=>e.split(":").filter((e,t)=>19!==t).join(":");function ye(e,t,o){function n(n){const i=e in k?ge(t):t;N(o,n,p,h,p),N(o,`Message data: %c${i}`,p)}H(o,e),ie[o]&&(ie[o]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ie[o];if(r)try{return e.contentWindow.iframeChildListener(v+t),void n(`Sending message to iframe %c${o}%c via sameOrigin`)}catch(e){}n(`Sending message to iframe: %c${o}%c targetOrigin: %c${a}`),i.postMessage(v+t,a)}():F(o,`Iframe(${o}) not found`))}function we(e){const t=ie[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ae.version,t.mode,"",t.logExpand].join(":")}let be=0,ve=!1,ze=!1,$e=!1;function je(t,o=-3){if(ze)return;const n=Math.max(ie[t].mode,o);if(n>ie[t]&&(ie[t].mode=n),n<0)throw P(t),ie[t].vAdvised||D(t||"Parent",`${te(n+2)}${te(2)}`),ie[t].vAdvised=!0,te(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");n>-1&&$e||function(t,o){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,A||o<1?"font-weight: bold;":e))}(`v${m} (${(e=>G(Q[e]))(n)})`,n),n<1&&D("Parent",te(3)),ze=!0}var ke=e=>t=>{function o(){if(ie[u]){const{iframe:e}=ie[u],t={close:ue.bind(null,e),disconnect:ce.bind(null,e),removeListeners(){D(u,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){D(u,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their 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."),ye.bind(null,"Window resize","resize",u)},moveToAnchor(e){((e,t,o)=>{if(typeof e!==t)throw new TypeError(`${o} is not a ${n=t,n.charAt(0).toUpperCase()+n.slice(1)}`);var n})(e,"string","moveToAnchor(anchor) anchor"),ye("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){ye("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function n(e){const{id:o}=t,{waitForLoad:n}=ie[o];ne(o,ie),V(t,"load",function(){ye($,`${e}:${ve}`,o),function(){const e=ie[u]?.firstRun,o=ie[u]?.heightCalculationMethod in z;!e&&o&&he({iframe:t,height:0,width:0,type:"init"})}()}),!1===n&&ye(j,`${e}:${ve}`,o)}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&D(u,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${w}"</>, <i>"${b}"</> or <i>"${y}"</>.\n`),e):{}}function r(e){const t=ie[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){Object.hasOwn(ie[u],e)&&(D(u,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),ie[u][t]=ie[u][e],delete ie[u][e])}const s=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function l(e){var o,n;ie[u]={...ie[u],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...re,...i(e),mouseEvents:s(e),mode:oe(e),syncTitle:r(u)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),H(u,"setup"),function(){const{direction:e}=ie[u];switch(e){case w:break;case b:ie[u].sizeHeight=!1;case"both":ie[u].sizeWidth=!0;break;case y:ie[u].sizeWidth=!1,ie[u].sizeHeight=!1,ie[u].autoResize=!1;break;default:throw new TypeError(u,`Direction value of "${e}" is not valid`)}}(),(o=e?.offsetSize||e?.offset)&&(ie[u].direction===w?ie[u].offsetHeight=o:ie[u].offsetWidth=o),e?.offset&&D(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===ie[u].postMessageTarget&&(ie[u].postMessageTarget=t.contentWindow),ie[u].targetOrigin=!0===ie[u].checkOrigin?""===(n=ie[u].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const c=()=>"iframeResizer"in t,u=function(o){if(o&&"string"!=typeof o)throw new TypeError("Invalid id for iFrame. Expected String");return""!==o&&o||(o=function(){let t=e?.id||re.id+be++;return null!==document.getElementById(t)&&(t+=be++),t}(),t.id=o),o}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=x,e.logExpand=!t.includes("ifrlog=collapsed"))}(e),function(e,t){const o=Object.hasOwn(t,"log"),n="string"==typeof t.log,i=o?!!n||t.log:re.log;Object.hasOwn(t,"logExpand")||(t.logExpand=o&&n?t.log===x:re.logExpand),function(e){-1===e?.log&&(e.log=!1,$e=!0)}(t),function({enabled:e,expand:t,iframeId:o}){const n=R({expand:t,label:C(o)});A=e,I[o]||(I[o]={console:n})}({enabled:i,expand:t.logExpand,iframeId:e}),n&&!(t.log in M)&&B(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(u,e),q(u,function(e){c()?F(u,`Ignored iframe (${u}), already setup.`):(l(e),function(){if(ze)return;const{mode:e}=ie[u];-1!==e&&je(u,e)}(),Te(),function(){switch(t.style.overflow=!1===ie[u]?.scrolling?"hidden":"auto",ie[u]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=ie[u]?ie[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ie[u];"number"!=typeof e&&"0"!==e||(ie[u].bodyMargin=`${e}px`)}(),n(we(u)),o())})(e),t?.iframeResizer};function xe(){!1===document.hidden&&function(e,t){const o=e=>ie[e]?.autoResize&&!ie[e]?.firstRun;Object.keys(ie).forEach(function(n){o(n)&&ye(e,t,n)})}("Tab Visible","resize")}const Te=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{V(window,"message",se),V(document,"visibilitychange",xe),window.iframeParentListener=e=>setTimeout(()=>se({data:e,sameOrigin:!0}))}),Me=`[${g}] `;window.iframeResize=function(){function e(e){switch(!0){case!e:throw new TypeError(`${Me}iframe is not defined`);case!e.tagName:throw new TypeError(`${Me}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${Me}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),o.push(e)}}let t,o;return function(n,i){if("undefined"==typeof window)return[];switch(t=ke(n),o=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${Me}Unexpected data type (${typeof i})`)}return Object.freeze(o)}}(),window.iFrameResize=function(...e){J("iFrameResize()","iframeResize()","","parent"),window.iframeResize(...e)}}();