@iframe-resizer/core 6.0.0-beta.5 → 6.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +18 -24
- package/index.cjs.js.map +1 -1
- package/index.esm.js +18 -959
- package/index.esm.js.map +1 -1
- package/index.umd.js +18 -24
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
package/index.umd.js
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* @preserve
|
|
3
|
+
*
|
|
4
|
+
* @module iframe-resizer/core 6.0.0-beta.6 (esm) - 2026-04-10
|
|
5
|
+
*
|
|
6
|
+
* @license GPL-3.0 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
|
+
*/
|
|
2
18
|
|
|
3
|
-
Detected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.
|
|
4
19
|
|
|
5
|
-
See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
|
|
6
|
-
`);return}l(e,`Version mismatch (Child: %c${t}%c !== Parent: %c${i.VERSION})`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT)}}function H(e,t,n){if(!r[e])return null;const s=r[e][t];if(typeof s!==i.FUNCTION)throw new TypeError(`${t} on iframe[${e}] is not a function`);if(t!=="onBeforeClose"&&t!=="onScroll")return i.isolateUserCode(s,n);try{return s(n)}catch(o){return console.error(o),w(e,`Error in ${t} callback`),null}}function ve(e,t){const{id:n,iframe:s}=e;l(n,`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT,a.FOREGROUND),H(n,"onMessage",{iframe:s,message:JSON.parse(t)})}function M(e,t){const{lastMessage:n}=r[e];return n.slice(n.indexOf(i.SEPARATOR)+i.MESSAGE_HEADER_LENGTH+t)}function C(e,t){const{id:n,iframe:s,height:o,type:u,width:c}=t;let f={x:0,y:0};if(c===0&&o===0){const d=M(n,9).split(i.SEPARATOR);f={x:d[1],y:d[0]}}else f={x:c,y:o};H(n,e,{iframe:s,screenX:Number(f.x),screenY:Number(f.y),type:u})}const E={position:null,version:i.VERSION};function z(){E.position=null}const ke=()=>E.position;function De(e){E.position=e}function F(e){return E.position===null&&(E.position={x:window.scrollX,y:window.scrollY}),l(e,`Get page position: %c${E.position.x}%c, %c${E.position.y}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),E.position}function B(e){E.position!==null&&(window.scrollTo(E.position.x,E.position.y),O(e,`Set page position: %c${E.position.x}%c, %c${E.position.y}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),z())}function x(e,t){const{id:n}=t,s=`${t[e]}px`;r[n].iframe.style[e]=s,O(n,`Set ${e}: %c${s}`,a.HIGHLIGHT)}function W(e){const{id:t}=e,{sizeHeight:n,sizeWidth:s}=r[t];n&&x(i.HEIGHT,e),s&&x(i.WIDTH,e)}function U(e){const{id:t}=e;W(e),B(t),H(t,"onResized",e)}function V(e){const{id:t}=e;l(t,"Disconnected from iframe"),delete r[t],delete e.iframeResizer}function j(e){const{id:t}=e;if(H(t,"onBeforeClose",t)===!1){l(t,"Close iframe cancelled by onBeforeClose");return}l(t,`Removing iframe: %c${t}`,a.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(n){w(t,n)}H(t,"onAfterClose",t),V(e)}function X(e){const{id:t,type:n}=e;l(t,`Size reset requested by ${n===i.INIT?"parent page":"child page"}`),F(t),W(e),A(i.RESET,i.RESET,t)}const q=(e,t)=>{const n={};return(s,o)=>{const{iframe:u}=r[o];function c(d,g){n[g]||(d(),n[g]=requestAnimationFrame(()=>{n[g]=null}))}function f(){A(`${s} (${e})`,`${e}:${t(u)}`,o)}c(f,o)}},Z=e=>t=>{e in r[t]&&(r[t][e](),delete r[t][e])},Y=((e,t)=>n=>{let s=!1;const o=I=>()=>{r[n]?(!s||s===I)&&(e(I,n),s=I,requestAnimationFrame(()=>{s=!1})):h()},u=o(i.SCROLL),c=o("resize window"),f=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));function g(I,S){l(n,`${I}listeners for send${t}`),S(window,i.SCROLL,u),S(window,i.RESIZE,c)}function h(){T(n,`stop${t}`),g("Remove ",i.removeEventListener),f.disconnect(),d.disconnect(),r[n]&&i.removeEventListener(r[n].iframe,i.LOAD,h)}function R(){g("Add ",i.addEventListener),f.observe(document.body),d.observe(r[n].iframe)}r[n]&&(r[n][`stop${t}`]=h,i.addEventListener(r[n].iframe,i.LOAD,h),R())});function _e(e){const t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),{scrollY:s,scrollX:o,innerHeight:u,innerWidth:c}=window,{clientHeight:f,clientWidth:d}=document.documentElement;return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(f,u||0),clientWidth:Math.max(d,c||0),offsetTop:Math.trunc(n.top-t.top),offsetLeft:Math.trunc(n.left-t.left),scrollTop:s,scrollLeft:o,documentHeight:f,documentWidth:d,windowHeight:u,windowWidth:c})}const Ce=q(i.PAGE_INFO,_e),ze=Y(Ce,"PageInfo"),Fe=Z("stopPageInfo");function Be(e){const{scrollWidth:t,scrollHeight:n}=document.documentElement,s=typeof window<"u"&&window.visualViewport?window.visualViewport:{},{width:o=0,height:u=0,offsetLeft:c=0,offsetTop:f=0,pageLeft:d=0,pageTop:g=0,scale:h=1}=s;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:u,offsetLeft:c,offsetTop:f,pageLeft:d,pageTop:g,scale:h}})}const xe=q(i.PARENT_INFO,Be),We=Y(xe,"ParentInfo"),Ue=Z("stopParentInfo");function J(e){const t=e.getBoundingClientRect(),n=F(e.id);return{x:Number(t.left)+Number(n.x),y:Number(t.top)+Number(n.y)}}function K(e){const{x:t,y:n}=ke(),s=r[e]?.iframe;if(H(e,"onScroll",{iframe:s,top:n,left:t,x:t,y:n})===!1){z();return}B(e)}function Ve(e){const{id:t,height:n,width:s}=e,o=window.parentIframe||window.parentIFrame||window;O(t,`scrollBy: x: %c${s}%c y: %c${n}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),o.scrollBy(s,n)}const Q=e=>t=>{const{id:n,iframe:s,height:o,width:u}=t;function c(I){De(I),K(n)}function f(I,S){I[`scrollTo${e?"Offset":""}`](S.x,S.y)}const d=I=>({x:u+I.x,y:o+I.y}),g=e?J(s):{x:0,y:0},h=d(g),R=window.parentIframe||window.parentIFrame;O(n,`Reposition requested (offset x:%c${g.x}%c y:%c${g.y})`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),R?f(R,h):c(h)},je=Q(!1),Xe=Q(!0);function qe(e,t,n){const{x:s,y:o}=J(n);O(e,`Moving to in page link: %c#${t}`,a.HIGHLIGHT),E.position={x:s,y:o},K(e),window.location.hash=t}function Ze(e,t){const n=window.parentIframe||window.parentIFrame;if(!n){l(e,`In page link #${t} not found`);return}n.moveToAnchor(t)}function Ye(e,t){const n=t.split("#")[1]||"",s=decodeURIComponent(n),o=document.getElementById(s)||document.getElementsByName(s)[0];if(o){qe(e,n,o);return}if(window.top===window.self){l(e,`In page link #${n} not found`);return}Ze(e,n)}function Je(e){const t=r[e]?.iframe?.title;return t===""||t===void 0}function Ke(e,t){r[e]?.syncTitle&&(r[e].iframe.title=t,O(e,`Set iframe title attribute: %c${t}`,a.HIGHLIGHT))}let P=!1,m=!1;function ee(e,t=-3){if(P)return;const n=Math.max(r[e].mode,t);if(n>r[e].mode&&(r[e].mode=n),n<0)throw ue(e),r[e].vAdvised||b(e||"Parent",`${i.getModeData(n+2)}${i.getModeData(2)}`),r[e].vAdvised=!0,i.getModeData(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(n>5&&m||ge(`v${i.VERSION} (${i.getModeLabel(n)})`,n),n){case 1:case 2:case 3:b("Parent",i.getModeData(6));break;case 4:b("Parent",i.getModeData(7));break;case 5:b("Parent",i.getModeData(8));break;default:n<1&&b("Parent",i.getModeData(3))}P=!0}function Qe(e){if(P)return;const{mode:t}=r[e];t>5&&ee(e,t)}function me(e){e?.log===-1&&(e.log=!1,m=!0)}function et(e,t){r[e]&&(l(e,`First run for ${e}`),ee(e,t===void 0?void 0:Number(t)),r[e].firstRun=!1)}function tt(e){const{height:t,id:n,iframe:s,mode:o,message:u,type:c,width:f}=e,{lastMessage:d}=r[n];switch(r[n]?.firstRun&&et(n,o),l(n,`Received: %c${d}`,a.HIGHLIGHT),c){case i.AUTO_RESIZE:r[n].autoResize=JSON.parse(M(n,9));break;case i.BEFORE_UNLOAD:O(n,"Ready state reset"),r[n].initialised=!1;break;case i.CLOSE:j(s);break;case i.IN_PAGE_LINK:Ye(n,M(n,9));break;case i.INIT:U(e),Pe(n),$e(n,u),r[n].initialised=!0,H(n,"onReady",s);break;case i.MESSAGE:ve(e,M(n,6));break;case i.MOUSE_ENTER:C("onMouseEnter",e);break;case i.MOUSE_LEAVE:C("onMouseLeave",e);break;case i.PAGE_INFO:ze(n);break;case i.PARENT_INFO:We(n);break;case i.PAGE_INFO_STOP:Fe(n);break;case i.PARENT_INFO_STOP:Ue(n);break;case i.RESET:X(e);break;case i.SCROLL_BY:Ve(e);break;case i.SCROLL_TO:je(e);break;case i.SCROLL_TO_OFFSET:Xe(e);break;case i.TITLE:Ke(n,u);break;default:if(f===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(f===0||t===0){l(n,"Ignoring message with 0 height or width");return}if(document.hidden){l(n,"Page hidden - ignored resize request");return}U(e)}}const nt=e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()},it=e=>Object.values(r).forEach(nt(e));function te(e){const t=e.data;if(t===i.CHILD_READY_MESSAGE){it(e.source);return}if(!ye(t)){if(typeof t!==i.STRING)return;T(i.PARENT,"ignoredMessage"),fe(i.PARENT,t);return}const n=Ae(t),{id:s,type:o}=n;switch(T(s,o),!0){case!r[s]:throw new Error(`${o} No settings for ${s}. Message was: ${t}`);case!Ge(n):case Ne(n):case!Me(n,e):return;default:r[s].lastMessage=e.data,D(s,tt)(n)}}const rt=i.once(()=>{i.addEventListener(window,i.MESSAGE,te),i.addEventListener(document,"visibilitychange",Le),window.iframeParentListener=e=>setTimeout(()=>te({data:e,sameOrigin:!0}))}),ne={};function st(e){if(ne[e]===!0)return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;ne[e]=!0;const n=Array.from(t).flatMap(s=>[i.NEW_LINE,s,i.NEW_LINE]);return b(e,`<rb>Duplicate ID attributes detected</>
|
|
7
|
-
|
|
8
|
-
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.
|
|
9
|
-
|
|
10
|
-
Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...n,i.NEW_LINE),!1}function ot(e){if(r[e]){const{iframe:t}=r[e];t.iframeResizer={close:j.bind(null,t),disconnect:V.bind(null,t),moveToAnchor(n){i.typeAssert(n,i.STRING,"moveToAnchor(anchor) anchor"),A("Move to anchor",`moveToAnchor:${n}`,e)},sendMessage(n){n=JSON.stringify(n),A(i.MESSAGE,`${i.MESSAGE}:${n}`,e)}}}}const at="8",ct="32",ft=i.CHILD,lt=!0;function ut(e){const{autoResize:t,bodyBackground:n,bodyMargin:s,bodyPadding:o,heightCalculationMethod:u,inPageLinks:c,license:f,log:d,logExpand:g,mouseEvents:h,offsetHeight:R,offsetWidth:I,mode:S,sizeHeight:xt,sizeWidth:Wt,tolerance:Ut,widthCalculationMethod:Vt}=r[e];return[e,at,Wt,d,ct,lt,t,s,u,n,o,Ut,c,ft,Vt,h,R,I,xt,f,E.version,S,"",g].join(i.SEPARATOR)}const dt="0";function gt(e){const{bodyMargin:t}=r[e];(typeof t===i.NUMBER||t===dt)&&(r[e].bodyMargin=`${t}px`)}const ht=e=>{try{return new URL(e).origin}catch{return null}},Et=e=>typeof e===i.OBJECT&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function It(e,t){const{checkOrigin:n,iframe:{src:s,sandbox:o},initialisedFirstPage:u,waitForLoad:c}=t[e],f=ht(s);T(e,"noResponse"),b(e,`<rb>No response from iframe</>
|
|
11
|
-
|
|
12
|
-
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.
|
|
13
|
-
${n&&f?`
|
|
14
|
-
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${f}</>, 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.
|
|
15
|
-
`:""}${c&&!u?`
|
|
16
|
-
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</>.
|
|
17
|
-
`:""}${Et(o)?`
|
|
18
|
-
The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
|
|
19
|
-
`:""}
|
|
20
|
-
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.
|
|
21
|
-
`)}function pt(e,t){function n(){if(t[e]===void 0)return;const{initialised:u,loadErrorShown:c}=t[e];if(t[e].msgTimeout=void 0,u){t[e].initialisedFirstPage=!0;return}c||(t[e].loadErrorShown=!0,It(e,t))}const{msgTimeout:s,warningTimeout:o}=t[e];o&&(s&&clearTimeout(s),t[e].msgTimeout=setTimeout(n,o))}const Ot=1,bt=e=>e.loading===i.LAZY,Tt=e=>e===i.INIT;function wt(e){r[e]?.heightCalculationMethod in i.RESET_REQUIRED_METHODS&&X({id:e,iframe:r[e].iframe,height:i.MIN_SIZE,width:i.MIN_SIZE,type:i.INIT})}function Lt(e,t){const n=()=>setTimeout(t,Ot);i.addEventListener(e,i.LOAD,n)}const Ht=e=>{const{src:t,srcdoc:n}=e;return!n&&(t==null||t===""||t==="about:blank")};function St(e,t){const{iframe:n,waitForLoad:s}=r[e];if(s!==!0){if(Ht(n)){setTimeout(()=>{T(e,"noContent"),O(e,"No content detected in the iframe, delaying initialisation")});return}setTimeout(t)}}function At(e,t){const n=o=>()=>{if(!r[e])return;const{firstRun:u,iframe:c}=r[e];A(o,t,e),Tt(o)&&bt(c)||pt(e,r),u||wt(e)},{iframe:s}=r[e];r[e].initChild=n(i.INIT_FROM_IFRAME),Lt(s,n(i.ONLOAD)),St(e,n(i.INIT))}function Rt(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||i.AUTO_RESIZE in t)&&b(e,`<rb>Deprecated Option</>
|
|
22
|
-
|
|
23
|
-
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${i.VERTICAL}</>, <bb>${i.HORIZONTAL}</>, <bb>${i.BOTH}</> or <bb>${i.NONE}</>.
|
|
24
|
-
`),t):{}}function Gt(e){r[e].warningTimeout||O(e,"warningTimeout:%c disabled",a.HIGHLIGHT)}function Mt(e,{offset:t,offsetSize:n}){const s=n||t;s&&(r[e].direction===i.VERTICAL?(r[e].offsetHeight=s,l(e,`Offset height: %c${s}`,a.HIGHLIGHT)):(r[e].offsetWidth=s,l(e,`Offset width: %c${s}`,a.HIGHLIGHT)))}function yt(e){const{direction:t}=r[e];switch(t){case i.VERTICAL:break;case i.HORIZONTAL:r[e].sizeHeight=!1;case i.BOTH:r[e].sizeWidth=!0;break;case i.NONE:r[e].sizeWidth=!1,r[e].sizeHeight=!1,r[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${t}" is not valid`)}l(e,`direction: %c${t}`,a.HIGHLIGHT)}const ie=e=>e===""||e.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":e;function Nt(e){const{checkOrigin:t,remoteHost:n}=r[e];Array.isArray(t)&&t.length===0&&w(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),r[e].targetOrigin=Array.isArray(t)?t.map(ie):[t===!1?"*":ie(n)]}function Pt(e){const{id:t}=e;r[t].postMessageTarget===null&&(r[t].postMessageTarget=e.contentWindow)}function $(e,t,n){i.hasOwn(r[e],t)&&(b(e,`<rb>Deprecated option</>
|
|
25
|
-
|
|
26
|
-
The <b>${t}</> option has been renamed to <b>${n}</>. ${i.REMOVED_NEXT_VERSION}`),r[e][n]=r[e][t],delete r[e][t])}function $t(e){$(e,i.OFFSET,i.OFFSET_SIZE),$(e,"onClose","onBeforeClose"),$(e,"onClosed","onAfterClose")}const vt=e=>i.hasOwn(e,"onMouseEnter")||i.hasOwn(e,"onMouseLeave");function kt(e,t){const{id:n}=e;r[n]={...r[n],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...G,...Rt(n,t),mouseEvents:vt(t),mode:i.setMode(t),syncTitle:Je(n)},$t(n),yt(n),Mt(n,t),Gt(n),Pt(e),Nt(n)}const Dt="yes",re="no";function _t(e){const{id:t}=e;switch(l(t,`Iframe scrolling ${r[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=r[t]?.scrolling===!1?i.HIDDEN:i.AUTO,r[t]?.scrolling){case i.OMIT:break;case!0:e.scrolling=Dt;break;case!1:e.scrolling=re;break;default:e.scrolling=r[t]?.scrolling||re}}function Ct(e,t,n){kt(t,n),l(e,`src: %c${t.srcdoc||t.src}`,a.HIGHLIGHT),Qe(e),_t(t),gt(e),At(e,ut(e)),ot(e),l(e,"Setup complete")}function zt(e,t){const{id:n}=e;T(n,"setup"),st(n)&&Ct(n,e,t),de(n)}function Ft(e,t){t.log===i.LOG_DISABLED?t.log=!1:t.log===i.LOG_COLLAPSED?t.log=i.COLLAPSE:t.log===i.LOG_EXPANDED&&(t.log=i.EXPAND);const n=i.hasOwn(t,"log"),s=i.isString(t.log),o=n?s?!0:t.log:G.log;i.hasOwn(t,"logExpand")||(t.logExpand=n&&s?t.log===i.EXPAND:G.logExpand),me(t),ce({enabled:o,expand:t.logExpand,iframeId:e}),s&&!(t.log in i.LOG_OPTIONS)&&le(e,`Invalid value for options.log: Accepted values are "${i.EXPAND}" and "${i.COLLAPSE}"`),t.log=o}function Bt(e){if(!i.isObject(e))throw new TypeError("Options is not an object");return rt(),Oe(e),t=>{const n=pe(t,e);return i.LABEL in t?(T(n,"alreadySetup"),w(n,`Ignored iframe (${n}), already setup.`)):(Ft(n,e),D(n,zt)(t,e)),t?.iframeResizer}}Object.defineProperty(p,"LOG_COLLAPSED",{enumerable:!0,get:()=>i.LOG_COLLAPSED}),Object.defineProperty(p,"LOG_DISABLED",{enumerable:!0,get:()=>i.LOG_DISABLED}),Object.defineProperty(p,"LOG_EXPANDED",{enumerable:!0,get:()=>i.LOG_EXPANDED}),p.default=Bt,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
20
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@iframe-resizer/common"),require("auto-console-group")):"function"==typeof define&&define.amd?define(["exports","@iframe-resizer/common","auto-console-group"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).connectResizer={},e.common,e.acg)}(this,function(e,n,t){"use strict";const i={},o=n.esModuleInterop(t);let r=!0;const s=o({expand:!1,label:n.PARENT}),a=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const c=e=>(n,...t)=>i[n]?i[n].console[e](...t):s[e](...t),d=e=>(n,...t)=>!0===(e=>i[e]?i[e].log:r)(n)?c(e)(n,...t):null,l=d("log"),f=l,u=d("debug"),g=c("warn"),m=c("error"),h=c("event"),p=c("purge"),E=c("endAutoGroup"),I=c("errorBoundary");const b=n.createFormatAdvise(n.id),T=(e,...t)=>i[e]?i[e].console.warn(...t.map(b)):queueMicrotask(()=>{const i=n.createFormatAdvise((e=>(...t)=>[`${n.LABEL}(${e})`,...t].join(" "))(e));console?.warn(...t.map(i))}),O=n.deprecate(T);O("Function"),O("Method"),O("Option");const w=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:n.VERTICAL,firstRun:!0,inPageLinks:!1,heightCalculationMethod:n.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:n.AUTO,onBeforeClose:()=>!0,onAfterClose(){},onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady(){},onResized(){},onScroll:()=>!0});let L=0;function H(e,t){let{id:i}=e;if(i&&!n.isString(i))throw new TypeError("Invalid id for iframe. Expected String");return i&&""!==i||(i=function(e){const n=e?.id||w.id+L++;return null===document.getElementById(n)?n:`${n}${L++}`}(t),e.id=i,h(i,"assignId"),l(i,`Added missing iframe ID: ${i} (${e.src})`)),i}function S(e,o,r){function s(i){const s=e in n.INIT_EVENTS?(e=>e.split(n.SEPARATOR).filter((e,n)=>19!==n).join(n.SEPARATOR))(o):o;f(r,i,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),f(r,`Message data: %c${s}`,t.HIGHLIGHT)}const{iframe:a,postMessageTarget:c,sameOrigin:d,targetOrigin:u}=i[r];if(d)try{return a.contentWindow.iframeChildListener(n.MESSAGE_ID+o),void s(`Sending message to iframe %c${r}%c via same origin%c`)}catch(m){e in n.INIT_EVENTS?(i[r].sameOrigin=!1,l(r,"New iframe does not support same origin")):g(r,"Same origin messaging failed, falling back to postMessage")}s(`Sending message to iframe: %c${r}%c targetOrigin: %c${u.join(", ")}`);for(const t of u)c.postMessage(n.MESSAGE_ID+o,t)}function y(e,n,t){h(t,e),i[t]?.postMessageTarget?S(e,n,t):g(t,"Iframe not found")}function R(){var e,t;!0!==document.hidden&&(e="tabVisible",t=n.RESIZE,Object.values(i).filter(({autoResize:e,firstRun:n})=>e&&!n).forEach(({iframe:n})=>y(e,t,n.id)))}function G(e){const t=e.slice(n.MESSAGE_ID_LENGTH).split(":"),o=t[1]?Number(t[1]):0,r=i[t[0]]?.iframe,s=r?getComputedStyle(r):null,a=s?function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(s)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(s):0,c={iframe:r,id:t[0],height:o+a,width:Number(t[2]),type:t[3],msg:t[4],message:t[4]};return t[5]&&(c.mode=t[5]),c}const A={true:1,false:1,undefined:1};function N(e,t,o){if(!i[e])return null;const r=i[e][t];if(typeof r!==n.FUNCTION)throw new TypeError(`${t} on iframe[${e}] is not a function`);if("onBeforeClose"!==t&&"onScroll"!==t)return n.isolateUserCode(r,o);try{return r(o)}catch(s){return console.error(s),g(e,`Error in ${t} callback`),null}}function $(e,t){const{lastMessage:o}=i[e];return o.slice(o.indexOf(n.SEPARATOR)+n.MESSAGE_HEADER_LENGTH+t)}function v(e,t){const{id:i,iframe:o,height:r,type:s,width:a}=t;let c={x:0,y:0};if(0===a&&0===r){const e=$(i,9).split(n.SEPARATOR);c={x:e[1],y:e[0]}}else c={x:a,y:r};N(i,e,{iframe:o,screenX:Number(c.x),screenY:Number(c.y),type:s})}const M={position:null,version:n.VERSION};function D(){M.position=null}function _(e){return null===M.position&&(M.position={x:window.scrollX,y:window.scrollY}),l(e,`Get page position: %c${M.position.x}%c, %c${M.position.y}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),M.position}function P(e){null!==M.position&&(window.scrollTo(M.position.x,M.position.y),f(e,`Set page position: %c${M.position.x}%c, %c${M.position.y}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),D())}function k(e,n){const{id:o}=n,r=`${n[e]}px`;i[o].iframe.style[e]=r,f(o,`Set ${e}: %c${r}`,t.HIGHLIGHT)}function C(e){const{id:t}=e,{sizeHeight:o,sizeWidth:r}=i[t];o&&k(n.HEIGHT,e),r&&k(n.WIDTH,e)}function x(e){const{id:n}=e;C(e),P(n),N(n,"onResized",e)}function z(e){const{id:n}=e;l(n,"Disconnected from iframe"),delete i[n],delete e.iframeResizer}function F(e){const{id:n}=e;if(!1!==N(n,"onBeforeClose",n)){l(n,`Removing iframe: %c${n}`,t.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(i){g(n,i)}N(n,"onAfterClose",n),z(e)}else l(n,"Close iframe cancelled by onBeforeClose")}function B(e){const{id:t,type:i}=e;l(t,"Size reset requested by "+(i===n.INIT?"parent page":"child page")),_(t),C(e),y(n.RESET,n.RESET,t)}const W=(e,n)=>{const t={};return(o,r)=>{const{iframe:s}=i[r];var a,c;a=function(){y(`${o} (${e})`,`${e}:${n(s)}`,r)},t[c=r]||(a(),t[c]=requestAnimationFrame(()=>{t[c]=null}))}},U=e=>n=>{e in i[n]&&(i[n][e](),delete i[n][e])},V=(e,t)=>o=>{let r=!1;const s=n=>()=>{i[o]?r&&r!==n||(e(n,o),r=n,requestAnimationFrame(()=>{r=!1})):g()},a=s(n.SCROLL),c=s("resize window"),d=new ResizeObserver(s("pageObserver")),f=new ResizeObserver(s("iframeObserver"));function u(e,i){l(o,`${e}listeners for send${t}`),i(window,n.SCROLL,a),i(window,n.RESIZE,c)}function g(){h(o,`stop${t}`),u("Remove ",n.removeEventListener),d.disconnect(),f.disconnect(),i[o]&&n.removeEventListener(i[o].iframe,n.LOAD,g)}i[o]&&(i[o][`stop${t}`]=g,n.addEventListener(i[o].iframe,n.LOAD,g),u("Add ",n.addEventListener),d.observe(document.body),f.observe(i[o].iframe))};const j=V(W(n.PAGE_INFO,function(e){const n=document.body.getBoundingClientRect(),t=e.getBoundingClientRect(),{scrollY:i,scrollX:o,innerHeight:r,innerWidth:s}=window,{clientHeight:a,clientWidth:c}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,r||0),clientWidth:Math.max(c,s||0),offsetTop:Math.trunc(t.top-n.top),offsetLeft:Math.trunc(t.left-n.left),scrollTop:i,scrollLeft:o,documentHeight:a,documentWidth:c,windowHeight:r,windowWidth:s})}),"PageInfo"),X=U("stopPageInfo");const q=V(W(n.PARENT_INFO,function(e){const{scrollWidth:n,scrollHeight:t}=document.documentElement,i="undefined"!=typeof window&&window.visualViewport?window.visualViewport:{},{width:o=0,height:r=0,offsetLeft:s=0,offsetTop:a=0,pageLeft:c=0,pageTop:d=0,scale:l=1}=i;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:n,scrollHeight:t},viewport:{width:o,height:r,offsetLeft:s,offsetTop:a,pageLeft:c,pageTop:d,scale:l}})}),"ParentInfo"),Z=U("stopParentInfo");function J(e){const n=e.getBoundingClientRect(),t=_(e.id);return{x:Number(n.left)+Number(t.x),y:Number(n.top)+Number(t.y)}}function Y(e){const{x:n,y:t}=M.position,o=i[e]?.iframe;!1!==N(e,"onScroll",{iframe:o,top:t,left:n,x:n,y:t})?P(e):D()}const K=e=>n=>{const{id:i,iframe:o,height:r,width:s}=n;const a=e?J(o):{x:0,y:0},c={x:s+(d=a).x,y:r+d.y};var d;const l=window.parentIframe||window.parentIFrame;var u;f(i,`Reposition requested (offset x:%c${a.x}%c y:%c${a.y})`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),l?(u=c,l["scrollTo"+(e?"Offset":"")](u.x,u.y)):function(e){var n;n=e,M.position=n,Y(i)}(c)},Q=K(!1),ee=K(!0);function ne(e,n){const i=n.split("#")[1]||"",o=decodeURIComponent(i),r=document.getElementById(o)||document.getElementsByName(o)[0];r?function(e,n,i){const{x:o,y:r}=J(i);f(e,`Moving to in page link: %c#${n}`,t.HIGHLIGHT),M.position={x:o,y:r},Y(e),window.location.hash=n}(e,i,r):window.top!==window.self?function(e,n){const t=window.parentIframe||window.parentIFrame;t?t.moveToAnchor(n):l(e,`In page link #${n} not found`)}(e,i):l(e,`In page link #${i} not found`)}function te(e){const n=i[e]?.iframe?.title;return""===n||void 0===n}let ie=!1,oe=!1;function re(e,o=-3){if(ie)return;const s=Math.max(i[e].mode,o);if(s>i[e].mode&&(i[e].mode=s),s<0)throw p(e),i[e].vAdvised||T(e||"Parent",`${n.getModeData(s+2)}${n.getModeData(2)}`),i[e].vAdvised=!0,n.getModeData(s+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(s>5&&oe||function(e,i){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,r||i<1?n.BOLD:t.NORMAL))}(`v${n.VERSION} (${n.getModeLabel(s)})`,s),s){case 1:case 2:case 3:T("Parent",n.getModeData(6));break;case 4:T("Parent",n.getModeData(7));break;case 5:T("Parent",n.getModeData(8));break;default:s<1&&T("Parent",n.getModeData(3))}ie=!0}function se(e){const{height:o,id:r,iframe:s,mode:a,message:c,type:d,width:u}=e,{lastMessage:m}=i[r];switch(i[r]?.firstRun&&function(e,n){i[e]&&(l(e,`First run for ${e}`),re(e,void 0===n?void 0:Number(n)),i[e].firstRun=!1)}(r,a),l(r,`Received: %c${m}`,t.HIGHLIGHT),d){case n.AUTO_RESIZE:i[r].autoResize=JSON.parse($(r,9));break;case n.BEFORE_UNLOAD:f(r,"Ready state reset"),i[r].initialised=!1;break;case n.CLOSE:F(s);break;case n.IN_PAGE_LINK:ne(r,$(r,9));break;case n.INIT:x(e),function(e){try{i[e].sameOrigin=!!i[e]?.iframe?.contentWindow?.iframeChildListener}catch(n){i[e].sameOrigin=!1}l(e,`sameOrigin: %c${i[e].sameOrigin}`,t.HIGHLIGHT)}(r),function(e,i){i!==n.VERSION&&(void 0!==i?l(e,`Version mismatch (Child: %c${i}%c !== Parent: %c${n.VERSION})`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT):T(e,"<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"))}(r,c),i[r].initialised=!0,N(r,"onReady",s);break;case n.MESSAGE:!function(e,n){const{id:i,iframe:o}=e;l(i,`onMessage passed: {iframe: %c${i}%c, message: %c${n}%c}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT,t.FOREGROUND),N(i,"onMessage",{iframe:o,message:JSON.parse(n)})}(e,$(r,6));break;case n.MOUSE_ENTER:v("onMouseEnter",e);break;case n.MOUSE_LEAVE:v("onMouseLeave",e);break;case n.PAGE_INFO:j(r);break;case n.PARENT_INFO:q(r);break;case n.PAGE_INFO_STOP:X(r);break;case n.PARENT_INFO_STOP:Z(r);break;case n.RESET:B(e);break;case n.SCROLL_BY:!function(e){const{id:n,height:i,width:o}=e,r=window.parentIframe||window.parentIFrame||window;f(n,`scrollBy: x: %c${o}%c y: %c${i}`,t.HIGHLIGHT,t.FOREGROUND,t.HIGHLIGHT),r.scrollBy(o,i)}(e);break;case n.SCROLL_TO:Q(e);break;case n.SCROLL_TO_OFFSET:ee(e);break;case n.TITLE:!function(e,n){i[e]?.syncTitle&&(i[e].iframe.title=n,f(e,`Set iframe title attribute: %c${n}`,t.HIGHLIGHT))}(r,c);break;default:if(0===u&&0===o)return void g(r,`Unsupported message received (${d}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===u||0===o)return void l(r,"Ignoring message with 0 height or width");if(document.hidden)return void l(r,"Page hidden - ignored resize request");x(e)}}function ae(e){const o=e.data;if(o===n.CHILD_READY_MESSAGE)return r=e.source,void Object.values(i).forEach((e=>({initChild:n,postMessageTarget:t})=>{e===t&&n()})(r));var r,s;if(s=o,n.MESSAGE_ID!==`${s}`.slice(0,n.MESSAGE_ID_LENGTH)||!(s.slice(n.MESSAGE_ID_LENGTH).split(":")[0]in i)){if(typeof o!==n.STRING)return;return h(n.PARENT,"ignoredMessage"),void u(n.PARENT,o)}const a=G(o),{id:c,type:d}=a;switch(h(c,d),!0){case!i[c]:throw new Error(`${d} No settings for ${c}. Message was: ${o}`);case!function(e){const{id:i,msg:o,iframe:r}=e,s=n.isIframe(r);return s||(l(i,`Received: %c${o}`,t.HIGHLIGHT),g(i,"The target iframe was not found.")),s}(a):case function(e){const{id:n,type:t}=e,i=t in A;return i&&l(n,"Ignoring init message from meta parent page"),i}(a):case!function(e,n){const{id:o}=e,{data:r,origin:s}=n;if("sameOrigin"in n&&n.sameOrigin)return!0;const a=i[o]?.checkOrigin;if(a&&"null"!=`${s}`&&!(a.constructor===Array?function(){l(o,`Checking connection is from allowed list of origins: %c${a}`,t.HIGHLIGHT);for(const e of a)if(e===s)return!0;return!1}():function(){const e=i[o]?.remoteHost;return l(o,`Checking connection is from: %c${e}`,t.HIGHLIGHT),s===e}()))throw new Error(`Unexpected message received from: ${s} for ${o}. Message was: ${r}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`);return!0}(a,e):return;default:i[c].lastMessage=e.data,I(c,se)(a)}}const ce=n.once(()=>{n.addEventListener(window,n.MESSAGE,ae),n.addEventListener(document,"visibilitychange",R),window.iframeParentListener=e=>setTimeout(()=>ae({data:e,sameOrigin:!0}))}),de={};const le="8",fe="32",ue=n.CHILD,ge=!0;function me(e,t){const{checkOrigin:i,iframe:{src:o,sandbox:r},initialisedFirstPage:s,waitForLoad:a}=t[e],c=(e=>{try{return new URL(e).origin}catch(n){return null}})(o);h(e,"noResponse"),T(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${i&&c?`\nThe <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${c}</>, 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.\n`:""}${a&&!s?"\nThe <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</>.\n":""}${(e=>typeof e===n.OBJECT&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin")))(r)?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>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`)}function he(e,t){const o=o=>()=>{if(!i[e])return;const{firstRun:r,iframe:s}=i[e];y(o,t,e),(e=>e===n.INIT)(o)&&(e=>e.loading===n.LAZY)(s)||function(e,n){const{msgTimeout:t,warningTimeout:i}=n[e];i&&(t&&clearTimeout(t),n[e].msgTimeout=setTimeout(function(){if(void 0===n[e])return;const{initialised:t,loadErrorShown:i}=n[e];n[e].msgTimeout=void 0,t?n[e].initialisedFirstPage=!0:i||(n[e].loadErrorShown=!0,me(e,n))},i))}(e,i),r||function(e){i[e]?.heightCalculationMethod in n.RESET_REQUIRED_METHODS&&B({id:e,iframe:i[e].iframe,height:n.MIN_SIZE,width:n.MIN_SIZE,type:n.INIT})}(e)},{iframe:r}=i[e];i[e].initChild=o(n.INIT_FROM_IFRAME),function(e,t){n.addEventListener(e,n.LOAD,()=>setTimeout(t,1))}(r,o(n.ONLOAD)),function(e,n){const{iframe:t,waitForLoad:o}=i[e];!0!==o&&((e=>{const{src:n,srcdoc:t}=e;return!t&&(null==n||""===n||"about:blank"===n)})(t)?setTimeout(()=>{h(e,"noContent"),f(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(n))}(e,o(n.INIT))}function pe(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||n.AUTO_RESIZE in t)&&T(e,`<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 <bb>${n.VERTICAL}</>, <bb>${n.HORIZONTAL}</>, <bb>${n.BOTH}</> or <bb>${n.NONE}</>.\n`),t):{}}const Ee=e=>""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e;function Ie(e,t,o){n.hasOwn(i[e],t)&&(T(e,`<rb>Deprecated option</>\n\nThe <b>${t}</> option has been renamed to <b>${o}</>. ${n.REMOVED_NEXT_VERSION}`),i[e][o]=i[e][t],delete i[e][t])}const be=e=>n.hasOwn(e,"onMouseEnter")||n.hasOwn(e,"onMouseLeave");function Te(e,o){const{id:r}=e;i[r]={...i[r],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...w,...pe(r,o),mouseEvents:be(o),mode:n.setMode(o),syncTitle:te(r)},function(e){Ie(e,n.OFFSET,n.OFFSET_SIZE),Ie(e,"onClose","onBeforeClose"),Ie(e,"onClosed","onAfterClose")}(r),function(e){const{direction:o}=i[e];switch(o){case n.VERTICAL:break;case n.HORIZONTAL:i[e].sizeHeight=!1;case n.BOTH:i[e].sizeWidth=!0;break;case n.NONE:i[e].sizeWidth=!1,i[e].sizeHeight=!1,i[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${o}" is not valid`)}l(e,`direction: %c${o}`,t.HIGHLIGHT)}(r),function(e,{offset:o,offsetSize:r}){const s=r||o;s&&(i[e].direction===n.VERTICAL?(i[e].offsetHeight=s,l(e,`Offset height: %c${s}`,t.HIGHLIGHT)):(i[e].offsetWidth=s,l(e,`Offset width: %c${s}`,t.HIGHLIGHT)))}(r,o),function(e){i[e].warningTimeout||f(e,"warningTimeout:%c disabled",t.HIGHLIGHT)}(r),function(e){const{id:n}=e;null===i[n].postMessageTarget&&(i[n].postMessageTarget=e.contentWindow)}(e),function(e){const{checkOrigin:n,remoteHost:t}=i[e];Array.isArray(n)&&0===n.length&&g(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),i[e].targetOrigin=Array.isArray(n)?n.map(Ee):[!1===n?"*":Ee(t)]}(r)}function Oe(e,o,r){Te(o,r),l(e,`src: %c${o.srcdoc||o.src}`,t.HIGHLIGHT),function(e){if(ie)return;const{mode:n}=i[e];n>5&&re(e,n)}(e),function(e){const{id:t}=e;switch(l(t,`Iframe scrolling ${i[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=!1===i[t]?.scrolling?n.HIDDEN:n.AUTO,i[t]?.scrolling){case n.OMIT:break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=i[t]?.scrolling||"no"}}(o),function(e){const{bodyMargin:t}=i[e];typeof t!==n.NUMBER&&"0"!==t||(i[e].bodyMargin=`${t}px`)}(e),he(e,function(e){const{autoResize:t,bodyBackground:o,bodyMargin:r,bodyPadding:s,heightCalculationMethod:a,inPageLinks:c,license:d,log:l,logExpand:f,mouseEvents:u,offsetHeight:g,offsetWidth:m,mode:h,sizeHeight:p,sizeWidth:E,tolerance:I,widthCalculationMethod:b}=i[e];return[e,le,E,l,fe,ge,t,r,a,o,s,I,c,ue,b,u,g,m,p,d,M.version,h,"",f].join(n.SEPARATOR)}(e)),function(e){if(i[e]){const{iframe:t}=i[e];t.iframeResizer={close:F.bind(null,t),disconnect:z.bind(null,t),moveToAnchor(t){n.typeAssert(t,n.STRING,"moveToAnchor(anchor) anchor"),y("Move to anchor",`moveToAnchor:${t}`,e)},sendMessage(t){t=JSON.stringify(t),y(n.MESSAGE,`${n.MESSAGE}:${t}`,e)}}}}(e),l(e,"Setup complete")}function we(e,t){const{id:i}=e;h(i,"setup"),function(e){if(!0===de[e])return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;de[e]=!0;const i=Array.from(t).flatMap(e=>[n.NEW_LINE,e,n.NEW_LINE]);return T(e,`<rb>Duplicate ID attributes detected</>\n\nThe <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.\n\nFound <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...i,n.NEW_LINE),!1}(i)&&Oe(i,e,t),E(i)}function Le(e,t){t.log===n.LOG_DISABLED?t.log=!1:t.log===n.LOG_COLLAPSED?t.log=n.COLLAPSE:t.log===n.LOG_EXPANDED&&(t.log=n.EXPAND);const s=n.hasOwn(t,"log"),c=n.isString(t.log),d=s?!!c||t.log:w.log;n.hasOwn(t,"logExpand")||(t.logExpand=s&&c?t.log===n.EXPAND:w.logExpand),function(e){-1===e?.log&&(e.log=!1,oe=!0)}(t),function({enabled:e,expand:n,iframeId:t}){const s=o({expand:n,label:a(t)});r=e,i[t]||(i[t]={console:s})}({enabled:d,expand:t.logExpand,iframeId:e}),c&&!(t.log in n.LOG_OPTIONS)&&m(e,`Invalid value for options.log: Accepted values are "${n.EXPAND}" and "${n.COLLAPSE}"`),t.log=d}Object.defineProperty(e,"LOG_COLLAPSED",{enumerable:!0,get:()=>n.LOG_COLLAPSED}),Object.defineProperty(e,"LOG_DISABLED",{enumerable:!0,get:()=>n.LOG_DISABLED}),Object.defineProperty(e,"LOG_EXPANDED",{enumerable:!0,get:()=>n.LOG_EXPANDED}),e.default=function(e){if(!n.isObject(e))throw new TypeError("Options is not an object");return ce(),function(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(n.LOG_DISABLED):e.log=!1;break;case n.EXPAND:case String(n.LOG_EXPANDED):e.log=n.EXPAND;break;case n.COLLAPSE:case String(n.LOG_COLLAPSED):default:e.log=n.COLLAPSE}}(e),t=>{const i=H(t,e);return n.LABEL in t?(h(i,"alreadySetup"),g(i,`Ignored iframe (${i}), already setup.`)):(Le(i,e),I(i,we)(t,e)),t?.iframeResizer}},Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
27
21
|
//# sourceMappingURL=index.umd.js.map
|