"use strict";var I=Object.create;var i=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var w=Object.getPrototypeOf;var A=Object.prototype.hasOwnProperty;var p=(e,a)=>i(e,"name",{value:a,configurable:true});var H=(e,a)=>{for(var t in a)i(e,t,{get:a[t],enumerable:true})};var f=(e,a,t,r)=>{if(a&&typeof a==="object"||typeof a==="function"){for(let o of h(a))if(!A.call(e,o)&&o!==t)i(e,o,{get:()=>a[o],enumerable:!(r=v(a,o))||r.enumerable})}return e};var u=(e,a,t)=>(t=e!=null?I(w(e)):{},f(a||!e||!e.__esModule?i(t,"default",{value:e,enumerable:true}):t,e));var P=e=>f(i({},"__esModule",{value:true}),e);var y={};H(y,{default:()=>U});module.exports=P(y);var n=require("react/jsx-runtime");var d=require("react-intl");var m=require("@mdi/js");var g=u(require("./ui/InfoBar"));var b=u(require("./ui/icon"));var s=require("../environment");var c=require("../helpers/update-helpers");const l=(0,d.defineMessages)({updateAvailable:{id:"infobar.updateAvailable",defaultMessage:"A new update for Ferdium is available."},changelog:{id:"infobar.buttonChangelog",defaultMessage:"What is new?"},buttonInstallUpdate:{id:"infobar.buttonInstallUpdate",defaultMessage:"Restart & install update"},isSnapMessage:{id:"infobar.isSnapMessage",defaultMessage:"Please update via Snap Store."}});const S=p(e=>{const{onInstallUpdate:a,updateVersionParsed:t,onHide:r}=e;const o=(0,d.useIntl)();return(0,n.jsxs)(g.default,{type:"primary",ctaLabel:s.isSnap?void 0:o.formatMessage(l.buttonInstallUpdate),onClick:M=>{!s.isWinPortable&&!s.isSnap&&a(M)},onHide:r,children:[(0,n.jsx)(b.default,{icon:m.mdiInformation}),(0,n.jsxs)("p",{style:{padding:"0 0.5rem 0 1rem"},children:[o.formatMessage(l.updateAvailable),s.isSnap&&` ${o.formatMessage(l.isSnapMessage)}`]}),(0,n.jsx)("button",{className:"info-bar__inline-button",type:"button",onClick:()=>{window.location.href=(0,c.onAuthGoToReleaseNotes)(window.location.href,t)},children:(0,n.jsx)("u",{children:o.formatMessage(l.changelog)})})]})},"AppUpdateInfoBar");var U=S;
