import{B as ee,a as Z,c as q,g as K,m as J}from"./chunk-EKD65OAZ.js";import{a as I}from"./chunk-NVRIF56Y.js";import{Ab as f,Ac as x,Bb as C,Cb as V,Cc as W,Db as G,Ga as c,Lb as L,Ma as k,Mb as B,Nb as P,Ob as H,Pb as $,Qa as E,Ra as v,Tb as j,Ub as U,Vb as X,Wb as M,Wf as te,X as D,Xa as T,Y as R,Yb as z,Zb as Q,aa as y,cb as w,db as p,ga as s,ha as d,mb as m,nb as u,nc as S,ob as h,sa as r,sb as O,tc as Y,wb as F}from"./chunk-XBTZE2EC.js";import{i as l}from"./chunk-WHYNGVB3.js";var N=class{_document;_textarea;constructor(e,a){this._document=a;let t=this._textarea=this._document.createElement("textarea"),i=t.style;i.position="fixed",i.top=i.opacity="0",i.left="-999em",t.setAttribute("aria-hidden","true"),t.value=e,t.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(t);}copy(){let e=this._textarea,a=!1;try{if(e){let t=this._document.activeElement;e.select(),e.setSelectionRange(0,e.value.length),a=this._document.execCommand("copy"),t&&t.focus();}}catch{}return a;}destroy(){let e=this._textarea;e&&(e.remove(),this._textarea=void 0);}},A=(()=>{let e=class e{_document=y(Y);constructor(){}copy(t){let i=this.beginCopy(t),n=i.copy();return i.destroy(),n;}beginCopy(t){return new N(t,this._document);}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275prov",R({token:e,factory:e.ɵfac,providedIn:"root"}));let o=e;return o;})();var ie=["*"],re=(o,e)=>({"is-input-group":o,"with-border":e}),oe=(()=>{let e=class e{notifier=y(te);clipboard=y(A);value=r(void 0);elementContent=r(void 0);title=r(void 0);notification=r(void 0);withBorder=r(!1,{transform:S});isInputGroup=r(!1,{transform:S});copy(){this.clipboard.copy(this.value()||this.elementContent()?.innerText);let t=this.notification();t&&this.notifier.success(t);}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275cmp",v({type:e,selectors:[["my-copy-button"]],inputs:{value:[1,"value"],elementContent:[1,"elementContent"],title:[1,"title"],notification:[1,"notification"],withBorder:[1,"withBorder"],isInputGroup:[1,"isInputGroup"]},features:[M([A])],ngContentSelectors:ie,decls:3,vars:5,consts:[["type","button",1,"btn","copy-button",3,"click","ngClass"],["iconName","copy"]],template:function(i,n){i&1&&(V(),m(0,"button",0),f("click",function(){return n.copy();}),h(1,"my-global-icon",1),G(2),u()),i&2&&(p("ngClass",Q(2,re,n.isInputGroup(),n.withBorder())),w("title",n.title()));},dependencies:[x,I],styles:[`button[_ngcontent-%COMP%]:not(.with-border,.is-input-group){border:0}.is-input-group[_ngcontent-%COMP%]{--bs-btn-border-color: var(--input-border-color);--bs-btn-hover-border-color: var(--input-border-color);border-top-left-radius:0;border-bottom-left-radius:0}my-global-icon[_ngcontent-%COMP%]{display:inline-block;width:15px;height:15px;line-height:15px;margin-inline-end:.3125rem}
/*# sourceMappingURL=copy-button.component-4JN7QB7G.css.map */`]}));let o=e;return o;})();var ae=["input"],pe=o=>({"input-error":o});function le(o,e){o&1&&h(0,"my-global-icon",10);}function ce(o,e){o&1&&h(0,"my-global-icon",11);}function ue(o,e){if(o&1){let a=O();m(0,"button",7),f("click",function(){s(a);let i=C();return d(i.toggle());}),T(1,le,1,0,"my-global-icon",8)(2,ce,1,0,"my-global-icon",9),u();}if(o&2){let a=C();p("title",a.toggleTitle),c(),p("ngIf",a.show()),c(),p("ngIf",!a.show());}}function se(o,e){if(o&1&&(m(0,"my-copy-button",12),F(1,1),u()),o&2){C();let a=P(2);p("value",a.value)("isInputGroup",!0);}}function de(o,e){if(o&1&&(m(0,"div",13),H(1),u()),o&2){let a=C();c(),$(a.formError());}}var je=(()=>{let e=class e{inputElement=k("input");inputId=r.required();value=E("");autocomplete=r("off");placeholder=r("");tabindex=r(0);withToggle=r(!0);withCopy=r(!1);readonly=r(!1);show=E(!1);formError=r(void 0);autofocus=r(!1);ariaLabel=r(void 0);get inputType(){return this.show()?"text":"password";}get toggleTitle(){return this.show()?"Ocultar":"Mostrar";}ngAfterViewInit(){this.autofocus()===!0&&this.inputElement().nativeElement.focus({preventScroll:!0});}toggle(){this.show.set(!this.show());}propagateChange=t=>{};writeValue(t){this.value.set(t);}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}update(){this.propagateChange(this.value());}focus(){this.inputElement().nativeElement.focus({preventScroll:!0});}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275cmp",v({type:e,selectors:[["my-input-text"]],viewQuery:function(i,n){i&1&&L(n.inputElement,ae,5),i&2&&B();},inputs:{inputId:[1,"inputId"],value:[1,"value"],autocomplete:[1,"autocomplete"],placeholder:[1,"placeholder"],tabindex:[1,"tabindex"],withToggle:[1,"withToggle"],withCopy:[1,"withCopy"],readonly:[1,"readonly"],show:[1,"show"],formError:[1,"formError"],autofocus:[1,"autofocus"],ariaLabel:[1,"ariaLabel"]},outputs:{value:"valueChange",show:"showChange"},features:[M([{provide:Z,useExisting:D(()=>e),multi:!0}])],decls:6,vars:16,consts:()=>{let t;t="Copiado";let i;return i="COPIAR",[["input",""],i,[1,"input-group"],[1,"form-control",3,"ngModelChange","click","input","change","id","name","autocomplete","value","placeholder","tabindex","ngModel","readonly","type","ngClass"],["type","button","class","btn",3,"title","click",4,"ngIf"],["notification",t,3,"value","isInputGroup",4,"ngIf"],["class","form-error","role","alert",4,"ngIf"],["type","button",1,"btn",3,"click","title"],["iconName","eye-open",4,"ngIf"],["iconName","eye-close",4,"ngIf"],["iconName","eye-open"],["iconName","eye-close"],["notification",t,3,"value","isInputGroup"],["role","alert",1,"form-error"]];},template:function(i,n){if(i&1){let g=O();m(0,"div",2)(1,"input",3,0),X("ngModelChange",function(_){return s(g),U(n.value,_)||(n.value=_),d(_);}),f("ngModelChange",function(){return s(g),d(n.update());})("click",function(){s(g);let _=P(2);return d(_.select());})("input",function(){return s(g),d(n.update());})("change",function(){return s(g),d(n.update());}),u(),T(3,ue,3,3,"button",4)(4,se,2,2,"my-copy-button",5),u(),T(5,de,2,1,"div",6);}i&2&&(c(),p("id",n.inputId())("name",n.inputId())("autocomplete",n.autocomplete())("value",n.value())("placeholder",n.placeholder())("tabindex",n.tabindex()),j("ngModel",n.value),p("readonly",n.readonly())("type",n.inputType)("ngClass",z(14,pe,n.formError())),w("aria-label",n.ariaLabel()),c(2),p("ngIf",n.withToggle()),c(),p("ngIf",n.withCopy()),c(),p("ngIf",n.formError()));},dependencies:[ee,q,K,J,x,W,I,oe],styles:[`input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:auto;max-width:auto;color:var(--input-fg);background-color:var(--input-bg);border:1px solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[_ngcontent-%COMP%]:focus, input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(auto + 40px)){input[_ngcontent-%COMP%]{width:100%}}.btn[_ngcontent-%COMP%], my-copy-button[_ngcontent-%COMP%]     .btn{background-color:var(--bg-secondary-400);border-left:1px solid var(--bg)}.btn[_ngcontent-%COMP%]:hover, my-copy-button[_ngcontent-%COMP%]     .btn:hover{background-color:var(--bg-secondary-450)}.btn[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:0;right:0;display:inline-block;width:18px;height:18px;line-height:18px}.btn[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{margin-inline-end:.1875rem}.copy-text[_ngcontent-%COMP%]{font-size:14px;margin-left:5px;vertical-align:top}
/*# sourceMappingURL=input-text.component-4Q46755F.css.map */`]}));let o=e;return o;})();export{oe as a,je as b};/**i18n:56bde403ffba090cdb11aaac0f86ffb9ae7c2bab95df4b44d5dba510264fcf4f*///# sourceMappingURL=chunk-O5UEGU4Z.js.map