import{r as i,d as n,B as o,h as l}from"./p-846bd001.js";import{g as t}from"./p-a68e998e.js";import{s as e}from"./p-4ff8bb4b.js";import"./p-5cd01495.js";import"./p-259f1737.js";import"./p-ae2fb9dc.js";import"./p-65879f9e.js";import"./p-dca1478c.js";const s=class{constructor(o){i(this,o),this.fireenjinTrigger=n(this,"fireenjinTrigger",7),this.fireenjinSubmit=n(this,"fireenjinSubmit",7),this.eventIconMap={alert:"notifications",notion:"./assets/svg/notion.svg"},this.query=void 0,this.filters=[{name:"type",label:"Event Type",icon:"magnet",options:t()}]}onSearchInput(i){this.query=i.target.value}componentDidLoad(){}render(){var i;return[l("ion-content",{class:"ion-padding"},l("div",{class:"ion-padding"},l("fireenjin-search-bar",{ref:i=>this.filterBarEl=i,paginationEl:this.paginationEl,filters:this.filters}),l("fireenjin-pagination",{ref:i=>this.paginationEl=i,name:"triggers",resultsKey:"triggers",disableVirtualScroll:!0,removeDuplicates:!0,listEl:({result:i})=>{var n,o,t,e,s,r;return l("ion-item",{href:`/triggers/${i.id}`,detail:!0,lines:"full"},l("ion-toggle",{slot:"start",name:"active",onClick:i=>{i.preventDefault(),i.stopPropagation()},onIonChange:n=>this.fireenjinSubmit.emit({endpoint:"editTrigger",id:i.id,data:{active:n.target.checked}}),value:null==i?void 0:i.id,checked:null==i?void 0:i.active}),l("ion-grid",null,l("ion-row",{class:"ion-align-items-center ion-justify-content-between"},l("ion-col",null,l("ion-label",null,l("h2",null,i.name))),l("ion-col",null,(null==i?void 0:i.type)&&l("ion-chip",{outline:!0,style:{float:"right",opacity:"0.6"}},l("ion-icon",{name:"magnet"}),l("ion-label",null,null==i?void 0:i.type,"   =>  "," ",null==i?void 0:i.action),l("ion-icon",{name:!(null===(t=null===(o=null===(n=this.eventIconMap)||void 0===n?void 0:n[null==i?void 0:i.action])||void 0===o?void 0:o.includes)||void 0===t?void 0:t.call(o,"/"))&&this.eventIconMap[null==i?void 0:i.action],src:(null===(r=null===(s=null===(e=this.eventIconMap)||void 0===e?void 0:e[null==i?void 0:i.action])||void 0===s?void 0:s.includes)||void 0===r?void 0:r.call(s,"/"))&&this.eventIconMap[null==i?void 0:i.action]}))))))},display:"list",endpoint:"listTriggers",limit:20,query:this.query}))),l("floodteam-navigation-footer",null,l("floodteam-title-bar",{back:"/dashboard"},l("ion-breadcrumbs",null,l("ion-breadcrumb",{onClick:()=>this.fireenjinTrigger.emit({name:"pin",payload:{icon:"flash",href:"/triggers",name:"Triggers"}})},l("ion-icon",{color:(null===(i=((null==e?void 0:e.pins)||[]).map((i=>null==i?void 0:i.href)))||void 0===i?void 0:i.includes("/triggers"))?"primary":null,slot:"start",name:"pin"}),"Triggers")),l("ion-buttons",{slot:"end"},l("ion-button",{fill:"solid",color:"primary",href:"/triggers/new"},"Add"))))]}};s.style="";export{s as app_trigger_list}