import o from"./TopBar.8157552e.js";import i from"./Container.f87d9f62.js";import s from"./Content.e22a1fd6.js";import m from"./Page.3927bdbf.js";import n from"./PageHeader.a5f457a5.js";import a from"./PageHeaderTitle.3ed783af.js";import p from"./PageBody.dec1fae1.js";import l from"./Button.f17dffc9.js";import f from"./List.d5d221b1.js";import u from"./ListItem.ee1e88fb.js";import _ from"./StatusBubble.4f1d8322.js";import c from"./NotificationBadge.b6fae3d5.js";import d from"./MainLayout.17290af6.js";import g from"./SettingsLayout.3305573b.js";import y from"./SettingsSegment.e8fdfb41.js";import h from"./FormInput.7debc7c5.js";import v from"./FormTextarea.5b8e3d32.js";import x from"./FormSelect.6e35ae7d.js";import b from"./Form.2cdcadd9.js";import S from"./FormActions.83ccca91.js";import{u as F}from"./confirm.059313bf.js";import k from"./Tabs.1a21a1c7.js";import{n as B}from"./plugin-vue2_normalizer.000ba15c.js";import"./TopBar.27b84f08.js";import"./Dropdown.d1060583.js";import"./DropdownList.02c48c2f.js";import"./DropdownListItem.ac31464c.js";import"./IconMoon.ade3e41b.js";import"./IconSun.8809e5d7.js";import"./IconSearch.27dac870.js";import"./IconButton.eadc8d3d.js";import"./Breadcrumbs.d39e2491.js";import"./BreadcrumbsItem.da3f8155.js";import"./TopBarTabBarContainer.3bdb2bb3.js";import"./TabBar.c1d45ed5.js";import"./TabBarItem.e9886f0a.js";import"./Confirm.888708f1.js";import"./Notification.d432029f.js";import"./IconDanger.2f6e115d.js";import"./IconWarning.ca92fb65.js";import"./IconSuccess.09b85716.js";import"./IconInfo.ad7662f9.js";import"./SearchPalette.282fdde5.js";import"./notification.db2f2ae7.js";import"./app.79e1f42d.js";import"./FormGroup.efd02a6a.js";import"./Label.9d0d3ee0.js";import"./ErrorText.b141a597.js";import"./HelperText.14a7ed0b.js";import"./IconClipboard.8551be1b.js";import"./IconKey.455a255f.js";const T={metaInfo(){return{title:`${this.__("Edit alert")}`}},layout:d,components:{TopBar:o,Container:i,Content:s,Page:m,PageHeader:n,PageHeaderTitle:a,PageBody:p,Button:l,List:f,ListItem:u,StatusBubble:_,NotificationBadge:c,FormInput:h,FormSelect:x,SettingsLayout:g,SettingsSegment:y,Form:b,FormTextarea:v,FormActions:S,Tabs:k},data(){return{sending:!1,form:{type:this.alert.type,message:this.alert.message,expires_at:this.alert.expires_at}}},props:{alert:Object},methods:{submit(){this.$inertia.patch(this.route("admin.alerts.update",this.alert.id),this.form,{onStart:()=>this.sending=!0,onFinish:()=>this.sending=!1})},confirmDelete(){F({title:this.__("Are you sure?"),message:this.__("Are you sure you want to delete this alert?"),onConfirm:()=>this.delete()})},delete(){this.$inertia.delete(this.route("admin.alerts.delete",this.alert.id),{onStart:()=>this.sending=!0,onFinish:()=>this.sending=!1})}}};var $=function(){var t=this,r=t._self._c;return r("Page",[r("TopBar"),r("Content",[r("Container",[r("PageHeader",{scopedSlots:t._u([{key:"start",fn:function(){return[r("PageHeaderTitle",[t._v(t._s(t.__("Edit alert")))])]},proxy:!0}])}),r("PageBody",[r("SettingsLayout",{scopedSlots:t._u([{key:"nav",fn:function(){return[r("Tabs")]},proxy:!0},{key:"segments",fn:function(){return[r("SettingsSegment",{scopedSlots:t._u([{key:"title",fn:function(){return[t._v(t._s(t.__("Edit")))]},proxy:!0},{key:"form",fn:function(){return[r("form",{staticClass:"space-y-4",on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[r("FormTextarea",{attrs:{label:t.__("Message"),errors:t.$page.props.errors.message},model:{value:t.form.message,callback:function(e){t.$set(t.form,"message",e)},expression:"form.message"}}),r("FormInput",{attrs:{label:t.__("Expires at"),placeholder:"2020-01-01 00:00:00",errors:t.$page.props.errors.expires_at},model:{value:t.form.expires_at,callback:function(e){t.$set(t.form,"expires_at",e)},expression:"form.expires_at"}}),r("FormSelect",{attrs:{errors:t.$page.props.errors.type,label:t.__("Type")},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[r("option",{attrs:{value:"info"}},[t._v(t._s(t.__("Informational")))]),r("option",{attrs:{value:"warning"}},[t._v(t._s(t.__("Warning")))]),r("option",{attrs:{value:"danger"}},[t._v(t._s(t.__("Danger")))])]),r("FormActions",[r("Button",[t._v(t._s(t.__("Save")))]),r("Button",{attrs:{variant:"danger",type:"button"},on:{click:t.confirmDelete}},[t._v(" "+t._s(t.__("Delete"))+" ")])],1)],1)]},proxy:!0}])})]},proxy:!0}])})],1)],1)],1)],1)},C=[],P=B(T,$,C,!1,null,null,null,null);const Ct=P.exports;export{Ct as default};
