1(self.webpackChunkapp=self.webpackChunkapp||[]).push([[808],{10808(m,p,t){"use strict";t.d(p,{ShareArticlePageModule:()=>g});var a=t(31635),l=t(23214),h=t(16213),T=t(89417),o=t(64211),f=t(25207),i=t(10467);var I,x=t(71702),U=t.n(x),S=t(98500),v=t(85843),d=t(25499),E=t(96739),b=t(17945),A=t(51239),O=t(68968),k=t(50066),D=t(40752),C=t(50678);let c=(class{constructor(e,r,n,s,u,R,B,z){this.actionSheet=e,this.cameraService=r,this.storiesService=n,this.alertController=s,this.store=u,this.loadingUtility=R,this.authService=B,this.analytics=z,this.userName="",this.userId="",this.userContactInformation="",this.storyTitle="",this.storyContent="",this.storyThumbnailBytes="",this.profile=null,this.thumbnailSelected=!1}ngOnInit(){this.analytics.trackEvent("User","entered_share_article_screen","Entered Share Article Screen"),this.initializeUserData()}initializeUserData(){var e=this;return(0,i.A)(function*(){e.userId=yield e.authService.getUserIdentitityKey(),e.store.pipe((0,d.Lt)(E.$z)).subscribe(function(){var r=(0,i.A)(function*(n){n?(e.profile=n,e.profile.firstName&&e.profile.lastName&&(e.userName=e.profile.firstName+" "+e.profile.lastName),e.profile.emailAddresses&&e.profile.emailAddresses.length>0?e.userContactInformation=e.profile.emailAddresses[0].emailAddress:e.profile.phones&&e.profile.phones.length>0&&(e.userContactInformation=e.profile.phones[0].formattedNumber)):e.userId=yield e.authService.getUserIdentitityKey()});return function(n){return r.apply(this,arguments)}}())})()}setUerName(e){this.userName=e}setUerContactInformation(e){this.userContactInformation=e}setStoryTitle(e){this.storyTitle=e}setStoryContent(e){this.storyContent=e}presentAddImageActionSheet(){var e=this;return(0,i.A)(function*(){yield(yield e.actionSheet.create({header:"Cover Photo",buttons:[{text:"Upload Photo",icon:"image",handler:()=>{e.cameraService.getImageFromGallery(),e.thumbnailSelected=!0}},{text:"Take Photo",icon:"camera",handler:()=>{e.cameraService.getImageFromCamera(50),e.thumbnailSelected=!0}},{text:"Cancel",icon:"close",role:"cancel",handler:()=>{}}]})).present()})()}sendStory(){var e=this;return(0,i.A)(function*(){e.analytics.trackEvent("User","clicked_send_story_on_share_article","Clicked Send Story On Share Article");let r=e.checkForm();if(r.length>0)yield e.showAlertMessage("Error","",r);else{!0===e.thumbnailSelected&&(e.cameraService.photo?.base64?.length>0||e.cameraService.photo)&&(yield e.setStoryThumbnailBytes());let n={contactInfos:e.userContactInformation,content:e.storyContent,thumbnailBytes:e.storyThumbnailBytes,title:e.storyTitle,userId:e.userId,userName:e.userName};yield e.loadingUtility.showLoader("Sharing your story..."),e.storiesService.apiStoriesSharePost(n).subscribe(s=>{e.loadingUtility.hideLoader(),s?.id?.length>0?(e.showAlertMessage("Thank You","",e.userName+", thank you for sharing your story. We will review it and post it on the Werner Blog if appropriate."),e.clearForm()):e.showAlertMessage("Error","",e.userName+", we are sorry we could not share your story because an error occurred. Please try again later.")})}})()}setStoryThumbnailBytes(){var e=this;return(0,i.A)(function*(){e.cameraService.theCapturedPhoto?.base64String?.length>0&&(e.storyThumbnailBytes=e.cameraService.theCapturedPhoto.base64String,e.cameraService.theCapturedPhoto=null)})()}clearForm(){this.userName="",this.userContactInformation="",this.storyTitle="",this.storyContent="",this.storyThumbnailBytes=""}checkForm(){let e="";return 0==this.userName.trim().length?e="Please enter your name.":0==this.userContactInformation.trim().length?e="Please enter your email address or phone number.":0==this.storyTitle.trim().length?e="Please enter the title for your story.":0==this.storyContent.trim().length&&(e="Please enter your story content."),0==e.length&&!1===this.textIsPhoneNumber(this.userContactInformation)&&!1===this.textIsEmailAddress(this.userContactInformation)&&(e="Please enter an email address or a phone number using the format [email protected] or 123-456-7890."),e}textIsPhoneNumber(e){let r=!1;if(null!==e&&e.trim().length>0){let n=this.getDigitsFromText(e);10==n?.length&&this.isNumber(n)&&(r=!0)}return r}getDigitsFromText(e){let r="";if(null!=e&&e.length>0){let n=0,s="";for(;n<e.length;n++)s=e[n],!0===this.isNumber(s)&&(r+=s)}return r}textIsEmailAddress(e){let r=!1;return null!==e&&e.trim().length>0&&(r=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e)),r}showAlertMessage(e,r,n){var s=this;return(0,i.A)(function*(){const u=yield s.alertController.create({header:e,subHeader:r,message:n,buttons:["OK"]});
1yield u.present(),yield u.onDidDismiss()})()}isNumber(e){return!Number.isNaN(Number.parseFloat(e))&&!Number.isNaN(e-0)}static#e=I=()=>(this.ctorParameters=()=>[{type:o.GD},{type:S.j},{type:v.zJ},{type:o.hG},{type:d.il},{type:b.N},{type:A.u},{type:C.c}],this)},I());c=(0,a.Cg)([(0,l.uAl)({selector:"app-share-article",template:'<ion-header class="ion-safe-area-top" mode="ios">\n <ion-toolbar>\n <ion-buttons slot="start">\n <ion-back-button defaultHref="/news" text=""></ion-back-button>\n </ion-buttons>\n <ion-title class="edge-value">Tell Your Story</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class="edge-value">\n <br />\n\n <stack-input\n label="Name"\n placeholder="Enter your full name"\n [text]="userName"\n (TheTextChanged)="setUerName($event)"\n ></stack-input>\n\n <br />\n\n <stack-input\n label="Email Address / Phone Number"\n placeholder="[email protected] or 123-456-7890"\n [text]="userContactInformation"\n (TheTextChanged)="setUerContactInformation($event)"\n\n ></stack-input>\n\n <br />\n\n <stack-input\n label="Story Title"\n placeholder="Enter a title for your story"\n [text]="storyTitle"\n (TheTextChanged)="setStoryTitle($event)"\n ></stack-input>\n\n <br />\n\n <stack-textarea\n label="Your Story"\n placeholder="Enter the story you\'d like to share"\n [text]="storyContent"\n (TheTextChanged)="setStoryContent($event)"\n ></stack-textarea>\n\n <secondary-button style="display: none !important;"\n title="Add optional image"\n (click)="presentAddImageActionSheet()"\n (keypress)="presentAddImageActionSheet()"\n ></secondary-button>\n\n <br />\n <br />\n <div class="cta werner-button primary" \n (click)="sendStory()"\n (keypress)="sendStory()">\n Submit\n </div>\n</ion-content>\n',imports:[o.bv,O.a,k.o,D.O],styles:[U()]}),(0,a.Sn)("design:paramtypes",[o.GD,S.j,v.zJ,o.hG,d.il,b.N,A.u,C.c])],c);const M=[{path:"",component:c}];let y=class{};y=(0,a.Cg)([(0,l.UQu)({imports:[f.iI.forChild(M)],exports:[f.iI]})],y);var F=t(44661);let g=class{};g=(0,a.Cg)([(0,l.UQu)({imports:[h.MD,T.YN,o.bv,y,F.u,c]})],g)},71702(m,p,t){var a=t(8564),h=t(98557)(a);h.push([m.id,"ion-content {\n --ion-background-color:#F8F9FA;\n}\n\n.cta {\n margin: 0px 16px;\n}",""]),m.exports=h.toString()}}]);
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.