"use strict";var y=Object.create;var s=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var g=Object.getPrototypeOf;var C=Object.prototype.hasOwnProperty;var m=(t,e)=>s(t,"name",{value:e,configurable:true});var N=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:true})};var p=(t,e,o,i)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let n of b(e))if(!C.call(t,n)&&n!==o)s(t,n,{get:()=>e[n],enumerable:!(i=I(e,n))||i.enumerable})}return t};var h=(t,e,o)=>(o=t!=null?y(g(t)):{},p(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:true}):o,t));var S=t=>p(s({},"__esModule",{value:true}),t);var B={};N(B,{default:()=>A});module.exports=S(B);var a=require("react/jsx-runtime");var r=require("mobx-react");var u=require("react");var _=require("@mdi/js");var v=h(require("markdown-to-jsx"));var l=require("react-intl");var k=h(require("../../components/ui/icon"));var c=require("../../environment-remote");var d=require("../../helpers/update-helpers");var w=require("../../helpers/url-helpers");const M=(0,l.defineMessages)({headline:{id:"settings.releasenotes.headline",defaultMessage:"Release Notes"}});class f extends u.Component{handleClickBound=this.handleClick.bind(this);constructor(e){super(e);this.state={data:""}}async componentDidMount(){const{intl:e}=this.props;const o=await(0,d.getUpdateInfoFromGH)(window.location.href,c.ferdiumVersion,e);this.setState({data:o});for(const i of document.querySelectorAll(".releasenotes__body a")){i.addEventListener("click",this.handleClickBound,false)}}handleClick(e){e.preventDefault();(0,w.openExternalUrl)(e.target.href)}componentWillUnmount(){for(const e of document.querySelectorAll(".releasenotes__body a")){e.removeEventListener("click",this.handleClickBound,false)}}render(){const{intl:e}=this.props;const{data:o}=this.state;return(0,a.jsx)("div",{className:"auth__container auth__container--releasenotes",children:(0,a.jsxs)("div",{className:"auth__main--releasenotes",children:[(0,a.jsxs)("div",{className:"auth__header",children:[(0,a.jsxs)("span",{className:"auth__header-item",children:["Ferdium ",(0,d.getFerdiumVersion)(window.location.href,c.ferdiumVersion)," "," | "]}),(0,a.jsx)("span",{className:"auth__header-item__secondary",children:e.formatMessage(M.headline)})]}),(0,a.jsx)("div",{className:"auth__body releasenotes__body",children:(0,a.jsx)(v.default,{options:{wrapper:"article"},children:o})}),(0,a.jsx)("div",{className:"auth__help",children:(0,a.jsx)("button",{type:"button",onClick:()=>{window.location.href="#/auth/welcome"},children:(0,a.jsx)(k.default,{icon:_.mdiArrowLeftCircle,size:1.5})})})]})})}}m(f,"AuthReleaseNotesScreen");var A=(0,l.injectIntl)((0,r.inject)("stores","actions")((0,r.observer)(f)));
