import{E as ee,a as W,c as q,g as K,o as J}from"./chunk-OPKDC23H.js";import{a as E}from"./chunk-CR4K7T5L.js";import{Da as p,Db as G,Ec as r,Fc as Z,Hb as s,Jb as h,Jc as I,Kb as L,Lb as B,Mc as P,Na as M,Rb as H,Sb as V,Tb as D,Tg as te,Wc as x,Y as R,Yb as U,Z as k,Zb as $,ba as g,cb as T,cc as j,dc as z,ec as X,ga as b,gb as _,ha as v,hb as f,kc as w,la as F,mb as c,mc as Y,nb as d,nc as Q,ob as u,pb as C,zb as O}from"./chunk-ZSQR4KTU.js";import{i as l}from"./chunk-IQVXR75E.js";var S=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(t){}return a;}destroy(){let e=this._textarea;e&&(e.remove(),this._textarea=void 0);}},A=(()=>{let e=class e{_document=g(F);constructor(){}copy(t){let i=this.beginCopy(t),n=i.copy();return i.destroy(),n;}beginCopy(t){return new S(t,this._document);}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275prov",k({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=g(te);clipboard=g(A);value=r(void 0);elementContent=r(void 0);title=r(void 0);notification=r(void 0);withBorder=r(!1,{transform:P});isInputGroup=r(!1,{transform:P});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",M({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:[w([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&&(L(),d(0,"button",0),s("click",function(){return n.copy();}),C(1,"my-global-icon",1),B(2),u()),i&2&&(c("ngClass",Q(2,re,n.isInputGroup(),n.withBorder())),T("title",n.title()));},dependencies:[x,E],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-FYOMQUHM.css.map */`]}));let o=e;return o;})();var ae=["input"],le=o=>({"input-error":o});function ue(o,e){o&1&&C(0,"my-global-icon",8);}function pe(o,e){o&1&&C(0,"my-global-icon",9);}function ce(o,e){if(o&1){let a=O();d(0,"button",7),s("click",function(){b(a);let i=h();return v(i.toggle());}),_(1,ue,1,0,"my-global-icon",8)(2,pe,1,0,"my-global-icon",9),u();}if(o&2){let a=h();c("title",a.toggleTitle),p(),f(a.show()?1:2);}}function de(o,e){if(o&1&&(d(0,"my-copy-button",5),G(1,1),u()),o&2){h();let a=D(2);c("value",a.value)("isInputGroup",!0);}}function se(o,e){if(o&1&&(d(0,"div",6),U(1),u()),o&2){let a=h();p(),$(a.formError());}}var Ue=(()=>{let e=class e{inputElement=Z("input");inputId=r.required();value=I("");autocomplete=r("off");placeholder=r("");tabindex=r(0);withToggle=r(!0);withCopy=r(!1);readonly=r(!1);show=I(!1);formError=r(void 0);autofocus=r(!1);ariaLabel=r(void 0);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.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",M({type:e,selectors:[["my-input-text"]],viewQuery:function(i,n){i&1&&H(n.inputElement,ae,5),i&2&&V();},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:[w([{provide:W,useExisting:R(()=>e),multi:!0}])],decls:6,vars:16,consts:()=>{let t;t="Copiado";let i;return i="COPY",[["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",1,"btn",3,"title"],["notification",t,3,"value","isInputGroup"],["role","alert",1,"form-error"],["type","button",1,"btn",3,"click","title"],["iconName","eye-open"],["iconName","eye-close"]];},template:function(i,n){if(i&1){let N=O();d(0,"div",2)(1,"input",3,0),X("ngModelChange",function(m){return b(N),z(n.value,m)||(n.value=m),v(m);}),s("ngModelChange",function(){return n.update();})("click",function(){b(N);let m=D(2);return v(m.select());})("input",function(){return n.update();})("change",function(){return n.update();}),u(),_(3,ce,3,2,"button",4),_(4,de,2,2,"my-copy-button",5),u(),_(5,se,2,1,"div",6);}i&2&&(p(),c("id",n.inputId())("name",n.inputId())("autocomplete",n.autocomplete())("value",n.value())("placeholder",n.placeholder())("tabindex",n.tabindex()),j("ngModel",n.value),c("readonly",n.readonly())("type",n.inputType)("ngClass",Y(14,le,n.formError())),T("aria-label",n.ariaLabel()),p(2),f(n.withToggle()?3:-1),p(),f(n.withCopy()?4:-1),p(),f(n.formError()?5:-1));},dependencies:[ee,q,K,J,x,E,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:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}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(--input-bg);border-left:1px solid var(--bg)}.btn[_ngcontent-%COMP%]:hover, my-copy-button[_ngcontent-%COMP%]     .btn:hover{opacity:.8}.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-UD276ZT6.css.map */`]}));let o=e;return o;})();export{oe as a,Ue as b};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-ZTV3BAJC.js.map