import{h}from"./index-38ad4957.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{H as HostBlock}from"./mixins-f750863a.js";var vanillaStyle="\n  :host{\n    display: block;   \n    width: 100%;\n  }\n";var textAlignStyle={right:"\nsl-input::part(input){\n  text-align: right;\n}",center:"  \nsl-input::part(input){\n  text-align: center;\n}",left:""};var disabledStyles="\n  sl-input::part(input){\n    cursor: default;\n  }\n";function CopyTextView(t){var o=t.buttonStyle,r=o===void 0?"icon":o;var e={HostBlock:HostBlock,inputStyle:{"&::part(input)":{textOverflow:"ellipsis",width:"100%",color:t.textColor||"var(--sl-input-color)"},"&::part(base)":{"--sl-input-border-radius":t.borderRadius+"px"||"var(--sqm-border-radius-normal)","--sl-input-border-color":"var(--sqm-border-color)","--sl-input-border-color-hover":"#999999","--sl-input-border-color-focus":"#999999","--sl-input-color-hover":"var(--sqm-input-color-hover)","--sl-input-color-focus":"var(--sqm-input-color-focus)","--sl-input-color-disabled":"var(--sqm-input-disabled-color)","--sl-input-background-color-focus":"var(--sqm-input-background)","--sl-input-background-color-hover":"var(--sqm-input-background)",cursor:"pointer",overflow:"visible",borderRadius:t.borderRadius+"px"||"var(--sqm-border-radius-normal)",background:t.backgroundColor||"var(--sqm-input-background)",border:"var(--sqm-border-thickness) solid "+(t.borderColor||"var(--sqm-input-border-color)")},width:"100%"},icon:{"&::part(base)":{color:t.textColor||"var(--sqm-text)"}},inputErrorStyle:{},ContainerDiv:{display:"flex",alignItems:"flex-start",flexDirection:"column",justifyContent:"center",gap:"var(--sl-spacing-x-small)",width:"100%"},containerStyle:{display:"flex",alignItems:"center",gap:"var(--sl-spacing-x-small)",width:"100%"},errorTextStyle:{margin:"0",color:"var(--sqm-danger-color-text)"},notificationTextStyle:{margin:"0",color:"inherit"}};var l=createStyleSheet(e);var i=l.toString();var n=!t.loading&&t.error;var s=n?t.inputPlaceholderText:t.copyString;var a=n||t.loading||t.disabled;var c=t.buttonStyle==="button-below"?"bottom":t.buttonStyle==="button-outside"?"top":"top-end";var u=h("sl-tooltip",{trigger:"manual",content:t.tooltiptext,placement:c,disabled:t.disabled,open:t.open,skidding:t.buttonStyle==="icon"?-5:0,slot:"suffix"},r==="icon"?h("sl-icon-button",{class:l.classes.icon,exportparts:"base: icon-button-base",onClick:function(){var o;return(o=t.onClick)===null||o===void 0?void 0:o.call(t)},name:"files",disabled:a}):h("sl-button",{exportparts:"base: "+(t.buttonType||"primary")+"button-base",onClick:function(){var o;return(o=t.onClick)===null||o===void 0?void 0:o.call(t)},size:"medium",style:{width:""+(r==="button-below"&&"100%")},disabled:a,type:"primary"},t.copyButtonLabel||"Copy"));return h("div",{class:l.classes.ContainerDiv},h("style",{type:"text/css"},i,vanillaStyle,textAlignStyle[t.textAlign],a&&disabledStyles),h("div",{class:l.classes.containerStyle,style:{flexDirection:""+(r==="button-below"?"column":"row")}},h("sl-input",{class:l.classes.inputStyle+" "+(n?l.classes.inputErrorStyle:""),value:t.loading?"Loading...":s,readonly:true,disabled:a},r==="icon"&&u,n&&h("p",{slot:"help-text",class:l.classes.errorTextStyle},t.errorText)),(r==="button-outside"||r==="button-below")&&u),t.isCopied&&t.showNotificationText&&t.notificationText&&h("p",{part:"sqm-notification-text",class:l.classes.notificationTextStyle},t.notificationText))}export{CopyTextView as C};