import{o as N,c as O,e as P,a as Q,p as n,s as c,t as f,j as R,n as U,b as h,d as W,f as _,h as i,l as X,m as r,k as j,u as Y,r as s}from"../../custom-element.js";import{i as F}from"../../if.js";import{s as $}from"../../slot.js";import{a as ee}from"../../attributes.js";import{c as te}from"../../input.js";import{b as ne}from"../../this.js";import{c as re}from"../../custom-element-forward-events.js";import"../../branches.js";var oe=_('<span class="mc-text-input__addon svelte-5c9enb"> </span>'),le=_('<span class="mc-text-input__addon svelte-5c9enb"> </span>'),ie=_('<div class="mc-controls-options svelte-5c9enb"><button type="button" class="mc-controls-options__button svelte-5c9enb"><svg class="mc-controls-options__icon svelte-5c9enb" aria-hidden="true"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" class="svelte-5c9enb"></path></svg> <span class="mc-controls-options__label svelte-5c9enb"> </span></button></div>'),se=_('<div><span class="mc-text-input__icon svelte-5c9enb"><!></span> <!> <input/> <!> <!></div>');const ae={hash:"svelte-5c9enb",code:`/**
 * Do not edit directly, this file was auto-generated.
 */.mc-controls-options.svelte-5c9enb {align-items:center;display:inline-flex;justify-content:center;gap:0.5rem;}.mc-controls-options__button.svelte-5c9enb {background-color:transparent;border-width:0;color:initial;font-family:inherit;outline:none;appearance:none;cursor:pointer;padding:0;border-radius:var(--border-radius-full, 100%);}.mc-controls-options__button.svelte-5c9enb:hover .mc-controls-options__icon:where(.svelte-5c9enb) {fill:var(--forms-color-icon-clear-hover, #4d4d4d);}.mc-controls-options__button.svelte-5c9enb:focus-visible {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-controls-options__icon.svelte-5c9enb {fill:var(--forms-color-icon-clear, #666666);color:var(--forms-color-icon-clear, #666666);}.mc-controls-options__button.svelte-5c9enb, .mc-controls-options__icon.svelte-5c9enb {height:1.5rem;width:1.5rem;}.mc-controls-options__label.svelte-5c9enb {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}.mc-controls-options__unit.svelte-5c9enb {font-size:var(--font-size-150, 1rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-semi-bold, 600);color:var(--forms-color-text-default, #000000);}

/* stylelint-disable string-no-newline */.mc-text-input.svelte-5c9enb {transition:box-shadow 200ms ease;background-color:var(--forms-color-background-default, #ffffff);border:var(--border-width-s, 0.0625rem) solid var(--forms-color-border-default, #666666);border-radius:var(--forms-border-radius, 0.25rem);transition:all ease 200ms;color:var(--forms-color-text-default, #000000);display:block;width:100%;height:3rem;display:flex;align-items:center;gap:0.5rem;box-sizing:border-box;}.mc-text-input__control.svelte-5c9enb {background-color:transparent;border-width:0;font-family:inherit;outline:none;}.mc-text-input__control[type=number].svelte-5c9enb::-webkit-inner-spin-button, .mc-text-input__control[type=number].svelte-5c9enb::-webkit-outer-spin-button {appearance:none;margin:0;}.mc-text-input__control[type=number].svelte-5c9enb {
  /* For Gecko rendering engine */appearance:textfield;}.mc-text-input__control[type=search].svelte-5c9enb::-webkit-search-decoration, .mc-text-input__control[type=search].svelte-5c9enb::-webkit-search-cancel-button {appearance:none;}.mc-text-input__control.svelte-5c9enb {padding:0.75rem 0.6875rem;font-size:var(--font-size-150, 1rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-regular, 400);color:var(--forms-color-text-default, #000000);flex-grow:1;}.mc-text-input__control.svelte-5c9enb::placeholder {color:var(--forms-color-placeholder, #666666);}.mc-text-input__addon.svelte-5c9enb {font-size:var(--font-size-150, 1rem);font-weight:var(--font-weight-semi-bold, 600);color:var(--forms-color-text-default, #000000);}.mc-text-input__icon.svelte-5c9enb {fill:var(--forms-color-icon-default, #666666);height:1.5rem;width:1.5rem;flex-shrink:0;}.mc-text-input.svelte-5c9enb:focus-within {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-text-input.svelte-5c9enb:hover:not(:focus-within) {border-color:var(--forms-color-border-hover, #4d4d4d);box-shadow:0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-hover, #4d4d4d);}.mc-text-input.svelte-5c9enb:has(input:where(.svelte-5c9enb):disabled) {background-color:var(--forms-color-background-disabled, #d9d9d9);cursor:not-allowed;border-color:transparent;box-shadow:none;color:var(--forms-color-text-disabled, #737373);pointer-events:none;}.mc-text-input.svelte-5c9enb:has(input[readonly]:where(.svelte-5c9enb)) {border-color:var(--forms-color-border-read-only, #cccccc);pointer-events:none;}.mc-text-input.svelte-5c9enb:has(.mc-text-input__icon:where(.svelte-5c9enb)), .mc-text-input.svelte-5c9enb:has(.mc-text-input__addon:where(.svelte-5c9enb)) {padding-inline-start:0.6875rem;}.mc-text-input.svelte-5c9enb:has(.mc-text-input__icon:where(.svelte-5c9enb)) .mc-text-input__control:where(.svelte-5c9enb), .mc-text-input.svelte-5c9enb:has(.mc-text-input__addon:where(.svelte-5c9enb)) .mc-text-input__control:where(.svelte-5c9enb) {padding-inline-start:0;}.mc-text-input.svelte-5c9enb:has(.mc-controls-options:where(.svelte-5c9enb)), .mc-text-input.svelte-5c9enb:has(.mc-text-input__addon:where(.svelte-5c9enb)) {padding-inline-end:0.6875rem;}.mc-text-input.svelte-5c9enb:has(.mc-controls-options:where(.svelte-5c9enb)) .mc-text-input__control:where(.svelte-5c9enb), .mc-text-input.svelte-5c9enb:has(.mc-text-input__addon:where(.svelte-5c9enb)) .mc-text-input__control:where(.svelte-5c9enb) {padding-inline-end:0;}.mc-text-input--s.svelte-5c9enb {height:2rem;}.mc-text-input--s.svelte-5c9enb .mc-text-input__control:where(.svelte-5c9enb) {padding:0.375rem 0.6875rem;font-size:var(--font-size-100, 0.875rem);line-height:var(--line-height-s, 1.3);}.mc-text-input--s.svelte-5c9enb:has(.mc-text-input__icon:where(.svelte-5c9enb)) {padding-inline-start:0.4375rem;}.mc-text-input--s.svelte-5c9enb:has(.mc-controls-options:where(.svelte-5c9enb)) {padding-inline-end:0.4375rem;}.mc-text-input.is-invalid.svelte-5c9enb {border-color:var(--forms-color-border-invalid, #ea302d);box-shadow:0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid, #ea302d);}.mc-text-input.is-invalid.svelte-5c9enb:hover:not(:focus-within) {border-color:var(--forms-color-border-invalid-hover, #c61112);box-shadow:0 0 0 var(--border-width-s, 0.0625rem) var(--forms-color-border-invalid-hover, #c61112);}.mc-text-input.svelte-5c9enb :where(.svelte-5c9enb) {box-sizing:border-box;}

/* stylelint-enable string-no-newline */.mc-text-input__icon.svelte-5c9enb:empty {display:none;}`};function ce(M,t){P(t,!0),Q(M,ae);let x=n(t,"id",7),g=n(t,"name",7),a=n(t,"value",15),w=n(t,"placeholder",7),y=n(t,"inputtype",7,"text"),d=n(t,"isinvalid",7),k=n(t,"disabled",7),z=n(t,"readonly",7),B=n(t,"size",7,"m"),L=n(t,"clearlabel",7,"Clear content"),C=n(t,"isclearable",7),v=n(t,"prefix",7),u=n(t,"suffix",7),m=n(t,"element",15),D=X(t,["$$slots","$$events","$$legacy","$$host","id","name","value","placeholder","inputtype","isinvalid","disabled","readonly","size","clearlabel","isclearable","prefix","suffix","element"]);const G=()=>a("");var V={get id(){return x()},set id(e){x(e),r()},get name(){return g()},set name(e){g(e),r()},get value(){return a()},set value(e){a(e),r()},get placeholder(){return w()},set placeholder(e){w(e),r()},get inputtype(){return y()},set inputtype(e="text"){y(e),r()},get isinvalid(){return d()},set isinvalid(e){d(e),r()},get disabled(){return k()},set disabled(e){k(e),r()},get readonly(){return z()},set readonly(e){z(e),r()},get size(){return B()},set size(e="m"){B(e),r()},get clearlabel(){return L()},set clearlabel(e="Clear content"){L(e),r()},get isclearable(){return C()},set isclearable(e){C(e),r()},get prefix(){return v()},set prefix(e){v(e),r()},get suffix(){return u()},set suffix(e){u(e),r()},get element(){return m()},set element(e){m(e),r()}},b=se(),E=i(b),q=i(E);$(q,t,"icon",{},null),s(E);var S=c(E,2);{var A=e=>{var o=oe(),l=i(o,!0);s(o),f(()=>j(l,v())),h(e,o)};F(S,e=>{v()&&e(A)})}var p=c(S,2);ee(p,()=>({class:"mc-text-input__control","aria-invalid":d(),name:g(),id:x(),type:y(),placeholder:w(),disabled:k(),readonly:z(),...D}),void 0,void 0,void 0,"svelte-5c9enb",!0),ne(p,e=>m(e),()=>m());var T=c(p,2);{var H=e=>{var o=le(),l=i(o,!0);s(o),f(()=>j(l,u())),h(e,o)};F(T,e=>{u()&&e(H)})}var I=c(T,2);{var J=e=>{var o=ie(),l=i(o),Z=c(i(l),2),K=i(Z,!0);s(Z),s(l),s(o),f(()=>j(K,L())),Y("click",l,G),h(e,o)};F(I,e=>{C()&&a()&&e(J)})}return s(b),f(()=>R(b,1,U(["mc-text-input",`mc-text-input--${B()}`,d()&&"is-invalid"]),"svelte-5c9enb")),te(p,a),h(M,b),W(V)}N(["click"]);customElements.define("m-textinput",O(ce,{isinvalid:{attribute:"isinvalid",reflect:!0,type:"Boolean"},disabled:{attribute:"disabled",reflect:!0,type:"Boolean"},readonly:{attribute:"readonly",reflect:!0,type:"Boolean"},isclearable:{attribute:"isclearable",reflect:!0,type:"Boolean"},id:{},name:{},value:{},placeholder:{},inputtype:{},size:{},clearlabel:{},prefix:{},suffix:{},element:{}},["icon"],[],{mode:"open"},re));export{ce as T};
//# sourceMappingURL=Textinput.js.map
