import{c as R,d as U}from"./chunk-2ZXCNSZZ.js";import{a as $,b as z}from"./chunk-5TTXT2K2.js";import{d as A}from"./chunk-2MELUOYA.js";import{Ea as K}from"./chunk-WOPE6PPO.js";import{a as L}from"./chunk-MDIMQ3H3.js";import{$b as w,Ad as d,Bc as l,Dc as I,Eb as k,Fa as _,Gb as B,Hb as N,Ib as b,Jb as r,Ka as c,Kb as a,Ub as T,Uc as E,Xb as F,Yc as i,Za as u,Zb as g,_b as P,ib as s,jb as S,ma as v,mc as f,na as C,nb as V,nc as G,nd as j,oa as h,oc as O,ra as M,va as x,wa as D}from"./chunk-GJDGQISV.js";var q=`
    .p-buttongroup {
        display: inline-flex;
    }

    .p-buttongroup .p-button {
        margin: 0;
    }

    .p-buttongroup .p-button:not(:last-child),
    .p-buttongroup .p-button:not(:last-child):hover {
        border-inline-end: 0 none;
    }

    .p-buttongroup .p-button:not(:first-of-type):not(:last-of-type) {
        border-radius: 0;
    }

    .p-buttongroup .p-button:first-of-type:not(:only-of-type) {
        border-start-end-radius: 0;
        border-end-end-radius: 0;
    }

    .p-buttongroup .p-button:last-of-type:not(:only-of-type) {
        border-start-start-radius: 0;
        border-end-start-radius: 0;
    }

    .p-buttongroup .p-button:focus {
        position: relative;
        z-index: 1;
    }
`;var X=["*"],Y=`
    ${q}

    /* For PrimeNG */
    .p-buttongroup p-button:focus .p-button {
        position: relative;
        z-index: 1;
    }

    .p-buttongroup p-button:not(:last-child) .p-button,
    .p-buttongroup p-button:not(:last-child) .p-button:hover {
        border-right: 0 none;
    }

    .p-buttongroup p-button:not(:first-of-type):not(:last-of-type) .p-button {
        border-radius: 0;
    }

    .p-buttongroup p-button:first-of-type:not(:only-of-type) .p-button {
        border-start-end-radius: 0;
        border-end-end-radius: 0;
    }

    .p-buttongroup p-button:last-of-type:not(:only-of-type) .p-button {
        border-start-start-radius: 0;
        border-end-start-radius: 0;
    }
`,Z={root:"p-buttongroup p-component"},H=(()=>{class t extends K{name="buttongroup";style=Y;classes=Z;static \u0275fac=(()=>{let e;return function(p){return(e||(e=c(t)))(p||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})();var m=(()=>{class t extends A{componentName="ButtonGroup";_componentStyle=M(H);static \u0275fac=(()=>{let e;return function(p){return(e||(e=c(t)))(p||t)}})();static \u0275cmp=s({type:t,selectors:[["p-buttonGroup"],["p-buttongroup"],["p-button-group"]],features:[l([H]),V],ngContentSelectors:X,decls:2,vars:0,consts:[["role","group",1,"p-buttongroup","p-component"]],template:function(o,p){o&1&&(P(),r(0,"span",0),w(1),a())},dependencies:[d],encapsulation:2,changeDetection:0})}return t})(),J=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=S({type:t});static \u0275inj=h({imports:[m]})}return t})();var et=t=>({warning:t});function ot(t,n){if(t&1){let e=T();r(0,"p-button",5),F("onClick",function(){let p=x(e).$implicit,y=g();return D(y.onSelect(p[y.keyValue()]))}),a()}if(t&2){let e=n.$implicit,o=g();b("label",e[o.keyLabel()])("severity",o.selectedValue()==e[o.keyValue()]?"primary":"secondary")("disabled",o.disabledSignal())("matTooltip",e[o.tooltipKey()])}}var Q=class t{label=i("");options=i([]);keyLabel=i("label");keyValue=i("value");disabled=i(!1);description=i("");defaultConfig=i();tooltipKey=i("");selectedValue=_(null);disabledSignal=E(()=>this.disabled());onChange=()=>{};onTouched=()=>{};writeValue(n){this.selectedValue.set(n)}registerOnChange(n){this.onChange=n}registerOnTouched(n){this.onTouched=n}setDisabledState(n){this.disabledSignal.set(n)}onSelect(n){this.disabledSignal()||(this.selectedValue.set(n),this.onChange(n),this.onTouched())}get isValueMatchDefaultConfig(){return this.defaultConfig()!==void 0&&this.selectedValue()===this.defaultConfig()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=s({type:t,selectors:[["POS-button-group"]],inputs:{label:[1,"label"],options:[1,"options"],keyLabel:[1,"keyLabel"],keyValue:[1,"keyValue"],disabled:[1,"disabled"],description:[1,"description"],defaultConfig:[1,"defaultConfig"],tooltipKey:[1,"tooltipKey"]},features:[l([{provide:L,useExisting:v(()=>t),multi:!0}])],decls:9,vars:5,consts:[[1,"mb-6","d-flex","justify-content-between","wrapper","align-items-center",3,"ngClass"],[1,"d-flex","flex-column"],[1,"mb-2","h5"],[1,"text-sm"],["matTooltipPosition","above",3,"label","severity","disabled","matTooltip"],["matTooltipPosition","above",3,"onClick","label","severity","disabled","matTooltip"]],template:function(e,o){e&1&&(r(0,"div",0)(1,"div",1)(2,"label",2),f(3),a(),r(4,"span",3),f(5),a()(),r(6,"p-buttongroup"),B(7,ot,1,4,"p-button",4,k),a()()),e&2&&(b("ngClass",I(3,et,!o.isValueMatchDefaultConfig)),u(3),G(o.label()),u(2),O("",o.description()," "),u(2),N(o.options()))},dependencies:[J,m,U,R,z,$,d,j],styles:[".wrapper[_ngcontent-%COMP%]{padding:4px;border-radius:8px}.warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}[_nghost-%COMP%]     .p-buttongroup .p-button{border:1px solid #d8d8d8}[_nghost-%COMP%]     .p-buttongroup .p-button+.p-button{margin-left:-1px}[_nghost-%COMP%]     .p-buttongroup .p-button:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}[_nghost-%COMP%]     .p-buttongroup .p-button:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}","label[_ngcontent-%COMP%]{font-weight:600}.form-control[_ngcontent-%COMP%]{padding:12px;border-radius:8px;color:#000}"],changeDetection:0})};export{Q as a};
