import{b as fe}from"./chunk-IZ7NRZYH.js";import{$ as w,F as le,La as _e,P as V,Q as g,R as se,Y as ce,Z as re,_ as B,ea as pe,s as y,wa as me}from"./chunk-PXYMNTRT.js";import{$b as Y,Ab as k,Bb as I,Db as D,Eb as s,Ec as te,Fb as W,Gb as G,Gc as ie,Ia as H,Ib as _,Ic as ne,Kb as f,Lb as u,M as Q,Mc as oe,N as F,Na as p,Oa as O,S as P,Uc as ae,Vc as L,Xb as U,Xc as S,Za as Z,Zb as X,Zc as A,_a as z,_c as M,aa as x,ad as R,ba as v,bb as N,db as J,ea as $,eb as l,ka as j,kc as T,la as q,mb as c,oc as m,pb as K,pc as ee,qb as E,rb as d,vb as b,wb as h,xb as C}from"./chunk-F6M2T5MC.js";var ge=["header"],be=["footer"],he=["rejecticon"],Ce=["accepticon"],Te=["message"],ye=["icon"],xe=["headless"],ve=[[["p-footer"]]],je=["p-footer"],Ee=(t,n,e)=>({$implicit:t,onAccept:n,onReject:e}),ke=t=>({$implicit:t});function Ie(t,n){t&1&&k(0)}function De(t,n){if(t&1&&l(0,Ie,1,0,"ng-container",6),t&2){let e=s(2);c("ngTemplateOutlet",e.headlessTemplate||e._headlessTemplate)("ngTemplateOutletContext",Y(2,Ee,e.confirmation,e.onAccept.bind(e),e.onReject.bind(e)))}}function Se(t,n){t&1&&l(0,De,1,6,"ng-template",null,2,T)}function Be(t,n){t&1&&k(0)}function Oe(t,n){if(t&1&&(b(0,"div",7),l(1,Be,1,0,"ng-container",8),h()),t&2){let e=s(3);c("ngClass",e.cx("header")),p(),c("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)}}function Le(t,n){t&1&&l(0,Oe,2,2,"ng-template",null,4,T)}function Ae(t,n){}function Me(t,n){t&1&&l(0,Ae,0,0,"ng-template")}function Re(t,n){if(t&1&&l(0,Me,1,0,null,8),t&2){let e=s(3);c("ngTemplateOutlet",e.iconTemplate||e._iconTemplate)}}function Ve(t,n){if(t&1&&C(0,"i",7),t&2){let e=s(4);E(e.option("icon")),c("ngClass",e.cx("icon"))}}function we(t,n){if(t&1&&l(0,Ve,1,3,"i",11),t&2){let e=s(3);c("ngIf",e.option("icon"))}}function Qe(t,n){}function Fe(t,n){t&1&&l(0,Qe,0,0,"ng-template")}function Pe(t,n){if(t&1&&l(0,Fe,1,0,null,6),t&2){let e=s(3);c("ngTemplateOutlet",e.messageTemplate||e._messageTemplate)("ngTemplateOutletContext",X(2,ke,e.confirmation))}}function $e(t,n){if(t&1&&C(0,"span",10),t&2){let e=s(3);c("ngClass",e.cx("message"))("innerHTML",e.option("message"),H)}}function qe(t,n){if(t&1&&l(0,Re,1,1)(1,we,1,1,"i",9)(2,Pe,1,4)(3,$e,1,2,"span",10),t&2){let e=s(2);d(e.iconTemplate||e._iconTemplate?0:!e.iconTemplate&&!e._iconTemplate&&!e._messageTemplate&&!e.messageTemplate?1:-1),p(2),d(e.messageTemplate||e._messageTemplate?2:3)}}function He(t,n){if(t&1&&l(0,Le,2,0)(1,qe,4,2,"ng-template",null,3,T),t&2){let e=s();d(e.headerTemplate||e._headerTemplate?0:-1)}}function Ze(t,n){t&1&&k(0)}function ze(t,n){if(t&1&&(G(0),l(1,Ze,1,0,"ng-container",8)),t&2){let e=s(2);p(),c("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function Ne(t,n){if(t&1&&C(0,"i"),t&2){let e=s(5);E(e.option("rejectIcon"))}}function Je(t,n){if(t&1&&l(0,Ne,1,2,"i",15),t&2){let e=s(4);c("ngIf",e.option("rejectIcon"))}}function Ke(t,n){}function We(t,n){t&1&&l(0,Ke,0,0,"ng-template")}function Ge(t,n){if(t&1){let e=I();b(0,"p-button",13),D("onClick",function(){x(e);let i=s(3);return v(i.onReject())}),l(1,Je,1,1,"i",14)(2,We,1,0,null,8),h()}if(t&2){let e=s(3);c("label",e.rejectButtonLabel)("styleClass",e.getButtonStyleClass("pcRejectButton","rejectButtonStyleClass"))("ariaLabel",e.option("rejectButtonProps","ariaLabel"))("buttonProps",e.getRejectButtonProps()),p(),d(e.rejectIcon&&!e.rejectIconTemplate&&!e._rejectIconTemplate?1:-1),p(),c("ngTemplateOutlet",e.rejectIconTemplate||e._rejectIconTemplate)}}function Ue(t,n){if(t&1&&C(0,"i"),t&2){let e=s(5);E(e.option("acceptIcon"))}}function Xe(t,n){if(t&1&&l(0,Ue,1,2,"i",15),t&2){let e=s(4);c("ngIf",e.option("acceptIcon"))}}function Ye(t,n){}function et(t,n){t&1&&l(0,Ye,0,0,"ng-template")}function tt(t,n){if(t&1){let e=I();b(0,"p-button",13),D("onClick",function(){x(e);let i=s(3);return v(i.onAccept())}),l(1,Xe,1,1,"i",14)(2,et,1,0,null,8),h()}if(t&2){let e=s(3);c("label",e.acceptButtonLabel)("styleClass",e.getButtonStyleClass("pcAcceptButton","acceptButtonStyleClass"))("ariaLabel",e.option("acceptButtonProps","ariaLabel"))("buttonProps",e.getAcceptButtonProps()),p(),d(e.acceptIcon&&!e._acceptIconTemplate&&!e.acceptIconTemplate?1:-1),p(),c("ngTemplateOutlet",e.acceptIconTemplate||e._acceptIconTemplate)}}function it(t,n){if(t&1&&l(0,Ge,3,6,"p-button",12)(1,tt,3,6,"p-button",12),t&2){let e=s(2);c("ngIf",e.option("rejectVisible")),p(),c("ngIf",e.option("acceptVisible"))}}function nt(t,n){if(t&1&&l(0,ze,2,1)(1,it,2,2),t&2){let e=s();d(e.footerTemplate||e._footerTemplate?0:-1),p(),d(!e.footerTemplate&&!e._footerTemplate?1:-1)}}var ot=({dt:t})=>`
.p-confirmdialog .p-dialog-content {
    display: flex;
    align-items: center;
    gap:  ${t("confirmdialog.content.gap")};
}

.p-confirmdialog .p-confirmdialog-icon {
    color: ${t("confirmdialog.icon.color")};
    font-size: ${t("confirmdialog.icon.size")};
    width: ${t("confirmdialog.icon.size")};
    height: ${t("confirmdialog.icon.size")};
}
`,at={root:"p-confirmdialog",icon:"p-confirmdialog-icon",message:"p-confirmdialog-message",pcRejectButton:"p-confirmdialog-reject-button",pcAcceptButton:"p-confirmdialog-accept-button"},ue=(()=>{class t extends pe{name="confirmdialog";theme=ot;classes=at;static \u0275fac=(()=>{let e;return function(i){return(e||(e=$(t)))(i||t)}})();static \u0275prov=Q({token:t,factory:t.\u0275fac})}return t})();var lt=M([S({transform:"{{transform}}",opacity:0}),L("{{transition}}",S({transform:"none",opacity:1}))]),st=M([L("{{transition}}",S({transform:"{{transform}}",opacity:0}))]),ct=(()=>{class t extends me{confirmationService;zone;header;icon;message;get style(){return this._style}set style(e){this._style=e,this.cd.markForCheck()}styleClass;maskStyleClass;acceptIcon;acceptLabel;closeAriaLabel;acceptAriaLabel;acceptVisible=!0;rejectIcon;rejectLabel;rejectAriaLabel;rejectVisible=!0;acceptButtonStyleClass;rejectButtonStyleClass;closeOnEscape=!0;dismissableMask;blockScroll=!0;rtl=!1;closable=!0;appendTo="body";key;autoZIndex=!0;baseZIndex=0;transitionOptions="150ms cubic-bezier(0, 0, 0.2, 1)";focusTrap=!0;defaultFocus="accept";breakpoints;get visible(){return this._visible}set visible(e){this._visible=e,this._visible&&!this.maskVisible&&(this.maskVisible=!0),this.cd.markForCheck()}get position(){return this._position}set position(e){switch(this._position=e,e){case"topleft":case"bottomleft":case"left":this.transformOptions="translate3d(-100%, 0px, 0px)";break;case"topright":case"bottomright":case"right":this.transformOptions="translate3d(100%, 0px, 0px)";break;case"bottom":this.transformOptions="translate3d(0px, 100%, 0px)";break;case"top":this.transformOptions="translate3d(0px, -100%, 0px)";break;default:this.transformOptions="scale(0.7)";break}}draggable=!0;onHide=new j;footer;_componentStyle=P(ue);headerTemplate;footerTemplate;rejectIconTemplate;acceptIconTemplate;messageTemplate;iconTemplate;headlessTemplate;templates;_headerTemplate;_footerTemplate;_rejectIconTemplate;_acceptIconTemplate;_messageTemplate;_iconTemplate;_headlessTemplate;confirmation;_visible;_style;maskVisible;dialog;wrapper;contentContainer;subscription;preWidth;_position="center";transformOptions="scale(0.7)";styleElement;id=V("pn_id_");ariaLabelledBy=this.getAriaLabelledBy();translationSubscription;get containerClass(){return this.cx("root")+" "+this.styleClass||" "}constructor(e,o){super(),this.confirmationService=e,this.zone=o,this.subscription=this.confirmationService.requireConfirmation$.subscribe(i=>{if(!i){this.hide();return}i.key===this.key&&(this.confirmation=i,Object.keys(i).forEach(a=>{this[a]=i[a]}),this.confirmation.accept&&(this.confirmation.acceptEvent=new j,this.confirmation.acceptEvent.subscribe(this.confirmation.accept)),this.confirmation.reject&&(this.confirmation.rejectEvent=new j,this.confirmation.rejectEvent.subscribe(this.confirmation.reject)),this.visible=!0)})}ngOnInit(){super.ngOnInit(),this.breakpoints&&this.createStyle(),this.translationSubscription=this.config.translationObserver.subscribe(()=>{this.visible&&this.cd.markForCheck()})}ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"header":this._headerTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;case"message":this._messageTemplate=e.template;break;case"icon":this._iconTemplate=e.template;break;case"rejecticon":this._rejectIconTemplate=e.template;break;case"accepticon":this._acceptIconTemplate=e.template;break;case"headless":this._headlessTemplate=e.template;break}})}getAriaLabelledBy(){return this.header!==null?V("pn_id_")+"_header":null}option(e,o){let i=this;if(i.hasOwnProperty(e))return o?i[o]:i[e]}getButtonStyleClass(e,o){let i=this.cx(e),r=this.option(o);return[i,r].filter(Boolean).join(" ")}getElementToFocus(){switch(this.option("defaultFocus")){case"accept":return y(this.dialog.el.nativeElement,".p-confirm-dialog-accept");case"reject":return y(this.dialog.el.nativeElement,".p-confirm-dialog-reject");case"close":return y(this.dialog.el.nativeElement,".p-dialog-header-close");case"none":return null;default:return y(this.dialog.el.nativeElement,".p-confirm-dialog-accept")}}createStyle(){if(!this.styleElement){this.styleElement=this.document.createElement("style"),this.styleElement.type="text/css",this.document.head.appendChild(this.styleElement);let e="";for(let o in this.breakpoints)e+=`
                    @media screen and (max-width: ${o}) {
                        .p-dialog[${this.id}] {
                            width: ${this.breakpoints[o]} !important;
                        }
                    }
                `;this.styleElement.innerHTML=e,le(this.styleElement,"nonce",this.config?.csp()?.nonce)}}close(){this.confirmation?.rejectEvent&&this.confirmation.rejectEvent.emit(g.CANCEL),this.hide(g.CANCEL)}hide(e){this.onHide.emit(e),this.visible=!1,this.unsubscribeConfirmationEvents(),this.confirmation=null}destroyStyle(){this.styleElement&&(this.document.head.removeChild(this.styleElement),this.styleElement=null)}ngOnDestroy(){this.subscription.unsubscribe(),this.unsubscribeConfirmationEvents(),this.translationSubscription&&this.translationSubscription.unsubscribe(),this.destroyStyle(),super.ngOnDestroy()}onVisibleChange(e){e?this.visible=e:this.close()}onAccept(){this.confirmation&&this.confirmation.acceptEvent&&this.confirmation.acceptEvent.emit(),this.hide(g.ACCEPT)}onReject(){this.confirmation&&this.confirmation.rejectEvent&&this.confirmation.rejectEvent.emit(g.REJECT),this.hide(g.REJECT)}unsubscribeConfirmationEvents(){this.confirmation&&(this.confirmation.acceptEvent?.unsubscribe(),this.confirmation.rejectEvent?.unsubscribe())}get acceptButtonLabel(){return this.option("acceptLabel")||this.config.getTranslation(w.ACCEPT)}get rejectButtonLabel(){return this.option("rejectLabel")||this.config.getTranslation(w.REJECT)}getAcceptButtonProps(){return this.option("acceptButtonProps")}getRejectButtonProps(){return this.option("rejectButtonProps")}static \u0275fac=function(o){return new(o||t)(O(se),O(q))};static \u0275cmp=Z({type:t,selectors:[["p-confirmDialog"],["p-confirmdialog"],["p-confirm-dialog"]],contentQueries:function(o,i,r){if(o&1&&(_(r,ce,5),_(r,ge,4),_(r,be,4),_(r,he,4),_(r,Ce,4),_(r,Te,4),_(r,ye,4),_(r,xe,4),_(r,re,4)),o&2){let a;f(a=u())&&(i.footer=a.first),f(a=u())&&(i.headerTemplate=a.first),f(a=u())&&(i.footerTemplate=a.first),f(a=u())&&(i.rejectIconTemplate=a.first),f(a=u())&&(i.acceptIconTemplate=a.first),f(a=u())&&(i.messageTemplate=a.first),f(a=u())&&(i.iconTemplate=a.first),f(a=u())&&(i.headlessTemplate=a.first),f(a=u())&&(i.templates=a)}},inputs:{header:"header",icon:"icon",message:"message",style:"style",styleClass:"styleClass",maskStyleClass:"maskStyleClass",acceptIcon:"acceptIcon",acceptLabel:"acceptLabel",closeAriaLabel:"closeAriaLabel",acceptAriaLabel:"acceptAriaLabel",acceptVisible:[2,"acceptVisible","acceptVisible",m],rejectIcon:"rejectIcon",rejectLabel:"rejectLabel",rejectAriaLabel:"rejectAriaLabel",rejectVisible:[2,"rejectVisible","rejectVisible",m],acceptButtonStyleClass:"acceptButtonStyleClass",rejectButtonStyleClass:"rejectButtonStyleClass",closeOnEscape:[2,"closeOnEscape","closeOnEscape",m],dismissableMask:[2,"dismissableMask","dismissableMask",m],blockScroll:[2,"blockScroll","blockScroll",m],rtl:[2,"rtl","rtl",m],closable:[2,"closable","closable",m],appendTo:"appendTo",key:"key",autoZIndex:[2,"autoZIndex","autoZIndex",m],baseZIndex:[2,"baseZIndex","baseZIndex",ee],transitionOptions:"transitionOptions",focusTrap:[2,"focusTrap","focusTrap",m],defaultFocus:"defaultFocus",breakpoints:"breakpoints",visible:"visible",position:"position",draggable:[2,"draggable","draggable",m]},outputs:{onHide:"onHide"},features:[U([ue]),J,N],ngContentSelectors:je,decls:6,vars:14,consts:[["dialog",""],["footer",""],["headless",""],["content",""],["header",""],["role","alertdialog",3,"visibleChange","visible","closable","styleClass","modal","header","closeOnEscape","blockScroll","appendTo","position","dismissableMask","draggable"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngClass"],[4,"ngTemplateOutlet"],[3,"ngClass","class"],[3,"ngClass","innerHTML"],[3,"ngClass","class",4,"ngIf"],[3,"label","styleClass","ariaLabel","buttonProps","onClick",4,"ngIf"],[3,"onClick","label","styleClass","ariaLabel","buttonProps"],[3,"class"],[3,"class",4,"ngIf"]],template:function(o,i){if(o&1){let r=I();W(ve),b(0,"p-dialog",5,0),D("visibleChange",function(de){return x(r),v(i.onVisibleChange(de))}),l(2,Se,2,0)(3,He,3,1)(4,nt,2,2,"ng-template",null,1,T),h()}o&2&&(K(i.style),c("visible",i.visible)("closable",i.option("closable"))("styleClass",i.containerClass)("modal",!0)("header",i.option("header"))("closeOnEscape",i.option("closeOnEscape"))("blockScroll",i.option("blockScroll"))("appendTo",i.option("appendTo"))("position",i.position)("dismissableMask",i.dismissableMask)("draggable",i.draggable),p(2),d(i.headlessTemplate||i._headlessTemplate?2:3))},dependencies:[oe,te,ie,ne,_e,fe,B],encapsulation:2,data:{animation:[ae("animation",[A("void => visible",[R(lt)]),A("visible => void",[R(st)])])]},changeDetection:0})}return t})(),Bt=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=z({type:t});static \u0275inj=F({imports:[ct,B,B]})}return t})();export{ct as a,Bt as b};
