import{a as w}from"./chunk-OFSPPASQ.js";import{a as S}from"./chunk-FVUFPTGH.js";import{a as I,b as F}from"./chunk-BQPO535K.js";import{c as D}from"./chunk-U5Y75IZ5.js";import{F as x,c as T,e as m,h as y,l as b,s as M}from"./chunk-MDIMQ3H3.js";import{Ad as R,Bb as p,Db as u,Dc as g,Ib as d,Jb as n,Kb as i,Lb as c,Xb as h,Za as r,ib as v,mc as o,nc as C,nd as _,ra as f}from"./chunk-GJDGQISV.js";var E=class{};var k=t=>({"is-invalid":t});function W(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Host URL is required."),i()())}function U(t,l){t&1&&(n(0,"span",9),o(1,"Enter the port or device URL used by your middleware."),i())}function O(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Buffer Time must be at least 100 ms."),i()())}function P(t,l){t&1&&(n(0,"span",9),o(1,"Enter the buffer time in milliseconds for your RFID device."),i())}var N=class t{dialogRef=f(I);data=f(F);config=new S;urlCtrl=new b(this.data?.url,[m.required]);bufferTimeCtrl=new b(this.data?.bufferTime??100,[m.required,m.min(100)]);isConnected=this.data?.isConnected;constructor(){this.initModalConfig()}initModalConfig(){this.config.title="Connect RFID",this.config.customWidth="450px",this.config.hideCancel=!0,this.config.okText=this.isConnected?"Disconnect":"Connect Now"}onClose(){this.dialogRef.close()}onConnect(){this.isConnected?this.dialogRef.close({disconnect:!0}):this.urlCtrl.valid&&this.bufferTimeCtrl.valid&&this.dialogRef.close({url:this.urlCtrl.value,bufferTime:this.bufferTimeCtrl.value})}get modalContentWording(){let l="RFID Connected",a="Your RFID device is successfully connected.",e="RFID Not Connected",s="Please connect your RFID device to process items",A=this.isConnected?l:e,L=this.isConnected?a:s;return{title:A,description:L}}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=v({type:t,selectors:[["app-modal-connect-rfid"]],decls:20,vars:15,consts:[[3,"onCancel","onClose","onOk","config","dynamicValidated"],[1,"d-flex","flex-column",2,"row-gap","1.5rem"],[1,"text-center","d-flex","flex-column","align-items-center",2,"row-gap","0.8rem"],[1,"fa-solid","fa-wifi","fa-3x","d-flex","align-items-center","justify-content-center","bg-light",2,"border-radius","50%","width","80px","height","80px",3,"ngClass"],[1,"fw-normal"],[1,"card","d-flex","justify-content-center","p-8","bg-light-gray",2,"border-radius","12px","margin","0"],["for","floatingInput",1,"fw-semibold","mb-2"],["id","floatingInput","placeholder","Host URL","type","text",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"],[1,"invalid-feedback","mt-4"],[1,"text-muted","mt-2"],["for","floatingInput",1,"fw-semibold","mb-2","mt-4"],["id","floatingInput","placeholder","Buffer Time (ms)","type","text","autoNum","",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"]],template:function(a,e){a&1&&(n(0,"modal-material",0),h("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()})("onOk",function(){return e.onConnect()}),n(1,"content")(2,"div",1)(3,"div",2),c(4,"i",3),n(5,"h2"),o(6),i(),n(7,"span",4),o(8),i()(),n(9,"div",5)(10,"label",6),o(11,"Port / URL"),i(),c(12,"input",7),p(13,W,3,0,"div",8)(14,U,2,0,"span",9),n(15,"label",10),o(16,"Buffer Time"),i(),c(17,"input",11),p(18,O,3,0,"div",8)(19,P,2,0,"span",9),i()()()()),a&2&&(d("config",e.config)("dynamicValidated",e.urlCtrl.valid),r(4),d("ngClass",e.isConnected?"text-success":"text-danger"),r(2),C(e.modalContentWording.title),r(2),C(e.modalContentWording.description),r(4),d("ngClass",g(11,k,e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)))("formControl",e.urlCtrl),r(),u(e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)?13:14),r(4),d("ngClass",g(13,k,e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)))("formControl",e.bufferTimeCtrl),r(),u(e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)?18:19))},dependencies:[R,_,x,T,y,M,D,w],encapsulation:2})};export{E as a,N as b};
