(function(y,v){typeof exports=="object"&&typeof module=="object"?module.exports=v():typeof define=="function"&&define.amd?define([],v):typeof exports=="object"?exports.XMindEmbedViewer=v():y.XMindEmbedViewer=v()})(self,function(){return(()=>{"use strict";var y={61:function(b,l){var h=this&&this.__awaiter||function(u,n,t,o){return new(t||(t=Promise))(function(e,a){function i(s){try{f(o.next(s))}catch(r){a(r)}}function c(s){try{f(o.throw(s))}catch(r){a(r)}}function f(s){var r;s.done?e(s.value):(r=s.value,r instanceof t?r:new t(function(d){d(r)})).then(i,c)}f((o=o.apply(u,n||[])).next())})},m=this&&this.__generator||function(u,n){var t,o,e,a,i={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(f){return function(s){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,o&&(e=2&r[0]?o.return:r[0]?o.throw||((e=o.return)&&e.call(o),0):o.next)&&!(e=e.call(o,r[1])).done)return e;switch(o=0,e&&(r=[2&r[0],e.value]),r[0]){case 0:case 1:e=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,o=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!((e=(e=i.trys).length>0&&e[e.length-1])||r[0]!==6&&r[0]!==2)){i=0;continue}if(r[0]===3&&(!e||r[1]>e[0]&&r[1]{Object.defineProperty(l,"__esModule",{value:!0}),l.IframeController=void 0;var h=function(){function m(p,u){var n,t=typeof p=="string"?document.querySelector(p):p;if(t===null)throw new Error("IFrame or mount element not found by selector "+p);t instanceof HTMLIFrameElement?n=t:(n=document.createElement("iframe"),t.appendChild(n)),n.setAttribute("frameborder","0"),n.setAttribute("scrolling","no"),n.setAttribute("allowfullscreen","true"),n.setAttribute("allow","allowfullscreen"),n.setAttribute("crossorigin","anonymous"),n.setAttribute("src",u),this.iframe=n}return m.prototype.getIframe=function(){return this.iframe},m.prototype.setStyles=function(p){for(var u=this.getIframe(),n=0,t=Object.entries(p);n{l.XMindEmbedViewer=void 0;var m=h(61),p=h(860),u=function(){function n(t){var o=this;this.internalState={sheets:[],zoomScale:100,currentSheetId:""};var e=t.file,a=t.el,i=t.styles,c=i===void 0?{height:"350px",width:"750px"}:i,f=t.isPitchModeDisabled,s=new p.IframeController(a,"https://www.xmind.app/embed-viewer"+(f?"?pitch-mode=disabled":"")),r=new m.IframeEventChannelController(s,"https://www.xmind.app");this.iframeController=s,this.iframeEventChannelController=r,r.addEventListener("sheet-switch",function(d){return o.internalState.currentSheetId=d}),r.addEventListener("zoom-change",function(d){return o.internalState.zoomScale=d}),r.addEventListener("sheets-load",function(d){return o.internalState.sheets=d}),this.iframeController.setStyles(c),e&&this.load(e)}return n.prototype.addEventListener=function(t,o){this.iframeEventChannelController.addEventListener(t,o)},n.prototype.removeEventListener=function(t,o){this.iframeEventChannelController.removeEventListener(t,o)},n.prototype.setStyles=function(t){this.iframeController.setStyles(t)},n.prototype.load=function(t){this.iframeEventChannelController.emit("open-file",t)},n.prototype.setZoomScale=function(t){this.iframeEventChannelController.emit("zoom",t)},n.prototype.setFitMap=function(){this.iframeEventChannelController.emit("fit-map")},n.prototype.switchSheet=function(t){this.iframeEventChannelController.emit("switch-sheet",t)},Object.defineProperty(n.prototype,"zoom",{get:function(){return this.internalState.zoomScale},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sheets",{get:function(){return JSON.parse(JSON.stringify(this.internalState.sheets))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentSheetId",{get:function(){return this.internalState.currentSheetId},enumerable:!1,configurable:!0}),n}();l.XMindEmbedViewer=u}},v={};return function b(l){if(v[l])return v[l].exports;var h=v[l]={exports:{}};return y[l].call(h.exports,h,h.exports,b),h.exports}(341)})().XMindEmbedViewer});