"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[91493],{91493:(e,t,n)=>{n.r(t),n.d(t,{AddonModDataFieldDateComponent:()=>u});var o=n(24742),a=n(94339),d=n(10093),i=n(86654),s=n(54438),r=n(60177),l=n(89417),p=n(2910),_=n(25880),m=n(17778),f=n(9970),c=n(73955),D=n(59528);function AddonModDataFieldDateComponent_span_0_span_1_Template(e,t){if(1&e&&s.nrm(0,"span",8),2&e){const e=s.XpG(2);s.Y8G("core-mark-required",e.field.required)}}function AddonModDataFieldDateComponent_span_0_ng_template_4_Template(e,t){if(1&e&&s.nrm(0,"ion-datetime",9),2&e){const e=s.XpG(2);s.Y8G("formControlName","f_"+e.field.id)("max",e.maxDate)("min",e.minDate)("disabled",!!e.searchMode&&!!e.searchFields&&!e.searchFields["f_"+e.field.id+"_z"])("showDefaultButtons",!0)}}function AddonModDataFieldDateComponent_span_0_core_input_errors_5_Template(e,t){if(1&e&&s.nrm(0,"core-input-errors",10),2&e){const e=s.XpG(2);s.Y8G("control",e.form.controls["f_"+e.field.id])("errorText",e.error)}}function AddonModDataFieldDateComponent_span_0_ion_item_6_Template(e,t){if(1&e){const e=s.RV6();s.j41(0,"ion-item",11)(1,"ion-checkbox",12),s.mxI("ngModelChange",(function AddonModDataFieldDateComponent_span_0_ion_item_6_Template_ion_checkbox_ngModelChange_1_listener(t){s.eBV(e);const n=s.XpG(2);return s.DH7(n.searchFields["f_"+n.field.id+"_z"],t)||(n.searchFields["f_"+n.field.id+"_z"]=t),s.Njj(t)})),s.EFF(2),s.nI1(3,"translate"),s.k0s()()}if(2&e){const e=s.XpG(2);s.R7$(),s.Y8G("formControlName","f_"+e.field.id+"_z"),s.R50("ngModel",e.searchFields["f_"+e.field.id+"_z"]),s.R7$(),s.SpI(" ",s.bMT(3,3,"addon.mod_data.usedate")," ")}}function AddonModDataFieldDateComponent_span_0_Template(e,t){if(1&e&&(s.j41(0,"span",2),s.DNE(1,AddonModDataFieldDateComponent_span_0_span_1_Template,1,1,"span",3),s.nrm(2,"ion-datetime-button",4),s.j41(3,"ion-modal",5),s.DNE(4,AddonModDataFieldDateComponent_span_0_ng_template_4_Template,1,5,"ng-template"),s.k0s(),s.DNE(5,AddonModDataFieldDateComponent_span_0_core_input_errors_5_Template,1,2,"core-input-errors",6)(6,AddonModDataFieldDateComponent_span_0_ion_item_6_Template,4,5,"ion-item",7),s.k0s()),2&e){const e=s.XpG();s.Y8G("formGroup",e.form),s.R7$(),s.Y8G("ngIf",e.editMode),s.R7$(2),s.Y8G("keepContentsMounted",!0),s.R7$(2),s.Y8G("ngIf",e.error&&e.editMode),s.R7$(),s.Y8G("ngIf",e.searchMode&&e.searchFields)}}function AddonModDataFieldDateComponent_span_1_Template(e,t){if(1&e&&(s.j41(0,"span"),s.EFF(1),s.nI1(2,"coreFormatDate"),s.k0s()),2&e){const e=s.XpG();s.R7$(),s.SpI(" ",s.i5U(2,1,e.displayDate,"strftimedate"),"\n")}}let u=(()=>{var e;class AddonModDataFieldDateComponent extends d.u{init(){var e,t;if(this.displayMode)return this.displayDate=null!==(t=this.value)&&void 0!==t&&t.content?1e3*parseInt(this.value.content,10):void 0,void 0;let n;var d;(this.maxDate=o.j.getDatetimeDefaultMax(),this.minDate=o.j.getDatetimeDefaultMin(),this.searchMode&&this.searchFields)?(this.addControl(`f_${this.field.id}_z`),n=this.searchFields["f_"+this.field.id+"_y"]?(0,a.yf)(this.searchFields["f_"+this.field.id+"_y"]+"-"+this.searchFields["f_"+this.field.id+"_m"]+"-"+this.searchFields["f_"+this.field.id+"_d"]):(0,a.yf)(),this.searchFields[`f_${this.field.id}`]=o.j.toDatetimeFormat(n.valueOf())):n=null!==(d=this.value)&&void 0!==d&&d.content?(0,a.yf)(1e3*parseInt(this.value.content,10)):(0,a.yf)();this.addControl(`f_${this.field.id}`,o.j.toDatetimeFormat(n.valueOf())),this.searchMode||null!==(e=this.value)&&void 0!==e&&e.content||this.onFieldInit.emit({fieldid:this.field.id,content:String(n.unix())})}}return(e=AddonModDataFieldDateComponent).ɵfac=(()=>{let t;return function AddonModDataFieldDateComponent_Factory(n){return(t||(t=s.xGo(e)))(n||e)}})(),e.ɵcmp=s.VBU({type:e,selectors:[["addon-mod-data-field-date"]],standalone:!0,features:[s.Vt3,s.aNF],decls:2,vars:2,consts:[[3,"formGroup",4,"ngIf"],[4,"ngIf"],[3,"formGroup"],["class","core-mark-required",3,"core-mark-required",4,"ngIf"],["datetime","datetime"],[3,"keepContentsMounted"],[3,"control","errorText",4,"ngIf"],["class","ion-text-wrap",4,"ngIf"],[1,"core-mark-required",3,"core-mark-required"],["id","datetime","presentation","date",3,"formControlName","max","min","disabled","showDefaultButtons"],[3,"control","errorText"],[1,"ion-text-wrap"],[3,"ngModelChange","formControlName","ngModel"]],template:function AddonModDataFieldDateComponent_Template(e,t){1&e&&s.DNE(0,AddonModDataFieldDateComponent_span_0_Template,7,5,"span",0)(1,AddonModDataFieldDateComponent_span_1_Template,3,4,"span",1),2&e&&(s.Y8G("ngIf",t.inputMode&&t.form),s.R7$(),s.Y8G("ngIf",t.displayMode&&t.displayDate))},dependencies:[i.n,r.bT,l.BC,l.cb,p.eY,p.A9,p.K4,p.uz,p.Sb,p.hB,p.Je,l.j4,l.JD,_.q,m.j,f.E,c.D9,D.f],encapsulation:2}),AddonModDataFieldDateComponent})()}}]);