text: !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(e,t,r){var n=r(1);"string"==typeof n&&(n=[[e.i,n,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};r(2)(n,o);n.locals&&(e.exports=n.locals)},function(e,t,r){},function(e,t,r){var n,o,a={},i=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=n.apply(this,arguments)),o}),s=function(e){return document.querySelector(e)},l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var r=s.call(this,e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),u=null,c=0,f=[],p=r(3);function d(e,t){for(var r=0;r<e.length;r++){var n=e[r],o=a[n.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](n.parts[i]);for(;i<n.parts.length;i++)o.parts.push(y(n.parts[i],t))}else{var s=[];for(i=0;i<n.parts.length;i++)s.push(y(n.parts[i],t));a[n.id]={id:n.id,refs:1,parts:s}}}}function h(e,t){for(var r=[],n={},o=0;o<e.length;o++){var a=e[o],i=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};n[i]?n[i].parts.push(s):r.push(n[i]={id:i,parts:[s]})}return r}function b(e,t){var r=l(e.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=f[f.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),f.push(t);else if("bottom"===e.insertAt)r.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=l(e.insertInto+" "+e.insertAt.before);r.insertBefore(t,o)}}function v(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=f.indexOf(e);t>=0&&f.splice(t,1)}function g(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),m(t,e.attrs),b(e,t),t}function m(e,t){Object.keys(t).forEach((function(r){e.setAttribute(r,t[r])}))}function y(e,t){var r,n,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=c++;r=u||(u=g(t)),n=S.bind(null,r,i,!1),o=S.bind(null,r,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",m(t,e.attrs),b(e,t),t}(t),n=H.bind(null,r,t),o=function(){v(r),r.href&&URL.revokeObjectURL(r.href)}):(r=g(t),n=O.bind(null,r),o=function(){v(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=h(e,t);return d(r,t),function(e){for(var n=[],o=0;o<r.length;o++){var i=r[o];(s=a[i.id]).refs--,n.push(s)}e&&d(h(e,t),t);for(o=0;o<n.length;o++){var s;if(0===(s=n[o]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete a[s.id]}}}};var w,L=(w=[],function(e,t){return w[e]=t,w.filter(Boolean).join("\n")});function S(e,t,r,n){var o=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=L(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function O(e,t){var r=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function H(e,t,r){var n=r.css,o=r.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(n=p(n)),o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([n],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(i),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var r=t.protocol+"//"+t.host,n=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var o,a=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(o=0===a.indexOf("//")?a:0===a.indexOf("/")?r+a:n+a.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(e,t,r){var n={"./file-explorer.png":5,"./file-transfer.png":6};function o(e){var t=a(e);return r(t)}function a(e){var t=n[e];if(!(t+1)){var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}return t}o.keys=function(){return Object.keys(n)},o.resolve=a,e.exports=o,o.id=4},function(e,t,r){e.exports=r.p+"bundle/file-explorer.bbd42c728754a8d48aab.png"},function(e,t,r){e.exports=r.p+"bundle/file-transfer.a4fe28359cd8f43fc54a.png"},function(e,t,r){"use strict";r.r(t);r(0);var n=[200,403,404],o="https://github.com/ganeshrvel/openmtp",a="https://api.github.com/repos/ganeshrvel/openmtp/releases/latest",i=function(e){return r(4)("./"+e)},s=function(e){return null==e},l=function(e){var t=e.url;return fetch("".concat(t)).then((function(e){return-1!==n.indexOf(e.status)?{json:e.json(),status:e.status}:null})).catch((function(){}))},u=function(e){return new Promise((function(t){var r=new Image;r.onload=function(){return t({src:e,status:"ok"})},r.onerror=function(){return t({src:e,status:"error"})},r.src=e}))},c={get(e){var t=e.param,r=void 0===t?"":t,n=e.url,o=void 0===n?"":n,a={};return""===o&&(o=window.location.href),o.replace(/[?&]+([^=&]+)=([^&]*)/gi,(function(e,t,r){a[t]=decodeURI(r)})),""===r?a:void 0===a[r]?null:a[r]},getUrlWithoutHash(e){var t=e.url,r=void 0===t?"":t;if(""!==r){var n=r.split("#")[0];return n||null}return window.location.href.split("#")[0]},getHash(e){var t=e.url,r=void 0===t?"":t;if(""!==r){var n=r.split("#")[1];return n||null}return location.hash.replace("#","").trim()},parseHash(e){var t=e.param,r=void 0===t?"":t,n=e.url,o=void 0===n?"":n,a="";""!==o&&(a=o);var i=c.getHash({url:a});if(""===i)return null;var s,l,u=i.split("&"),f={};for(s=0;s<u.length;s+=1)(l=u[s].split("=")).length<2&&l.push(""),f[decodeURIComponent(l[0])]=decodeURIComponent(l[1]);return""===r?f:void 0===f[r]?null:f[r]},removeHash(){window.location.replace("#")},getUrlPath:()=>window.location.pathname};function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(new(function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._checkLatestGitHubRelease=function(){return l({url:a}).then((function(e){if(s(e))return null;var r=e.json,n=e.status;return r.then((function(e){return t.gitHubLatestReleaseData=t._generateDownloadLatestGitHubReleaseUrl(e,n),t._releaseInformationSet(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t.gitHubLatestReleaseData))}))}))},this._generateDownloadLatestGitHubReleaseUrl=function(e,t){return 200===t?{latest:e.name,url:{mac:"https://github.com/ganeshrvel/openmtp/releases/download/".concat(e.tag_name,"/").concat(e.name,".dmg")}}:{latest:"OpenMTP",url:{mac:"https://github.com/ganeshrvel/openmtp/releases/"}}},this._forceDownloadLatestGitHubRelease=function(e){return s(t.gitHubLatestReleaseData)?(t._checkLatestGitHubRelease().then((function(){return s(t.gitHubLatestReleaseData)?null:(window.location.href=t.gitHubLatestReleaseData.url[e],!0)})).catch((function(){})),null):t.gitHubLatestReleaseData},this._checkDownloadRequestUrl=function(){var e=c.get({}),r=e.downloadApp,n=e.release,o=e.platform;if(s(r)||s(n)||s(o))return null;switch(r){case"github":default:if(!t._forceDownloadLatestGitHubRelease(o))return null;window.location.href=t.gitHubLatestReleaseData.url[o]}},this._appScreenshotsLazyLoad=function(){Object.keys(t.lazyLoadImages).map((function(e){var r=t.lazyLoadImages[e],n=i(r.imgSrc);return u(n).then((function(e){if(!e.status)return null;if(!s(r.loader)){var n=r.parentSelector.querySelector(r.loader);r.parentSelector.removeChild(n)}return t._createImg(e.src,r.parentSelector,r.id),!0})).catch((function(){}))}))},this._createImg=function(e,t,r){var n=document.createElement("img");n.src=e,n.id=r,t.appendChild(n)},this._downloadBtnEvents=function(){t.$el.downloadBtnGitHub.addEventListener("click",(function(e){e.preventDefault();if(!t._forceDownloadLatestGitHubRelease("mac"))return null;window.location.href=t.gitHubLatestReleaseData.url.mac}))},this._navigateToGithuBtnEvents=function(){t.$el.navigateToGitHub.addEventListener("click",(function(e){e.preventDefault(),window.location.href=o}))},this._releaseInformationSet=function(e){for(var r=e.latest,n=e.url,o=0;o<t.$el.gitHubLatestVersionWrapper.length;o+=1)t.$el.gitHubLatestVersionWrapper[o].innerHTML='<a href="'.concat(n.mac,'">').concat(r,"</a>")},this.selectors={spinner:".spinner",appScreenshotFileExplorerImageWrapper:"#app-screenshot-file-explorer-wrapper",appScreenshotFileTransferImageWrapper:"#app-screenshot-file-transfer-wrapper",appScreenshotFileExplorerId:"app-screenshot-file-explorer",appScreenshotFileTransferId:"app-screenshot-file-transfer",downloadBtnGitHub:"#download-btn-github",navigateToGitHub:"#navigate-to-github",gitHubLatestVersionWrapper:".github-latest-version-wrapper"},this.$el={appScreenshotFileExplorerImageWrapper:document.querySelector(this.selectors.appScreenshotFileExplorerImageWrapper),appScreenshotFileTransferImageWrapper:document.querySelector(this.selectors.appScreenshotFileTransferImageWrapper),downloadBtnGitHub:document.querySelector(this.selectors.downloadBtnGitHub),navigateToGitHub:document.querySelector(this.selectors.navigateToGitHub),gitHubLatestVersionWrapper:document.querySelectorAll(this.selectors.gitHubLatestVersionWrapper)},this.gitHubLatestReleaseData=null,this.lazyLoadImages={fileExplorer:{imgSrc:"file-explorer.png",parentSelector:this.$el.appScreenshotFileExplorerImageWrapper,id:this.selectors.appScreenshotFileExplorerId,loader:this.selectors.spinner},fileTransfer:{imgSrc:"file-transfer.png",parentSelector:this.$el.appScreenshotFileTransferImageWrapper,id:this.selectors.appScreenshotFileTransferId,loader:this.selectors.spinner}}}var t,r,n;return t=e,(r=[{key:"init",value:function(){this._checkLatestGitHubRelease(),this._checkDownloadRequestUrl(),this._appScreenshotsLazyLoad(),this._downloadBtnEvents(),this._navigateToGithuBtnEvents()}}])&&d(t.prototype,r),n&&d(t,n),e}())).init()}]);