import{a as m}from"./chunk-KL7Y3AYY.js";import"./chunk-HSBVAXVK.js";import"./chunk-MJMWESWV.js";import{c as A,d as U}from"./chunk-2HUTMGWF.js";import"./chunk-WKOH7QOZ.js";import"./chunk-UCVOHDQH.js";import{d as H}from"./chunk-DFDVJJF5.js";import"./chunk-3WETVYFL.js";import{e as C}from"./chunk-3K6OG4X3.js";import"./chunk-AQH4B3NW.js";import"./chunk-3LM5OI6G.js";import"./chunk-OGY335Z5.js";import{V as q,g as G,p as V,q as $,z as j}from"./chunk-RAGTUOY6.js";import{h as R,x as k}from"./chunk-FCHM4KKB.js";import"./chunk-QICOL66Z.js";import{g as N}from"./chunk-WEYT6MSP.js";import{c as v}from"./chunk-YCONLW35.js";import"./chunk-DYEAP73Z.js";import"./chunk-W5A7VAW2.js";import"./chunk-UGQL4IPH.js";import"./chunk-4TDNJBFX.js";import"./chunk-LI2NM675.js";import"./chunk-72BQRPR2.js";import"./chunk-RGMIUFM4.js";import"./chunk-I6HXBYFU.js";import{p as E}from"./chunk-AVXTYPYF.js";import"./chunk-HNZDUL32.js";import"./chunk-5EZRMHVZ.js";import{$b as a,Bd as u,Cd as M,Ha as h,Hc as F,Ia as x,Ic as O,Kb as f,Lb as D,Nd as T,Qb as p,Td as S,ad as I,ic as i,jc as r,kc as g,oc as b,od as _,ra as w,rc as y,tc as d,xb as n,yb as s}from"./chunk-HEIW4SFT.js";S();k();_();S();function L(e,l){if(e&1&&(i(0,"div"),g(1,"paw-input-field",5),r()),e&2){let t=l.$implicit,o=d();n(),a("field",t)("model",o.dataModel)("form",o.formGroup)}}function X(e,l){if(e&1&&(i(0,"div",6),g(1,"paw-action",7),r()),e&2){let t=l.$implicit;n(),a("action",t)}}var P=(()=>{class e{constructor(t){this.dialogService=t,this.formGroup=new R([]),this.fields=[{id:"text",label:"Demo",required:!0,component:V},{id:"switch",label:"Demo",component:j},{id:"textarea",label:"Demo",component:$}],this.dataModel={text:m.randomName(),switch:m.randomBoolean(),textarea:m.randomName()+`
`+m.randomFullName()+`
`+m.randomColor()},this.actions=[{id:"submit",label:"Submit",type:"mat-flat-button",formGroup:this.formGroup,onSelected:()=>{this.dialogService.open({text:"Form submitted"}),this.dialogRef.close()}}]}ngOnInit(){}ngOnDestroy(){}static{this.\u0275fac=function(o){return new(o||e)(s(C))}}static{this.\u0275cmp=f({type:e,selectors:[["paw-sb-dialog-content"]],inputs:{dialogRef:"dialogRef"},standalone:!1,decls:6,vars:2,consts:[[4,"ngFor","ngForOf"],[1,"paw-area-h"],[1,"paw-col-d"],[1,"paw-col","paw-area-h"],["class","paw-col",4,"ngFor","ngForOf"],[3,"field","model","form"],[1,"paw-col"],[3,"action"]],template:function(o,c){o&1&&(i(0,"div"),p(1,L,2,3,"div",0),i(2,"div",1),g(3,"div",2),i(4,"div",3),p(5,X,2,1,"div",4),r()()()),o&2&&(n(),a("ngForOf",c.fields),n(4),a("ngForOf",c.actions))},dependencies:[u,G,v],encapsulation:2})}}return e})();_();S();function Y(e,l){if(e&1&&(i(0,"div",7)(1,"span",8),F(2),r()()),e&2){let t=d().$implicit;n(2),O(t.title)}}function Z(e,l){if(e&1){let t=b();i(0,"div",2),p(1,Y,3,1,"div",4),i(2,"div",5)(3,"paw-action",6),y("selected",function(){let c=h(t).$implicit,W=d(2);return x(W.onOpenDialog(c))}),r()()()}if(e&2){let t=l.$implicit,o=d(2);n(),a("ngIf",t.title),n(2),a("id",o.dialogOpenAction.id+"-"+t.id)("action",o.dialogOpenAction)}}function ee(e,l){if(e&1&&(i(0,"div",2),p(1,Z,4,3,"div",3),r()),e&2){let t=d();n(),a("ngForOf",t.dialogCases)}}var Q=(()=>{class e{constructor(t){this.dialogService=t,this.mainHeaderDef={viewSwitch:{viewTitle:"PAW Dialog"}},this.dialogCases=[{id:"text-only",title:"Text only",onShow:()=>{this.dialogService.open({text:m.loremIpsum()})}},{id:"question",title:"Question",onShow:()=>{this.dialogService.openTyped({text:m.loremIpsum(),onConfirm:()=>{}})}},{id:"component",title:"Component",onShow:()=>{this.dialogService.open({component:P})}}],this.dialogOpenAction={id:"open-dialog",type:"mat-flat-button",label:"Open dialog"}}ngOnInit(){}ngOnDestroy(){}onOpenDialog(t){t.onShow()}static{this.\u0275fac=function(o){return new(o||e)(s(C))}}static{this.\u0275cmp=f({type:e,selectors:[["paw-sb-dialog"]],standalone:!1,decls:3,vars:1,consts:[["contentTpl",""],[3,"headerDef"],[1,""],["class","",4,"ngFor","ngForOf"],["class","paw-offset-s",4,"ngIf"],[1,"paw-offset"],[3,"selected","id","action"],[1,"paw-offset-s"],[1,"paw-text-l","paw-noselect"]],template:function(o,c){o&1&&(i(0,"paw-main-view",1),p(1,ee,2,1,"ng-template",null,0,I),r()),o&2&&a("headerDef",c.mainHeaderDef)},dependencies:[u,M,A,v],encapsulation:2})}}return e})();_();var he=(()=>{class e{static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275mod=D({type:e})}static{this.\u0275inj=w({imports:[T,U,q,N,H,E.forChild([{path:"",component:Q}])]})}}return e})();export{he as SbDialogModule};
