1"use strict";(self.webpackChunkcitizen_web=self.webpackChunkcitizen_web||[]).push([[960],{960:(ct,x,e)=>{e.r(x),e.d(x,{CommentAnonymousModule:()=>et});var l=e(8583),r=e(3679),G=e(83),O=e(9631),f=e(1834),t=e(8720),h=e(4762),L=e(9765),A=e(6215),R=e(6782),S=e(8002),b=e(8049),F=e(5978),P=e(7368),U=e(4672),B=e(1186),I=e(6299),J=e(3204),Q=e(6273),T=e(5402),$=e(7219),v=e(9602);let H=(()=>{class n{constructor(o,i,c,a,m,d,y,p,g,u){this.auth=o,this.router=i,this.policyRepo=c,this.zipcodeEntity=a,this.zipcodeRepo=m,this.commentRepository=d,this.firestore=y,this.accountRepository=p,this.preCommentQuery=g,this.preComment=u}execute(o,i,c){var a,m;return(0,h.mG)(this,void 0,void 0,function*(){const d=yield this.auth.user(),y=yield this.policyRepo.getByID$(i).pipe((0,b.P)()).toPromise(),p=yield this.preCommentQuery.getPromise();if(d&&p&&(!d||d.isAnonymous)&&y){const g=(0,B.qs)(this.firestore),u=yield this.accountRepository.myAccount(),z=this.commentRepository.document(c),M={id:z.id,policy_id:i,politician_account_id:y.politician_account_id,citizen_account_id:c,is_email_read:!1,is_author_concerned:!1,body:p.body,created_at:(0,P.G)(),updated_at:(0,P.G)(),is_check_irrelevant:!1,is_check_safe:!1,is_shared:!1,is_suggested:!1,citizen:{name:null!==(a=null==u?void 0:u.name)&&void 0!==a?a:[],image_url:null!==(m=null==u?void 0:u.image_url)&&void 0!==m?m:"",citizen_type:"normal",profile:null},_politician_favorited_count:0,_citizen_favorited_count:0,report:null};p.report&&(M.report=(0,U.Zq)(p.report)),g.set(z,M);const C=this.zipcodeEntity.from(o),it={account_id:c,value:(null==C?void 0:C.value)||null},st=this.zipcodeRepo.document(c);g.set(st,it),yield g.commit(),this.preComment.reset(),this.router.navigate([`/projects/${i}/comments/send`])}else this.router.navigate([`/projects/${i}/comment`])})}}return n.\u0275fac=function(o){return new(o||n)(t.LFG(I.N),t.LFG(f.F0),t.LFG(J.g),t.LFG(Q.Q),t.LFG(T.L),t.LFG($.r),t.LFG(B.gg),t.LFG(F.P),t.LFG(v.Qg),t.LFG(v.og))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var D=e(7605);let Z=(()=>{class n{constructor(o,i,c,a,m){this.accountRepo=o,this.formBuilder=i,this.commentUsecase=c,this.signInAnonymouslyUsecase=a,this.preCommentQuery=m,this.policyID$=new A.X("")}commentBody$(){return this.preCommentQuery.select("body")}buildFormForZipcode(){return this.formBuilder.group({zipcode:[null,r.kI.compose([r.kI.pattern("[0-9]{7}")])]})}signInWithAnonymous(){return(0,h.mG)(this,void 0,void 0,function*(){yield this.signInAnonymouslyUsecase.execute()})}postCommentInAnonymous(o){var i;return(0,h.mG)(this,void 0,void 0,function*(){const c=yield this.accountRepo.myAccount(),a=yield this.policyID$.pipe((0,b.P)()).toPromise();this.commentUsecase.execute(o,a,null!==(i=null==c?void 0:c._id)&&void 0!==i?i:"")})}}return n.\u0275fac=function(o){return new(o||n)(t.LFG(F.P),t.LFG(r.qu),t.LFG(H),t.LFG(D.h),t.LFG(v.Qg))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var j=e(8433),E=e(8238),k=e(2428);const W=function(n){return{"button-icon-disabled":n}},N=["*"];let X=(()=>{class n{constructor(){this.appClick=new t.vpe,this.active=!1,this.image_url=""}ngOnInit(){}onClick(){this.appClick.emit()}}return n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-send-button"]],inputs:{active:"active",image_url:"image_url"},outputs:{appClick:"appClick"},ngContentSelectors:N,decls:3,vars:3,consts:[[1,"button"],[1,"button-icon",3,"ngClass","click"]],template:function(o,i){1&o&&(t.F$t(),t.TgZ(0,"div",0),t.TgZ(1,"button",1),t.NdJ("click",function(){return i.onClick()}),t.Hsn(2),t.qZA(),t.qZA()),2&o&&(t.xp6(1),t.Q6J("ngClass",t.VKq(1,W,!i.active)))},directives:[l.mk],styles:["[_nghost-%COMP%]{display:block}.button[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;justify-content:center}.button-icon[_ngcontent-%COMP%]{display:block;background:#e31f3c;width:56px;height:56px;border-radius:28px;cursor:pointer;padding-left:3px}.button-icon[_ngcontent-%COMP%]:hover{background:#cd1833}.button-icon-disabled[_ngcontent-%COMP%]{opacity:.38;pointer-events:none}"],changeDetection:0}),n})();var Y=e(1599),K=e(5672);function V(n,s){if(1&n&&(t.ynx(0),t.TgZ(1,"div",12),t._UZ(2,"p",13),t.ALo(3,"brTag"),t.ALo(4,"autoLink"),t.qZA(),t.BQk()),2&n){const o=s.ngIf;t.xp6(2),t.Q6J("innerHtml",t.lcZ(3,1,t.lcZ(4,3,o)),t.oJD)}}let w=(()=>{class n{constructor(o,i){this.activatedRoute=o,this.service=i,this.onDestroy$=new L.xQ,this.formGroup=this.service.buildFormForZipcode(),this.policyID$=new A.X(""),this.commentBody$=this.service.commentBody$()}ngOnInit(){this.service.signInWithAnonymous(),this.activeRoute()}activeRoute(){const o=this.activatedRoute.parent,i=null==o?void 0:o.parent;o&&i&&i.params.pipe((0,R.R)(this.onDestroy$),(0,S.U)(c=>{this.service.policyID$.next(c.projectId)})).subscribe()}ngOnDestroy(){this.onDestroy$.next()}get getZipcodeControl(){return this.formGroup.get("zipcode")}onClick(){return(0,h.mG)(this,void 0,void 0,function*(){this.service.postCommentInAnonymous(this.getZipcodeControl.value)})}}return n.\u0275fac=function(o){return new(o||n)(t.Y36(f.gz),t.Y36(Z))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-comment-anonymous-container"]],decls:16,vars:10,consts:[[1,"page-container"],[1,"page"],[1,"form",3,"formGroup"],[1,"header"],[1,"header-title"],[1,"invisible-gt-sm"],[4,"ngIf"],[3,"title","isOptional","sentence"],["id","zipcode","type","text","autocomplete","postal-code",1,"input-item",3,"formControl"],[3,"form"],[1,"button",3,"active","appClick"],["src","assets/images/submit.svg","loading","lazy","width","21px","height","18px"],[1,"comment-container"],[1,"sentence",3,"innerHtml"]],template:function(o,i){1&o&&(t._UZ(0,"app-header"),t.TgZ(1,"main",0),t.TgZ(2,"section",1),t.TgZ(3,"form",2),t.TgZ(4,"div",3),t.TgZ(5,"h1",4),t._uU(6,"\u7d20\u6575\u306a\u30b3\u30e1\u30f3\u30c8"),t._UZ(7,"br",5),t._uU(8,"\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01"),t.qZA(),t.qZA(),t.YNc(9,V,5,5,"ng-container",6),t.ALo(10,"async"),t._UZ(11,"app-input-label",7),t._UZ(12,"input",8),t._UZ(13,"app-input-zipcode-message",9),t.TgZ(14,"app-send-button",10),t.NdJ("appClick",function(){return i.onClick()}),t._UZ(15,"img",11),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&o&&(t.xp6(3),t.Q6J("formGroup",i.formGroup),t.xp6(6),t.Q6J("ngIf",t.lcZ(10,8,i.commentBody$)),t.xp6(2),t.Q6J("title","\u90f5\u4fbf\u756a\u53f7")("isOptional",!0)("sentence","\u30b3\u30e1\u30f3\u30c8\u3057\u305f\u653f\u7b56\u306e\u653f\u6cbb\u5bb6\u3068\u540c\u3058\u5730\u57df\u3060\u3063\u305f\u5834\u5408\u3001\u610f\u898b\u304c\u3088\u308a\u53c2\u8003\u306b\u3055\u308c\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u307b\u304b\u306ePoliPoli\u5229\u7528\u8005\u306b\u516c\u958b\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002"),t.xp6(1),t.Q6J("formControl",i.getZipcodeControl),t.xp6(1),t.Q6J("form",i.getZipcodeControl),t.xp6(1),t.Q6J("active",!i.formGroup.invalid))},directives:[j.G,r._Y,r.JL,r.sg,l.O5,E.i,r.Fj,r.JJ,r.oH,k.E,X],pipes:[l.Ov,Y.W,K.y],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block}.page[_ngcontent-%COMP%]{padding-top:16px;padding-bottom:16px}.page-container[_ngcontent-%COMP%]{max-width:688px;margin:0 auto;padding-left:16px;padding-right:16px}@media all and (min-width: 768px){.page-container[_ngcontent-%COMP%]{padding-left:40px;padding-right:40px}}.input-item[_ngcontent-%COMP%]{width:100%;border:solid 1px #dbd9d9;border-radius:4px;color:#1f1a1b;box-sizing:border-box;background:#ffffff;padding:7px 12px;font-family:"Helvetica","Hiragino Kaku Gothic Pro","\\30d2\\30e9\\30ae\\30ce\\89d2\\30b4 Pro W3","\\30e1\\30a4\\30ea\\30aa","Meiryo","\\ff2d\\ff33 \\ff30\\30b4\\30b7\\30c3\\30af","Helvetica Neue","Arial",sans-serif;font-size:16px;line-height:22px;letter-spacing:.25px;font-weight:300}.input-item[_ngcontent-%COMP%]:focus{outline:0;border:solid 1px #04856a}.input-item.ng-invalid.ng-dirty[_ngcontent-%COMP%]{border:solid 1px #990f24}.input-item.ng-invalid.ng-touched[_ngcontent-%COMP%]{border:solid 1px #990f24}.header[_ngcontent-%COMP%]{margin-bottom:16px}.header-title[_ngcontent-%COMP%]{margin-bottom:6px;color:#1f1a1b;font-family:"Helvetica","Hiragino Kaku Gothic Pro","\\30d2\\30e9\\30ae\\30ce\\89d2\\30b4 Pro W3","\\30e1\\30a4\\30ea\\30aa","Meiryo","\\ff2d\\ff33 \\ff30\\30b4\\30b7\\30c3\\30af","Helvetica Neue","Arial",sans-serif;font-weight:700;font-size:22px;line-height:30px;letter-spacing:.5px}@media all and (min-width: 768px){.invisible-gt-sm[_ngcontent-%COMP%]{display:none}}.comment-container[_ngcontent-%COMP%]{margin-bottom:24px;box-sizing:border-box;padding:12px 16px;background:#ffffff;box-shadow:0 2px 7px #0000001a;border-radius:8px}
1.comment-container[_ngcontent-%COMP%] .sentence[_ngcontent-%COMP%]{color:#1f1a1b;font-family:"Helvetica","Hiragino Kaku Gothic Pro","\\30d2\\30e9\\30ae\\30ce\\89d2\\30b4 Pro W3","\\30e1\\30a4\\30ea\\30aa","Meiryo","\\ff2d\\ff33 \\ff30\\30b4\\30b7\\30c3\\30af","Helvetica Neue","Arial",sans-serif;font-weight:normal;font-size:14px;line-height:20px;letter-spacing:.25px}.button[_ngcontent-%COMP%]{margin-top:16px;margin-bottom:48px}'],changeDetection:0}),n})();const q=[{path:"",component:(()=>{class n{constructor(){}ngOnInit(){}}return n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-comment-anonymous-page"]],decls:1,vars:0,template:function(o,i){1&o&&t._UZ(0,"app-comment-anonymous-container")},directives:[w],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})()}];let _=(()=>{class n{}return n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[f.Bz.forChild(q)],f.Bz]}),n})(),tt=(()=>{class n{}return n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[l.ez]]}),n})();var nt=e(6676),ot=e(2102);let et=(()=>{class n{}return n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[Z],imports:[[l.ez,ot.d,_,G.q,O.h,r.u5,r.UX,tt,nt.O]]}),n})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.