import { ChangeDetectionStrategy, Component, inject, Input } from '@angular/core';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import { TooltipDirective } from '@ironsource/fusion-ui/components/tooltip/v4';
import { TooltipPosition } from '@ironsource/fusion-ui/components/tooltip/common/base';
import { CopyToClipboardModule } from '@ironsource/fusion-ui/directives/copy-to-clipboard';
import { SnackbarService } from '@ironsource/fusion-ui/components/snackbar/v4';
import * as i0 from "@angular/core";
import * as i1 from "@ironsource/fusion-ui/components/icon/v1";
import * as i2 from "@ironsource/fusion-ui/directives/copy-to-clipboard";
function InlineCopyComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 0);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.text);
} }
export class InlineCopyComponent {
    constructor() {
        this.text = '';
        this.size = 'small';
        this.tooltipText = 'Copy to clipboard';
        this.tooltipConfiguration = {
            position: TooltipPosition.Bottom,
            suppressPositionArrow: true
        };
        this.iconName = 'ph/copy';
        this.iconPosition = 'right';
        this.testId = '';
        this.valueToCopy = '';
        this.suppressTooltip = false;
        this.suppressSnackbar = false;
        this.copiedSnackbarText = 'Copied successfully';
        this.snackbarService = inject(SnackbarService);
    }
    copyToClipboard() {
        return () => this.valueToCopy || this.text;
    }
    textCopied() {
        if (!this.suppressSnackbar) {
            this.snackbarService.show({
                title: this.copiedSnackbarText,
                type: 'success',
                location: 'top-right',
                duration: 1500
            });
        }
    }
    static { this.ɵfac = function InlineCopyComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InlineCopyComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InlineCopyComponent, selectors: [["fusion-inline-copy"]], hostAttrs: [1, "fusion-v4"], inputs: { text: "text", size: "size", tooltipText: "tooltipText", tooltipConfiguration: "tooltipConfiguration", iconName: "iconName", iconPosition: "iconPosition", testId: "testId", valueToCopy: "valueToCopy", suppressTooltip: "suppressTooltip", suppressSnackbar: "suppressSnackbar", copiedSnackbarText: "copiedSnackbarText" }, standalone: true, features: [i0.ɵɵProvidersFeature([SnackbarService]), i0.ɵɵStandaloneFeature], decls: 3, vars: 10, consts: [[1, "fu-inline-copy-text"], [1, "fu-inline-copy-icon", 3, "copied", "name", "fusionTooltip", "configuration", "fusionCopyToClipboard"]], template: function InlineCopyComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div");
            i0.ɵɵtemplate(1, InlineCopyComponent_Conditional_1_Template, 2, 1, "div", 0);
            i0.ɵɵelementStart(2, "fusion-icon", 1);
            i0.ɵɵlistener("copied", function InlineCopyComponent_Template_fusion_icon_copied_2_listener() { return ctx.textCopied(); });
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵclassMapInterpolate2("fu-inline-copy-wrapper fu-size-", ctx.size, " fu-icon-position-", ctx.iconPosition, "");
            i0.ɵɵattribute("data-testid", ctx.testId);
            i0.ɵɵadvance();
            i0.ɵɵconditional(!!ctx.text ? 1 : -1);
            i0.ɵɵadvance();
            i0.ɵɵproperty("name", ctx.iconName)("fusionTooltip", !ctx.suppressTooltip ? ctx.tooltipText : null)("configuration", !ctx.suppressTooltip ? ctx.tooltipConfiguration : null)("fusionCopyToClipboard", ctx.copyToClipboard());
        } }, dependencies: [IconModule, i1.IconComponent, TooltipDirective, CopyToClipboardModule, i2.CopyToClipboardDirective], styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.font-v4-bold[_ngcontent-%COMP%], .font-v4-tab-label-2[_ngcontent-%COMP%], .font-v4-chart-2[_ngcontent-%COMP%], .font-v4-chart-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:700;-webkit-font-smoothing:antialiased}.font-v4-semibold[_ngcontent-%COMP%], .font-v4-chip-label[_ngcontent-%COMP%], .font-v4-table-label[_ngcontent-%COMP%], .font-v4-button[_ngcontent-%COMP%], .font-v4-heading-6[_ngcontent-%COMP%], .font-v4-heading-5[_ngcontent-%COMP%], .font-v4-heading-4[_ngcontent-%COMP%], .font-v4-heading-3[_ngcontent-%COMP%], .font-v4-heading-2[_ngcontent-%COMP%], .font-v4-heading-1[_ngcontent-%COMP%], .font-v4-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:600;-webkit-font-smoothing:antialiased}.font-v4-medium[_ngcontent-%COMP%], .font-v4-tab-label-1[_ngcontent-%COMP%], .font-v4-input-label[_ngcontent-%COMP%], .font-v4-overline[_ngcontent-%COMP%], .font-v4-subtitle-2[_ngcontent-%COMP%], .font-v4-subtitle-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:500;-webkit-font-smoothing:antialiased}.font-v4-regular[_ngcontent-%COMP%], .font-v4-caption[_ngcontent-%COMP%], .font-v4-body-2[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-inline-copy-wrapper[_ngcontent-%COMP%], .font-v4-body-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased}.font-v4-title[_ngcontent-%COMP%]{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-v4-heading-1[_ngcontent-%COMP%]{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-v4-heading-2[_ngcontent-%COMP%]{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}.font-v4-heading-3[_ngcontent-%COMP%]{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-v4-heading-4[_ngcontent-%COMP%]{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-v4-heading-5[_ngcontent-%COMP%]{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-v4-heading-6[_ngcontent-%COMP%]{font-size:.75rem;line-height:.75rem;letter-spacing:0}[_nghost-%COMP%]   .fu-inline-copy-wrapper[_ngcontent-%COMP%], .font-v4-body-1[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-body-2[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-subtitle-1[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-subtitle-2[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-chart-1[_ngcontent-%COMP%]{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-v4-chart-2[_ngcontent-%COMP%]{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-v4-button[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-v4-overline[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-v4-caption[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem}.font-v4-table-label[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-v4-input-label[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-v4-tab-label-1[_ngcontent-%COMP%], .font-v4-tab-label-2[_ngcontent-%COMP%]{font-size:.875rem;line-height:1rem}.font-v4-chip-label[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem;letter-spacing:normal}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes _ngcontent-%COMP%_shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}[_nghost-%COMP%]{--fu-inline-copy-gap: 8px;--fu-inline-copy-color: var(--text-secondary, hsl(0, 0%, 39.3%));--fu-inline-copy-icon-hover-color: var(--action-primary, hsl(0, 0%, 12.5%));--fu-inline-copy-icon-size: 16px}[_nghost-%COMP%]   .fu-inline-copy-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--fu-inline-copy-gap);color:var(--fu-inline-copy-color)}[_nghost-%COMP%]   .fu-inline-copy-wrapper.fu-size-medium[_ngcontent-%COMP%]{--fu-inline-copy-icon-size: 20px}[_nghost-%COMP%]   .fu-inline-copy-wrapper[_ngcontent-%COMP%]   .fu-inline-copy-icon[_ngcontent-%COMP%]{width:var(--fu-inline-copy-icon-size);height:var(--fu-inline-copy-icon-size)}[_nghost-%COMP%]   .fu-inline-copy-wrapper[_ngcontent-%COMP%]   .fu-inline-copy-icon[_ngcontent-%COMP%]:hover{color:var(--fu-inline-copy-icon-hover-color);cursor:pointer}[_nghost-%COMP%]   .fu-inline-copy-wrapper.fu-icon-position-left[_ngcontent-%COMP%]{justify-content:flex-end;flex-direction:row-reverse}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InlineCopyComponent, [{
        type: Component,
        args: [{ selector: 'fusion-inline-copy', standalone: true, host: { class: 'fusion-v4' }, imports: [IconModule, TooltipDirective, CopyToClipboardModule], providers: [SnackbarService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"fu-inline-copy-wrapper fu-size-{{size}} fu-icon-position-{{iconPosition}}\" [attr.data-testid]=\"testId\">\n    @if(!!text){\n        <div class=\"fu-inline-copy-text\">{{text}}</div>\n    }\n    <fusion-icon class=\"fu-inline-copy-icon\"\n                 [name]=\"iconName\"\n                 [fusionTooltip]=\"!suppressTooltip ? tooltipText : null\"\n                 [configuration]=\"!suppressTooltip ? tooltipConfiguration : null\"\n                 [fusionCopyToClipboard]=\"copyToClipboard()\"\n                 (copied)=\"textCopied()\"\n    />\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.font-v4-bold,.font-v4-tab-label-2,.font-v4-chart-2,.font-v4-chart-1{font-family:Inter,sans-serif;font-weight:700;-webkit-font-smoothing:antialiased}.font-v4-semibold,.font-v4-chip-label,.font-v4-table-label,.font-v4-button,.font-v4-heading-6,.font-v4-heading-5,.font-v4-heading-4,.font-v4-heading-3,.font-v4-heading-2,.font-v4-heading-1,.font-v4-title{font-family:Inter,sans-serif;font-weight:600;-webkit-font-smoothing:antialiased}.font-v4-medium,.font-v4-tab-label-1,.font-v4-input-label,.font-v4-overline,.font-v4-subtitle-2,.font-v4-subtitle-1{font-family:Inter,sans-serif;font-weight:500;-webkit-font-smoothing:antialiased}.font-v4-regular,.font-v4-caption,.font-v4-body-2,:host .fu-inline-copy-wrapper,.font-v4-body-1{font-family:Inter,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased}.font-v4-title{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-v4-heading-1{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-v4-heading-2{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}.font-v4-heading-3{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-v4-heading-4{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-v4-heading-5{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-v4-heading-6{font-size:.75rem;line-height:.75rem;letter-spacing:0}:host .fu-inline-copy-wrapper,.font-v4-body-1{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-body-2{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-subtitle-1{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-subtitle-2{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-chart-1{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-v4-chart-2{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-v4-button{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-v4-overline{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-v4-caption{font-size:.75rem;line-height:1rem}.font-v4-table-label{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-v4-input-label{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-v4-tab-label-1,.font-v4-tab-label-2{font-size:.875rem;line-height:1rem}.font-v4-chip-label{font-size:.75rem;line-height:1rem;letter-spacing:normal}:host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host{--fu-inline-copy-gap: 8px;--fu-inline-copy-color: var(--text-secondary, hsl(0, 0%, 39.3%));--fu-inline-copy-icon-hover-color: var(--action-primary, hsl(0, 0%, 12.5%));--fu-inline-copy-icon-size: 16px}:host .fu-inline-copy-wrapper{display:flex;align-items:center;gap:var(--fu-inline-copy-gap);color:var(--fu-inline-copy-color)}:host .fu-inline-copy-wrapper.fu-size-medium{--fu-inline-copy-icon-size: 20px}:host .fu-inline-copy-wrapper .fu-inline-copy-icon{width:var(--fu-inline-copy-icon-size);height:var(--fu-inline-copy-icon-size)}:host .fu-inline-copy-wrapper .fu-inline-copy-icon:hover{color:var(--fu-inline-copy-icon-hover-color);cursor:pointer}:host .fu-inline-copy-wrapper.fu-icon-position-left{justify-content:flex-end;flex-direction:row-reverse}\n"] }]
    }], null, { text: [{
            type: Input
        }], size: [{
            type: Input
        }], tooltipText: [{
            type: Input
        }], tooltipConfiguration: [{
            type: Input
        }], iconName: [{
            type: Input
        }], iconPosition: [{
            type: Input
        }], testId: [{
            type: Input
        }], valueToCopy: [{
            type: Input
        }], suppressTooltip: [{
            type: Input
        }], suppressSnackbar: [{
            type: Input
        }], copiedSnackbarText: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InlineCopyComponent, { className: "InlineCopyComponent", filePath: "inline-copy.component.ts", lineNumber: 18 }); })();
//# sourceMappingURL=data:application/json;base64, 