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