1import{r as e,h as a,a as t}from"./p-DUzt9vTO.js";import{a2 as o,at as c,a4 as s,A as i,a as d,i as n}from"./p-CqD2VFGZ.js";import{T as r}from"./p-Bxu81zuk.js";import"./p-Bb52nWwj.js";import"./p-AuPLCHfl.js";import"./p-E-ZsRS8r.js";const b=class{constructor(a){e(this,a),this.termsAccepted=!1,this.isLoading=!1}componentWillLoad(){console.log("componentWillLoad")}async openReadTermsModal(){await r.open()}async acceptTerms(){if(this.termsAccepted){this.isLoading=!0;try{const e=i.currentUser.id,a=i.siteConfig.siteId,t=i.siteConfig.termsApprovedVersion.version,d=(await o.getUserTermsConsentByUserId({userId:e,siteId:a,category:s.TERMS_AND_CONDITIONS,targetType:c.SITE})).find((e=>e.category===s.TERMS_AND_CONDITIONS));if(d)await o.updateUserTermsConsent(Object.assign(Object.assign({},d),{version:t,date:new Date}));else{const i={userId:e,siteId:a,category:s.TERMS_AND_CONDITIONS,version:t,targetType:c.SITE,date:new Date};await o.createUserTermsConsent(i)}}catch(e){console.error("Error accepting terms:",e),d.presentErrorToast({message:n("TERMS.ERROR_ACCEPTING")})}finally{await this.el.closest("ion-modal").dismiss({termsAccepted:!0}),this.isLoading=!1}}}render(){return[a("ion-header",{key:"b06dc51ade1661b2862cbb0b64e544e19ace428a"},a("ion-toolbar",{key:"913ee476d24ee5a74ecce03431d25d9775b2e985",color:"primary"},a("ion-title",{key:"dfb6893002b03b276b1557043ce47e613f6309cc",class:"bold"},n("TERMS_AND_CONDITIONS_PAGE.MODAL_TITLE")))),a("ion-content",{key:"5bc1e12c51b26f05be2685bac5747804d7393496",class:"ion-padding"},a("div",{key:"8d081d5713e738aaa6b58868ada808167d99bc16",style:{display:"flex",flexDirection:"column",height:"100%"}},a("div",{key:"dafacae9a1ad0711802b26bfde17b7ea165303af"},a("h2",{key:"55e64c0507b62b5a2036ece47437a84a5b45670f"},n("TERMS_AND_CONDITIONS_PAGE.MODAL_HEADER")),a("p",{key:"0962597ba6422ba10820ac56e8cd168c3a9eae44"},n("TERMS_AND_CONDITIONS_PAGE.MODAL_DESCRIPTION")),a("p",{key:"67b8d3a5a70d48495f6a17a42114e8152190e45c"},n("TERMS_AND_CONDITIONS_PAGE.MODAL_INFO"))),a("ion-button",{key:"e6bd251b475a05f195be54876fa3b7470b520ccf",expand:"block",class:"ion-margin-top",color:"dark",onClick:()=>this.openReadTermsModal(),fill:"outline"},a("ion-icon",{key:"6defcc38e34d2ccb5ad3469d762f8c3f27e342ad",slot:"start",name:"document-text-outline"}),n("TERMS_AND_CONDITIONS_PAGE.MODAL_READ_BUTTON")),a("div",{key:"caed74f179af461e4a785f53bee4dd22b1877d73",style:{marginTop:"auto"}},a("ion-item",{key:"d6347078f5d751f2df3d3725e6700c76ed897fa6"},a("ion-checkbox",{key:"d5c48e0ef31efe6aa2187d594378085a2d609713",slot:"start",checked:this.termsAccepted,onIonChange:e=>this.termsAccepted=e.detail.checked,labelPlacement:"end"},n("TERMS_AND_CONDITIONS_PAGE.MODAL_ACCEPT_LABEL")))))),a("app-modal-footer",{key:"02ce19446bb7d9e68ce0e52197476e100e249a1a",showSave:!0,showCancel:!1,saveText:n("TERMS_AND_CONDITIONS_PAGE.MODAL_ACCEPT_BUTTON"),save:()=>this.acceptTerms(),disableSaveBtn:!this.termsAccepted||this.isLoading})]}get el(){return t(this)}};export{b as app_terms_modal}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.