import{A as ee,a as Z,c as J,g as K,l as q}from"./chunk-I267ADJP.js";import{a as w}from"./chunk-NIY7P74G.js";import{$a as a,Db as G,Eb as B,Fa as c,Fb as L,Ga as M,Gb as E,Hb as H,Ib as j,La as C,Mb as $,Nb as U,Ob as X,Pb as v,Qf as te,Ra as D,Rb as z,Sa as b,Sb as Q,Y as S,Z as N,_a as R,ba as A,fc as O,ia as u,ib as m,ja as d,jb as s,kb as f,mc as Y,ob as x,sb as k,tc as T,vc as W,wb as g,xb as y,yb as V,zb as F}from"./chunk-4JM6MIZ5.js";import{i as l}from"./chunk-QJQRWPYR.js";var P=class{_document;_textarea;constructor(e,r){this._document=r;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,r=!1;try{if(e){let t=this._document.activeElement;e.select(),e.setSelectionRange(0,e.value.length),r=this._document.execCommand("copy"),t&&t.focus();}}catch{}return r;}destroy(){let e=this._textarea;e&&(e.remove(),this._textarea=void 0);}},I=(()=>{let e=class e{_document=A(Y);constructor(){}copy(t){let i=this.beginCopy(t),n=i.copy();return i.destroy(),n;}beginCopy(t){return new P(t,this._document);}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275prov",N({token:e,factory:e.ɵfac,providedIn:"root"}));let o=e;return o;})();var re=["*"],ae=(o,e)=>({"is-input-group":o,"with-border":e}),oe=(()=>{let e=class e{notifier;clipboard;value;elementContent;title;notification;withBorder=!1;isInputGroup=!1;constructor(t,i){this.notifier=t,this.clipboard=i;}copy(){this.clipboard.copy(this.value||this.elementContent?.innerText),this.notification&&this.notifier.success(this.notification);}};l(e,"\u0275fac",function(i){return new(i||e)(M(te),M(I));}),l(e,"\u0275cmp",C({type:e,selectors:[["my-copy-button"]],inputs:{value:"value",elementContent:"elementContent",title:"title",notification:"notification",withBorder:[2,"withBorder","withBorder",O],isInputGroup:[2,"isInputGroup","isInputGroup",O]},features:[v([I]),D],ngContentSelectors:re,decls:3,vars:5,consts:[["type","button",1,"btn","copy-button",3,"click","title","ngClass"],["iconName","copy"]],template:function(i,n){i&1&&(V(),m(0,"button",0),g("click",function(){return n.copy();}),f(1,"my-global-icon",1),F(2),s()),i&2&&a("title",n.title)("ngClass",Q(2,ae,n.isInputGroup,n.withBorder));},dependencies:[T,w],styles:[`button[_ngcontent-%COMP%]:not(.with-border,.is-input-group){border:0}.is-input-group[_ngcontent-%COMP%]{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-O5AJQ3QA.css.map */`]}));let o=e;return o;})();var pe=["input"],le=o=>({"input-error":o});function ce(o,e){o&1&&f(0,"my-global-icon",10);}function se(o,e){o&1&&f(0,"my-global-icon",11);}function ue(o,e){if(o&1){let r=x();m(0,"button",7),g("click",function(){u(r);let i=y();return d(i.toggle());}),b(1,ce,1,0,"my-global-icon",8)(2,se,1,0,"my-global-icon",9),s();}if(o&2){let r=y();a("title",r.toggleTitle),c(),a("ngIf",r.show),c(),a("ngIf",!r.show);}}function de(o,e){if(o&1&&(m(0,"my-copy-button",12),k(1,1),s()),o&2){y();let r=E(2);a("value",r.value)("isInputGroup",!0);}}function me(o,e){if(o&1&&(m(0,"div",13),H(1),s()),o&2){let r=y();c(),j(r.formError);}}var ze=(()=>{let e=class e{inputElement;inputId;value="";autocomplete="off";placeholder="";tabindex=0;withToggle=!0;withCopy=!1;readonly=!1;show=!1;formError;autofocus=!1;ariaLabel;get inputType(){return this.show?"text":"password";}get toggleTitle(){return this.show?"Agochar":"Mostrar";}ngAfterViewInit(){this.autofocus===!0&&this.inputElement.nativeElement.focus({preventScroll:!0});}toggle(){this.show=!this.show;}propagateChange=t=>{};writeValue(t){this.value=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",C({type:e,selectors:[["my-input-text"]],viewQuery:function(i,n){if(i&1&&G(pe,5),i&2){let p;B(p=L())&&(n.inputElement=p.first);}},inputs:{inputId:"inputId",value:"value",autocomplete:"autocomplete",placeholder:"placeholder",tabindex:"tabindex",withToggle:"withToggle",withCopy:"withCopy",readonly:"readonly",show:"show",formError:"formError",autofocus:"autofocus",ariaLabel:"ariaLabel"},features:[v([{provide:Z,useExisting:S(()=>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 p=x();m(0,"div",2)(1,"input",3,0),X("ngModelChange",function(_){return u(p),U(n.value,_)||(n.value=_),d(_);}),g("ngModelChange",function(){return u(p),d(n.update());})("click",function(){u(p);let _=E(2);return d(_.select());})("input",function(){return u(p),d(n.update());})("change",function(){return u(p),d(n.update());}),s(),b(3,ue,3,3,"button",4)(4,de,2,2,"my-copy-button",5),s(),b(5,me,2,1,"div",6);}i&2&&(c(),a("id",n.inputId)("name",n.inputId)("autocomplete",n.autocomplete)("value",n.value)("placeholder",n.placeholder)("tabindex",n.tabindex),$("ngModel",n.value),a("readonly",n.readonly)("type",n.inputType)("ngClass",z(14,le,n.formError)),R("aria-label",n.ariaLabel),c(2),a("ngIf",n.withToggle),c(),a("ngIf",n.withCopy),c(),a("ngIf",n.formError));},dependencies:[ee,J,K,q,T,W,w,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;padding-inline-start:.9375rem!important;padding-inline-end:.9375rem!important}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%]{opacity:.4}@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-6JBF5OIV.css.map */`]}));let o=e;return o;})();export{oe as a,ze as b};/**i18n:68865f44f2a527c44cf5136a17c76a0ff8308c2bae5c7c8d50070a5fb9847c44*///# sourceMappingURL=chunk-UVCMNOGP.js.map