diff --git a/apps/start/package.json b/apps/start/package.json index d5b97664a..5d6a6f7dc 100644 --- a/apps/start/package.json +++ b/apps/start/package.json @@ -9,6 +9,7 @@ "deploy": "npx wrangler deploy", "cf-typegen": "wrangler types", "build": "pnpm with-env vite build", + "build:embed": "vite build --config vite.embed.config.ts", "serve": "vite preview", "test": "vitest run", "format": "biome format", @@ -26,11 +27,13 @@ "@faker-js/faker": "^9.6.0", "@hookform/resolvers": "^3.3.4", "@hyperdx/node-opentelemetry": "^0.8.1", + "@iframe-resizer/child": "^5.0.0", + "@iframe-resizer/parent": "^5.0.0", "@number-flow/react": "0.3.5", "@openpanel/common": "workspace:^", "@openpanel/constants": "workspace:^", - "@openpanel/integrations": "workspace:^", "@openpanel/importer": "workspace:^", + "@openpanel/integrations": "workspace:^", "@openpanel/json": "workspace:*", "@openpanel/payments": "workspace:*", "@openpanel/sdk-info": "workspace:^", diff --git a/apps/start/public/openpanel-embed.js b/apps/start/public/openpanel-embed.js new file mode 100644 index 000000000..865a0de4c --- /dev/null +++ b/apps/start/public/openpanel-embed.js @@ -0,0 +1,73 @@ +(function(){"use strict";/*! + * @module auto-console-group v1.2.11 + * + * @description Automagically group console logs in the browser console. + * + * @author David J. Bradshaw + * @see {@link https://github.com/davidjbradshaw/auto-console-group#readme} + * @license MIT + * + * @copyright (c) 2025, David J. Bradshaw. All rights reserved. + */const ue="font-weight: normal;",rt="font-weight: bold;",st="font-style: italic;",at=ue+st,lt="color: #135CD2;",ct="color: #A9C7FB;",ut="color: #1F1F1F;",ft="color: #E3E3E3;",Q="default",dt="error",$e="log",pt=Object.freeze({assert:!0,error:!0,warn:!0}),je={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},mt={profile:0,profileEnd:0,timeStamp:0,trace:0},ht=e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""},V=Object.assign(console);function gt(){const e=new Date,t=(g,R)=>e[g]().toString().padStart(R,"0"),n=t("getHours",2),a=t("getMinutes",2),u=t("getSeconds",2),p=t("getMilliseconds",3);return`@ ${n}:${a}:${u}.${p}`}const{fromEntries:yt,keys:bt}=Object,vt=e=>[e,V[e]],wt=e=>t=>[t,function(n){e[t]=n}],fe=(e,t)=>yt(bt(e).map(t));function zt(e={}){const t={},n={},a=[],u={...je,expand:!e.collapsed||je.expanded,...e};let p="";function g(){a.length=0,p=""}function R(){delete u.event,g()}const B=()=>a.some(([f])=>f in pt),J=()=>B()?!0:!!u.expand,F=()=>u.showTime?p:"";function s(){if(a.length===0){R();return}V[J()?"group":"groupCollapsed"](`%c${u.label}%c ${ht(u)} %c${F()}`,ue,rt,at);for(const[f,...S]of a)V.assert(f in V,`Unknown console method: ${f}`),f in V&&V[f](...S);V.groupEnd(),R()}function i(){p===""&&(p=gt())}function c(f){i(),u.event=f}function m(){i(),queueMicrotask(()=>queueMicrotask(s))}function y(f,...S){a.length===0&&m(),a.push([f,...S])}const k=f=>(...S)=>{let d;try{d=f(...S)}catch(r){if(!Error.prototype.isPrototypeOf(r))throw r;y(dt,r),s()}return d};function T(f,...S){f!==!0&&y("assert",f,...S)}function x(f=Q){n[f]?n[f]+=1:n[f]=1,y($e,`${f}: ${n[f]}`)}function O(f=Q){delete n[f]}function H(f=Q){i(),t[f]=performance.now()}function E(f=Q,...S){if(!t[f]){y("timeLog",f,...S);return}const d=performance.now()-t[f];y($e,`${f}: ${d} ms`,...S)}function Z(f=Q){E(f),delete t[f]}const w=f=>[f,(...S)=>y(f,...S)];return{...fe(u,wt(u)),...fe(console,w),...fe(mt,vt),assert:T,count:x,countReset:O,endAutoGroup:s,errorBoundary:k,event:c,purge:g,time:H,timeEnd:Z,timeLog:E,touch:i}}const ke=typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches,C=ke?ct:lt,ne=ke?ft:ut;/*! + * @preserve + * + * @module iframe-resizer/core 5.5.7 (esm) - 2025-09-23 + * + * @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 + * + * @see {@link https://iframe-resizer.com} + * + * @copyright (c) 2013 - 2025, David J. Bradshaw. All rights reserved. + */const de="5.5.7",Te="iframeResizer",G=":",xe="autoResize",ee="init",Me="iframeReady",pe="load",ie="message",Ee="onload",Re="pageInfo",Se="parentInfo",me="reset",he="resize",Oe="scroll",$t="child",Ie="parent",re="string",Ce="object",Ae="function",ge="auto",Le="none",se="vertical",We="horizontal",ye="[iFrameSizer]",jt=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),Ne=Object.freeze({[Ee]:1,[ee]:1,[Me]:1}),Be="expanded",Fe="collapsed",kt=Object.freeze({[Be]:1,[Fe]:1}),te=(e,t,n,a)=>e.addEventListener(t,n,a||!1),Pe=(e,t,n)=>e.removeEventListener(t,n,!1),He=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let a,u=0;u>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},_=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),be=["spjluzl","rlf","clyzpvu"],Tt=["Puchspk Spjluzl Rlf","Tpzzpun Spjluzl Rlf","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.Jvttlyjphs SpjluzlMvy jvttlyjphs bzl,

pmyhtl-ylzpgly ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa oaawz://pmyhtl-ylzpgly.jvt/wypjpun.Vwlu Zvbyjl SpjluzlPm 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 spjluzl rlf pu

pmyhtl-ylzpgly vwapvuz av NWSc3.Mvy tvyl pumvythapvu wslhzl zll: oaawz://pmyhtl-ylzpgly.jvt/nws","NWSc3 Spjluzl ClyzpvuAopz clyzpvu vm

pmyhtl-ylzpgly pz ilpun bzlk bukly aol alytz vm aol NWS C3 spjluzl. Aopz spjluzl hssvdz fvb av bzl

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.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.Mvy tvyl pumvythapvu cpzpa oaawz://pmyhtl-ylzpgly.jvt/wypjpun.","Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpuAv bzl

pmyhtl-ylzpgly dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll oaawz://pmyhtl-ylzpgly.jvt/wypjpun mvy tvyl klahpsz."],xt=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],De=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ae=e=>_(Tt[e]),Mt=e=>{const t=e[_(be[0])]||e[_(be[1])]||e[_(be[2])];if(!t)return-1;const n=t.split("-");let a=function(u=""){let p=-2;const g=He(_(u));return g in De&&(p=De[g]),p}(n[0]);return a===0||(u=>u[2]===He(u[0]+u[1]))(n)||(a=-2),a},oe=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),Et=e=>e,qe=e=>t=>window.chrome?e(t.replaceAll("
",` +`).replaceAll("","\x1B[31;1m").replaceAll("","\x1B[m").replaceAll("","\x1B[1m").replaceAll("","\x1B[3m").replaceAll("","\x1B[4m")):e((n=>n.replaceAll("
",` +`).replaceAll(/<[/a-z]+>/gi,""))(t)),o={},Ue=(X=zt,X!=null&&X.__esModule?X.default:X);var X;let ve=!0;const Rt=Ue({expand:!1,label:Ie}),St=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`,K=e=>(t,...n)=>o[t]?o[t].console[e](...n):Rt[e](...n);var Je;const W=(Je="log",(e,...t)=>(n=>o[n]?o[n].log:ve)(e)===!0?K(Je)(e,...t):null),q=K("warn"),Ot=K("error"),U=K("event"),It=K("purge"),Ze=K("errorBoundary"),N=(e,...t)=>o[e]?o[e].console.warn(qe(Et)(...t)):queueMicrotask(()=>console==null?void 0:console.warn(qe((n=>(...a)=>[`${Te}(${n})`,...a].join(" "))(e))(...t))),Ct=(e=>(t,n="renamed to")=>(a,u,p="",g="")=>e(g,`Deprecated ${t}(${a.replace("()","")}) + +The ${a} ${t.toLowerCase()} has been ${n} ${u}. ${p}Use of the old ${t.toLowerCase()} will be removed in a future version of iframe-resizer.`))(N),At=Ct("Option");function Lt(e,t){const{msgTimeout:n,warningTimeout:a}=t[e];a&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(t[e]===void 0)return;const{initialised:u,loadErrorShown:p}=t[e];t[e].msgTimeout=void 0,u||p||(t[e].loadErrorShown=!0,function(g,R){const{iframe:B,waitForLoad:J}=R[g],{sandbox:F}=B,s=typeof F===Ce&&F.length>0&&!(F.contains("allow-scripts")&&F.contains("allow-same-origin"));U(g,"noResponse"),N(g,`No response from iframe + +The iframe (${g}) has not responded within ${R[g].warningTimeout/1e3} seconds. Check @iframe-resizer/child package has been loaded in the iframe. +${J?` +The waitForLoad option is currently set to 'true'. If the iframe loads before iframe-resizer runs, this option will prevent iframe-resizer initialising. To disable this option, set waitForLoad to 'false'. +`:""}${s?` +The iframe has the sandbox attribute, please ensure it contains both the 'allow-same-origin' and 'allow-scripts' values. +`:""} +This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning. +`)}(e,t))},a))}const le=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:se,firstRun:!0,inPageLinks:!1,heightCalculationMethod:ge,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:ge,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof o[e.id].onInit===Ae&&(At("init()","onReady()","",e.id),o[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),I={position:null,version:de};function Ve(e){function t(){et(w),Ke(d),x("onResized",w)}function n(r){return r.boxSizing!=="border-box"?0:(r.paddingTop?parseInt(r.paddingTop,10):0)+(r.paddingBottom?parseInt(r.paddingBottom,10):0)}function a(r){return r.boxSizing!=="border-box"?0:(r.borderTopWidth?parseInt(r.borderTopWidth,10):0)+(r.borderBottomWidth?parseInt(r.borderBottomWidth,10):0)}const u=r=>E.slice(E.indexOf(G)+7+r),p=(r,l)=>(h,b)=>{const v={};var z,$;z=function(){Y(`${h} (${r})`,`${r}:${l()}`,b)},v[$=b]||(z(),v[$]=requestAnimationFrame(()=>{v[$]=null}))},g=(r,l)=>()=>{let h=!1;const b=P=>()=>{o[j]?h&&h!==P||(r(P,j),h=P,requestAnimationFrame(()=>{h=!1})):L()},v=b(Oe),z=b("resize window");function $(P,D){D(window,Oe,v),D(window,he,z)}function L(){U(j,`stop${l}`),$(0,Pe),M.disconnect(),A.disconnect(),Pe(o[j].iframe,pe,L)}const j=d,M=new ResizeObserver(b("pageObserver")),A=new ResizeObserver(b("iframeObserver"));o[j]&&(o[j][`stop${l}`]=L,te(o[j].iframe,pe,L),$(0,te),M.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),A.observe(o[j].iframe,{attributes:!0,childList:!1,subtree:!1}))},R=r=>()=>{r in o[d]&&(o[d][r](),delete o[d][r])},B=p(Re,function(){const r=document.body.getBoundingClientRect(),l=w.iframe.getBoundingClientRect(),{scrollY:h,scrollX:b,innerHeight:v,innerWidth:z}=window,{clientHeight:$,clientWidth:L}=document.documentElement;return JSON.stringify({iframeHeight:l.height,iframeWidth:l.width,clientHeight:Math.max($,v||0),clientWidth:Math.max(L,z||0),offsetTop:parseInt(l.top-r.top,10),offsetLeft:parseInt(l.left-r.left,10),scrollTop:h,scrollLeft:b,documentHeight:$,documentWidth:L,windowHeight:v,windowWidth:z})}),J=p(Se,function(){const{iframe:r}=w,{scrollWidth:l,scrollHeight:h}=document.documentElement,{width:b,height:v,offsetLeft:z,offsetTop:$,pageLeft:L,pageTop:j,scale:M}=window.visualViewport;return JSON.stringify({iframe:r.getBoundingClientRect(),document:{scrollWidth:l,scrollHeight:h},viewport:{width:b,height:v,offsetLeft:z,offsetTop:$,pageLeft:L,pageTop:j,scale:M}})}),F=g(B,"PageInfo"),s=g(J,"ParentInfo"),i=R("stopPageInfo"),c=R("stopParentInfo");function m(r){const l=r.getBoundingClientRect();return _e(),{x:Number(l.left)+Number(I.position.x),y:Number(l.top)+Number(I.position.y)}}function y(r){const l=r?m(w.iframe):{x:0,y:0};W(d,`Reposition requested (offset x:%c${l.x}%c y:%c${l.y})`,C,ne,C);const h=((v,z)=>({x:v.width+z.x,y:v.height+z.y}))(w,l),b=window.parentIframe||window.parentIFrame;b?function(v,z){setTimeout(()=>v["scrollTo"+(r?"Offset":"")](z.x,z.y))}(b,h):function(v){I.position=v,k(d)}(h)}function k(r){var v;const{x:l,y:h}=I.position,b=(v=o[r])==null?void 0:v.iframe;x("onScroll",{iframe:b,top:h,left:l,x:l,y:h})!==!1?Ke(r):Xe()}function T(r){let l={};if(w.width===0&&w.height===0){const h=u(9).split(G);l={x:h[1],y:h[0]}}else l={x:w.width,y:w.height};x(r,{iframe:w.iframe,screenX:Number(l.x),screenY:Number(l.y),type:w.type})}const x=(r,l)=>we(d,r,l);function O(){var L;const{height:r,iframe:l,msg:h,type:b,width:v}=w;switch((L=o[d])!=null&&L.firstRun&&function(){o[d]&&(nt(d,w.mode),o[d].firstRun=!1)}(),b){case"close":Ye(l);break;case ie:$=u(6),x("onMessage",{iframe:w.iframe,message:JSON.parse($)});break;case"mouseenter":T("onMouseEnter");break;case"mouseleave":T("onMouseLeave");break;case"beforeUnload":W(d,"Ready state reset"),o[d].initialised=!1;break;case xe:o[d].autoResize=JSON.parse(u(9));break;case"scrollBy":(function(){const j=w.width,M=w.height,A=window.parentIframe||window.parentIFrame||window;W(d,`scrollBy: x: %c${j}%c y: %c${M}`,C,ne,C),A.scrollBy(j,M)})();break;case"scrollTo":y(!1);break;case"scrollToOffset":y(!0);break;case Re:F();break;case Se:s();break;case"pageInfoStop":i();break;case"parentInfoStop":c();break;case"inPageLink":(function(j){const M=j.split("#")[1]||"",A=decodeURIComponent(M);let P=document.getElementById(A)||document.getElementsByName(A)[0];P?function(){const D=m(P);W(d,`Moving to in page link: %c#${M}`,C),I.position={x:D.x,y:D.y},k(d),window.location.hash=M}():window.top!==window.self&&function(){const D=window.parentIframe||window.parentIFrame;D&&D.moveToAnchor(M)}()})(u(9));break;case"title":(function(j,M){var A;(A=o[M])!=null&&A.syncTitle&&(o[M].iframe.title=j,W(M,`Set iframe title attribute: %c${j}`,C))})(h,d);break;case me:Qe(w);break;case ee:t(),function(j){var M,A,P;try{o[j].sameOrigin=!!((P=(A=(M=o[j])==null?void 0:M.iframe)==null?void 0:A.contentWindow)!=null&&P.iframeChildListener)}catch{o[j].sameOrigin=!1}}(d),(z=h)!==de&&(z!==void 0||N(d,`Legacy version detected in iframe + +Detected legacy version of child page script. It is recommended to update the page in the iframe to use @iframe-resizer/child. + +See https://iframe-resizer.com/setup/#child-page-setup for more details. +`)),o[d].initialised=!0,x("onReady",l);break;default:if(v===0&&r===0)return void q(d,`Unsupported message received (${b}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(v===0||r===0||document.hidden)return;t()}var z,$}function H(r){if(!o[r])throw new Error(`${w.type} No settings for ${r}. Message was: ${E}`)}let E=e.data;if(E==="[iFrameResizerChild]Ready")return Z=e.source,void Object.values(o).forEach((r=>({initChild:l,postMessageTarget:h})=>{r===h&&l()})(Z));var Z;if(!(r=>ye===`${r}`.slice(0,13)&&r.slice(13).split(G)[0]in o)(E))return typeof E!==re?void 0:void U(Ie,"ignoredMessage");const w=function(r){var $;const l=r.slice(13).split(G),h=l[1]?Number(l[1]):0,b=($=o[l[0]])==null?void 0:$.iframe,v=getComputedStyle(b),z={iframe:b,id:l[0],height:h+n(v)+a(v),width:Number(l[2]),type:l[3],msg:l[4]};return l[5]&&(z.mode=l[5]),z}(E),{id:f,type:S}=w,d=f;d?(U(d,S),Ze(d,function(r){H(d),w.type in{true:1,false:1,undefined:1}||(w.iframe!==null||(q(d,`The iframe (${w.id}) was not found.`),0))&&function(){var v;const{origin:l,sameOrigin:h}=e;if(h)return!0;let b=(v=o[d])==null?void 0:v.checkOrigin;if(b&&`${l}`!="null"&&!(b.constructor===Array?function(){let z=0,$=!1;for(;z{setTimeout(()=>p(...g),0)})(a,n)}return u}function Ge(e){const{id:t}=e;delete o[t],delete e.iframeResizer}function Ye(e){const{id:t}=e;if(we(t,"onBeforeClose",t)!==!1){try{e.parentNode&&e.remove()}catch(n){q(t,n)}we(t,"onAfterClose",t),Ge(e)}}function _e(e){I.position===null&&(I.position={x:window.scrollX,y:window.scrollY})}function Xe(){I.position=null}function Ke(e){I.position!==null&&(window.scrollTo(I.position.x,I.position.y),W(e,`Set page position: %c${I.position.x}%c, %c${I.position.y}`,C,ne,C),Xe())}function Qe(e){_e(e.id),et(e),Y(me,me,e.id)}function et(e){function t(p){const g=`${e[p]}px`;e.iframe.style[p]=g,W(n,`Set ${p}: %c${g}`,C)}const{id:n}=e,{sizeHeight:a,sizeWidth:u}=o[n];a&&t("height"),u&&t("width")}const Wt=e=>e.split(G).filter((t,n)=>n!==19).join(G);function Y(e,t,n){var u;function a(p){const g=e in Ne?Wt(t):t;W(n,p,C,ne,C),W(n,`Message data: %c${g}`,C)}U(n,e),o[n]&&((u=o[n])!=null&&u.postMessageTarget?function(){const{iframe:p,postMessageTarget:g,sameOrigin:R,targetOrigin:B}=o[n];if(R)try{return p.contentWindow.iframeChildListener(ye+t),void a(`Sending message to iframe %c${n}%c via same origin%c`)}catch{e in Ne?o[n].sameOrigin=!1:q(n,"Same origin messaging failed, falling back to postMessage")}a(`Sending message to iframe: %c${n}%c targetOrigin: %c${B}`),g.postMessage(ye+t,B)}():q(n,`Iframe(${n}) not found`))}let tt=0,ze=!1,ot=!1;function nt(e,t=-3){if(ze)return;const n=Math.max(o[e].mode,t);if(n>o[e].mode&&(o[e].mode=n),n<0)throw It(e),o[e].vAdvised||N(e||"Parent",`${ae(n+2)}${ae(2)}`),o[e].vAdvised=!0,ae(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");n>0&&ot||function(a,u){queueMicrotask(()=>console.info(`%ciframe-resizer ${a}`,ve||u<1?"font-weight: bold;":ue))}(`v${de} (${(a=>_(xt[a]))(n)})`,n),n<1&&N("Parent",ae(3)),ze=!0}const Nt=e=>t=>{function n(){var i;((i=o[s])==null?void 0:i.heightCalculationMethod)in jt&&Qe({iframe:t,height:1,width:1,type:ee})}function a(){if(o[s]){const{iframe:i}=o[s],c={close:Ye.bind(null,i),disconnect:Ge.bind(null,i),removeListeners(){N(s,`Deprecated Method Name + +The \x1B[removeListeners() method has been renamed to \x1B[disconnect(). +`),this.disconnect()},resize(){N(s,`Deprecated Method + +Use of the resize() method from the parent page is deprecated and will be removed in a future version of 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.`),Y.bind(null,"Window resize",he,s)},moveToAnchor(m){((y,k,T)=>{if(typeof y!==k)throw new TypeError(`${T} is not a ${x=k,x.charAt(0).toUpperCase()+x.slice(1)}`);var x})(m,re,"moveToAnchor(anchor) anchor"),Y("Move to anchor",`moveToAnchor:${m}`,s)},sendMessage(m){m=JSON.stringify(m),Y(ie,`${ie}:${m}`,s)}};i.iframeResizer=c,i.iFrameResizer=c}}function u(i,c){const m=k=>()=>{if(!o[i])return;const{firstRun:T,iframe:x}=o[i];Y(k,c,i),(O=>O===ee)(k)&&(O=>O.loading==="lazy")(x)||Lt(i,o),T||n()},{iframe:y}=o[i];o[i].initChild=m(Me),function(k,T){te(k,pe,()=>setTimeout(T,1))}(y,m(Ee)),function(k,T){const{iframe:x,waitForLoad:O}=o[k];O!==!0&&((H=>{const{src:E,srcdoc:Z}=H;return!Z&&(E==null||E===""||E==="about:blank")})(x)?setTimeout(()=>{U(k,"noContent"),W(k,"No content detected in the iframe, delaying initialisation")}):setTimeout(T))}(i,m(ee))}function p(i){return i?(("sizeWidth"in i||"sizeHeight"in i||xe in i)&&N(s,`Deprecated Option + +The sizeWidth, sizeHeight and autoResize options have been replaced with new direction option which expects values of "${se}", "${We}" or "${Le}". +`),i):{}}function g(i){var m,y;const c=(y=(m=o[i])==null?void 0:m.iframe)==null?void 0:y.title;return c===""||c===void 0}function R(i,c){oe(o[s],i)&&(N(s,`Deprecated option + +The ${i} option has been renamed to ${c}. Use of the old name will be removed in a future version of iframe-resizer.`),o[s][c]=o[s][i],delete o[s][i])}const B=i=>oe(i,"onMouseEnter")||oe(i,"onMouseLeave");function J(i){var c,m;o[s]={...o[s],iframe:t,remoteHost:t==null?void 0:t.src.split("/").slice(0,3).join("/"),...le,...p(i),mouseEvents:B(i),mode:Mt(i),syncTitle:g(s)},R("offset","offsetSize"),R("onClose","onBeforeClose"),R("onClosed","onAfterClose"),U(s,"setup"),function(){const{direction:y}=o[s];switch(y){case se:break;case We:o[s].sizeHeight=!1;case"both":o[s].sizeWidth=!0;break;case Le:o[s].sizeWidth=!1,o[s].sizeHeight=!1,o[s].autoResize=!1;break;default:throw new TypeError(s,`Direction value of "${y}" is not valid`)}}(),(c=(i==null?void 0:i.offsetSize)||(i==null?void 0:i.offset))&&(o[s].direction===se?o[s].offsetHeight=c:o[s].offsetWidth=c),function(y){y!=null&&y.offset&&N(s,`Deprecated option + + The offset option has been renamed to offsetSize. Use of the old name will be removed in a future version of iframe-resizer.`)}(i),o[s].warningTimeout||W(s,"warningTimeout:%c disabled",C),o[s].postMessageTarget===null&&(o[s].postMessageTarget=t.contentWindow),o[s].targetOrigin=o[s].checkOrigin===!0?(m=o[s].remoteHost)===""||m.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":m:"*"}const F=()=>Te in t,s=function(i){if(i&&typeof i!==re)throw new TypeError("Invalid id for iFrame. Expected String");return i!==""&&i||(i=function(){let c=(e==null?void 0:e.id)||le.id+tt++;return document.getElementById(c)!==null&&(c+=tt++),c}(),t.id=i,U(i,"assignId")),i}(t.id);if(typeof e!==Ce)throw new TypeError("Options is not an object");return function(i){const{search:c}=window.location;c.includes("ifrlog")&&(i.log=Fe,i.logExpand=c.includes("ifrlog=expanded"))}(e),function(i,c){const m=oe(c,"log"),y=typeof c.log===re,k=m?!!y||c.log:le.log;oe(c,"logExpand")||(c.logExpand=m&&y?c.log===Be:le.logExpand),function(T){(T==null?void 0:T.log)===-1&&(T.log=!1,ot=!0)}(c),function({enabled:T,expand:x,iframeId:O}){const H=Ue({expand:x,label:St(O)});ve=T,o[O]||(o[O]={console:H})}({enabled:k,expand:c.logExpand,iframeId:i}),y&&!(c.log in kt)&&Ot(i,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),c.log=k}(s,e),Ze(s,function(i){F()?q(s,`Ignored iframe (${s}), already setup.`):(J(i),function(){if(ze)return;const{mode:c}=o[s];c!==-1&&nt(s,c)}(),Ft(),function(){var c,m;switch(t.style.overflow=((c=o[s])==null?void 0:c.scrolling)===!1?"hidden":ge,(m=o[s])==null?void 0:m.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=o[s]?o[s].scrolling:"no"}}(),function(){const{bodyMargin:c}=o[s];typeof c!="number"&&c!=="0"||(o[s].bodyMargin=`${c}px`)}(),u(s,function(c){const{autoResize:m,bodyBackground:y,bodyMargin:k,bodyPadding:T,heightCalculationMethod:x,inPageLinks:O,license:H,log:E,logExpand:Z,mouseEvents:w,offsetHeight:f,offsetWidth:S,mode:d,sizeHeight:r,sizeWidth:l,tolerance:h,widthCalculationMethod:b}=o[c];return[c,"8",l,E,"32",!0,m,k,x,y,T,h,O,$t,b,w,f,S,r,H,I.version,d,"",Z].join(G)}(s)),a())})(e),t==null?void 0:t.iframeResizer};function Bt(){document.hidden!==!0&&((e,t)=>{Object.values(o).filter(({autoResize:n,firstRun:a})=>n&&!a).forEach(({iframe:n})=>Y(e,t,n.id))})("tabVisible",he)}const Ft=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{te(window,ie,Ve),te(document,"visibilitychange",Bt),window.iframeParentListener=e=>setTimeout(()=>Ve({data:e,sameOrigin:!0}))});/*! + * @preserve + * + * @module iframe-resizer/parent 5.5.7 (esm) - 2025-09-23 + * + * @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 + * + * @see {@link https://iframe-resizer.com} + * + * @copyright (c) 2013 - 2025, David J. Bradshaw. All rights reserved. + */const Pt="iframeResizer",Ht="string",Dt="object",it="undefined",ce=`[${Pt}] `;function qt(){function e(a){switch(!0){case!a:throw new TypeError(`${ce}iframe is not defined`);case!a.tagName:throw new TypeError(`${ce}Not a valid DOM element`);case a.tagName.toUpperCase()!=="IFRAME":throw new TypeError(`${ce}Expected