import{C as e,D as t,I as n,J as r,M as i,P as a,S as o,V as s,W as c,Y as l,_ as u,b as d,dt as f,ft as p,it as m,j as h,n as g,nt as _,ot as v,q as y,st as b,t as x,v as S,w as C}from"../../client.js";import{C as w,V as T,b as E,u as D}from"../../components.js";import O from"../button/Button.js";import k from"../divider/Divider.js";var A=a(`<span class="mc-file-uploader-item__details svelte-1sb9cm3"><!></span>`),j=a(`<!> <div class="mc-file-uploader-item__actions-container svelte-1sb9cm3"><!></div>`,1),M=a(`<div class="mc-file-uploader-item__delete-button-container svelte-1sb9cm3"><!></div>`),N=a(`<span class="mc-file-uploader-item__error-message svelte-1sb9cm3"><!></span>`),ee=a(`<div><div><div><span class="mc-file-uploader-item__status-icon svelte-1sb9cm3"><!></span> <div class="mc-file-uploader-item__info-content svelte-1sb9cm3"><span class="mc-file-uploader-item__label svelte-1sb9cm3"><!></span> <!></div></div> <!></div> <!></div>`),P={hash:`svelte-1sb9cm3`,code:`/**
 * Do not edit directly, this file was auto-generated.
 */.mc-file-uploader.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:1rem;box-sizing:border-box;}.mc-file-uploader__files-list.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:1rem;}.mc-file-uploader__hidden-input.svelte-1sb9cm3 {clip-path:inset(100%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}.mc-file-uploader__input.svelte-1sb9cm3 {display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-semi-bold, 600);border-radius:var(--border-radius-m, 0.5rem);color:var(--file-uploader-color-drag-and-drop-text-default, #242938);}.mc-file-uploader__input.svelte-1sb9cm3 .mc-file-uploader__button:where(.svelte-1sb9cm3) {width:100%;}.mc-file-uploader__input--disabled.svelte-1sb9cm3 .mc-file-uploader__button.mc-button.mc-button--outlined:where(.svelte-1sb9cm3) {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-file-uploader__input-title.svelte-1sb9cm3 {height:1.125rem;font-size:var(--font-size-150, 1rem);}.mc-file-uploader__input-subtitle.svelte-1sb9cm3 {height:1.125rem;font-size:var(--font-size-100, 0.875rem);}.mc-file-uploader--draggable.svelte-1sb9cm3 .mc-file-uploader__input:where(.svelte-1sb9cm3) {padding:2rem;outline:0.125rem dashed var(--file-uploader-color-drag-and-drop-border-default, #464e63);display:flex;}.mc-file-uploader--draggable.svelte-1sb9cm3 .mc-file-uploader__input--disabled:where(.svelte-1sb9cm3) {outline-color:var(--file-uploader-color-drag-and-drop-border-disabled, #b3b3b3);color:var(--file-uploader-color-drag-and-drop-text-disabled, #b3b3b3);cursor:not-allowed;}.mc-file-uploader--draggable.svelte-1sb9cm3 .mc-file-uploader__input--dragged:where(.svelte-1sb9cm3) {outline-width:0.25rem;}.mc-file-uploader-item.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:0.25rem;}.mc-file-uploader-item__container.svelte-1sb9cm3 {border:1px solid var(--file-uploader-color-file-item-border-default, #cccccc);border-radius:var(--border-radius-m, 0.5rem);padding:0.75rem;}.mc-file-uploader-item__meta-row.svelte-1sb9cm3 {display:flex;align-items:center;flex-grow:1;}.mc-file-uploader-item__meta-row--with-info.svelte-1sb9cm3 {align-items:start;}.mc-file-uploader-item__status-icon.svelte-1sb9cm3 {fill:var(--file-uploader-color-file-item-icon-valid, #3f9e10);}.mc-file-uploader-item__info-content.svelte-1sb9cm3 {display:flex;flex-direction:column;flex-grow:1;padding-left:0.5rem;padding-right:1rem;}.mc-file-uploader-item__label.svelte-1sb9cm3 {color:var(--file-uploader-color-file-item-text-file-name, #000000);font-size:var(--font-size-100, 0.875rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-semi-bold, 600);}.mc-file-uploader-item__details.svelte-1sb9cm3 {color:var(--file-uploader-color-file-item-text-information, #666666);font-size:var(--font-size-50, 0.75rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-regular, 400);}.mc-file-uploader-item__error-message.svelte-1sb9cm3 {color:var(--field-color-validation-invalid, #c61112);font-size:var(--font-size-100, 0.875rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-regular, 400);}.mc-file-uploader-item__container--inline.svelte-1sb9cm3 {display:flex;align-items:center;}.mc-file-uploader-item__container--stacked.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:0.75rem;}.mc-file-uploader-item__delete-button-container.svelte-1sb9cm3 {padding-left:0.25rem;margin-left:0.25rem;border-left:1px solid var(--divider-color-primary, #cccccc);}.mc-file-uploader-item__actions-container.svelte-1sb9cm3 {padding:0 2rem;display:flex;align-items:center;gap:0.25rem;justify-content:center;}.mc-file-uploader-item__action.svelte-1sb9cm3 {padding:0 0.75rem;flex-grow:1;}.mc-file-uploader-item--error.svelte-1sb9cm3 .mc-file-uploader-item__container:where(.svelte-1sb9cm3) {border-width:var(--border-width-m, 0.125rem);border-color:var(--file-uploader-color-file-item-border-invalid, #ea302d);}.mc-file-uploader-item--error.svelte-1sb9cm3 .mc-file-uploader-item__status-icon:where(.svelte-1sb9cm3) {fill:var(--file-uploader-color-file-item-icon-invalid, #ea302d);}.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__container:where(.svelte-1sb9cm3) {gap:1rem;flex-direction:column;align-items:normal;}.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__status-icon:where(.svelte-1sb9cm3) {fill:var(--color-standalone-disabled, #b3b3b3);}.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__label:where(.svelte-1sb9cm3),
.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__details:where(.svelte-1sb9cm3) {color:var(--color-standalone-disabled, #b3b3b3);}`};function F(a,x){let F=e(x);b(x,!0),d(a,P);let I=g(x,`file`,7),L=g(x,`format`,7,`inline`),R=g(x,`valid`,7),z=g(x,`errormessage`,7),B=g(x,`deletebuttonlabel`,7,`Delete`),V=g(x,`information`,7),H=g(x,`ondelete`,7),U=_(()=>L()===`stacked`),W=_(()=>R()?`default`:`error`),G={default:D,error:T},K=_(()=>G[s(W)]);var q={get file(){return I()},set file(e){I(e),m()},get format(){return L()},set format(e=`inline`){L(e),m()},get valid(){return R()},set valid(e){R(e),m()},get errormessage(){return z()},set errormessage(e){z(e),m()},get deletebuttonlabel(){return B()},set deletebuttonlabel(e=`Delete`){B(e),m()},get information(){return V()},set information(e){V(e),m()},get ondelete(){return H()},set ondelete(e){H(e),m()}},J=ee(),Y=y(J),X=y(Y),Z=y(X);o(y(Z),()=>s(K),(e,t)=>{t(e,{})}),p(Z);var Q=l(Z,2),$=y(Q);C(y($),x,`name`,{get file(){return I()}},e=>{var t=n();c(()=>h(t,I().name)),i(e,t)}),p($);var te=l($,2),ne=e=>{var t=A();C(y(t),x,`information`,{get file(){return I()}},e=>{var t=n();c(()=>h(t,V())),i(e,t)}),p(t),i(e,t)};t(te,e=>{(V()||F.information)&&e(ne)}),p(Q),p(X);var re=l(X,2),ie=e=>{var t=j(),a=r(t);k(a,{});var o=l(a,2);O(y(o),{ghost:!0,size:`s`,iconposition:`left`,"aria-label":`Delete file`,get onclick(){return H()},children:(e,t)=>{f();var r=n();c(()=>h(r,B())),i(e,r)},$$slots:{default:!0,icon:(e,t)=>{w(e,{slot:`icon`})}}}),p(o),i(e,t)},ae=e=>{var t=M();O(y(t),{ghost:!0,size:`s`,iconposition:`only`,"aria-label":`Delete file`,get onclick(){return H()},children:(e,t)=>{f();var r=n();c(()=>h(r,B())),i(e,r)},$$slots:{default:!0,icon:(e,t)=>{E(e,{slot:`icon`})}}}),p(t),i(e,t)};t(re,e=>{s(U)?e(ie):e(ae,-1)}),p(Y);var oe=l(Y,2),se=e=>{var t=N();C(y(t),x,`errorMessage`,{},e=>{var t=n();c(()=>h(t,z())),i(e,t)}),p(t),i(e,t)};return t(oe,e=>{!R()&&(z()||F.errorMessage)&&e(se)}),p(J),c(()=>{u(J,1,S({"mc-file-uploader-item":!0,[`mc-file-uploader-item--${s(W)}`]:s(W)!==`default`}),`svelte-1sb9cm3`),u(Y,1,S({"mc-file-uploader-item__container":!0,[`mc-file-uploader-item__container--${L()}`]:!0}),`svelte-1sb9cm3`),u(X,1,S({"mc-file-uploader-item__meta-row":!0,"mc-file-uploader-item__meta-row--with-info":V()}),`svelte-1sb9cm3`)}),i(a,J),v(q)}customElements.define(`m-file-uploader-item`,x(F,{file:{},format:{},valid:{},errormessage:{},deletebuttonlabel:{},information:{},ondelete:{}},[`name`,`information`,`errorMessage`],[],{mode:`open`}));export{F as default};
//# sourceMappingURL=FileUploaderItem.js.map