1"use strict";(self.webpackChunkslated=self.webpackChunkslated||[]).push([[9962],{75373:(Nt,gt,n)=>{n.d(gt,{l:()=>t});var d=n(46395);function t(N){return N&&!d.Ai.test(N)?N.startsWith("//")?`https:${N}`:`https://${N}`:N}},5526:(Nt,gt,n)=>{n.d(gt,{S:()=>oe});var d=n(69808),t=n(5e3),N=n(67399),k=n(44987),Q=n(26991),W=n(39300),X=n(18505),R=n(95698),G=n(65967),V=n(59655),K=n(85746),L=n(75853),mt=n(46395),et=n(3596),q=n(75373),rt=n(8089),Ct=n(31302),ht=n(1982),Rt=n(64416),ut=n(30896),$t=n(39575),kt=n(37302),It=n(93075),Ht=n(67322),ie=n(74107),e=n(90508),Dt=n(84629),T=n(98833),b=n(65835),ot=n(13528),Jt=n(70095),H=n(47423),B=n(20773),Z=n(79814),Pt=n(83996),Tt=n(74346);function Et(C,f){if(1&C&&(t.TgZ(0,"div",6)(1,"div",7),t._uU(2),t.qZA(),t._UZ(3,"avatar",8),t.qZA()),2&C){const i=t.oxw();t.xp6(2),t.Oqu(i.investor.name||i.investor.full_name||i.investor.first_name+" "+i.investor.last_name),t.xp6(1),t.Q6J("url",null!=i.investor.profile&&i.investor.profile.is_member&&null!=i.investor.profile&&i.investor.profile.is_approved?null==i.investor.profile?null:i.investor.profile.profile_url:null)("isRound",i.isIndividualType)("score",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.score:i.investor.score)("isGovernment",i.isGovernmentType)("image",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.medium_image_url:i.investor.medium_image_url)}}function re(C,f){1&C&&(t.TgZ(0,"p",9),t._uU(1,"Slated requires that all attachments are verified independently to\xa0ensure a\xa0high level of\xa0integrity and help build trust in\xa0the community. The team member you request verification for "),t.TgZ(2,"span",10),t._uU(3,"must have already agreed to be attached to your project."),t.qZA()())}function Bt(C,f){1&C&&(t.ynx(0),t._uU(1,"All fields required"),t.BQk())}function Lt(C,f){if(1&C&&t._UZ(0,"avatar",45),2&C){const i=t.oxw(2);t.Q6J("url",null!=i.investor.profile&&i.investor.profile.is_member&&null!=i.investor.profile&&i.investor.profile.is_approved?null==i.investor.profile?null:i.investor.profile.profile_url:null)("isRound",i.isIndividualType)("score",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.score:i.investor.score)("isGovernment",i.isGovernmentType)("image",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.medium_image_url:i.investor.medium_image_url)}}function Qt(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"This is required"),t.qZA())}function I(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"This must be a valid a URL"),t.qZA())}function st(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"mat-form-field",46)(1,"mat-label"),t._uU(2),t.qZA(),t.TgZ(3,"input",47,48),t.NdJ("ngModelChange",function(r){return t.CHM(i),t.oxw(2).websiteUrl=r}),t.qZA(),t.YNc(5,I,2,0,"mat-error",5),t.qZA()}if(2&C){const i=t.MAs(4),s=t.oxw(2);t.xp6(2),t.hij("",s.isCompanyType?"Company":"Entity"," website (optional)"),t.xp6(1),t.Q6J("ngModel",s.websiteUrl)("disabled",s.verifyPending||!s.type)("pattern",s.urlPattern),t.xp6(2),t.Q6J("ngIf",i.invalid&&i.dirty&&(null==i.errors?null:i.errors.pattern))}}function nt(C,f){if(1&C&&(t.TgZ(0,"mat-option",20),t._uU(1),t.qZA()),2&C){const i=f.$implicit;t.Q6J("value",i.slug),t.xp6(1),t.Oqu(i.name)}}function z(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"This is required"),t.qZA())}function ct(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"Must be less than $300,000,000"),t.qZA())}function yt(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"Enter amount in US dollars"),t.qZA())}function jt(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"Enter stage"),t.qZA())}function Ft(C,f){if(1&C&&(t.TgZ(0,"div",49),t._UZ(1,"avatar",50),t.TgZ(2,"div",51)(3,"div",52),t._uU(4),t.qZA(),t.TgZ(5,"div",53),t._uU(6,"Investor"),t.qZA()()()),2&C){const i=t.oxw(2);t.xp6(1),t.Q6J("url",null!=i.investor.profile&&i.investor.profile.is_member&&null!=i.investor.profile&&i.investor.profile.is_approved?null==i.investor.profile?null:i.investor.profile.profile_url:null)("isRound",i.isIndividualType)("score",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.score:i.investor.score)("isGovernment",i.isGovernmentType)("image",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.medium_image_url:i.investor.medium_image_url),t.xp6(3),t.Oqu(i.investor.name||i.investor.full_name||i.investor.first_name+" "+i.investor.last_name)}}function se(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"div",54)(1,"button",55),t.NdJ("click",function(){return t.CHM(i),t.oxw(2).bottomSheetRef.dismiss()}),t._uU(2,"Cancel"),t.qZA()()}if(2&C){const i=t.oxw(2);t.xp6(1),t.Q6J("disabled",i.bottomSheetRef.disableClose||i.pending)}}function Se(C,f){1&C&&t._UZ(0,"mat-spinner",57)}function ye(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"button",58),t.NdJ("click",function(){t.CHM(i),t.oxw(2);const r=t.MAs(8);return t.oxw().triggerValidation(r)}),t.qZA()}}function ge(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"div",54)(1,"div",11)(2,"button",56),t.NdJ("click",function(){return t.CHM(i),t.oxw(2).verify(!0)}),t.TgZ(3,"span",42),t.YNc(4,Se,1,0,"mat-spinner",43),t._uU(5,"Verify Later "),t.qZA()(),t.YNc(6,ye,1,0,"button",44),t.qZA()()}if(2&C){t.oxw();const i=t.MAs(8),s=t.oxw();
1t.xp6(2),t.Q6J("disabled",s.bottomSheetRef.disableClose||!s.investor||i.invalid),t.xp6(2),t.Q6J("ngIf",s.verifyPending&&s.verifyLater),t.xp6(2),t.Q6J("ngIf",!s.investor||i.invalid)}}function Oe(C,f){1&C&&t._UZ(0,"mat-spinner",57)}function me(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"button",58),t.NdJ("click",function(){t.CHM(i),t.oxw();const r=t.MAs(8);return t.oxw().triggerValidation(r)}),t.qZA()}}const fe=function(){return{prefix:"$ ",thousands:",",allowNegative:!1,precision:0,align:"left"}};function le(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"div",11)(1,"div",12)(2,"div",13),t._uU(3," Investors will only be visible to project admins and Slated staff. All investment information marked as verified must be accurate, and Slated may opt to audit the information to ensure accuracy. "),t.qZA(),t.YNc(4,Bt,2,0,"ng-container",5),t.qZA(),t.TgZ(5,"div",14),t.YNc(6,Lt,1,5,"avatar",15),t.TgZ(7,"form",null,16)(9,"mat-form-field",17)(10,"mat-label"),t._uU(11,"Type of Investor"),t.qZA(),t.TgZ(12,"mat-select",18,19),t.NdJ("openedChange",function(r){return t.CHM(i),t.oxw().toggleDisableTouchEvents(r)})("selectionChange",function(){return t.CHM(i),t.oxw().clearSelection()})("ngModelChange",function(r){return t.CHM(i),t.oxw().type=r}),t.TgZ(14,"mat-option",20),t._uU(15,"Individual"),t.qZA(),t.TgZ(16,"mat-option",20),t._uU(17,"Company"),t.qZA(),t.TgZ(18,"mat-option",20),t._uU(19,"Public funding and incentives"),t.qZA()(),t.YNc(20,Qt,2,0,"mat-error",5),t.qZA(),t.TgZ(21,"inline-entity-search",21),t.NdJ("focusChanged",function(r){return t.CHM(i),t.oxw().toggleDisableTouchEvents(r)})("intercom",function(){return t.CHM(i),t.oxw().bottomSheetRef.dismiss()})("selection",function(r){return t.CHM(i),t.oxw().selectInvestor(r)}),t.qZA(),t.YNc(22,st,6,5,"mat-form-field",22),t.TgZ(23,"div")(24,"div",23)(25,"mat-form-field",24)(26,"mat-label"),t._uU(27,"Type of Financing"),t.qZA(),t.TgZ(28,"mat-select",25,26),t.NdJ("ngModelChange",function(r){return t.CHM(i),t.oxw().financingType=r}),t.YNc(30,nt,2,2,"mat-option",27),t.qZA(),t.YNc(31,z,2,0,"mat-error",5),t.qZA(),t.TgZ(32,"mat-form-field",28)(33,"mat-label"),t._uU(34,"Amount"),t.qZA(),t.TgZ(35,"input",29,30),t.NdJ("ngModelChange",function(r){return t.CHM(i),t.oxw().financingAmount=r}),t.qZA(),t.TgZ(37,"mat-hint"),t._uU(38,"US dollars"),t.qZA(),t.YNc(39,ct,2,0,"mat-error",5),t.YNc(40,yt,2,0,"mat-error",5),t.qZA()()(),t.TgZ(41,"mat-form-field",31)(42,"mat-label"),t._uU(43,"Stage"),t.qZA(),t.TgZ(44,"mat-select",32,33),t.NdJ("openedChange",function(r){return t.CHM(i),t.oxw().toggleDisableTouchEvents(r)})("ngModelChange",function(r){return t.CHM(i),t.oxw().stage=r}),t.TgZ(46,"mat-option",34),t._uU(47,"Production"),t.qZA(),t.TgZ(48,"mat-option",35),t._uU(49,"Distribution/Marketing"),t.qZA()(),t.YNc(50,jt,2,0,"mat-error",5),t.qZA()(),t.YNc(51,Ft,7,6,"div",36),t.qZA(),t.TgZ(52,"div",37),t.YNc(53,se,3,1,"div",38),t.YNc(54,ge,7,3,"ng-template",null,39,t.W1O),t.TgZ(56,"div",40)(57,"div",11)(58,"button",41),t.NdJ("click",function(){return t.CHM(i),t.oxw().verifyNow()}),t.TgZ(59,"span",42),t.YNc(60,Oe,1,0,"mat-spinner",43),t._uU(61),t.qZA()(),t.YNc(62,me,1,0,"button",44),t.qZA()()()()}if(2&C){const i=t.MAs(8),s=t.MAs(13),r=t.MAs(29),g=t.MAs(36),D=t.MAs(45),F=t.MAs(55),O=t.oxw();
1t.xp6(1),t.ekj("_selected",O.investor),t.xp6(3),t.Q6J("ngIf",!O.type||O.isIndividualType),t.xp6(2),t.Q6J("ngIf",O.investor),t.xp6(6),t.Q6J("disabled",O.verifyPending)("ngModel",O.type),t.xp6(2),t.Q6J("value",O.investorTypes.individual),t.xp6(2),t.Q6J("value",O.investorTypes.company),t.xp6(2),t.Q6J("value",O.investorTypes.government),t.xp6(2),t.Q6J("ngIf",s.invalid&&s.dirty&&(null==s.errors?null:s.errors.required)),t.xp6(1),t.Q6J("resetIfChanged",O.type)("type",O.isIndividualType?"user":O.isGovernmentType?"government":"company")("label",O.searchFieldLabel)("validate",O.validateInlineEntitySearch)("disable",O.verifyPending||!O.type)("resetOnChange",!0)("projectId",O.data.project.id)("required",!0),t.xp6(1),t.Q6J("ngIf",O.isCompanyType||O.isGovernmentType),t.xp6(6),t.Q6J("disabled",!O.financingTypes||!O.type||O.verifyPending)("ngModel",O.financingType),t.xp6(2),t.Q6J("ngForOf",O.financingTypes),t.xp6(1),t.Q6J("ngIf",r.invalid&&r.dirty&&(null==r.errors?null:r.errors.required)),t.xp6(4),t.Q6J("disabled",!O.type||O.verifyPending)("options",t.DdM(39,fe))("max",O.investmentLimit)("ngModel",O.financingAmount),t.xp6(4),t.Q6J("ngIf",g.invalid&&g.dirty&&(null==g.errors?null:g.errors.max)),t.xp6(1),t.Q6J("ngIf",g.invalid&&g.dirty&&(null==g.errors?null:g.errors.required)||(null==g.errors?null:g.errors.number)||(null==g.errors?null:g.errors.min)),t.xp6(4),t.Q6J("disabled",O.verifyPending||!O.type)("ngModel",O.stage),t.xp6(6),t.Q6J("ngIf",D.invalid&&D.dirty&&(null==D.errors?null:D.errors.required)),t.xp6(1),t.Q6J("ngIf",O.investor),t.xp6(2),t.Q6J("ngIf",O.canVerifyImmediately)("ngIfElse",F),t.xp6(5),t.Q6J("disabled",O.verifyPending||!O.investor||i.invalid),t.xp6(2),t.Q6J("ngIf",O.verifyPending&&!O.verifyLater),t.xp6(1),t.hij("",O.canVerifyImmediately?"Add":"Verify n
1ow"," "),t.xp6(1),t.Q6J("ngIf",!O.investor||i.invalid)}}function je(C,f){if(1&C&&(t.TgZ(0,"p",62),t._uU(1),t.qZA()),2&C){const i=t.oxw(2);t.xp6(1),t.AsE("",i.investor.first_name," ",i.investor.last_name,' is a Slated member. When you click "Send verification e-mail", an e-mail will be sent to verify the role.')}}function Ee(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"This is required"),t.qZA())}function Ce(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"This must be a valid email address"),t.qZA())}function Fe(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"That email address is associated with a different person"),t.qZA())}function we(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"mat-form-field",69)(1,"mat-label"),t._uU(2,"Email"),t.qZA(),t.TgZ(3,"input",70,71),t.NdJ("ngModelChange",function(r){return t.CHM(i),t.oxw(4).investorEmail=r})("action",function(r){return t.CHM(i),t.oxw(4).handleEmailAvailabilityAction(r)}),t.qZA(),t.YNc(5,Ee,2,0,"mat-error",5),t.YNc(6,Ce,2,0,"mat-error",5),t.YNc(7,Fe,2,0,"mat-error",5),t.qZA()}if(2&C){const i=t.MAs(4),s=t.oxw(4);t.xp6(3),t.Q6J("disabled",s.pending)("ngModel",s.investorEmail)("ignoreUser",s.investor)("pattern",s.emailPattern),t.xp6(2),t.Q6J("ngIf",i.invalid&&i.dirty&&(null==i.errors?null:i.errors.required)),t.xp6(1),t.Q6J("ngIf",i.invalid&&i.dirty&&(null==i.errors?null:i.errors.pattern)),t.xp6(1),t.Q6J("ngIf",i.invalid&&i.dirty&&(null==i.errors?null:i.errors.emailAvailability))}}function Te(C,f){1&C&&t.GkF(0)}function Wt(C,f){if(1&C&&(t.ynx(0),t.YNc(1,Te,1,0,"ng-container",72),t.BQk()),2&C){t.oxw(2);const i=t.MAs(5);t.xp6(1),t.Q6J("ngTemplateOutlet",i)}}function ve(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"mat-radio-group",66),t.NdJ("ngModelChange",function(r){return t.CHM(i),t.oxw(3).verificationType=r}),t.TgZ(1,"mat-radio-button",67),t._uU(2,"Email investor"),t.qZA(),t.YNc(3,we,8,7,"mat-form-field",68),t.TgZ(4,"mat-radio-button",20),t._uU(5,"Email representative"),t.qZA(),t.YNc(6,Wt,2,1,"ng-container",5),t.qZA()}if(2&C){const i=t.oxw(3);t.Q6J("ngModel",i.verificationType)("disabled",i.pending),t.xp6(1),t.Q6J("value",i.verificationTypes.investor),t.xp6(2),t.Q6J("ngIf",i.verificationType===i.verificationTypes.investor),t.xp6(1),t.Tol(i.verificationType===i.verificationTypes.representative?"sl8d-margin-top-sm sl8d-margin-bottom-xxs":""),t.Q6J("value",i.verificationTypes.representative),t.xp6(2),t.Q6J("ngIf",i.verificationType===i.verificationTypes.representative)}}function Ue(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"HTML is not allowed."),t.qZA())}function Me(C,f){if(1&C&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&C){t.oxw(2);const i=t.MAs(4);t.xp6(1),t.hij(" Enter first and last name",null!=i.errors&&null!=i.errors.fullName&&i.errors.fullName.incorrectCharacters?", cannot include < or >":""," ")}}function Ae(C,f){if(1&C&&t.YNc(0,Me,2,1,"mat-error",5),2&C){t.oxw();const i=t.MAs(4);t.Q6J("ngIf",i.invalid&&i.dirty&&((null==i.errors?null:i.errors.required)||(null==i.errors?null:i.errors.fullName)))}}function Ie(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"This is required"),t.qZA())}function Ze(C,f){1&C&&(t.TgZ(0,"mat-error"),t._uU(1,"This must be a valid email address"),t.qZA())}function Gt(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"mat-form-field",73)(1,"mat-label"),t._uU(2,"Representative name"),t.qZA(),t.TgZ(3,"input",74,75),t.NdJ("ngModelChange",function(r){return t.CHM(i),t.oxw(3).repName=r}),t.qZA(),t.YNc(5,Ue,2,0,"mat-error",76),t.YNc(6,Ae,1,1,"ng-template",null,77,t.W1O),t.qZA(),t.TgZ(8,"mat-form-field",78)(9,"mat-label"),t._uU(10,"Representative email address"),t.qZA(),t.TgZ(11,"input",79,80),t.NdJ("ngModelChange",function(r){return t.CHM(i),t.oxw(3).repEmail=r}),t.qZA(),t.YNc(13,Ie,2,0,"mat-error",5),t.YNc(14,Ze,2,0,"mat-error",5),t.qZA()}if(2&C){const i=t.MAs(4),s=t.MAs(7),r=t.MAs(12),g=t.oxw(3);t.ekj("sl8d-padding-left-xxl",g.isIndividualType),t.xp6(3),t.Q6J("disabled",g.pending)("ngModel",g.repName),t.xp6(2),t.Q6J("ngIf",i.invalid&&i.dirty&&(null==i.errors?null:i.errors.html))("ngIfElse",s),t.xp6(3),t.ekj("sl8d-padding-left-xxl",g.isIndividualType),t.xp6(3),t.Q6J("disabled",g.pending)("ngModel",g.repEmail)("pattern",g.emailPattern),t.xp6(2),t.Q6J("ngIf",r.invalid&&r.dirty&&(null==r.errors?null:r.errors.required)),t.xp6(1),t.Q6J("ngIf",r.invalid&&r.dirty&&(null==r.errors?null:r.errors.pattern))}}function he(C,f){if(1&C&&(t.ynx(0),t.TgZ(1,"p",63),t._uU(2,"How
1would like to verify this investment?"),t.qZA(),t.YNc(3,ve,7,8,"mat-radio-group",64),t.YNc(4,Gt,15,13,"ng-template",null,65,t.W1O),t.BQk()),2&C){const i=t.MAs(5),s=t.oxw(2);t.xp6(3),t.Q6J("ngIf",s.isIndividualType)("ngIfElse",i)}}function Re(C,f){if(1&C&&(t.TgZ(0,"div",49),t._UZ(1,"avatar",50),t.TgZ(2,"div",51)(3,"div",52),t._uU(4),t.qZA(),t.TgZ(5,"div",53),t._uU(6,"Investor"),t.qZA()()()),2&C){const i=t.oxw(2);t.xp6(1),t.Q6J("url",null!=i.investor.profile&&i.investor.profile.is_member&&null!=i.investor.profile&&i.investor.profile.is_approved?null==i.investor.profile?null:i.investor.profile.profile_url:null)("isRound",i.isIndividualType)("score",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.score:i.investor.score)("isGovernment",i.isGovernmentType)("image",i.isIndividualType?null==i.investor.profile?null:i.investor.profile.medium_image_url:i.investor.medium_image_url),t.xp6(3),t.Oqu(i.investor.name||i.investor.full_name||i.investor.first_name+" "+i.investor.last_name)}}function De(C,f){1&C&&t._UZ(0,"mat-spinner",57)}function Be(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"button",58),t.NdJ("click",function(){t.CHM(i),t.oxw();const r=t.MAs(3);return t.oxw().triggerValidation(r)}),t.qZA()}}function $e(C,f){if(1&C){const i=t.EpF();t.TgZ(0,"div")(1,"div",14)(2,"form",null,59)(4,"div"),t.YNc(5,je,2,2,"p",60),t.YNc(6,he,6,2,"ng-container",5),t.qZA()(),t.YNc(7,Re,7,6,"div",36),t.qZA(),t.TgZ(8,"div",37)(9,"div",54)(10,"button",55),t.NdJ("click",function(){return t.CHM(i),t.oxw().bottomSheetRef.dismiss()}),t._uU(11,"Cancel"),t.qZA()(),t.TgZ(12,"div",40)(13,"div",11)(14,"button",41),t.NdJ("click",function(){return t.CHM(i),t.oxw().verify(!1)}),t.TgZ(15,"span",42),t.YNc(16,De,1,0,"mat-spinner",43),t._uU(17,"Send\xa0"),t.TgZ(18,"span",61),t._uU(19,"Verification\xa0"),t.qZA(),t._uU(20,"Email "),t.qZA()(),t.YNc(21,Be,1,0,"button",44),t.qZA()()()()}if(2&C){const i=t.MAs(3),s=t.oxw();t.xp6(5),t.Q6J("ngIf",null==s.investor.profile?null:s.investor.profile.is_member),t.xp6(1),t.Q6J("ngIf",!(null!=s.investor.profile&&s.investor.profile.is_member)),t.xp6(1),t.Q6J("ngIf",s.investor),t.xp6(3),t.Q6J("disabled",s.bottomSheetRef.disableClose||s.pending),t.xp6(4),t.Q6J("disabled",s.pending||!s.investor||(null==i?null:i.invalid)),t.xp6(2),t.Q6J("ngIf",s.pending),t.xp6(5),t.Q6J("ngIf",!s.investor||(null==i?null:i.invalid))}}let oe=class extends V.K{constructor(f,i,s,r,g,D,F,O,it,tt,_t,pt,Mt){super(f,s,r,g),this.bottomSheetRef=f,this.data=i,this.elRef=s,this.locationStrategy=r,this.ngZone=g,this.actions$=D,this.cacheService=F,this.cdr=O,this.companiesApi=it,this.errorHandler=tt,this.projectPageSupportService=_t,this.snackBarService=pt,this.tagsApi=Mt,this.emailPattern=mt.CU,this.urlPattern=mt.Wh,this.verificationType=L.PU.investor,this.validateInlineEntitySearch=!1,this.verifyLater=!1,this.verifyPending=!1,this.pending=!1,this.investorTypes=K.yk,this.investmentLimit=L.Yc,this.verificationTypes=L.PU}ngOnDestroy(){super.ngOnDestroy()}ngOnInit(){super.ngOnInit(),this.data.investor&&(this.type=this.data.investor.name?K.yk.company:K.yk.individual,this.verificationType=this.isCompanyType?L.PU.representative:L.PU.investor,this.investor=this.data.investor,this.investor.full_name=`${this.data.investor.first_name} ${this.data.investor.last_name}`,this.data.verifyOnly&&this.data.investment.verification_info&&(this.data.investment.verification_info.verification_type===L.PU.investor?(this.investorEmail=this.data.investment.verification_info.verifier_email,this.verificationType=L.PU.investor):(this.repName=this.data.investment.verification_info.verifier_name,this.repEmail=this.data.investment.verification_info.verifier_email,this.verificationType=L.PU.representative))),this.cacheService.cache(G.$G.financingTypes,this.tagsApi.tags$(G.$G.financingTypes).pipe((0,Ct.f)())).subscribe({next:({results:f})=>this.financingTypes=f.filter(i=>"soft-money"!==i.slug),error:()=>{this.snackBarService.message(et.B.loadingData),this.cacheService.flush(G.$G.financingTypes)}})}clearSelection(){this.investor=null,this.userToOverwrite=null}get isCompanyType(){return this.type===K.yk.company}get isGovernmentType(){return this.type===K.yk.government}get isIndividualType(){return this.type===K.yk.individual}handleEmailAvailabilityAction({name:f,value:i}){"overwrite-user"===f&&(this.userToOverwrite=i)}get searchFieldLabel(){switch(this.type){case K.yk.company:return"Company name";case K.yk.government:return"Entity name";default:return"Name"}}selectInvestor(f){(!f||!("bubbles"in f))&&(this.investor=f)}toggleDisableTouchEvents(f){this.disableTouchEvents=f}triggerValidation(f){(0,rt.B)(f),this.validateInlineEntitySearch=!0}verify(f){var i,s;this.verifyLater=f,this.verifyPending=this.bottomSheetRef.disableClose=!0;const r=this.investor.fake&&this.userToOverwrite?this.userToOverwrite:this.investor,g=r.fake,D=r.is_onboarded,F={amount:this.financingAmou
1nt,investment_class:this.isIndividualType?"P":this.isCompanyType?"C":"G",film:this.data.project.id,stage:this.stage,type:{slug:this.financingType}};let O,it;if(this.isIndividualType||this.data.verifyOnly){if(this.verificationType===L.PU.investor?F.verification_info={verifier_name:r.full_name||`${r.first_name} ${r.last_name}`,verifier_email:this.investorEmail,verification_type:this.verificationType}:this.verificationType===L.PU.representative&&(F.verification_info={verifier_name:this.repName,verifier_email:this.repEmail,verification_type:this.verificationType}),g&&!this.data.verifyOnly){O={profile:{imdb_url:"",twitter_handle:""}};const tt=r.full_name||r.name;O.first_name=tt.substr(0,tt.indexOf(" ")),O.last_name=tt.substr(tt.indexOf(" ")+1),O.email=this.investorEmail}}else(this.isGovernmentType||this.isCompanyType)&&(F.website_url=(0,q.l)((this.websiteUrl||"").trim())),g&&(it={name:r.name,website_url:(0,q.l)((this.websiteUrl||"").trim())}),f||(F.verification_info={verifier_name:this.repName,verifier_email:this.repEmail,verification_type:L.PU.representative});if(g||(F.investor=r.url),F.verify_later=f,(f||D||this.isGovernmentType)&&Reflect.deleteProperty(F,"verification_info"),(null===(i=r.profile)||void 0===i?void 0:i.is_approved)&&r.profile.is_member&&Reflect.deleteProperty(F,"verification_info"),this.data.verifyOnly)return(null===(s=r.profile)||void 0===s?void 0:s.is_member)&&(F.verification_info=null),this.patchInvestment(F);this.canVerifyImmediately&&Reflect.deleteProperty(F,"verification_info"),this.addInvestment({role:F,user:O,company:it})}get canVerifyImmediately(){return this.isGovernmentType||["crowdfunding","grants","tax-incentives"].includes(this.financingType)}verifyNow(){this.canVerifyImmediately||this.investor.id&&(this.data.context.user_is_superuser&&this.investor.id===this.data.context.user_id||this.data.project.film_admins.includes(this.investor.id))?this.verify(!1):this.data.step=2}addInvestment({role:f,user:i,company:s}){i||s?i?this.createNonMemberUserInvestorRole(f,i):s&&this.createNonMemberCompanyInvestorRole(f,s):this.createInvestorRole(f)}createNonMemberUserInvestorRole(f,i){f.verify_later||2===this.data.step?this.createInvestorRole(f,f.verification_info&&f.verification_info.verification_type!==L.PU.representative?{newUser:i}:{tpvu:i}):this.data.step=2}createNonMemberCompanyInvestorRole(f,i){this.createInvestorRole(f,{newCompany:i})}createInvestorRole(f,i={}){this.actions$.pipe((0,Q.l4)(ut.$R),(0,k.t)(this),(0,W.h)(s=>!s.data.status.pending),(0,X.b)(s=>{this.pending=!1,s.data.status.error?(this.verifyPending=this.verifyLater=this.bottomSheetRef.disableClose=!1,this.snackBarService.message(s.data.status.error,{duration:7e3})):(L.Jd.includes(f.slug)&&this.projectPageSupportService.checkSimulationUpdates(this.data.project.id,null,!0),this.data.fetchInvestors(f),this.data.updateScore(),this.snackBarService.message("Investment added to the project."),this.bottomSheetRef.dismiss()),this.cdr.markForCheck()}),(0,R.q)(1)).subscribe(),this.pending=this.bottomSheetRef.disableClose=!0,i.tpvu?this.data.action({type:ut.MQ.type,data:{data:f,user:{ignore_existing_email:!0,profile:i.tpvu.profile,first_name:i.tpvu.first_name,last_name:i.tpvu.last_name}}}):i.newUser?this.data.action({type:ut.aL.type,data:{data:f,user:{ignore_existing_email:!0,email:i.newUser.email,profile:i.newUser.profile,first_name:i.newUser.first_name,last_name:i.newUser.last_name}}}):i.newCompany?this.companiesApi.createCompany(i.newCompany).subscribe({next:s=>this.data.action({type:ut.e2.type,data:{data:Object.assign(Object.assign({},f),{investor:s.url})}}),error:s=>{this.verifyPending=this.bottomSheetRef.disableClose=!1,this.errorHandler.handle(s,()=>{if(400===s.status){let r=[];return Object.keys(s.error).map(g=>r.push(s.error[g])),r=r.flat(1),r.length?r.join(" "):et.B.processing}return!1}),this.cdr.markForCheck()}}):this.data.action({type:ut.e2.type,data:{data:f}})}patchInvestment(f){return this.actions$.pipe((0,Q.l4)(ut.LJ),(0,k.t)(this),(0,W.h)(i=>!i.data.status.pending),(0,X.b)(i=>{i.data.status.error?(this.bottomSheetRef.disableClose=!1,this.snackBarService.message(i.data.status.error)):(this.snackBarService.message("Investment updated."),this.bottomSheetRef.dismiss()),this.pending=!1,this.cdr.markForCheck()}),(0,R.q)(1)).subscribe(),this.pending=this.bottomSheetRef.disableClose=!0,this.data.action({type:ut.VL.type,data:{fetchInvestors:!0,investment:this.data.investment,data:{verification_info:f.verification_info,verify_later:!1}}})}};oe.\u0275fac=function(f){return new(f||oe)(t.Y36(N.oL),t.Y36(N.OG),t.Y36(t.SBq),t.Y36(d.S$),t.Y36(t.R0b),t.Y36(Q.eX),t.Y36(ht.QM),t.Y36(t.sBO),t.Y36(G.zo),t.Y36(ht.qL),t.Y36(Rt.G),t.Y36(ht.cw),t.Y36(G.vO))}
1,oe.\u0275cmp=t.Xpm({type:oe,selectors:[["bottom-sheet-add-investor"]],features:[t.qOj],decls:6,vars:6,consts:[[1,"container"],["title","Add Investor",3,"disableClose","ref"],["class","user-header sl8d-hide-gt-xs sl8d-flex sl8d-justify-content-space-between sl8d-align-items-end",4,"ngIf"],["class","sl8d-body-2 sl8d-margin-bottom-xs-xs sl8d-padding-bottom sl8d-margin-bottom-l-gt-xs",4,"ngIf"],["class","sl8d-relative",4,"ngIf"],[4,"ngIf"],[1,"user-header","sl8d-hide-gt-xs","sl8d-flex","sl8d-justify-content-space-between","sl8d-align-items-end"],[1,"sl8d-subtitle-1"],["scoreSize","medium",1,"entity-avatar","_step-2","_medium",3,"url","isRound","score","isGovernment","image"],[1,"sl8d-body-2","sl8d-margin-bottom-xs-xs","sl8d-padding-bottom","sl8d-margin-bottom-l-gt-xs"],[1,"sl8d-medium"],[1,"sl8d-relative"],[1,"sl8d-margin-bottom-xxxl","sl8d-caption","notes"],[1,"sl8d-margin-bottom-xxs"],[1,"sl8d-flex","sl8d-align-items-start"],["class","entity-avatar sl8d-hide-gt-xs _medium","scoreSize","medium",3,"url","isRound","score","isGovernment","image",4,"ngIf"],["investorForm","ngForm"],["hideRequiredMarker","","appearance","outline","floatLabel","always",1,"sl8d-full-width"],["name","investorType","required","",3,"disabled","ngModel","openedChange","selectionChange","ngModelChange"],["typeFieldRef","ngModel"],[3,"value"],["className","sl8d-margin-top-l",3,"resetIfChanged","type","label","validate","disable","resetOnChange","projectId","required","focusChanged","intercom","selection"],["appearance","outline","floatLabel","always","class","sl8d-full-width sl8d-margin-top-l _website",4,"ngIf"],[1,"col-wrap","sl8d-gap-xs","sl8d-flex","sl8d-flex-column-xs"],["hideRequiredMarker","","appearance","outline","floatLabel","always",1,"sl8d-margin-top-l","sl8d-flex-basis-100p-xs"],["name","financingType","required","",3,"disabled","ngModel","ngModelChange"],["financingTypeField","ngModel"],[3,"value",4,"ngFor","ngForOf"],["hideRequiredMarker","","appearance","outline","floatLabel","always",1,"sl8d-margin-top-sm","sl8d-margin-top-l-gt-xs","sl8d-flex-basis-100p-xs"],["name","amount","matInput","","required","","currencyMask","","min","1",3,"disabled","options","max","ngModel","ngModelChange"],["amountField","ngModel"],["hideRequiredMarker","","appearance","outline","floatLabel","always",1,"sl8d-full-width","sl8d-margin-top-l"],["name","stage","required","",3,"disabled","ngModel","openedChange","ngModelChange"],["stageSelectRef","ngModel"],["value","P"],["value","B"],["class","entity-column sl8d-hide-xs sl8d-flex sl8d-flex-shrink-0 sl8d-align-items-center",4,"ngIf"],[1,"sl8d-padding-top-xl","sl8d-flex","sl8d-justify-content-end"],["class","sl8d-padding-right-xxs sl8d-flex-basis-50p-xs",4,"ngIf","ngIfElse"],["verifyLaterBtnTmpl",""],[1,"sl8d-padding-left-xxs","sl8d-flex-basis-50p-xs"],["mat-flat-button","","color","accent",1,"sl8d-full-width",3,"disabled","click"],[1,"sl8d-flex","sl8d-align-items-center","sl8d-justify-content-center"],["color","steel","class","sl8d-margin-right-xs","diameter","20",4,"ngIf"],["class","sl8d-invisible-button","type","button","aria-label","Click here to validate form",3,"click",4,"ngIf"],["scoreSize","medium",1,"entity-avatar","sl8d-hide-gt-xs","_medium",3,"url","isRound","score","isGovernment","image"],["appearance","outline","floatLabel","always",1,"sl8d-full-width","sl8d-margin-top-l","_website"],["matInput","","name","website","type","url","maxlength","100",3,"ngModel","disabled","pattern","ngModelChange"],["websiteFieldRef","ngModel"],[1,"entity-column","sl8d-hide-xs","sl8d-flex","sl8d-flex-shrink-0","sl8d-align-items-center"],["scoreSize","medium",1,"_medium",3,"url","isRound","score","isGovernment","image"],[1,"sl8d-padding-left-l","info-column"],[1,"sl8d-margin-bottom-xs","sl8d-subtitle-1","sl8d-truncate-wrap"],[1,"sl8d-body-1","sl8d-truncate"],[1,"sl8d-padding-right-xxs","sl8d-flex-basis-50p-xs"],["mat-button","","disableRipple","",1,"sl8d-base-link-btn","sl8d-full-width-xs",3,"disabled","click"],["mat-button","",1,"sl8d-flat","sl8d-full-width",3,"disabled","click"],["color","steel","diameter","20",1,"sl8d-margin-right-xs"],["type","button","aria-label","Click here to validate form",1,"sl8d-invisible-button",3,"click"],["teamInvestorsVerifyForm","ngForm"],["class","sl8d-subtitle-2 sl8d-margin-top-xs-negative sl8d-margin-bottom-sm-xs",4,"ngIf"],[1,"sl8d-hide-xs"],[1,"sl8d-subtitle-2","sl8d-margin-top-xs-negative","sl8d-margin-bottom-sm-xs"],[1,"sl8d-subtitle-2","sl8d-margin-bottom-xl","sl8d-margin-top-xs-negative","sl8d-padding-top-xs-xs"],["name","verificationType","class","sl8d-margin-negative sl8d-padding sl8d-no-padding-right sl8d-full-width sl8d-flex sl8d-flex-column","required","",3,"ngModel","disabled","ngModelChange",4,"ngIf","ngIfElse"],["representativeTmpl",""],["name","verificationType","required","",1,"sl8d-margin-negative","sl8d-padding","sl8d-no-padding-right","sl8d-full-width","sl8d-flex","sl8d-flex-column",3,"ngModel","disabled","ngModelChange"],[1,"sl8d-margin-bottom-xxs",3,"value"],["appearance","outline","floatLabel","always","hideRequiredMarker","","class","sl8d-margin-top-l sl8d-full-width sl8d-padding-left-xxl sl8d-margin-bottom-xxs",4,"ngIf"],["appearance","outline","floatLabel","always","hideRequiredMarker","",1,"sl8d-margin-top-l","sl8d-full-width","sl8d-padding-left-xxl","sl8d-margin-bottom-xxs"],["name","email","matInput","","email","","type","email","required","","emailAvailability","","minlength","6","maxlength","254",3,"disabled","ngModel","ignoreUser","pattern","ngModelChange","action"],["emailField","ngModel"],[4,"ngTemplateOutlet"],["appearance","outline","floatLabel","always","hideRequiredMarker","",1,"sl8d-margin-top-l","sl8d-full-width","sl8d-margin-bottom-xxs"],["name","repName","matInput","","fullName","","required","",3,"disabled","ngModel","ngModelChange"],["repNameField","ngModel"],[4,"ngIf","ngIfElse"],["defaultErrorTmpl",""],["appearance","outline","floatLabel","always","hideRequiredMarker","",1,"sl8d-margin-top","sl8d-full-width"],["name","repEmail","matInput","","email","","type","email","required","","minlength","6","maxlength","254",3,"disabled","ngModel","pattern","ngModelChange"],["repEmailField","ngModel"]],template:function(f,i){1&f&&(t.TgZ(0,"div",0),t._UZ(1,"bottom-sheet-header",1),t.YNc(2,Et,4,6,"div",2),t.YNc(3,re,4,0,"p",3),t.YNc(4,le,63,40,"div",4),t.YNc(5,$e,22,7,"div",5),t.qZA()),2&f&&(t.xp6(1),t.Q6J("disableClose",i.bottomSheetRef.disableClose)("ref",i.bottomSheetRef),t.xp6(1),t.Q6J("ngIf",i.investor&&2===i.data.step),t.xp6(1),t.Q6J("ngIf",2===i.data.step),t.xp6(1),t.Q6J("ngIf",1===i.data.step),t.xp6(1),t.Q6J("ngIf",2===i.data.step))},directives:[$t._,d.O5,kt.A,It._Y,It.JL,It.F,Ht.KE,Ht.hX,ie.gD,It.Q7,It.JJ,It.On,e.ey,Ht.TO,Dt.h$,T.Nt,It.Fj,It.nD,It.c5,d.sg,b.g1,ot.K,Jt.m,Ht.bx,H.lW,B.Ou,Z.VQ,Z.U0,It.on,Pt.r,It.wO,d.tP,Tt.Q],styles:["form[_ngcontent-%COMP%]{width:100%;max-width:400px}.entity-column[_ngcontent-%COMP%]{padding-left:76px;margin-top:-12px;max-width:560px}.info-column[_ngcontent-%COMP%]{max-width:calc(100% - 80px)}mat-radio-group[_ngcontent-%COMP%]{padding-top:0}@media (max-width: 959px){form[_ngcontent-%COMP%]{max-width:320px}.entity-column[_ngcontent-%COMP%]{max-width:calc(100vw - 360px);padding-left:28px}}@media (min-width: 600px){.col-wrap[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{max-width:calc(50% - 4px)}}@media (max-width: 599px){form[_ngcontent-%COMP%]{max-width:400px}
1.entity-avatar[_ngcontent-%COMP%]{position:absolute;right:28px;top:-38px}.entity-avatar._step-2[_ngcontent-%COMP%]{position:relative;top:12px;margin-top:-58px}.user-header[_ngcontent-%COMP%]{margin-bottom:22px}.notes._selected[_ngcontent-%COMP%]{padding-top:48px}}@media (max-width: 330px){[_nghost-%COMP%] ._website.mat-form-field-appearance-outline[_ngcontent-%COMP%] .mat-form-field-label-wrapper{overflow:visible}}"],changeDetection:0}),oe=function(C,f,i,s){var D,r=arguments.length,g=r<3?f:null===s?s=Object.getOwnPropertyDescriptor(f,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(C,f,i,s);else for(var F=C.length-1;F>=0;F--)(D=C[F])&&(g=(r<3?D(g):r>3?D(f,i,g):D(f,i))||g);return r>3&&g&&Object.defineProperty(f,i,g),g}([(0,k.c)(),function(C,f){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata("design:paramtypes",f)}(0,[N.oL,Object,t.SBq,d.S$,t.R0b,Q.eX,ht.QM,t.sBO,G.zo,ht.qL,Rt.G,ht.cw,G.vO])],oe)},53040:(Nt,gt,n)=>{n.d(gt,{Y:()=>q});var d=n(69808),t=n(93075),N=n(47423),k=n(90508),Q=n(67322),W=n(98833),X=n(20773),R=n(79814),G=n(74107),V=n(65835),K=n(50703),L=n(93368),mt=n(41467),et=n(5e3);let q=(()=>{class rt{}return rt.\u0275fac=function(ht){return new(ht||rt)},rt.\u0275mod=et.oAB({type:rt}),rt.\u0275inj=et.cJS({imports:[[K.Y,d.ez,V.zh,t.u5,L.b,N.ot,Q.lN,W.c,k.Ng,R.Fk,G.LD,X.Cq,mt.E$]]}),rt})()},49962:(Nt,gt,n)=>{n.r(gt),n.d(gt,{FilmsModule:()=>vn});var d=n(69808),t=n(67399),N=n(47423),k=n(90508),Q=n(86856),W=n(48966),X=n(4834),R=n(25245),G=n(14623),V=n(92181),K=n(74107),L=n(2638),mt=n(32368),et=n(1402),q=n(32119),rt=n(62904),Ct=n(95776),ht=n(50703),Rt=n(41467),ut=n(83476),$t=n(42947),kt=n(45237),It=n(6333),Ht=n(15790),ie=n(95113),e=n(5e3),Dt=n(44987),T=n(26991),b=n(65620),ot=n(63900),Jt=n(48382),H=n(39646),B=n(34782),Z=n(54004),Pt=n(94086),Tt=n(95698),j=n(18505),dt=n(11365),Et=n(75853),re=n(91192),Bt=n(53092),Lt=n(54525),Qt=n(1982),I=n(64416),st=n(29071),nt=n(93075),z=n(77446),ct=n(81125),yt=n(98833),jt=n(20773),Ft=n(79814),se=n(53251),Se=n(87238),ye=n(93368),ge=n(49880),Oe=n(51530),me=n(54024);let fe=(()=>{class a{}return a.\u0275fac=function(l){return new(l||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[[ht.Y,d.ez,$t._,nt.u5,ut.x,t._r,N.ot,X.t,W.Is,R.Ps,yt.c,Ft.Fk,z.p9,ct.To,mt.rP,jt.Cq,se.Nh,Se.AV,ye.b,ge.h,Oe.w,Rt.E$,nt.UX,et.Bz,me.td,st.Cl]]}),a})();var le=n(41215),je=n(18303),Ee=n(24877),Ce=n(45227);function Fe(a,u){if(1&a){const l=e.EpF();e.TgZ(0,"sl-financing-widget",10),e.NdJ("action",function(v){return e.CHM(l),e.oxw(2).handleFinancingWidgetAction(v)}),e.ALo(1,"async"),e.ALo(2,"async"),e.ALo(3,"async"),e.ALo(4,"async"),e.qZA()}if(2&a){const l=u.ngIf,_=e.oxw(2);e.Q6J("statuses",e.lcZ(1,5,_.statuses$))("context",e.lcZ(2,7,_.context$))("project",l)("budget",e.lcZ(3,9,_.budget$))("view",e.lcZ(4,11,_.view$))}}function we(a,u){if(1&a){const l=e.EpF();e.TgZ(0,"sl-base-layout-subpage",1),e.NdJ("scroll",function(v){return e.CHM(l),e.oxw().stateService.pageScrolled(v.target,!0)}),e.TgZ(1,"div",2)(2,"div",3)(3,"button",4),e.NdJ("click",function(){return e.CHM(l),e.oxw().back()}),e.TgZ(4,"mat-icon"),e._uU(5,"arrow_back"),e.qZA()(),e.TgZ(6,"h3",5),e.NdJ("click",function(){return e.CHM(l),e.oxw().back()}),e._uU(7),e.ALo(8,"async"),e.qZA()()(),e.TgZ(9,"div",6)(10,"div",7),e.YNc(11,Fe,5,13,"sl-financing-widget",8),e.ALo(12,"async"),e.qZA()(),e._UZ(13,"sl-footer",9),e.qZA()}if(2&a){const l=u.ngIf,_=e.oxw();let v;e.xp6(7),e.Oqu(null==(v=e.lcZ(8,4,_.project$))?null:v.name),e.xp6(4),e.Q6J("ngIf",e.lcZ(12,6,_.project$)),e.xp6(2),e.Q6J("memberid",l.user_id)("authenticated",!0)}}let Te=(()=>{class a{constructor(l,_,v){this.projectPageSupportService=l,this.financingWidgetService=_,this.stateService=v,this.project$=this.financingWidgetService.project$,this.context$=this.financingWidgetService.context$,this.view$=this.financingWidgetService.view$,this.budget$=this.financingWidgetService.budget$,this.statuses$=this.financingWidgetService.statuses$}ngOnDestroy(){this.projectPageSupportService.subpages.financing.close()}back(){this.projectPageSupportService.subpages.financing.close()}handleFinancingWidgetAction(l){this.financingWidgetService.handle(l)}}return a.\u0275fac=function(l){return new(l||a)(e.Y36(I.G),e.Y36(me.RE),e.Y36(le.b))},a.\u0275cmp=e.Xpm({type:a,selectors:[["ng-component"]],decls:2,vars:3,consts:[["cdkScrollable","",3,"scroll",4,"ngIf"],["cdkScrollable","",3,"scroll"],["header","",1,"sl8d-header-secondary","sl8d-flex","sl8d-align-items-center"],[1,"container","sl8d-flex","sl8d-align-items-center"],["type","button","mat-icon-button","",1,"sl8d-margin-left-xs-negative",3,"click"],[1,"sl8d-cursor-pointer","sl8d-margin-left-sm","sl8d-truncate",3,"click"],["content","",1,"project-page","sl8d-bg"],[1,"container"],[3,"statuses","context","project","budget","view","action",4,"ngIf"],["footer","","id","siteFooter","slFooter","",1,"footer",3,"memberid","authenticated"],[3,"statuses","context","project","budget","view","action"]],template:function(l,_){1&l&&(e.YNc(0,we,14,8,"sl-base-layout-subpage",0),e.ALo(1,"async")),2&l&&e.Q6J("ngIf",e.lcZ(1,1,_.context$))},directives:[d.O5,je.h,st.PQ,N.lW,R.Hw,Ee.E,Ce.c],pipes:[d.Ov],styles:[".check[_ngcontent-%COMP%]{position:relative;margin-right:5px;top:-4px}.chevron-right[_ngcontent-%COMP%]{transform:scale(1.6);margin-left:4px;color:#218eb7}"],changeDetection:0}),a})();var Wt=n(30896),ve=n(46784),Ue=n(26524),Me=n(76725),Ae=n(85746),Ie=n(17400),Ze=n(13749),Gt
1=n(83829);function he(a,u){1&a&&(e.TgZ(0,"div",16)(1,"mat-icon"),e._uU(2,"add"),e.qZA()())}function Re(a,u){1&a&&(e.TgZ(0,"div",5)(1,"mat-icon"),e._uU(2,"check"),e.qZA()())}function De(a,u){1&a&&(e.TgZ(0,"div",16)(1,"mat-icon"),e._uU(2,"power_settings_new"),e.qZA()())}function Be(a,u){1&a&&(e.TgZ(0,"div",5)(1,"mat-icon"),e._uU(2,"check"),e.qZA()())}function $e(a,u){if(1&a){const l=e.EpF();e.TgZ(0,"button",17),e.NdJ("click",function(){return e.CHM(l),e.oxw(2).projectPageSupportService.subpages.projectSettings.open()}),e.TgZ(1,"div",16)(2,"mat-icon"),e._uU(3,"settings"),e.qZA()(),e.TgZ(4,"div",6),e._uU(5,"Set Visibility To\xa0Start Matching"),e.qZA()()}}function oe(a,u){1&a&&(e.TgZ(0,"div",21)(1,"mat-icon"),e._uU(2,"lock"),e.qZA()())}function C(a,u){1&a&&(e.TgZ(0,"div",16)(1,"mat-icon"),e._uU(2,"wifi_tethering"),e.qZA()())}const f=function(a){return{project:a}};function i(a,u){if(1&a&&(e.TgZ(0,"a",19),e.YNc(1,oe,3,0,"div",20),e.YNc(2,C,3,0,"div",8),e.TgZ(3,"div",6),e._uU(4," Match with Talent, Crew\xa0&\xa0Investors "),e.qZA()()),2&a){const l=u.ngIf,_=e.oxw(3);e.ekj("sl8d-pointer-none",l.disabledUI),e.Q6J("queryParams",e.VKq(7,f,_.project.id)),e.xp6(1),e.Q6J("ngIf",l.disabledUI),e.xp6(1),e.Q6J("ngIf",!l.disabledUI),e.xp6(1),e.ekj("promo-widget__step-title--disabled",l.disabledUI)}}const s=function(a){return{disabledUI:a}};function r(a,u){if(1&a&&e.YNc(0,i,5,9,"a",18),2&a){const l=e.oxw().ngIf,_=e.oxw();e.Q6J("ngIf",e.VKq(1,s,!l.isOpportunitiesExist||!_.project.profile.has_active_subscription&&!_.project.profile.has_deactivated_subscription))}}function g(a,u){if(1&a&&(e.TgZ(0,"div")(1,"h3"),e._uU(2,"What does your project\xa0need?"),e.qZA(),e.TgZ(3,"p",22),e._uU(4," Get started by creating opportunities for the key roles you need to fill, including investors. "),e.qZA(),e.TgZ(5,"a",23),e._uU(6,"Create Opportunities"),e.qZA()()),2&a){const l=e.oxw(2);e.xp6(5),e.MGl("routerLink","/films/",l.project.id,"/opportunities")}}function D(a,u){if(1&a){const l=e.EpF();e.TgZ(0,"div")(1,"h3"),e._uU(2,"Time to start the engines!"),e.qZA(),e.TgZ(3,"p",22),e._uU(4," Now that you\u2019ve created opportunities, connect with thousands of industry professionals. "),e.qZA(),e.TgZ(5,"button",24),e.NdJ("click",function(){return e.CHM(l),e.oxw(2).openSubscriptionDialog()}),e._uU(6,"Activate Now"),e.qZA()()}}function F(a,u){if(1&a&&(e.TgZ(0,"div")(1,"h3"),e._uU(2,"Want better matches?"),e.qZA(),e.TgZ(3,"p",22),e._uU(4," Projects with high Script & Financial Scores get 10x the introductions and attract the highest scoring professionals. "),e.qZA(),e.TgZ(5,"a",25),e._uU(6,"Get Analysis"),e.qZA()()),2&a){const l=e.oxw(2);e.xp6(5),e.MGl("routerLink","/analysis/",l.project.id,"")}}function O(a,u){if(1&a){const l=e.EpF();e.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"mat-icon"),e._uU(6,"check"),e.qZA()(),e.TgZ(7,"div",6),e._uU(8,"Create Project"),e.qZA()(),e.TgZ(9,"a",7),e.YNc(10,he,3,0,"div",8),e.YNc(11,Re,3,0,"div",9),e.TgZ(12,"div",6),e._uU(13,"Create Opportunities"),e.qZA()(),e.TgZ(14,"button",10),e.NdJ("click",function(){return e.CHM(l),e.oxw().openSubscriptionDialog()}),e.YNc(15,De,3,0,"div",8),e.YNc(16,Be,3,0,"div",9),e.TgZ(17,"div",6),e._uU(18,"Activate Project"),e.qZA()(),e.YNc(19,$e,6,0,"button",11),e.YNc(20,r,1,3,"ng-template",null,12,e.W1O),e.TgZ(22,"a",13),e._uU(23,"Learn more about the listing process"),e.qZA()(),e.TgZ(24,"div",14),e.YNc(25,g,7,1,"div",15),e.YNc(26,D,7,0,"div",15),e.YNc(27,F,7,1,"div",15),e.qZA()()()}if(2&a){const l=u.ngIf,_=e.MAs(21),v=e.oxw();e.xp6(9),e.ekj("promo-widget__step--active",l.isOpportunitiesExist),e.MGl("routerLink","/films/",v.project.id,"/opportunities"),e.xp6(1),e.Q6J("ngIf",!l.isOpportunitiesExist),e.xp6(1),e.Q6J("ngIf",l.isOpportunitiesExist),e.xp6(3),e.ekj("promo-widget__step--active",v.project.profile.has_active_subscription||v.project.profile.has_deactivated_subscription),e.Q6J("disabled",v.project.profile.has_active_subscription||v.project.profile.has_deactivated_subscription),e.xp6(1),e.Q6J("ngIf",!v.project.profile.has_active_subscription&&!v.project.profile.has_deactivated_subscription),e.xp6(1),e.Q6J("ngIf",v.project.profile.has_active_subscription||v.project.profile.has_deactivated_subscription),e.xp6(3),e.Q6J("ngIf",(v.project.profile.has_active_subscription||v.project.profile.has_deactivated_subscription)&&v.project.profile.privacy===v.projectVisibility.hidden)("ngIfElse",_),e.xp6(6),e.Q6J("ngIf",!l.isOpportunitiesExist),e.xp6(1),e.Q6J("ngIf",!v.project.profile.has_active_subscription&&!v.project.profile.has_deactivated_subscription&&l.isOpportunitiesExist),e.xp6(1),e.Q6J("ngIf",(v.project.profile.has_active_subscription||v.project.profile.has_deactivated_subscription)&&l.isOpportunitiesExist)}}const it=function(a){return{isOpportunitiesExist:a}};let tt=(()=>{class a{constructor(l,_,v){this.projectProfileService=l,this.projectPageSupportService=_,this.store=v,this.opportunityGroups=Ie.W,this.project
1Visibility=Ae.P8,this.isOpportunitiesExist$=this.store.pipe((0,b.Ys)(Gt.Yi),(0,Pt.g)(0),(0,Z.U)(w=>this.opportunityGroups.some(lt=>w[lt.type.toUpperCase()])))}openSubscriptionDialog(){this.projectProfileService.openActivateProjectDialog()}}return a.\u0275fac=function(l){return new(l||a)(e.Y36(Ze.A),e.Y36(I.G),e.Y36(b.yh))},a.\u0275cmp=e.Xpm({type:a,selectors:[["project-promo-widget"]],inputs:{project:"project"},decls:2,vars:5,consts:[["class","promo-widget",4,"ngIf"],[1,"promo-widget"],[1,"promo-widget__container"],[1,"promo-widget__west"],[1,"promo-widget__step","promo-widget__step--active"],[1,"promo-widget__step-icon","promo-widget__step-icon--check"],[1,"promo-widget__step-title"],["fragment","filmTabs",1,"promo-widget__step","sl8d-decoration-none",3,"routerLink"],["class","promo-widget__step-icon",4,"ngIf"],["class","promo-widget__step-icon promo-widget__step-icon--check",4,"ngIf"],[1,"promo-widget__step",3,"disabled","click"],["class","promo-widget__step sl8d-decoration-none",3,"click",4,"ngIf","ngIfElse"],["matchingBtnTemplate",""],["href","https://get.slated.com/filmmakers","target","_blank",1,"promo-widget__get-started","sl8d-underline","sl8d-medium"],[1,"promo-widget__east"],[4,"ngIf"],[1,"promo-widget__step-icon"],[1,"promo-widget__step","sl8d-decoration-none",3,"click"],["routerLink","/n/opportunity-matches/","class","promo-widget__step sl8d-decoration-none",3,"queryParams","sl8d-pointer-none",4,"ngIf"],["routerLink","/n/opportunity-matches/",1,"promo-widget__step","sl8d-decoration-none",3,"queryParams"],["class","promo-widget__step-icon promo-widget__step-icon--disabled",4,"ngIf"],[1,"promo-widget__step-icon","promo-widget__step-icon--disabled"],[1,"sl8d-margin-top-xxs","sl8d-margin-bottom-xs"],["mat-flat-button","","color","accent","fragment","filmTabs",1,"_gradient",3,"routerLink"],["mat-flat-button","","color","accent",1,"_gradient",3,"click"],["mat-flat-button","","color","accent",1,"_gradient",3,"routerLink"]],template:function(l,_){1&l&&(e.YNc(0,O,28,15,"div",0),e.ALo(1,"async")),2&l&&e.Q6J("ngIf",e.VKq(3,it,e.lcZ(1,1,_.isOpportunitiesExist$)))},directives:[d.O5,R.Hw,et.yS,N.zs,N.lW],pipes:[d.Ov],styles:['[_nghost-%COMP%]{position:relative;z-index:1}.promo-widget[_ngcontent-%COMP%]{background:#202D3B;color:#fff;padding:30px 0}@media (max-width: 819px){.promo-widget[_ngcontent-%COMP%]{padding:30px 0 60px}}.promo-widget__get-started[_ngcontent-%COMP%]{position:absolute;left:-21px;bottom:-58px;white-space:nowrap}@media (max-width: 819px){.promo-widget__get-started[_ngcontent-%COMP%]{left:0;bottom:-40px}}.promo-widget__get-started[_ngcontent-%COMP%]:hover, .promo-widget__get-started[_ngcontent-%COMP%]:focus{color:#218eb7;text-decoration:none}.promo-widget[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-weight:700}@media (min-width: 820px){.promo-widget[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:20px}}.promo-widget[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:10px;font-weight:500;color:#ccc}.promo-widget__east[_ngcontent-%COMP%]{max-width:min(100vw - 190px,270px)}.promo-widget__container[_ngcontent-%COMP%]{max-width:1024px;margin:0 auto;padding:0 20px;display:flex;align-items:center;justify-content:space-between}@media (max-width: 599px){.promo-widget__container[_ngcontent-%COMP%]{padding:0 10px}}.promo-widget__west[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;text-align:center;width:100%;max-width:min(100vw - 415px,585px);margin-left:32px;margin-top:-24px;position:relative}@media (max-width: 819px){.promo-widget__west[_ngcontent-%COMP%]{margin-top:-12px;width:auto;flex-direction:column;gap:16px;margin-left:7px}}@media (min-width: 820px){.promo-widget__west[_ngcontent-%COMP%]:before{content:"";height:2px;top:calc(50% - 1px);left:10px;right:10px;background:#eee;position:absolute}}.promo-widget__step[_ngcontent-%COMP%]{position:relative}.promo-widget__step[disabled][_ngcontent-%COMP%]{cursor:default}@media (max-width: 819px){.promo-widget__step[_ngcontent-%COMP%]{border:none;border-radius:0;aspect-ratio:auto;justify-content:flex-end;flex-direction:row-reverse;text-align:left;padding:0;font-size:12px;line-height:14px;font-weight:700;width:100%;gap:8px}}.promo-widget__step[_ngcontent-%COMP%]:not(:has(.promo-widget__step-icon--check)):hover .promo-widget__step-icon[_ngcontent-%COMP%]{transform:scale(1.12)}.promo-widget__step-title[_ngcontent-%COMP%]{font-size:12px;line-height:14px;font-weight:700;width:132px;position:absolute;
1left:50%;top:calc(100% + 8px);color:#fff;transform:translate(-50%)}.promo-widget__step-title--disabled[_ngcontent-%COMP%]{color:#888}@media (max-width: 819px){.promo-widget__step-title[_ngcontent-%COMP%]{left:24px;top:2px;transform:none}}.promo-widget__step-icon[_ngcontent-%COMP%]{width:36px;aspect-ratio:1;background:#218EB7;color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:transform .2s ease-out}.promo-widget__step-icon--check[_ngcontent-%COMP%]{color:#64b695;background:#fff}.promo-widget__step-icon--disabled[_ngcontent-%COMP%]{background:#888;color:#ccc}@media (max-width: 819px){.promo-widget__step-icon[_ngcontent-%COMP%]{width:18px;height:18px}.promo-widget__step-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transform:scale(.5)}}@media (max-width: 640px){._gradient[_ngcontent-%COMP%]{line-height:21px;padding:4px 12px;font-size:12px;border-radius:15px}}'],changeDetection:0}),a})();var _t=n(67631),pt=n(8022),Mt=n(53434),ee=n(11381),ue=n(13414),vt=n(50905),At=n(32781),Xt=function(a,u,l,_){return new(l||(l=Promise))(function(w,lt){function bt(te){try{Zt(_.next(te))}catch(h){lt(h)}}function Ut(te){try{Zt(_.throw(te))}catch(h){lt(h)}}function Zt(te){te.done?w(te.value):function v(w){return w instanceof l?w:new l(function(lt){lt(w)})}(te.value).then(bt,Ut)}Zt((_=_.apply(a,u||[])).next())})};function _e(a,u){if(1&a){const l=e.EpF();e.TgZ(0,"site-banners",13),e.NdJ("action",function(v){return e.CHM(l),e.oxw(2).handleAction(v)}),e.qZA()}if(2&a){const l=u.ngIf;e.Q6J("memberHasInactiveEmail",l.user_has_inactive_email)("memberId",l.user_id)("email",l.user_email)("verified",l.has_verified_email)}}function We(a,u){if(1&a&&e._UZ(0,"project-promo-widget",15),2&a){const l=e.oxw().ngIf;e.Q6J("project",l)}}function Ye(a,u){if(1&a&&(e.ynx(0),e.YNc(1,We,1,1,"project-promo-widget",14),e.ALo(2,"find"),e.BQk()),2&a){const l=u.ngIf,_=e.oxw().ngIf;e.xp6(1),e.Q6J("ngIf","released"!==l.stage.slug&&(!l.has_purchased_analysis||!l.profile.had_subscription&&!l.profile.has_active_subscription&&!l.profile.has_deactivated_subscription)&&l.profile.onboarded&&e.Dn7(2,1,_.context.user_admin_films,"id",l.id))}}function Le(a,u){1&a&&(e.TgZ(0,"div",23),e._uU(1,"Generated to showcase Slated Analytics\u2019 services and predictive accuracy."),e.qZA())}function Ne(a,u){1&a&&(e.TgZ(0,"sl-promotion",17)(1,"div",18),e._uU(2,"Sample Project"),e.qZA(),e.YNc(3,Le,2,0,"ng-template",null,19,e.W1O),e.TgZ(5,"div",20)(6,"a",21),e._uU(7,"Learn More"),e.qZA(),e.TgZ(8,"a",22),e._uU(9,"Get Analysis"),e.qZA()()())}function Je(a,u){if(1&a&&(e.ynx(0),e._uU(1),e.ALo(2,"lowercase"),e.ALo(3,"rank"),e.BQk()),2&a){const l=e.oxw(2).$implicit,_=e.oxw(3).ngIf;e.xp6(1),e.lnq("Please verify your ",e.lcZ(2,3,l.role_name)," investment of $",e.lcZ(3,5,l.amount)," in ",_.name,"")}}function Qe(a,u){if(1&a&&e._uU(0),2&a){const l=e.oxw(2).$implicit,_=e.oxw(3).ngIf;e.AsE("Please verify your role as ",l.role_name," on ",_.name,"")}}function Kt(a,u){if(1&a&&(e.TgZ(0,"sl-promotion",26)(1,"div",27),e.YNc(2,Je,4,7,"ng-container",28),e.YNc(3,Qe,1,2,"ng-template",null,29,e.W1O),e.qZA(),e.TgZ(5,"div",30)(6,"a",31),e._uU(7,"Confirm"),e.qZA(),e.TgZ(8,"a",32),e._uU(9,"Deny"),e.qZA()()()),2&a){const l=e.MAs(4),_=e.oxw().$implicit;e.xp6(2),e.Q6J("ngIf",_.investment)("ngIfElse",l),e.xp6(4),e.Q6J("href",_.confirm_url,e.LSH),e.xp6(2),e.Q6J("href",_.deny_url,e.LSH)}}function ae(a,u){if(1&a&&(e.ynx(0),e.YNc(1,Kt,10,4,"sl-promotion",25),e.BQk()),2&a){const l=u.$implicit;e.xp6(1),e.Q6J("ngIf",l.added_by_filmmaker)}}function Ve(a,u){if(1&a&&(e.ynx(0),e.YNc(1,ae,2,1,"ng-container",24),e.BQk()),2&a){const l=e.oxw().ngIf;e.xp6(1),e.Q6J("ngForOf",l.unverified_roles)}}function ke(a,u){if(1&a&&(e.ynx(0),e.YNc(1,Ve,2,1,"ng-container",0),e.ALo(2,"async"),e.BQk()),2&a){const l=u.ngIf,_=e.oxw(3);e.xp6(1),e.Q6J("ngIf",l.unverified_roles.length&&(!l.can_edit||"self"===e.lcZ(2,1,_.viewName$)))}}function He(a,u){if(1&a&&(e.ynx(0),e.YNc(1,Ne,10,0,"sl-promotion",16),e.YNc(2,ke,3,3,"ng-container",0),e.ALo(3,"async"),e.BQk()),2&a){const l=u.ngIf,_=e.oxw(2);e.xp6(1),e.Q6J("ngIf",l.profile.film_type===_.projectTypes.marketing),e.xp6(1),e.Q6J("ngIf",e.lcZ(3,2,_.view$))}}function Xe(a,u){if(1&a){const l=e.EpF();e.TgZ(0,"super-admin-toggle",34),e.NdJ("toggle",function(v){return e.CHM(l),e.oxw(3).toggleSuperAdminView(v)}),e.ALo(1,"async"),e.qZA()}if(2&a){const l=e.oxw(3);e.Q6J("state",e.lcZ(1,1,l.superAdminViewService.superAdminView$))}}function ze(a,u){if(1&a&&(e.ynx(0),e.YNc(1,Xe,2,3,"super-admin-toggle",33),e.BQk()),2&a){const l=u.ngIf,_=e.oxw().ngIf;e.xp6(1),e.Q6J("ngIf",(null==_.context?null:_.context.user_is_superuser)&&l.profile.onboarded)}}function qe(a,u){if(1&a){const l=e.EpF();e.ynx(0),e.TgZ(1,"sl-base-layout",1),e.YNc(2,_e,1,4,"site-banners",2),e._UZ(3,"sl-footer",3),e.TgZ(4,"div",4),e.YNc(5,Ye,3,5,"ng-container",0),e.ALo(6,"async"),e.YNc(7,He,4,4,"ng-container",0),e.ALo(8,"async"),e.TgZ(9,"div",5),e._UZ(10,"router-outlet"),e.qZA()()(),e.YNc(11,ze,2,1,"ng-container",0),e.ALo(12,"async"),e.TgZ(13,"div",6),e.NdJ("click",function(){e.CHM(l);const v=e.MAs(15),w=e.MAs(18);return v.close(),w.close()}),e.qZA(),e.TgZ(14,"mat-drawer",7,8),e.NdJ("ngAfterInit",function(){e.CHM(l);const v=e.MAs(15);return e.oxw().stateService.drawer=v}),e.TgZ(16,"sl-menu",9),e.NdJ("action",function(v){return e.CHM(l),e.oxw().handleAction(v)})("toggleDrawer",function(){return e.CHM(l),e.MAs(15).toggle()}),e.qZA()(),e.TgZ(17,"mat-drawer",10,11),e.NdJ("ngAfterInit",function(){e.CHM(l);const v=e.MAs(18);return e.oxw().stateService.menu=v}),e.TgZ(19,"sl-mobile-menu",12),e.NdJ("toggleMenu",function(){return e.CHM(l),e.MAs(18).toggle()}),e.qZA()(),e.BQk()}if(2&a){const l=u.ngIf,_=e.MAs(15),v=e.MAs(18),w=e.oxw();e.xp6(2),e.Q6J("ngIf",l.context),e.xp6(1),e.Q6J("memberid",null==l.context?null:l.context.user_id)("authenticated",l.authenticated),e.xp6(2),e.Q6J("ngIf",e.lcZ(6,14,w.project$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(8,16,w.project$)),e.xp6(4),e.Q6J("ngIf",e.lcZ(12,18,w.project$)),e.xp6(2),e.ekj("_visible",_.opened||v.opened),e.xp6(1),e.Gre("overlay-menu sl8d-flex sl8d-flex-basis-280px-xs sl8d-flex-basis-320px-sm ",null!=l.adminProjects&&l.adminProjects.length?"sl8d-flex-basis-600px-gt-sm":"sl8d-flex-basis-280px-gt-sm",""),e.xp6(2),e.Q6J("profile",l.context)("projects",l.adminProjects)("open",_.opened)}}const tn=function(a,u,l){return{adminProjects:a,authenticated:u,context:l}},Pe={financing:Te};let zt=class{constructor(u,l,_,v,w,lt,bt,Ut){this.projectPageSupportService=u,this.superAdminViewService=l,this.actions$=_,this.baseLayoutService=v,this.breakpointObserver=w,this.injector=lt,this.store=bt,this.stateService=Ut,this.context$=this.store.pipe((0,b.Ys)(Bt.x_),(0,B.d)(1)),this.view$=this.projectPageSupportService.view$,this.viewName$=this.store.pipe((0,b.Ys)(Wt.yS)),this.adminProjects$=this.context$.pipe((0,Z.U)(({user_admin_films:Zt})=>Zt||[])),this.authenticated$=this.context$.pipe((0,Z.U)(({is_authenticated:Zt})=>Zt)),this.project$=this.store.pipe((0,b.Ys)(Wt.iV)),this.projectTypes=Et.sX,this.finishedSteps$=this.store.pipe((0,b.Ys)(Lt.y$))}
1preloadModules(u){var l;return Xt(this,void 0,void 0,function*(){((null===(l=u.user_admin_films)||void 0===l?void 0:l.length)||u.user_is_superuser)&&(Pe.editProject||(yield this.preloadProjectEditModule()),Pe.projectSettings||(yield this.preloadProjectSettingsModule()))})}preloadProjectEditModule(){return Xt(this,void 0,void 0,function*(){const{ProjectEditModule:u}=yield Promise.all([n.e(9505),n.e(463),n.e(3286)]).then(n.bind(n,43286)),l=(0,e.hM9)(u,this.injector);Pe.editProject=l.instance.getProjectEditComponent()})}preloadProjectSettingsModule(){return Xt(this,void 0,void 0,function*(){const{ProjectSettingsModule:u}=yield Promise.all([n.e(8592),n.e(265)]).then(n.bind(n,70265)),l=(0,e.hM9)(u,this.injector);Pe.projectSettings=l.instance.getProjectSettingsComponent()})}ngAfterViewInit(){document.body.classList.add("_app-loaded"),this.actions$.pipe((0,T.l4)(re.JN),(0,ot.w)(({chunkNames:u})=>(0,Jt.s)(()=>!!(null==u?void 0:u.length),(0,H.of)({chunkNames:u}),(0,H.of)({chunkNames:u}).pipe((0,Pt.g)(5e3)))),(0,Tt.q)(1),(0,ot.w)(()=>this.context$)).subscribe(u=>this.preloadModules(u)),this.projectPageSupportService.subpages$.pipe((0,Dt.t)(this),(0,j.b)(({name:u,open:l,init:_})=>Xt(this,void 0,void 0,function*(){Pe[u]||("editProject"===u?yield this.preloadProjectEditModule():"projectSettings"===u&&(yield this.preloadProjectSettingsModule())),l?this.baseLayoutService.openSubpage(u,Pe[u],{init:_}):this.baseLayoutService.closeSubpage(u)}))).subscribe(),this.context$.pipe((0,Tt.q)(1),(0,dt.M)(this.superAdminViewService.superAdminView$),(0,j.b)(([u,l])=>this.toggleSuperAdminView(!!(null==u?void 0:u.user_is_superuser)&&l,!!(null==u?void 0:u.user_is_superuser)))).subscribe()}handleAction({name:u,value:l}){"send-verification"===u&&this.store.dispatch((0,Bt.ZC)({data:l}))}toggleSuperAdminView(u,l=!0){this.view$.pipe((0,Tt.q)(1),(0,j.b)(({id:_})=>this.store.dispatch((0,Wt.Od)({data:"member"===_?_:u||!l?"self":"self_not_superuser"}))),(0,j.b)(()=>this.superAdminViewService.setSuperAdminView(u))).subscribe()}};zt.\u0275fac=function(u){return new(u||zt)(e.Y36(I.G),e.Y36(Qt.X6),e.Y36(T.eX),e.Y36(ut.N),e.Y36(ie.Yg),e.Y36(e.zs3),e.Y36(b.yh),e.Y36(le.b))},zt.\u0275cmp=e.Xpm({type:zt,selectors:[["ng-component"]],decls:4,vars:11,consts:[[4,"ngIf"],["deviceDetect","",1,"sl8d-full-width"],["slBanner","",3,"memberHasInactiveEmail","memberId","email","verified","action",4,"ngIf"],["id","siteFooter","slFooter","",1,"footer",3,"memberid","authenticated"],[1,"project-page","sl8d-bg"],[1,"container"],[1,"drawer-container__backdrop",3,"click"],["mode","over","position","end",3,"ngAfterInit"],["drawer",""],[3,"profile","projects","open","action","toggleDrawer"],["mode","over","position","start",3,"ngAfterInit"],["menu",""],[3,"toggleMenu"],["slBanner","",3,"memberHasInactiveEmail","memberId","email","verified","action"],[3,"project",4,"ngIf"],[3,"project"],["mode","dark","color","white","icon","movie_filter","iconSize","48px","class","sl8d-block sl8d-margin-bottom",4,"ngIf"],["mode","dark","color","white","icon","movie_filter","iconSize","48px",1,"sl8d-block","sl8d-margin-bottom"],["title","",1,"sl8d-body-2","sl8d-padding-top-xxs","sl8d-fz-m","sl8d-medium","sl8d-uppercase"],["content",""],["aside","",1,"sl8d-flex-shrink-0","sl8d-flex","sl8d-flex-column-xs","sl8d-gap-sm"],["href","https://get.slated.com/analysis","mat-stroked-button","","target","_blank",1,"sl8d-full-width-xs","_white"],["routerLink","/analysis/nofilm","mat-flat-button","","color","accent",1,"_gradient","sl8d-full-width-xs"],[1,"sl8d-margin-top-xs"],[4,"ngFor","ngForOf"],["mode","banner","color","warning","icon","warning","class","sl8d-block",4,"ngIf"],["mode","banner","color","warning","icon","warning",1,"sl8d-block"],["title","",1,"sl8d-body-2"],[4,"ngIf","ngIfElse"],["defaultRoleTmpl",""],["aside","",1,"sl8d-gap-xs","sl8d-flex","sl8d-flex-column-xs"],["mat-flat-button","","color","accent",3,"href"],["mat-button","",1,"sl8d-flat",3,"href"],[3,"state","toggle",4,"ngIf"],[3,"state","toggle"]],template:function(u,l){1&u&&(e.YNc(0,qe,20,20,"ng-container",0),e.ALo(1,"async"),e.ALo(2,"async"),e.ALo(3,"async")),2&u&&e.Q6J("ngIf",e.kEZ(7,tn,e.lcZ(1,1,l.adminProjects$),e.lcZ(2,3,l.authenticated$),e.lcZ(3,5,l.context$)))},directives:[d.O5,ve.i,Ue.y,Me.u,Ce.c,tt,_t.e,N.zs,et.yS,d.sg,et.lC,pt.$,L.jA,Mt.o,ee.M,ue.f],pipes:[d.Ov,vt.Z,d.i8,At.J],styles:["[_nghost-%COMP%]{width:100%;display:flex;flex-grow:1}[_nghost-%COMP%] .project-page[_ngcontent-%COMP%]{padding-top:0}sl-base-layout[_ngcontent-%COMP%]{width:100%}sl-base-layout[_ngcontent-%COMP%] .mat-drawer-content .container{margin:0 auto;width:100%;flex-grow:1;flex-shrink:0}sl-base-layout[_ngcontent-%COMP%] .drawer-content__inner{flex-grow:1;flex-direction:column;display:flex}sl-base-layout[_ngcontent-%COMP%] .drawer-container{display:flex;flex-grow:1}.mat-drawer[_ngcontent-%COMP%]{z-index:52;position:fixed}
1.drawer-container__backdrop[_ngcontent-%COMP%]{pointer-events:none;touch-action:none;opacity:0;transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:opacity;position:fixed;left:0;top:0;height:100svh;width:100vw;background-color:#0009;z-index:52;cursor:pointer}.drawer-container__backdrop._visible[_ngcontent-%COMP%]{opacity:1;pointer-events:all;touch-action:all}"]}),zt=function(a,u,l,_){var lt,v=arguments.length,w=v<3?u:null===_?_=Object.getOwnPropertyDescriptor(u,l):_;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)w=Reflect.decorate(a,u,l,_);else for(var bt=a.length-1;bt>=0;bt--)(lt=a[bt])&&(w=(v<3?lt(w):v>3?lt(u,l,w):lt(u,l))||w);return v>3&&w&&Object.defineProperty(u,l,w),w}([(0,Dt.c)(),function(a,u){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata("design:paramtypes",u)}(0,[I.G,Qt.X6,T.eX,ut.N,ie.Yg,e.zs3,b.yh,le.b])],zt);const p=[{path:"",component:zt,children:[{path:":projectId/onboarding",loadChildren:()=>Promise.all([n.e(9505),n.e(463),n.e(6188)]).then(n.bind(n,76188)).then(a=>a.ProjectOnboardingModule)},{path:"submit",loadChildren:()=>n.e(8632).then(n.bind(n,28632)).then(a=>a.ListNewProjectModule)},{path:":projectId/error",loadChildren:()=>n.e(6046).then(n.bind(n,76046)).then(a=>a.FilmErrorModule)},{path:":projectId",loadChildren:()=>Promise.all([n.e(9505),n.e(8592),n.e(681)]).then(n.bind(n,90681)).then(a=>a.FilmProfileModule)}]}];var m=n(40520),o=n(12105),E=n(39841),Y=n(39300),$=n(70262),Ot=n(82722),St=n(95577),de=n(28746),be=n(65967),xt=n(8854);const ce=(a,u)=>{const l=a.reduce((_,v)=>{switch(v.statement_descriptor){case xt.V$.scriptFinancial:_.scriptFinancial=v;break;case xt.V$.script:_.script.regular=v;break;case xt.V$.scriptRush:_.script.rush=v;break;case xt.V$.financial:_.financial=v;break;case xt.V$.screening:_.screening=v;break;default:(0,o.n_)({data:{projectId:u,product:v}}),(0,o.uT)("Unexpected analysis product")}return _},{script:{},financial:{},scriptFinancial:{}});return l.scriptFinancial.saveValue=parseInt(l.script.rush.total_price,10)+parseInt(l.financial.total_price,10)-parseInt(l.scriptFinancial.total_price,10),l};var qt=n(18460),pe=n(97714),Vt=n(3596),en=n(78422),at=n(24394),Yt=n(43773),nn=n(99493),U=n(54706),rn=n(635),pn=n(76995),Ge=n(60147),c=n(87474),J=n(44257);let _n=(()=>{class a{constructor(l,_,v,w,lt,bt,Ut,Zt,te){this.actions$=l,this.analysisApi=_,this.projectPageSupportService=v,this.projectsApi=w,this.snackBarService=lt,this.store=bt,this.userApi=Ut,this.router=Zt,this.onboardingStoreService=te,this.getProject$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.bf),(0,dt.M)(this.store.pipe((0,b.Ys)(J.iV)),this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.tn)),this.store.pipe((0,b.Ys)(nn.A0)),this.store.pipe((0,b.Ys)(Bt.x_))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.n_)({data:(0,U.HW)(y),statusChange:!0}))),(0,ot.w)(([h,y,A,x,S,{user_id:P}])=>this.projectsApi.fetchFilm$(A,"profile").pipe((0,j.b)(M=>!M.profile&&this.router.navigate(["/404"])),(0,Y.h)(M=>!!M.profile),(0,Z.U)(M=>{var ft;return x?(this.store.dispatch((0,Bt.BG)({id:M.id,name:M.name,is_released:M.stage.id===Et.FH.released,score:(null===(ft=M.score)||void 0===ft?void 0:ft.total_score)||0,small_image:M.small_image})),(0,c.n_)({data:(0,U.XG)(Object.assign(Object.assign({},y),M))})):(this.store.dispatch((0,c.Ic)({data:M.profile.media_url})),(0,c.n_)({data:(0,U.XG)(M),updateScript:!0,updateFinancialScript:!0}))}),(0,j.b)(()=>this.store.dispatch((0,c.Hc)({data:{isUpdateImage:!1}}))),(0,$.K)(M=>(this.router.navigate(P?["/403"]:["/login"],{queryParams:{next:S}}),(0,H.of)((0,c.n_)({data:(0,U.MI)(M),statusChange:!0}),(0,at.bR)(c.n_.type,M)))))))),this.fetchRunFinancialStatus$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.xu),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx))),(0,j.b)(()=>this.runFinancialStatusStartDate=Date.now()),(0,ot.w)(([h,y])=>this.analysisApi.projectAnalysis$(y,["run_financial"]).pipe((0,Ot.R)(this.actions$.pipe((0,T.l4)(c.Qt),(0,Tt.q)(1))),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx))),(0,Z.U)(([{run_financial:A},x])=>
1!x||this.runFinancialStatusStartDate<this.runFinancialStartDate&&this.runFinancialEndDate<Date.now()&&this.runFinancialStartDate<this.runFinancialEndDate?(0,at.PH)(at.E_):(0,c.lu)({run_financial:A})),(0,$.K)(A=>(0,H.of)((0,at.bR)(c.xu.type,A))),(0,j.b)(()=>setTimeout(()=>this.store.dispatch((0,c.PM)()))))))),this.getFilmProfileAnalysis$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.O5),(0,j.b)(()=>this.store.dispatch((0,c.WT)({data:(0,U.HW)(),statusChange:!0}))),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx))),(0,ot.w)(([{updateScript:h,updateFinancialScript:y},A])=>this.analysisApi.projectAnalysis$(A).pipe((0,ot.w)(x=>this.store.pipe((0,b.Ys)(J.iV)).pipe((0,Y.h)(S=>!!S),(0,Tt.q)(1),(0,Z.U)(S=>{var P;Array.isArray(x.script_analyses)&&S.profile.film_type!==Et.sX.marketing&&(x.script_analyses=x.script_analyses.filter(ft=>!!ft.current_delivery_estimate));const M=Object.assign(Object.assign({},x),{products:ce(x.products,A)});if(!M.active_financial_analysis&&(null===(P=M.financial_analyses)||void 0===P?void 0:P.length)){let ft=M.financial_analyses[0];M.financial_analyses.map(xe=>{ft.created_at<xe.created_at&&(ft=xe)}),M.active_financial_analysis=ft.id}return(0,c.WT)({data:(0,U.XG)(M),updateScript:h,updateFinancialScript:y})}))),(0,$.K)(x=>(0,H.of)((0,c.WT)({data:(0,U.MI)(x),statusChange:!0}),(0,at.bR)(c.WT.type,x))))))),this.handleAnalysisData$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.WT,c.n_),(0,Y.h)(h=>!h.statusChange),(0,dt.M)(this.store.pipe((0,b.Ys)(J.iV)),this.store.pipe((0,b.Ys)(J.jS)),this.store.pipe((0,b.Ys)(J.Ds))),(0,Y.h)(([h])=>!h.filterEffect),(0,Y.h)(([h,y,A])=>!!y&&!!A),(0,Z.U)(([h,y,A,x])=>(this.store.pipe((0,b.Ys)(J.rp),(0,Y.h)(Boolean),(0,Tt.q)(1)).subscribe(S=>{h.updateScript&&S.can_view_scripts&&this.store.dispatch((0,c.Ol)()),h.updateFinancialScript&&S.can_view_financials&&x&&this.store.dispatch((0,c.iO)({data:x}))}),(0,at.PH)(at.E_))))),this.fetchScriptAnalyse$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Tw),(0,dt.M)(this.store.pipe((0,b.Ys)(J.rp)),this.store.pipe((0,b.Ys)(J.hI))),(0,Y.h)(([h,y])=>y.can_view_scripts),(0,j.b)(([{data:h},y,A])=>this.fetchScript(h,y,A))),{dispatch:!1}),this.fetchFinancialAnalyse$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.iO),(0,dt.M)(this.store.pipe((0,b.Ys)(J.rp)),this.store.pipe((0,b.Ys)(J.m7)),this.store.pipe((0,b.Ys)(J.jS))),(0,Y.h)(([h,y])=>y.can_view_financials),(0,j.b)(([h,y,A])=>this.store.dispatch((0,c.SI)({data:(0,U.HW)(A)}))),(0,St.z)(([{data:h},y,A,x])=>this.analysisApi.getFinancialAnalysis$(h).pipe((0,Z.U)(S=>this.handleFinancialAnalysisResponse(S,A)),(0,$.K)(S=>{var P;return(0,H.of)((0,c.SI)({data:(0,U.XG)(Object.assign(Object.assign({},A),{analysis:null===(P=null==x?void 0:x.financial_analyses)||void 0===P?void 0:P.find(M=>M.id===+h),get_started:!1,error:!0,serverError:S.error.detail}))}),(0,at.bR)(c.iO.type,S))}))))),this.fetchViews$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Wn),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(Bt.x_)),this.store.pipe((0,b.Ys)(J.Ru))),(0,j.b)(([h,y,A,x])=>this.store.dispatch((0,c.kA)({data:(0,U.HW)(x)}))),(0,Y.h)(([h,y])=>!!y),(0,ot.w)(([h,y,{user_id:A}])=>(0,E.a)([this.projectsApi.fetchViews$(y),A?this.projectsApi.fetchProjectFrequencyForUser$(y,A):(0,H.of)({frequency:en.r.never})]).pipe((0,Z.U)(([x,{frequency:S}])=>{var P;return Object.keys(x||{}).forEach(M=>{x[M].weekly_digest_setting=S}),(null===(P=null==x?void 0:x.self)||void 0===P?void 0:P.unverified_roles)&&(x.self.unverified_roles=x.self.unverified_roles.map(M=>Object.assign(Object.assign({},M),{investment:M.confirm_url.startsWith("/approve/investment")}))),(0,c.kA)({data:(0,U.XG)(x)})}),(0,$.K)(x=>(404===x.status&&this.router.navigate(["/404"]),(0,H.of)((0,at.bR)(c.Wn.type,x)))))))),this.onboardProject$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.bR),(0,dt.M)(this.store.pipe((0,b.Ys)(J.iV)),this.store.pipe((0,b.Ys)(Lt.Sd)),this.store.pipe((0,b.Ys)(Lt.Fi))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.n_)({data:(0,U.HW)(y),statusChange:!0}))),(0,ot.w)(([{data:h},y,A,{finished_steps:x,selected_fields:S}])=>this.projectsApi.patchProject$(h.id,h.fields).pipe((0,ot.w)(()=>this.projectsApi.completeOnboarding$(h.id).pipe((0,dt.M)(this.store.pipe((0,b.Ys)(Lt.Fi))),(0,ot.w)(([P,M])=>!M.completed&&M.selected_fields.includes(Ge.Vt.filmmaker)?this.onboardingStoreService.updateOnboarding$({postpone:!1,steps:[Ge.Xd.listProjects]}).pipe((0,Z.U)(()=>P),(0,$.K)(()=>(0,H.of)(P))):(0,H.of)(P)),(0,Z.U)(P=>(this.store.dispatch((0,Bt.U9)()),this.store.dispatch((0,Yt.yE)({event:"filmOnboarded",film_id:P.id,data:(null==S?void 0:S.includes(Ge.Vt.filmmaker))&&!x.includes(Ge.Xd.listProjects)&&"first"})),this.store.dispatch((0,Yt.LH)({command:"send",fieldsObject:{hitType:"pageview",eventCategory:"/films/onboarding/done/"}})),this.store.dispatch((0,Yt.vb)({eventName:"onboarded-film",metadata:{name:P.name,year:P.year}})),setTimeout(()=>{this.store.dispatch((0,Yt.vb)({action:"update",eventName:{last_request_at:Math.floor((new Date).getTime()/1e3)}}))},500),this.store.dispatch((0,Yt.UY)({eventType:"track",eventName:"Onboarded Film",data:{value:"
10.00",currency:"USD"}})),this.router.navigate(["films",P.id,...A?["opportunities"]:[]]),(0,c.n_)({data:(0,U.XG)(P),updateScript:!0,updateFinancialScript:!0}))))),(0,$.K)(P=>{if(null==P?void 0:P.data){const M=this.generateErrorMessage(P.data).join(". ").replace(/\.\./g,".");this.snackBarService.message(M)}else this.snackBarService.message("Error processing your request. Please try again or contact support");return(0,H.of)((0,at.bR)(c.n_.type,P))}))))),this.requestScriptAccess$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.H8),(0,dt.M)(this.store.pipe((0,b.Ys)(J.kV)),this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.E8)({data:(0,U.HW)(y)}))),(0,ot.w)(([{data:h},y,A])=>this.projectsApi.requestAccess$(h).pipe((0,j.b)(x=>this.store.dispatch((0,c.n_)({data:(0,U.XG)(Object.assign(Object.assign({},A),{analysis_access_requested:Object.assign(Object.assign({},A.analysis_access_requested),{script:x.created})}))}))),(0,Z.U)(x=>(0,c.E8)({data:(0,U.XG)(x)})),(0,$.K)(x=>(x.errors=[],Object.keys(x.error).map(S=>{x.errors.push(x.error[S])}),x.errors=x.errors.flatten(1),(0,H.of)((0,c.E8)({data:(0,U.MI)(x)}),(0,at.bR)(c.H8.type,x)))))))),this.requestFinancialAccess$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.zA),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Rp)),this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.NR)({data:(0,U.HW)(y)}))),(0,ot.w)(([{data:h},y,A])=>this.projectsApi.requestAccess$(h).pipe((0,j.b)(x=>this.store.dispatch((0,c.n_)({data:(0,U.XG)(Object.assign(Object.assign({},A),{analysis_access_requested:Object.assign(Object.assign({},A.analysis_access_requested),{financial:x.created})}))}))),(0,Z.U)(x=>(0,c.NR)({data:(0,U.XG)(x)})),(0,$.K)(x=>(x.errors=[],Object.keys(x.error).map(S=>{x.errors.push(x.error[S])}),x.errors=x.errors.flatten(1),(0,H.of)((0,c.NR)({data:(0,U.MI)(x)}),(0,at.bR)(c.zA.type,x)))))))),this.runFinancialAnalysis$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Qt),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.m7))),(0,j.b)(()=>this.store.dispatch((0,c.OJ)({data:(0,U.HW)()}))),(0,j.b)(([{financialScript:h},y])=>localStorage.setItem("run-financial",`${y}|${h}|${Date.now()}`)),(0,j.b)(()=>this.runFinancialStartDate=Date.now()),(0,ot.w)(([h,y,A])=>this.analysisApi.runFinancialAnalysis$(y).pipe((0,j.b)(()=>this.runFinancialEndDate=Date.now()),(0,Ot.R)(this.actions$.pipe((0,T.l4)(c.Au),(0,Tt.q)(1))),(0,j.b)(x=>this.store.dispatch(this.handleFinancialAnalysisResponse(x,A))),(0,j.b)(()=>this.store.dispatch((0,Yt.yE)({event:"film_page - analysis_updated",film_id:y}))),(0,j.b)(()=>this.store.dispatch((0,c.OJ)({data:(0,U.XG)()}))),(0,ot.w)(()=>this.updateScores(y)),(0,de.x)(()=>localStorage.removeItem("run-financial")),(0,$.K)(x=>(0,H.of)((0,c.OJ)({data:(0,U.MI)(x.error)}),(0,at.bR)(c.Qt.type,x))))))),this.cancelRunFinancialAnalysis$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Au),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx))),(0,ot.w)(([h,y])=>this.analysisApi.cancelFinancialAnalysis$(y).pipe((0,j.b)(()=>this.store.dispatch((0,c.OJ)({data:(0,U.XG)()}))),(0,Z.U)(()=>(0,c.lu)({run_financial:!0})),(0,de.x)(()=>localStorage.removeItem("run-financial")),(0,$.K)(A=>(0,H.of)((0,at.bR)(c.Au.type,A))))))),this.activateScriptAnalysis=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.uu),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.jS))),(0,j.b)(()=>this.store.dispatch((0,c.HN)({data:(0,U.HW)()}))),(0,ot.w)(([{data:h},y,A])=>this.analysisApi.activateProjectAnalysis$(y,parseInt(h,10)).pipe((0,j.b)(()=>this.projectPageSupportService.checkSimulationUpdates(y,null,!0)),(0,j.b)(()=>this.store.dispatch((0,c.HN)({data:(0,U.XG)()}))),(0,j.b)(x=>{const S=Object.assign(Object.assign({},x),{products:ce(x.products,y)});S.script_analyses=S.script_analyses.map(P=>{const M=A.script_analyses.find(ft=>ft.id==P.id);return Object.assign(Object.assign({},P),{results:M?M.results:null})}),this.store.dispatch((0,c.WT)({data:(0,U.XG)(S),filterEffect:!0,updateScript:!0}))}),(0,ot.w)(()=>this.updateScores(y)),(0,$.K)(x=>(this.snackBarService.message(Vt.B.processing),(0,H.of)((0,c.HN)({data:(0,U.MI)(x.error)}),(0,at.bR)(c.uu.type,x)))))))),this.markFullyFunded$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Jz),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx))),(0,ot.w)(([{data:h,opportunityId:y},A])=>this.projectsApi.patchOpportunity$(A,y,h).pipe((0,j.b)(()=>this.store.dispatch((0,c.M9)({data:(0,U.XG)(!0)}))),(0,Z.U)(x=>(0,Gt.Sn)(x)),(0,$.K)(x=>(0,H.of)((0,c.M9)({data:(0,U.MI)(x)}),(0,at.bR)(c.Jz.type,x))))))),this.addInvestor$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.e2),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.rp))),(0,j.b)(()=>this.store.dispatch((0,c.$R)({data:(0,U.HW)()}))),(0,ot.w)(([{data:h},y,A])=>this.projectsApi.addInvestor$(h).pipe((0,Z.U)(x=>(0,c.$R)({data:(0,U.XG)(x)})),(0,j.b)(()=>this.store.dispatch((0,Yt.yE)({event:"attachmentAdded",attachmentType:"investors",film_id:y}))),(0,j.b)(()=>
1this.store.dispatch((0,Gt.OB)())),(0,j.b)(()=>A.can_view_scripts&&this.store.dispatch((0,c.Ol)())),(0,$.K)(x=>{var S;let P=Vt.B.processing;return(null===(S=x.error)||void 0===S?void 0:S.conflicting_role)&&(P=Vt.B.conflictingInvestor),(0,H.of)((0,c.$R)({data:(0,U.MI)(P)}),(0,at.bR)(c.e2.type,x))}))))),this.updateInvestment$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.VL),(0,j.b)(({investment:h})=>this.store.dispatch((0,c.LJ)({data:(0,U.HW)(h)}))),(0,dt.M)(this.store.pipe((0,b.Ys)(J.iV))),(0,St.z)(([{investment:h,data:y,fetchInvestors:A,entityId:x},{id:S}])=>{var P;return(null===(P=y.type)||void 0===P?void 0:P.slug)&&Et.Jd.includes(y.type.slug)&&(y.verify_later=!1),this.projectsApi.patchInvestment$(h.id,y).pipe((0,Z.U)(M=>(0,c.LJ)({data:(0,U.XG)(Object.assign(Object.assign({},M),{amount_edit:M.amount,stage_edit:M.stage,type_edit:h.type,edit:h.edit})),entityId:x})),(0,j.b)(()=>A&&this.store.dispatch((0,c.LU)({data:{skipAnalytics:!0}}))),(0,j.b)(()=>this.store.dispatch((0,c.O5)({}))),(0,j.b)(()=>this.store.dispatch((0,c.lF)({projectId:S}))),(0,$.K)(M=>{var ft;const xe=[],Ke=M.error&&Object.keys(M.error);return(null===(ft=M.error)||void 0===ft?void 0:ft.conflicting_role)?xe.push(Vt.B.conflictingInvestor):Ke&&Ke.map(on=>{var an;return null===(an=M.error[on])||void 0===an?void 0:an.map(hn=>xe.push(`${on[0].toUpperCase()+on.slice(1)}: ${hn}`))}),(0,H.of)((0,c.LJ)({data:(0,U.MI)(xe.length?xe.join(" "):Vt.B.processing,{id:h.id})}),(0,at.bR)(c.VL.type,M))}))}))),this.deleteInvestments$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.KT),(0,ot.w)(({data:h,fetchRoles:y})=>this.projectsApi.deleteInvestments$(h).pipe((0,j.b)(()=>y&&this.store.dispatch((0,c.LU)({data:{skipAnalytics:!0}}))),(0,j.b)(()=>this.store.dispatch((0,c.O5)({}))),(0,Z.U)(()=>(0,at.PH)(at.E_)),(0,$.K)(A=>(this.snackBarService.message(Vt.B.processing),(0,H.of)((0,at.bR)(c.KT.type,A)))))))),this.addTPVU$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.MQ),(0,ot.w)(({data:h,user:y})=>this.userApi.createTPVU(y).pipe((0,Z.U)(A=>(0,c.e2)({data:Object.assign(Object.assign({},h),{investor:A.url})})),(0,$.K)(A=>(0,H.of)((0,c.LJ)({data:(0,U.MI)(Vt.B.processing)}),(0,at.bR)(c.MQ.type,A))))))),this.addNewUser$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.aL),(0,ot.w)(({data:h,user:y})=>this.userApi.createUser(y).pipe((0,Z.U)(A=>(0,c.e2)({data:Object.assign(Object.assign({},h),{investor:A.url,verification_info:A.is_onboarded?null:h.verification_info})})),(0,$.K)(A=>(0,H.of)((0,c.LJ)({data:(0,U.MI)(Vt.B.processing)}),(0,at.bR)(c.aL.type,A))))))),this.inviteToSlated$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Wj),(0,St.z)(({invitationId:h,projectId:y,email:A,thirdPartyUser:x,registeredUser:S,group:P,resend:M})=>this.projectsApi.inviteToSlated$(h,y,A,x,S,M).pipe((0,Z.U)(({date_invited:ft,allow_resend:xe,id:Ke})=>(0,c.FP)({projectId:y,email:A,thirdPartyUser:x,registeredUser:S,group:P,invitation:{date_invited:ft,allow_resend:xe,id:Ke}})),(0,$.K)(ft=>(this.snackBarService.message(403===ft.status?Vt.B.permissions:Vt.B.processing),(0,H.of)((0,c.FP)({projectId:y,email:A,thirdPartyUser:x,registeredUser:S,group:P}),(0,at.bR)(c.Wj.type,ft)))))))),this.updateSelfView$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.OZ),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.Ru)),this.store.pipe((0,b.Ys)(Bt.x_))),(0,j.b)(([h,y,A])=>this.store.dispatch((0,c.kA)({data:(0,U.HW)(A)}))),(0,ot.w)(([h,y,A,{user_id:x}])=>this.projectsApi.updateProjectFrequencyForUser$(y,x,h.frequency).pipe((0,Z.U)(({frequency:S})=>(0,c.kA)({data:(0,U.XG)(Object.assign(Object.assign({},A),{self:Object.assign(Object.assign({},A.self),{weekly_digest_setting:S})}))})),(0,$.K)(S=>(0,H.of)((0,c.kA)({data:(0,U.MI)(S,A)}),(0,at.bR)(c.OZ.type,S))))))),this.updateProjectField$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.D),(0,ot.w)(h=>{var{id:y,initial_budget:A}=h,x=function(a,u){var l={};for(var _ in a)Object.prototype.hasOwnProperty.call(a,_)&&u.indexOf(_)<0&&(l[_]=a[_]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols){var v=0;for(_=Object.getOwnPropertySymbols(a);v<_.length;v++)u.indexOf(_[v])<0&&Object.prototype.propertyIsEnumerable.call(a,_[v])&&(l[_[v]]=a[_[v]])}return l}(h,["id","initial_budget"]);return this.projectsApi.patchProject$(y,x).pipe((0,dt.M)(this.store.pipe((0,b.Ys)(Gt.Sf))),(0,j.b)(()=>{A&&this.projectPageSupportService.checkSimulationUpdates(y,A)}),(0,j.b)(([S,P])=>{x.investment_profile&&P&&this.store.dispatch((0,Gt.ng)({id:P.id,investment_profile_object:{breakdown:S.investment_profile.breakdown,close_date_approaching:S.investment_profile.close_date_approaching,investments_match_budget:S.investment_profile.investments_match_budget,is_fully_funded:S.investment_profile.is_fully_funded,min_investment:S.investment_profile.min_investment,remaining:S.investment_profile.remaining_financing,total_budget:S.investment_profile.total_budget,target_close_date:S.investment_profile.target_close_date}}))}),(0,Z.U)(([S,P])=>{var M;return(0,c.C)(Object.assign(Object.assign({},S),{allow_analysis:!(null===(M=S.genre_tags)||void 0===M?void 0:M.some(ft=>"documentary"===ft.slug)),profile:Object.assign(Object.assign({},S.profile),(0,qt.C)(S))}))}),(0,j.b)(()=>this.store.dispatch((0,c.xu)())),(0,$.K)(S=>(0,H.of)((0,at.bR)(c.D.type,S))))}))),this.updateProject$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Hh),(0,dt.M)(this.store.pipe((0,b.Ys)(J.iV)),this.store.pipe((0,b.Ys)(nn.A0))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.n_)({data:(0,U.HW)(y),statusChange:!0}))),(0,ot.w)(([{data:h,updateScore:y,fetchAnalysis:A},x,S])=>this.projectsApi.patchProject$(x.id,h).pipe((0,j.b)(P=>{var M,ft;(h.name||h.stage||h.feature_type)&&this.store.dispatch((0,Bt.BG)({id:P.id,name:P.name,is_released:P.stage.
1id===Et.FH.released,score:(null===(M=P.score)||void 0===M?void 0:M.total_score)||0,small_image:P.small_image,feature_type:P.feature_type})),(null===(ft=h.profile)||void 0===ft?void 0:ft.media_url)&&this.store.dispatch((0,c.Ic)({data:P.profile.media_url})),S.includes("opportunities")&&h.business_details&&"production_start_date"in h.business_details&&this.store.dispatch((0,Gt.Jd)({withPending:!1}))}),(0,j.b)(P=>{A&&(this.store.dispatch((0,c.Ol)()),P.profile.media_url!==x.profile.media_url&&this.store.dispatch((0,Yt.vb)({eventName:"added-promo-video"})))}),(0,j.b)(P=>{var M;const ft=null===(M=x.profile)||void 0===M?void 0:M.privacy;ft!==P.profile.privacy&&ft===Ae.P8.hidden&&(this.store.dispatch((0,Yt.yE)({event:"profile-unhidden"})),this.store.dispatch((0,Yt.yE)({event:"filmVisSettingChange",priorVisibility:ft,newVisibility:P.profile.privacy})),this.store.dispatch((0,Yt.vb)({eventName:"updated-visibility-settings",metadata:{project_id:x.id,project_name:x.name,prior_visibility:ft,new_visibility:P.profile.privacy}})))}),(0,St.z)(P=>{var M;return(0,Jt.s)(()=>y,this.updateScores(P.id,P),(0,H.of)((0,c.n_)({data:(0,U.XG)(Object.assign(Object.assign({},P),{allow_analysis:!(null===(M=P.genre_tags)||void 0===M?void 0:M.some(ft=>"documentary"===ft.slug)),profile:Object.assign(Object.assign({},P.profile),(0,qt.C)(P))}))})))}),(0,$.K)(P=>{const M=P instanceof m.UA?Object.values((0,rn.z)(P.error)||{}).join(" "):null;return this.snackBarService.message(M||"Error updating project data. Please contact support."),(0,H.of)((0,c.n_)({data:(0,U.MI)(P,x),statusChange:!0}),(0,at.bR)(c.Hh.type,P))}))))),this.updateFeeAgreement$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c._w),(0,dt.M)(this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.n_)({data:(0,U.HW)(y),statusChange:!0}))),(0,ot.w)(([{data:h,privacy:y},A])=>{const x=y?Object.assign(Object.assign({},h),{profile:{privacy:y}}):h;return this.projectsApi.patchProject$(A.id,x).pipe((0,Z.U)(S=>{var P;return Object.assign(Object.assign({},S),{allow_analysis:!(null===(P=S.genre_tags)||void 0===P?void 0:P.some(M=>"documentary"===M.slug)),profile:Object.assign(Object.assign({},S.profile),(0,qt.C)(S))})}),(0,St.z)(S=>(0,Jt.s)(()=>!!y,(0,H.of)((0,c.n_)({data:(0,U.XG)(S)}),(0,c.Wn)(),(0,Yt.vb)({eventName:"updated-visibility-settings",metadata:{project_id:A.id,project_name:A.name,prior_visibility:A.profile.privacy,new_visibility:y}})),(0,H.of)((0,c.n_)({data:(0,U.XG)(S)})))),(0,$.K)(S=>(0,H.of)((0,c.n_)({data:(0,U.MI)(S,J.iV),statusChange:!0}),(0,at.bR)(c._w.type,S))))}))),this.getProjectMediaThumb$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Ic),(0,Z.U)(h=>h.data),(0,Y.h)(h=>!!h),(0,ot.w)(h=>{var y;const A=h;if(A.replace||((0,o.n_)({data:{media_url:h}}),(0,o.uT)("FilmEffects.getProjectMediaThumb$: Something wrong with media_url")),A.replace(",","").indexOf("vimeo")>-1){const S=null===(y=new RegExp(pn.c0).exec(A))||void 0===y?void 0:y[4];return S?this.projectsApi.fetchVimeoMediaThumb$(S).pipe((0,Z.U)(P=>(0,c.C$)({data:{jpg:P[0].thumbnail_large.replace(".webp",".jpg"),webp:P[0].thumbnail_large.replace(".jpg",".webp")}})),(0,$.K)(P=>(0,H.of)((0,at.bR)(c.Ic.type,P)))):(0,H.of)((0,at.PH)(at.E_))}return(0,H.of)((0,at.PH)(at.E_))}))),this.updateProjectScore$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.h_),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx))),(0,j.b)(()=>this.store.dispatch((0,c.zJ)({pending:!0}))),(0,ot.w)(([h,y])=>this.updateScores(y)))),this.fetchBudgetData$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.lF),(0,ot.w)(({projectId:h})=>this.projectsApi.fetchProject$(h,["investment_profile"],"profile").pipe((0,dt.M)(this.store.pipe((0,b.Ys)(J.iV))),(0,Z.U)(([y,A])=>(0,c.n_)({data:(0,U.XG)(Object.assign(Object.assign({},A),y)),filterEffect:!0})))))),this.fetchCastRolesForProject$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Gx),(0,j.b)(()=>this.store.dispatch((0,c.RR)({cast:pe.iF.pending}))),(0,dt.M)(this.store.pipe((0,b.Ys)(J.pj)),this.store.pipe((0,b.Ys)(J.rp)),this.store.pipe((0,b.Ys)(J.Ds)),this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.Tu)({data:(0,U.HW)(y)}))),(0,ot.w)(([{data:h},y,A,x,S,P])=>this.projectsApi.fetchCastRoles(S).pipe((0,j.b)(M=>!h.skipAnalytics&&this.addAttachmentIntercom(P,this.prepareCastCrewRoleForIntercom(M,h.role))),(0,j.b)(()=>h.fetchAnalysisIfNeeded&&this.fetchAnalysisIfNeeded(A,x)),(0,Z.U)(M=>(0,c.Tu)({data:(0,U.XG)(M)})),(0,$.K)(M=>(0,H.of)((0,c.Tu)({data:(0,U.MI)(!0,y)}),(0,at.bR)(c.Gx.type,M))),(0,j.b)(()=>this.store.dispatch((0,c.RR)({cast:pe.iF.completed}))))))),this.fetchCrewRolesForProject$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.jU),(0,j.b)(()=>
1this.store.dispatch((0,c.RR)({crew:pe.iF.pending}))),(0,dt.M)(this.store.pipe((0,b.Ys)(J.qb)),this.store.pipe((0,b.Ys)(J.rp)),this.store.pipe((0,b.Ys)(J.Ds)),this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.fh)({data:(0,U.HW)(y)}))),(0,ot.w)(([{data:h},y,A,x,S,P])=>this.projectsApi.fetchCrewRoles(S).pipe((0,j.b)(M=>!h.skipAnalytics&&this.addAttachmentIntercom(P,this.prepareCastCrewRoleForIntercom(M,h.role))),(0,j.b)(()=>h.fetchAnalysisIfNeeded&&this.fetchAnalysisIfNeeded(A,x)),(0,Z.U)(M=>(0,c.fh)({data:(0,U.XG)(M)})),(0,$.K)(M=>(0,H.of)((0,c.fh)({data:(0,U.MI)(!0,y)}),(0,at.bR)(c.jU.type,M))),(0,j.b)(()=>this.store.dispatch((0,c.RR)({crew:pe.iF.completed}))))))),this.fetchCompanyRolesForProject$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.uU),(0,j.b)(()=>this.store.dispatch((0,c.RR)({companies:pe.iF.pending}))),(0,dt.M)(this.store.pipe((0,b.Ys)(J.kI)),this.store.pipe((0,b.Ys)(J.rp)),this.store.pipe((0,b.Ys)(J.Ds)),this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.Nw)({data:(0,U.HW)(y)}))),(0,ot.w)(([{data:h},y,A,x,S,P])=>this.projectsApi.fetchCompanyRoles(S).pipe((0,j.b)(M=>!h.skipAnalytics&&this.addAttachmentIntercom(P,this.prepareCompanyRoleForIntercom(M,h.role))),(0,j.b)(()=>h.fetchAnalysisIfNeeded&&this.fetchAnalysisIfNeeded(A,x)),(0,Z.U)(M=>(0,c.Nw)({data:(0,U.XG)(M)})),(0,$.K)(M=>(0,H.of)((0,c.Nw)({data:(0,U.MI)(!0,y)}),(0,at.bR)(c.uU.type,M))),(0,j.b)(()=>this.store.dispatch((0,c.RR)({companies:pe.iF.completed}))))))),this.fetchInvestorsForProject$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.LU),(0,j.b)(()=>this.store.dispatch((0,c.RR)({investors:pe.iF.pending}))),(0,dt.M)(this.store.pipe((0,b.Ys)(J.ST)),this.store.pipe((0,b.Ys)(J.rp)),this.store.pipe((0,b.Ys)(J.Ds)),this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([h,y])=>this.store.dispatch((0,c.PL)({data:(0,U.HW)(y||[])}))),(0,ot.w)(([{data:h},y,A,x,S,P])=>this.projectsApi.fetchInvestorRoles(S).pipe((0,j.b)(M=>!h.skipAnalytics&&this.addAttachmentIntercom(P,this.prepareInvestorRoleForIntercom(M,h.role))),(0,j.b)(()=>h.fetchAnalysisIfNeeded&&this.fetchAnalysisIfNeeded(A,x)),(0,Z.U)(M=>(0,c.PL)({data:(0,U.XG)(M)})),(0,$.K)(M=>(0,H.of)((0,c.PL)({data:(0,U.MI)(!0,y)}),(0,at.bR)(c.LU.type,M))),(0,j.b)(()=>this.store.dispatch((0,c.RR)({investors:pe.iF.completed}))))))),this.deleteCompanyRole$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.UV),(0,ot.w)(({data:h})=>this.projectsApi.deleteCompanyRole$(h).pipe((0,j.b)(()=>this.store.dispatch((0,c.uU)({data:{skipAnalytics:!0,fetchAnalysisIfNeeded:!0}}))),(0,Z.U)(()=>(0,c.h_)()),(0,$.K)(y=>(this.snackBarService.message(Vt.B.processing),(0,H.of)((0,at.bR)(c.UV.type,y)))))))),this.deleteRole$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Fv),(0,ot.w)(({data:h,entityType:y})=>this.projectsApi.deleteRole$(h).pipe((0,j.b)(()=>{this.store.dispatch("cast"===y?(0,c.Gx)({data:{skipAnalytics:!0,fetchAnalysisIfNeeded:!0}}):(0,c.jU)({data:{skipAnalytics:!0,fetchAnalysisIfNeeded:!0}}))}),(0,Z.U)(()=>(0,c.h_)()),(0,$.K)(A=>(this.snackBarService.message(Vt.B.processing),(0,H.of)((0,at.bR)(c.Fv.type,A)))))))),this.updateRole$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.DM),(0,j.b)(({role:h})=>this.store.dispatch((0,c.Ef)({data:(0,U.HW)(h)}))),(0,St.z)(({role:h,data:y,entityId:A,entityType:x})=>this.projectsApi.editRole$(h.id,y).pipe((0,j.b)(()=>this.store.dispatch((0,c.h_)())),(0,Z.U)(S=>(0,c.Ef)({data:(0,U.XG)(Object.assign(Object.assign({},S),{billing_order_edit:h.billing_order_edit,role_tag_edit:h.role_tag_edit,role_name_edit:h.role_name_edit})),entityId:A,entityType:x})),(0,j.b)(()=>this.store.dispatch((0,c.Wn)())),(0,j.b)(()=>this.store.dispatch((0,c.O5)({}))),(0,$.K)(S=>{const P=(0,Qt.Dq)(S,()=>{if(400===S.status){let M=[];return Object.keys(S.error).map(ft=>M.push(S.error[ft])),M=M.flat(1),M.length?M.join(" "):Vt.B.processing}return 409===S.status&&`${(h.role_tag_edit||h.role_tag).name}${h.billing_order_edit?` (${Et.to[h.billing_order_edit]})`:""} has already been added.`});return(0,H.of)((0,c.Ef)({data:(0,U.MI)(P,{id:h.id})}),(0,at.bR)(c.DM.type,S))}
1))))),this.updateCompanyRole$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.zk),(0,j.b)(({role:h})=>this.store.dispatch((0,c.PU)({data:(0,U.HW)(h)}))),(0,St.z)(({role:h,data:y,entityId:A})=>this.projectsApi.editCompanyRole$(h.id,y).pipe((0,j.b)(()=>this.store.dispatch((0,c.h_)())),(0,Z.U)(x=>(0,c.PU)({data:(0,U.XG)(Object.assign(Object.assign({},x),{role_tag_edit:h.role_tag_edit})),entityId:A})),(0,j.b)(()=>this.store.dispatch((0,c.O5)({}))),(0,$.K)(x=>{const S=(0,Qt.Dq)(x,()=>{if(400===x.status){let P=[];return Object.keys(x.error).map(M=>P.push(x.error[M])),P=P.flat(1),P.length?P.join(" "):Vt.B.processing}return 409===x.status&&`${h.role_tag_edit.name} has already been added.`});return(0,H.of)((0,c.PU)({data:(0,U.MI)(S,{id:h.id})}),(0,at.bR)(c.DM.type,x))}))))),this.fetchScriptsIfNeeded$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.Ol),(0,dt.M)(this.store.pipe((0,b.Ys)(J.Sx)),this.store.pipe((0,b.Ys)(nn.A0)),this.store.pipe((0,b.Ys)(J.jS)),this.store.pipe((0,b.Ys)(Bt.x_)),this.store.pipe((0,b.Ys)(J.hI)),this.store.pipe((0,b.Ys)(J.rp))),(0,Y.h)(([h,y,A,x,S,P,M])=>!!x&&!!y),(0,j.b)(([h,y,A,x,S,P,M])=>this.fetchScriptsInNeeded(A,y,x,S,P,M))),{dispatch:!1}),this.toggleUpdateFinancialAnalysisAutomatically$=(0,T.GW)(()=>this.actions$.pipe((0,T.l4)(c.wu),(0,dt.M)(this.store.pipe((0,b.Ys)(J.iV))),(0,ot.w)(([{state:h},y])=>this.projectsApi.patchProject$(y.id,{profile:{financial_auto_update:h}}).pipe((0,Z.U)(A=>(0,c.n_)({data:(0,U.XG)(this.prepareProjectObject(A))})),(0,$.K)(A=>{const x=Object.values((0,rn.z)(A.error)||{}).join(" ");return this.snackBarService.message(x||"Error updating project data. Please contact support."),(0,H.of)((0,c.n_)({data:(0,U.MI)(A,y),statusChange:!0}),(0,at.bR)(c.wu.type,A))})))))}addAttachmentIntercom(l,_){if(_){const{user:v,score:w,role_name:lt,film:bt,company:Ut}=Object.assign(Object.assign({},_),{film:{value:l.name,url:`${location.origin}/api/v2/films/${l.id}/?data=profile`}});this.store.dispatch((0,Yt.vb)({eventName:"added-attachment",metadata:{company:Ut,user:v,score:w,role_name:lt,film:bt}}))}}prepareCastCrewRoleForIntercom(l,_){return l.reduce((v,w)=>{if(v)return v;let lt;const bt=_.user;return(null==bt?void 0:bt.includes("users"))&&(lt=parseInt(bt.split("users/")[1],10)),w.id===lt?(_.score=w.score,{score:_.score||0,user:{value:`${w.first_name} ${w.last_name}`,url:bt},role_name:_.role_name}):void 0},null)}prepareCompanyRoleForIntercom(l,_){return l.reduce((v,w)=>v||(w.id===_.company?{company:{value:w.name,url:w.url},score:w.score||0,role_name:_.role_name}:void 0),null)}prepareInvestorRoleForIntercom(l=[],_){return l.reduce((v,w)=>{if(v)return v;const lt=_.investor,bt=-1!==(null==lt?void 0:lt.indexOf("users"))?parseInt(lt.split("users/")[1],10):"";return w.id===bt?{user:{value:`${w.first_name} ${w.last_name}`,url:lt},score:w.score||0,role_name:_.role_name}:void 0},null)}generateErrorMessage(l={}){return Object.keys(l).reduce((_,v)=>Array.isArray(l[v])?[..._,...l[v].filter(w=>"string"==typeof w)]:l[v]?[..._,...this.generateErrorMessage(l[v])]:"string"==typeof l[v]?[..._,l[v]]:_,[])}fetchAnalysisIfNeeded(l,_){(l.can_view_scripts||l.can_view_financials)&&(this.store.dispatch((0,c.O5)({})),this.store.dispatch((0,c.Ol)()),_&&this.store.dispatch((0,c.iO)({data:_})))}handleFinancialAnalysisResponse(l,_){var v,w;return(null===(v=l.submission)||void 0===v?void 0:v.nonrecoupables)&&(l.submission.total_nonrecoupables=0,Object.keys(l.submission.nonrecoupables).forEach(lt=>{l.submission.total_nonrecoupables+=l.submission.nonrecoupables[lt]})),(null===(w=l.potential_submission)||void 0===w?void 0:w.nonrecoupables)&&(l.potential_submission.total_nonrecoupables=0,Object.keys(l.potential_submission.nonrecoupables).forEach(lt=>{l.potential_submission.total_nonrecoupables+=l.potential_submission.nonrecoupables[lt]})),(0,c.SI)(l.state===xt.ET.new||l.state===xt.ET.started||l.state===xt.ET.submitted||l.state===xt.ET.readyForReview?{data:(0,U.XG)({analysis:l,completed:_.completed,is_purchased:!!l.current_delivery_estimate,in_progress:!0,get_started:!1,error:!1,serverError:""})}:l.state===xt.ET.completed?{data:(0,U.XG)({analysis:l,is_purchased:_.is_purchased,in_progress:!1,get_started:!1,completed:!0,results:l.results,potential_results:l.potential_results,submission:l.submission,error:!1,serverError:"",updated_at:l.updated_at})}:{data:(0,U.XG)(Object.assign(Object.assign({},_),{analysis:l,get_started:!1,error:!0,serverError:""}))})}updateScores(l,_){return this.projectsApi.fetchProject$(l,["score","potential_score","investment_profile"],"profile").pi
1pe((0,dt.M)(this.store.pipe((0,b.Ys)(J.iV))),(0,j.b)(([v,w])=>this.store.dispatch((0,c.n_)({data:(0,U.XG)(Object.assign(Object.assign({},_||w),v)),filterEffect:!0}))),(0,Z.U)(()=>(0,c.zJ)({pending:!1})),(0,$.K)(v=>(this.store.dispatch((0,c.zJ)({pending:!1})),(0,H.of)((0,at.bR)(c.h_.type,v)))))}fetchScriptsInNeeded(l,_,v,w,lt,bt){l.startsWith(`/films/${_}/script`)&&v.script_analyses.some(Ut=>Ut.state===xt.ET.completed||Ut.state===xt.ET.started)&&v.script_analyses.filter(Ut=>{var Zt;const te=null===(Zt=w.user_admin_films)||void 0===Zt?void 0:Zt.some(h=>h.id===_);return Ut.results||!te&&!w.user_is_superuser?Ut.state===xt.ET.completed&&Ut.active:Ut.state===xt.ET.completed||Ut.state===xt.ET.started||Ut.state===xt.ET.abortedDueAnError}).forEach(Ut=>this.fetchScript(Ut.id,bt,lt))}fetchScript(l,_,v){this.store.dispatch((0,c.Yy)({data:(0,U.HW)(v)})),this.analysisApi.getScriptAnalysis$(l).pipe((0,Z.U)(({results:w,is_screening:lt,state:bt})=>{if(v.analyses&&v.analyses.length){const Ut=v.analyses.map(Zt=>(Zt.id===+l&&(Zt.results=w,Zt.is_screening=lt),Zt)).sort((Zt,te)=>Zt.created_at>te.created_at?-1:1);return this.store.dispatch((0,c.Yy)({data:(0,U.XG)({analyses:Ut,get_started:!(_.can_view_scripts||bt===xt.ET.completed),completed:_.can_view_scripts&&bt===xt.ET.completed,admin_view:!0})}))}return this.store.dispatch((0,c.Yy)(_.can_view_scripts&&bt===xt.ET.completed?{data:(0,U.XG)({analyses:[],get_started:!0,completed:!1,admin_view:!1})}:{data:(0,U.XG)({analyses:[],get_started:!0,admin_view:!1,completed:!1})}))}),(0,$.K)(w=>(this.store.dispatch((0,c.Yy)({data:(0,U.XG)(Object.assign(Object.assign({},v),{analyses:v.analyses?v.analyses.map(lt=>(lt.id===+l&&(lt.error=w.error.detail),lt)):[],get_started:!1}))})),(0,H.of)((0,at.bR)(c.Tw.type,w))))).subscribe()}prepareProjectObject(l){var _;return Object.assign(Object.assign({},l),{allow_analysis:!(null===(_=l.genre_tags)||void 0===_?void 0:_.some(v=>"documentary"===v.slug)),profile:Object.assign(Object.assign({},l.profile),(0,qt.C)(l))})}}return a.\u0275fac=function(l){return new(l||a)(e.LFG(T.eX),e.LFG(be.zt),e.LFG(I.G),e.LFG(be.lV),e.LFG(Qt.cw),e.LFG(b.yh),e.LFG(be.Wj),e.LFG(et.F0),e.LFG(Lt.iC))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),a})();var ln=n(22089),sn=n(57579);function dn(){return{statuses:{},analysis:null,project:null,cast:null,crew:null,companies:null,investors:null,budget:{close_date_approaching:null,investments_match_budget:null,total:null,raised:null,remaining:null,is_fully_funded:null,investor_breakdown:null,unverified:null,percentage_thermo:null,target_close_date:null,can_view:!1},scriptAnalysisInfo:{data:{analyses:null,admin_view:!1,get_started:!0,completed:!1},status:{loaded:!1,pending:!1,error:!1}},financialAnalysisInfo:{data:{analysis:null,get_started:!0,in_progress:!1,is_purchased:!1,completed:!1,error:!1},status:{loaded:!1,pending:!1,error:!1}},runFinancialAnalysis:{data:null,status:{loaded:!1,pending:!1,error:!1}},isImageUpdate:!1,projectScorePending:!1,views:null,activeViewName:"self",addInvestor:(0,U.XG)(),requestScriptAccess:(0,U.XG)(),requestFinancialAccess:(0,U.XG)()}}var cn=function(a,u){var l={};for(var _ in a)Object.prototype.hasOwnProperty.call(a,_)&&u.indexOf(_)<0&&(l[_]=a[_]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols){var v=0;for(_=Object.getOwnPropertySymbols(a);v<_.length;v++)u.indexOf(_[v])<0&&Object.prototype.propertyIsEnumerable.call(a,_[v])&&(l[_[v]]=a[_[v]])}return l};const gn=(0,b.Lq)(dn(),(0,b.on)(c.zY,a=>
1Object.assign(Object.assign({},a),dn())),(0,b.on)(c.n_,(a,{data:u})=>{var l;return Object.assign(Object.assign({},a),{project:{status:u.status,data:u.data&&Object.assign(Object.assign({},u.data),{allow_analysis:!(null===(l=u.data.genre_tags)||void 0===l?void 0:l.some(_=>"documentary"===_.slug)),profile:Object.assign(Object.assign({},u.data.profile),(0,qt.C)(u.data))})}})}),(0,b.on)(c.Tu,(a,{data:u})=>Object.assign(Object.assign({},a),{cast:u})),(0,b.on)(c.fh,(a,{data:u})=>Object.assign(Object.assign({},a),{crew:u})),(0,b.on)(c.Nw,(a,{data:u})=>Object.assign(Object.assign({},a),{companies:u})),(0,b.on)(c.PL,(a,{data:u})=>Object.assign(Object.assign({},a),{investors:u})),(0,b.on)(c.WT,(a,{data:u})=>{let l=[];return u.data&&(l=u.data.script_analyses.filter(_=>_.state!==xt.ET.new)),Object.assign(Object.assign({},a),{analysis:u,scriptAnalysisInfo:{status:u.status,data:Object.assign(Object.assign({},a.scriptAnalysisInfo.data),{analyses:l})}})}),(0,b.on)(c.LJ,(a,{data:u,entityId:l})=>l&&u.data&&!u.status.error&&!u.status.pending?Object.assign(Object.assign({},a),{investors:{status:a.investors.status,data:a.investors.data.map(_=>(_.id===l&&(_.roles=_.roles.map(v=>v.id===u.data.id?u.data:v)),_))}}):a),(0,b.on)(c.FP,(a,{thirdPartyUser:u,registeredUser:l,group:_,invitation:v})=>v?Object.assign(Object.assign({},a),{[_]:{status:a[_].status,data:"investors"===_?a.investors.data.map(w=>w.id===(u||l)?(w.invitation=v,Object.assign({},w)):w):a[_].data.map(w=>w.id===(u||l)?(w.invitation=v,Object.assign({},w)):w)}}):a),(0,b.on)(c.Ef,(a,{data:u,entityId:l,entityType:_,allowResend:v})=>{if(l&&_&&u.data&&!u.status.error&&!u.status.pending){const w=a[_].data.map(lt=>(lt.id===l&&(lt.roles=lt.roles.map(bt=>bt.id===u.data.id?Object.assign(Object.assign({},u.data),{allow_resend:!1===v||!0===v?v:u.data.allow_resend}):bt)),lt));return Object.assign(Object.assign({},a),{[_]:{status:a[_].status,data:w}})}return a}),(0,b.on)(c.PU,(a,{data:u,entityId:l})=>l&&u.data&&!u.status.error&&!u.status.pending?Object.assign(Object.assign({},a),{companies:{status:a.companies.status,data:a.companies.data.map(_=>(_.id===l&&(_.roles=_.roles.map(v=>v.id===u.data.id?u.data:v)),_))}}):a),(0,b.on)(c.Od,(a,{data:u})=>Object.assign(Object.assign({},a),{activeViewName:u})),(0,b.on)(c.jl,(a,{data:u})=>Object.assign(Object.assign({},a),{budget:u})),(0,b.on)(c.Hc,(a,{data:u})=>Object.assign(Object.assign({},a),{isImageUpdate:u.isUpdateImage})),(0,b.on)(c.kA,(a,{data:u})=>Object.assign(Object.assign({},a),{views:u})),(0,b.on)(c.E8,(a,{data:u})=>Object.assign(Object.assign({},a),{requestScriptAccess:u})),(0,b.on)(c.NR,(a,{data:u})=>Object.assign(Object.assign({},a),{requestFinancialAccess:u})),(0,b.on)(c.Yy,(a,{data:u})=>Object.assign(Object.assign({},a),{scriptAnalysisInfo:u})),(0,b.on)(c.SI,(a,{data:u})=>Object.assign(Object.assign({},a),{financialAnalysisInfo:u})),(0,b.on)(c.PM,a=>Object.assign(Object.assign({},a),{statuses:Object.assign(Object.assign({},a.statuses),{runFinancialAnalysisFlag:pe.iF.completed})})),(0,b.on)(c.xu,a=>Object.assign(Object.assign({},a),{statuses:Object.assign(Object.assign({},a.statuses),{runFinancialAnalysisFlag:pe.iF.pending})})),(0,b.on)(c.OJ,(a,{data:u})=>{var l,_,v,w;return Object.assign(Object.assign({},a),{runFinancialAnalysis:u,analysis:{data:Object.assign(Object.assign({},(null===(l=a.analysis)||void 0===l?void 0:l.data)||{}),{run_financial:!u.status.loaded&&!!(null===(v=null===(_=a.analysis)||void 0===_?void 0:_.data)||void 0===v?void 0:v.run_financial)}),status:null===(w=a.analysis)||void 0===w?void 0:w.status}})}),(0,b.on)(c.C$,(a,{data:u})=>Object.assign(Object.assign({},a),{project:{status:a.project.status,data:Object.assign(Object.assign({},a.project.data),{profile:Object.assign(Object.assign({},a.project.data.profile),{media_thumb:u})})}})),(0,b.on)(ln.ck,(a,{id:u})=>{var l;return(null===(l=a.project)||void 0===l?void 0:l.data.id)===u?Object.assign(Object.assign({},a),{views:Object.assign(Object.assign({},a.views),{data:Object.assign({self:Object.assign(Object.assign({},a.views.data.self),{trackPending:!0}),member:Object.assign(Object.assign({},a.views.data.member),{trackPending:!0})},a.views.data.self_not_superuser?{self_not_superuser:Object.assign(Object.assign({},a.views.data.self_not_superuser),{trackPending:!0})}:{})})}):a}),(0,b.on)(ln.fZ,(a,{data:u,id:l,status:_})=>{var v;return(null===(v=a.project)||void 0===v?void 0:v.data.id)===l?Object.assign(Object.assign({},a),{views:Object.assign(Object.assign({},a.views),{data:Object.assign({self:Object.assign(Object.assign({},a.views.data.self),{is_tracked:"success"===_?u:a.views.data.self.is_tracked,trackPending:!1}),member:Object.assign(Object.assign({},a.views.data.member),{is_tracked:"success"===_?u:a.views.data.member.is_tracked,trackPending:!1})},a.views.data.self_not_superuser?{self_not_superuser:Object.assign(Object.assign({},a.views.data.self_not_superuser),{is_tracked:"success"===_?u:a.views.data.self_not_superuser.is_tracked,trackPending:!1})}:{})})}):a}),(0,b.on)(c.C,(a,u)=>Object.assign(Object.assign({},a),{project:(0,U.R6)(a.project,u)})),(0,b.on)(Gt.F2,Gt.Sn,(a,u)=>{var l,_,w=cn(u,["type"]);const lt=(null===(_=null===(l=null==w?void 0:w.role)||void 0===l?void 0:l.role_type)||void 0===_?void 0:_.group)===Ie.c.investor,bt=(0,sn.yA)(a.project);if(!lt)return a;const{is_active:Ut,id:Zt,opportunity_connection:te,reasons:h,investment_profile_object:y,business_details_object:A}=w;return Object.assign(Object.assign({},a),{project:(0,U.R6)(a.project,Object.assign(Object.assign({},bt),{investment_profile:Object.assign(Object.assign(Object.assign({},bt.investment_profile),y),{remaining_financing:y.remaining}),business_details:Object.assign(Object.assign({},bt.business_details||{}),A),financial_opportunity:{is_active:Ut,id:Zt,opportunity_connection:te,reasons:h}}))})}),(0,b.on)(Gt._d,(a,{id:u,status:l})=>{var _;const v=(0,sn.yA)(a.project);return u&&v.financial_opportunity&&u===(null===(_=v.financial_opportunity)||void 0===_?void 0:_.id)?Object.assign(Object.assign({},a),{project:(0,U.R6)(a.project,Object.assign(Object.assign({},v),{financial_opportunity:Object.assign(Object.assign({},v.financial_opportunity),{opportunity_connection:Object.assign(Object.assign({},v.financial_opportunity.opportunity_connection),{interest_status:l.sent,interest_status_updated:l.sent_date})})}))}):a}),(0,b.on)(c.RR,(a,u)=>{var _=cn(u,["type"]);return Object.assign(Object.assign({},a),{statuses:Object.assign(Object.assign({},a.statuses),_)})}),(0,b.on)(c.lu,(a,{run_financial:u})=>Object.assign(Object.assign({},a),{analysis:(0,U.R6)(a.analysis,Object.assign(Object.assign({},(0,sn.yA)(a.analysis)),{run_financial:u}))})),(0,b.on)(c.zJ,(a,{pending:u})=>Object.assign(Object.assign({},a),{projectScorePending:u}))),mn=(0,b.UY)({film:gn,opportunities:Gt.WZ});let fn=(()=>{class a{}return a.\u0275fac=function(l){return new(l||a)},a.\u0275mod=e.oAB({type:a}
1),a.\u0275inj=e.cJS({imports:[[b.Aw.forFeature("film",mn),T.sQ.forFeature([_n,Gt.cD])],b.Aw]}),a})(),vn=(()=>{class a{}return a.\u0275fac=function(l){return new(l||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[[d.ez,fn,et.Bz.forChild(p),ht.Y,Ct.ME,fe,$t._,t._r,N.ot,Q.FA,W.Is,X.t,R.Ps,G.ie,V.Tx,k.XK,K.LD,L.SJ,mt.rP,ut.x,kt.$,q.s,Rt.E$,rt.y,It.G,Ht.C]]}),a})()},92278:(Nt,gt,n)=>{n.d(gt,{U:()=>R});var d=n(39300),t=n(18505),N=n(54554),k=n(40968),Q=n(5e3),W=n(40520),X=n(48966);let R=(()=>{class G{constructor(K,L){this.http=K,this.dialog=L}fetch$(K,L){return this.http.get(`api/v2/films/${K}/opportunities/${L}/`)}create$(K,L){return this.http.post(`/api/v2/films/${K}/opportunities/`,L)}update$(K,L,mt){return this.http.patch(`/api/v2/films/${K}/opportunities/${L}/`,mt)}remove$(K,L){return this.http.delete(`/api/v2/films/${K}/opportunities/${L}/`)}resetFinancingStatus$(K,L){return this.update$(K,L,{investment_profile:{target_close_date:null,fully_funded:{funded:!1}}})}updateBudget$(K,L,mt){return this.http.patch(`/api/v2/films/${K}/opportunities/${L}/`,{investment_profile:{total_budget:mt}})}toggle$(K,L,mt){return this.http.patch(`/api/v2/films/${K}/opportunities/${L}/`,{is_active:mt})}resetFinancingStatusConfirmation(K="This project has been marked as fully financed. If you would like to raise additional funds, please chat with customer service."){this.dialog.open(N.p,{data:{title:"Financing - Fully Funded",description:K,btnOkText:"Chat"}}).afterClosed().pipe((0,d.h)(Boolean),(0,t.b)(()=>(0,k.a)())).subscribe()}}return G.\u0275fac=function(K){return new(K||G)(Q.LFG(W.eN),Q.LFG(X.uw))},G.\u0275prov=Q.Yz7({token:G,factory:G.\u0275fac,providedIn:"root"}),G})()},88298:(Nt,gt,n)=>{n.d(gt,{Jy:()=>Qt,Sc:()=>C});var d=n(5e3),t=n(67399),N=n(44987),k=n(61135),Q=n(39300),W=n(18505),X=n(17400),R=n(8089),G=n(29071),V=n(69808),K=n(20096),L=n(20773),mt=n(63559),et=n(39575),q=n(35077),rt=n(47423);function Rt(f,i){if(1&f&&d._UZ(0,"mat-spinner",11),2&f){const s=i.ngIf;d.ekj("_pending","pendingMatches"===s),d.Q6J("value","completeMatches"===s?100:0)}}function ut(f,i){1&f&&(d.TgZ(0,"div",16),d._uU(1,"-"),d.qZA())}function $t(f,i){if(1&f&&(d.TgZ(0,"div",17),d._uU(1,"0"),d.qZA()),2&f){const s=d.oxw().ngIf,r=d.oxw(2);d.Q6J("countUp",s.matchesCount)("options",r.countUpOptions)}}function kt(f,i){if(1&f&&(d.TgZ(0,"div",12),d.YNc(1,ut,2,0,"div",13),d.YNc(2,$t,2,2,"div",14),d.TgZ(3,"div",15),d._uU(4),d.qZA()()),2&f){const s=i.ngIf,r=d.oxw(2);d.xp6(1),d.Q6J("ngIf","-"===s.matchesCount),d.xp6(1),d.Q6J("ngIf","-"!==s.matchesCount),d.xp6(2),d.hij("match",r.getMatchesSuffix(s.matchesCount),"")}}const It=function(f){return{matchesCount:f}};function Ht(f,i){if(1&f&&(d.TgZ(0,"temporary-visible",7)(1,"div",8),d.YNc(2,Rt,1,3,"mat-spinner",9),d.ALo(3,"async"),d.YNc(4,kt,5,3,"div",10),d.ALo(5,"async"),d.qZA()()),2&f){const s=d.oxw();d.ekj("_shadowed",s.isShadow),d.Q6J("show",s.data.matches$)("duration",2e3),d.xp6(2),d.Q6J("ngIf",d.lcZ(3,6,s.matchesState$)),d.xp6(2),d.Q6J("ngIf",d.VKq(10,It,d.lcZ(5,8,s.data.matches$)))}}function ie(f,i){1&f&&d._UZ(0,"mat-spinner",25)}function e(f,i){if(1&f){const s=d.EpF();d.TgZ(0,"button",26),d.NdJ("click",function(){d.CHM(s);const g=d.oxw(2);return g.triggerValidation(g.model)}),d.qZA()}}function Dt(f,i){if(1&f){const s=d.EpF();d.TgZ(0,"div",18)(1,"button",19),d.NdJ("click",function(){return d.CHM(s),d.oxw().bottomSheetRef.dismiss()}),d._uU(2,"Cancel"),d.qZA(),d.TgZ(3,"div",20)(4,"button",21)(5,"span",22),d.YNc(6,ie,1,0,"mat-spinner",23),d._uU(7,"Save "),d.qZA()(),d.YNc(8,e,1,0,"button",24),d.qZA()()}if(2&f){const s=d.oxw();d.xp6(1),d.Q6J("disabled",s.bottomSheetRef.disableClose),d.xp6(3),d.Q6J("disabled",s.model.invalid||s.bottomSheetRef.disableClose),d.xp6(2),d.Q6J("ngIf",s.bottomSheetRef.disableClose),d.xp6(2),d.Q6J("ngIf",s.model.invalid)}}let T=class{constructor(i,s,r){this.bottomSheetRef=i,this.data=s,this.cdr=r,this.countUpOptions={startVal:0,duration:1},this.matchesState$=new k.X("completeMatches")}ngOnInit(){var i;null===(i=this.data)||void 0===i||i.state$.pipe((0,N.t)(this),(0,Q.h)(s=>["pendingMatches","completeMatches"].includes(s)),(0,W.b)(s=>this.matchesState$.next(s))).subscribe()}ngOnDestroy(){}get title(){switch(this.data.type){case X.c.cast:return"Cast Opportunity";case X.c.crew:return"Crew / Services <br/>Opportunity";case X.c.investor:return"Financing Opportunity";case X.c.distributor:return"Sales / Distribution <br/>Opportunity"}return""}getMatchesSuffix(i){const s=parseInt(i,10);return isNaN(s)||1!==s?"es":""}
1handleForm(i){switch(i.name){case"destroy":this.data.action$.next({name:"destroy"});break;case"submit":this.data.send(i.value);break;case"update":this.data.update$.next(i.value)}}triggerValidation(i){(0,R.B)(i),this.cdr.detectChanges()}scrollContainer(i){this.isShadow=i.target.scrollTop>0}};T.\u0275fac=function(i){return new(i||T)(d.Y36(t.oL),d.Y36(t.OG),d.Y36(d.sBO))},T.\u0275cmp=d.Xpm({type:T,selectors:[["bottom-sheet-opportunity"]],decls:7,vars:8,consts:[["cdkScrollable","",1,"scrollable-container",3,"scroll"],[1,"container","sl8d-padding-top-xl"],["class","statistics",3,"_shadowed","show","duration",4,"ngIf"],[1,"sl8d-margin-bottom-xs",3,"disableClose","ref","title"],[1,"bottom-sheet-content","sl8d-padding-top-sm-sm"],[3,"model","validateOnInit","rows","modelChange","action"],["class","controls sl8d-flex sl8d-justify-content-end",4,"ngIf"],[1,"statistics",3,"show","duration"],[1,"statistics-inner"],["color","accent","class","statistics-spinner","diameter","88","mode","determinate",3,"_pending","value",4,"ngIf"],["class","statistics-value sl8d-de-em-dark",4,"ngIf"],["color","accent","diameter","88","mode","determinate",1,"statistics-spinner",3,"value"],[1,"statistics-value","sl8d-de-em-dark"],["class","sl8d-subtitle-1",4,"ngIf"],["class","sl8d-subtitle-1",3,"countUp","options",4,"ngIf"],[1,"sl8d-caption","sl8d-relative"],[1,"sl8d-subtitle-1"],[1,"sl8d-subtitle-1",3,"countUp","options"],[1,"controls","sl8d-flex","sl8d-justify-content-end"],["type","button","mat-button","","disableRipple","",1,"sl8d-base-link-btn","sl8d-flex-basis-50p-xs",3,"disabled","click"],[1,"sl8d-relative","sl8d-flex-basis-50p-xs"],["mat-flat-button","","color","accent",1,"sl8d-full-width",3,"disabled"],[1,"sl8d-flex","sl8d-justify-content-center","sl8d-align-items-center"],["color","steel","class","sl8d-margin-right-xs","diameter","20",4,"ngIf"],["class","sl8d-invisible-button","type","button","aria-label","Click here to validate form",3,"click",4,"ngIf"],["color","steel","diameter","20",1,"sl8d-margin-right-xs"],["type","button","aria-label","Click here to validate form",1,"sl8d-invisible-button",3,"click"]],template:function(i,s){1&i&&(d.TgZ(0,"div",0),d.NdJ("scroll",function(g){return s.scrollContainer(g)}),d.TgZ(1,"div",1),d.YNc(2,Ht,6,12,"temporary-visible",2),d._UZ(3,"bottom-sheet-header",3),d.TgZ(4,"div",4)(5,"sl-configurable-form",5),d.NdJ("modelChange",function(g){return s.model=g})("action",function(g){return s.handleForm(g)}),d.YNc(6,Dt,9,4,"div",6),d.qZA()()()()),2&i&&(d.xp6(2),d.Q6J("ngIf",s.data.matches$),d.xp6(1),d.Q6J("disableClose",s.bottomSheetRef.disableClose)("ref",s.bottomSheetRef)("title",s.title),d.xp6(2),d.Q6J("model",s.model)("validateOnInit",s.data.validateOnInit)("rows",s.data.rows),d.xp6(1),d.Q6J("ngIf",s.model))},directives:[G.PQ,V.O5,K.r,L.Ou,mt.P,et._,q.i,rt.lW],pipes:[V.Ov],styles:['.opportunity-bottom-sheet{display:flex}[_nghost-%COMP%]{align-items:stretch;flex-grow:1;padding:0!important;display:flex!important}.scrollable-container[_ngcontent-%COMP%]{position:relative;align-items:stretch;flex-grow:1;overflow-x:hidden;overflow-y:auto}.select-options[_ngcontent-%COMP%]{max-height:205px;overflow-y:auto;overflow-x:hidden}.mat-divider[_ngcontent-%COMP%]{margin-bottom:32px}.bottom-sheet-content[_ngcontent-%COMP%]{position:relative}.textarea[_ngcontent-%COMP%]{padding:0}.statistics[_ngcontent-%COMP%]{display:block;right:0;width:88px;height:0;margin-top:0;margin-left:auto;z-index:2;position:relative}.statistics-spinner[_ngcontent-%COMP%]{transform-origin:center;transform:rotate(180deg);position:relative;border-radius:50%;background:#eee}.statistics-spinner[_ngcontent-%COMP%]:before{content:"";top:0;bottom:0;left:0;right:0;width:72px;height:72px;margin:auto;border-radius:50%;background:#fff;position:absolute;z-index:1}.statistics-spinner[_ngcontent-%COMP%] circle{transition:stroke-dashoffset .9s ease-out}.statistics-spinner._pending[_ngcontent-%COMP%] circle{transition:stroke-dashoffset 225ms linear}.statistics.temporary-visible[_ngcontent-%COMP%]{position:sticky;transform:translateY(-10px);top:34px}.statistics.temporary-visible._shadowed[_ngcontent-%COMP%]:before{box-shadow:0 3px 4px #0006}@media (max-width: 959px){.statistics[_ngcontent-%COMP%]{right:6px;transform:translateY(-16px)}.statistics.temporary-visible[_ngcontent-%COMP%]{top:66px;transform:translateY(-58px);right:30px}}@media (max-width: 599px){.statistics.temporary-visible[_ngcontent-%COMP%]{right:14px}}.statistics-value[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;text-align:center}.statistics-inner[_ngcontent-%COMP%]{width:88px;height:88px;position:relative;top:-18px}@media (max-width: 959px){.statistics-inner[_ngcontent-%COMP%]{top:0}}.statistics[_ngcontent-%COMP%] canvas[_ngcontent-%COMP%]{position:relative}.statistics[_ngcontent-%COMP%]:before{content:"";display:block;position:absolute;top:-19px;left:0;bottom:0;right:6px;width:88px;background:#fff;height:88px;border-radius:50%}@media (max-width: 959px){.statistics[_ngcontent-%COMP%]:before{top:-2px}}@media (min-width: 430px){ bottom-sheet-header h3 br{display:none}}'],changeDetection:0}),T=function(f,i,s,r){var F,g=arguments.length,D=g<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)D=Reflect.decorate(f,i,s,r);else for(var O=f.length-1;O>=0;O--)(F=f[O])&&(D=(g<3?F(D):g>3?F(i,s,D):F(i,s))||D);return g>3&&D&&Object.defineProperty(i,s,D),D}([(0,N.c)(),function(f,i){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata("design:paramtypes",i)}(0,[t.oL,Object,d.sBO])],T);var b=n(93075),ot=n(86856),Jt=n(4834),H=n(67322),B=n(98833),Z=n(25245),Pt=n(74107),Tt=n(78029),j=n(65835),dt=n(50703),Et=n(16882),re=n(87390),Bt=n(95776),Lt=n(40217);let Qt=(()=>{class f{}return f.\u0275fac=function(s){return new(s||f)},f.\u0275mod=d.oAB({type:f}),f.\u0275inj=d.cJS({imports:[[re.k,dt.Y,V.ez,Bt.ME,Lt.v,mt.m,j.zh,b.u5,rt.ot,ot.FA,Jt.t,H.lN,B.c,Z.Ps,L.Cq,Pt.LD,Tt.KP,b.UX,G.Cl,Et.p]]}),f})();var I=n(77579),st=n(39841),nt=n(5963),z=n(39646),ct=n(54004),yt=n(63900),jt=n(70262),Ft=n(82722),se=n(95698),Se=n(53092),ye=n(30896),ge=n(83829),Oe=n(1982),me=n(10484),fe=n(65620),le=n(87125),je=n(32993),Ee=n(90900),Ce=n(47910),Fe=n(94086),we=n(34782),Te=n(11365),Wt=n(65967),ve=n(39566),Ue=n(1099),Me=n(31302);function Ie(f){return i=>{var s;const r=null===(s=i.root.value)||void 0===s?void 0:s[f];return r&&i.value&&i.value>r?{minMaxBudget:r}:null}}function Ze(f){return i=>f&&i.value&&i.value<f?{moreThanRaisedBudget:f}:null}function Gt(f){return i=>{const s=i.root;return s&&s.value&&setTimeout(()=>f.forEach(r=>{var g;return null===(g=s.get(r))||void 0===g?void 0:g.updateValueAndValidity()})),null}}const he=f=>i=>b.kI.required(i)?{requiredChip:f}:null,Re=(f,i)=>s=>{var r;return(null===(r=s.value)||void 0===r?void 0:r.length)>f?{maxChips:i}:null};let De=(()=>{class f{constructor(s,r,g){this.cacheService=s,this.tagsApi=r,this.store=g}findTags(s,r="",{minQueryLength:g,limit:D,type:F}={}){return g&&(!r||(null==r?void 0:r.length)<g)?(0,z.of)([]):r?this.tagsApi.tags$(s,r,{limit:D,type:F}).pipe((0,ct.U)(O=>{var it;return null!==(it=null==O?void 0:O.results.map(({name:tt,slug:_t,id:pt})=>({name:tt,value:_t||pt})))&&void 0!==it?it:[]}),(0,jt.K)(()=>(0,z.of)([]))):this.cacheService.cache(`tags_${s}`,this.tagsApi.tags$(s,r,{limit:D,type:F}).pipe((0,ct.U)(O=>{var it;return null!==(it=null==O?void 0:O.results.map(({name:tt,slug:_t,id:pt})=>({name:tt,value:_t||pt})))&&void 0!==it?it:[]}),(0,jt.K)(()=>(0,z.of)([])),(0,Me.f)(),(0,Fe.g)(100)))}findRoleTags(s,r=""){return this.cacheService.cache(`${s}_role_tag`,this.tagsApi.lookingForTags$(s,r).pipe((0,jt.K)(()=>(0,z.of)([])),(0,Me.f)())).pipe((0,ct.U)(g=>(0,Ue.G)(g,r.toLowerCase())))}createCastFields(s,r){var g,D,F,O,it;return[[{tabletLayout:"max",groups:[{title:"Seeking",fields:[[{type:"select",name:"role_tag",label:"Role type",validators:[b.kI.required],required:!0,autocomplete:{placeholder:"Search Role"},value:(null===(g=null==r?void 0:r.role)||void 0===g?void 0:g.id)||null,options$:(tt="")=>this.findRoleTags("cast",tt).pipe((0,ct.U)(_t=>{var pt,Mt;return null!==(Mt=null===(pt=null==_t?void 0:_t[0])||void 0===pt?void 0:pt.role_tags.map(({name:ee,id:ue})=>({name:ee,value:ue})))&&void 0!==Mt?Mt:[]}))},{type:"select",name:"filter_billing",label:"Billing",withEmptyOption:!0,value:null===(D=null==r?void 0:r.filter_billing)||void 0===D?void 0:D.slug,autocomplete:{placeholder:"Search Billing"},options$:tt=>this.findTags(Wt.$G.billing,tt)},this.createNameField(r)],[this.createDescriptionField(r,{sm:{min:12,max:12}})]]}]},{groups:[{title:"Role Attributes",fields:[this.createGendersField(r),{type:"chips",name:"filter_ethnicities",label:"Ethnicities",removable:!0,keepOpenOnSelect:!0,value:null===(F=null==r?void 0:r.filter_ethnicities)||void 0===F?void 0:F.map(({slug:tt,name:_t})=>({name:_t,value:tt})),options$:tt=>this.findTags(Wt.$G.ethnicities,tt)},{type:"select",name:"filter_age_ranges",label:"Age range",value:null===(O=null==r?void 0:r.filter_age_ranges)||void 0===O?void 0:O.map(tt=>tt.slug),autocomplete:{placeholder:"Search Age Range"},multiple:!0,options$:tt=>this.findTags(Wt.$G.age_ranges,tt)},this.createLanguagesField(r)]}]},{groups:[{title:"Candidate Must Have",fields:[this.createUserScoreField(r),this.createLocationField(X.c.cast,s.location_tags,r)]},{title:"Desired",fields:[{type:"select",name:"filter_skills",label:"Skills",multiple:!0,autocomplete:{placeholder:"Search Skills"},value:null===(it=null==r?void 0:r.filter_skills)||void 0===it?void 0:it.map(tt=>tt.slug),options$:tt=>this.findTags(Wt.$G.skills,tt,{limit:150})}]}]}]]}createCrewFields(s,r){var g;return[[{tabletLayout:"max",groups:[{title:"Seeking",fields:[[{type:"select",name:"role_tag",label:"Role type",validators:[b.kI.required],required:!0,withGroups:!0,autocomplete:{placeholder:"Search Role"},value:(null===(g=null==r?void 0:r.role)||void 0===g?void 0:g.id)||null,options$:D=>this.findRoleTags("crew_services",D).pipe((0,ct.U)(F=>{var O;return null!==(O=null==F?void 0:F.map(({role_tags:it=[],role_type:tt=""})=>{var _t;return{name:tt,options:null!==(_t=it.map(({name:pt,id:Mt})=>({name:pt,value:Mt})))&&void 0!==_t?_t:[]}}))&&void 0!==O?O:[]}))},this.createLocationField(X.c.crew,s.location_tags,r,{breakpoints:[ve.Bh]})],[Object.assign(Object.assign({},this.createDescriptionField(r,{sm:{min:7,max:7},md:{min:4,max:7}})),{label:"Additional details"})]]}]},{tabletLayout:"max",groups:[{title:"Candidate must have",fields:[[this.createUserScoreField(r)],[this.createLocationField(X.c.crew,s.location_tags,r,{breakpoints:[ve.NU,ve.H$]})]]}]}]]}createDistFields(s,r){var g,D;return[[{tabletLayout:"max",groups:[{title:"Seeking",fields:[[this.createDistRoleField(r),{type:"chips",name:"filter_distribution_territories",label:"Territories",validators:[he("Enter at least one territory")],required:!0,value:(null===(g=null==r?void 0:r.filter_distribution_territories)||void 0===g?void 0:g.length)?r.filter_distribution_territories.map(({slug:F,name:O})=>({name:O,value:F})):[{value:"worldwide",name:"Worldwide"}],keepOpenOnSelect:!0,removable:!0,options$:F=>this.findTags(Wt.$G.territories,F)},{type:"chips",name:"filter_distribution_rights",value:(null===(D=null==r?void 0:r.filter_distribution_rights)||void 0===D?void 0:D.length)?r.filter_distribution_rights.map(({slug:F,name:O})=>({name:O,value:F})):[{value:"all-rights",name:"All Rights"}],keepOpenOnSelect:!0,label:"Rights",validators:[he("Enter at least one rights type")],required:!0,removable:!0,options$:F=>this.findTags(Wt.$G.rights,F)}],[Object.assign(Object.assign({},this.createDescriptionField(r,{sm:{min:17,max:17}})),{label:"Description/Sales and distribution pitch"})]]}]},{tabletLayout:"max",groups:[{title:"Candidate must have",fields:[[this.createUserScoreField(r)],[]]}]}]]}createInvestorFields(s,r){var g,D,F,O,it,tt,_t,pt,Mt,ee,ue,vt,At,wt,ne;const Xt=(null===(g=null==s?void 0:s.business_details)||void 0===g?void 0:g.production_start_date)||(null===(D=null==r?void 0:r.business_details_object)||void 0===D?void 0:D.production_start_date),_e=(null===(F=null==r?void 0:r.investment_profile_object)||void 0===F?void 0:F.total_budget)||(null===(O=null==s?void 0:s.investment_profile)||void 0===O?void 0:O.total_budget),We=new Date,Ye=new Date;Ye.setDate(Ye.getDate()+1);const Le=new Date;Le.setDate(Le.getDate()-1);const Ne=(0,le.Z)(new Date,{years:2,days:-1}),Je=["Development","Pre-Production","Packaging"].includes(null===(it=s.stage)||void 0===it?void 0:it.name)?Ye:null,Qe=["Development","Pre-Production","Packaging"].includes(null===(tt=s.stage)||void 0===tt?void 0:tt.name)?Ne:"Production"===(null===(_t=s.stage)||void 0===_t?void 0:_t.name)?We:["Post-Production","Distribution","Completed","Released"].includes(null===(pt=s.stage)||void 0===pt?void 0:pt.name)?Le:null;return[[{groups:[{title:"Financing Details",fields:[{type:"select",name:"project_financing_stage",label:"Financing stage",value:(null==r?void 0:r.project_financing_stage)||"P",options$:(0,z.of)([{value:"D",name:"Development"},{value:"P",name:"Production & Post-production"}
1,{value:"B",name:"Distribution & Marketing"}])},{type:"chips",name:"project_financing_types",label:"Financing type",options$:Kt=>this.findTags(Wt.$G.financingTypes,Kt),keepOpenOnSelect:!0,removable:!0,value:null===(Mt=null==r?void 0:r.project_financing_types)||void 0===Mt?void 0:Mt.map(({slug:Kt,name:ae})=>({name:ae,value:Kt}))},{type:"budget",name:"min_investment",label:"Minimum investment amount",validators:[Ie("total_budget"),b.kI.max(1e7),b.kI.min(0)],value:null===(ee=null==r?void 0:r.investment_profile_object)||void 0===ee?void 0:ee.min_investment},Object.assign(Object.assign({},this.createDescriptionField(r,{sm:{min:9,max:9}})),{label:"Filmmaker statement",leftHint:{type:"link",content:"How to write a strong filmmaker statement",href:"https://help.slated.com/en/articles/4454339-how-to-write-a-strong-filmmaker-statement",target:"_blank",suffix:"launch"}})]}]},{groups:[{classes:{gtXs:{"sl8d-padding-top-xxxxl":!0}},title:"Production Details",fields:[{type:"budget",name:"total_budget",label:"Total production budget",validators:[Gt(["min_investment"]),b.kI.max(3e8),Ze(null===(ue=null==s?void 0:s.investment_profile)||void 0===ue?void 0:ue.total_raised),b.kI.min(1),b.kI.required],value:_e,required:!0},Object.assign(Object.assign({},this.createLocationField(X.c.investor,s.location_tags,r)),{label:"Production locations",validators:[he("Enter at least one production location"),Re(6,"Only 6 production locations allowed")],required:!0,value:r?(null===(At=null===(vt=null==r?void 0:r.project_object)||void 0===vt?void 0:vt.location_tags)||void 0===At?void 0:At.map(({slug:Kt,name:ae})=>({value:Kt,name:ae})))||[]:s.location_tags.map(({name:Kt,slug:ae})=>({name:Kt,value:ae}))}),{type:"date",name:"production_start_date",label:"Production Start Date",value:Xt?new Date(`${Xt}T00:00:00`):null,min:Je,max:Qe,validators:[["Production","Distribution","Post-Production","Released"].includes(null===(wt=s.stage)||void 0===wt?void 0:wt.name)?b.kI.required:null].filter(Kt=>!!Kt),required:["Production","Distribution","Post-Production","Released"].includes(null===(ne=s.stage)||void 0===ne?void 0:ne.name),customErrorMessage:Kt=>{var ae;if(Kt.matDatepickerMin)return"Production cannot have started in the past if current stage is Development or Pre-production";if(Kt.matDatepickerMax)switch(null===(ae=s.stage)||void 0===ae?void 0:ae.name){case"Production":case"Post-Production":case"Completed":case"Released":return"Production must have started in the past if current stage is Production or later";default:return"Production must start within 2 years"}return"This is invalid"}}]}]}]]}createDistRoleField(s){var r;return{type:"select",name:"role_type",label:"Role type",value:null===(r=null==s?void 0:s.role_type)||void 0===r?void 0:r.id,validators:[b.kI.required],required:!0,options$:D=>this.findTags(Wt.$G.distRoles,D).pipe((0,yt.w)(F=>this.store.pipe((0,fe.Ys)(ge.Yi),(0,ct.U)(O=>O.DIST),(0,ct.U)((O=[])=>F.filter(({value:it})=>{var tt;return(null===(tt=null==s?void 0:s.role_type)||void 0===tt?void 0:tt.id)===it||!O.find(({role_type:_t})=>(null==_t?void 0:_t.id)===it)})))))}}createGendersField(s){var r;const g=this.tagsApi.genders$().pipe((0,ct.U)(D=>{var F;return null!==(F=D.map(({name:O,id:it})=>({name:O,value:it})))&&void 0!==F?F:[]}),(0,jt.K)(()=>(0,z.of)([])),(0,we.d)(1));return{type:"select",name:"filter_gender",label:"Gender",value:null===(r=null==s?void 0:s.filter_gender)||void 0===r?void 0:r.id,autocomplete:{placeholder:"Search Gender"},options$:(D="")=>g.pipe((0,ct.U)(F=>F.filter(({name:O=""})=>O.toLowerCase().indexOf(D.toLowerCase())>=0))),withEmptyOption:!0}}createNameField(s){return{type:"input",name:"name",label:"Role name",validators:[b.kI.maxLength(30)],value:null==s?void 0:s.name,rightHint:{type:"length",max:30}}}createDescriptionField(s,r){return{type:"textarea",name:"description",label:"Role description",value:null==s?void 0:s.description,validators:[b.kI.maxLength(500)],rightHint:{type:"length",max:500},rows:r}}createLanguagesField(s){var r;return{type:"chips",name:"filter_spoken_languages",label:"Spoken languages",keepOpenOnSelect:!0,removable:!0,value:null===(r=null==s?void 0:s.filter_spoken_languages)||void 0===r?void 0:r.map(({slug:g,name:D})=>({name:D,value:g})),options$:g=>this.findTags(Wt.$G.languages,g,{limit:-1})}}createLocationField(s,r=[],g,D){var F,O;let it;const tt=()=>it.pipe((0,ct.U)(vt=>vt.length>1)),_t=new I.x,Mt=_t.pipe((0,Q.h)(vt=>"destroy"===vt.name));it=new k.X(r.map(({name:vt,slug:At})=>({name:vt,value:At,get canRemove$(){return tt()}}))),_t.pipe((0,Q.h)(vt=>"select"===vt.name),(0,Te.M)(it),(0,W.b)(([vt,At])=>{const Xt=function(f,i){var s={};for(var r in f)Object.prototype.hasOwnProperty.call(f,r)&&i.indexOf(r)<0&&(s[r]=f[r]);if(null!=f&&"function"==typeof Object.getOwnPropertySymbols){var g=0;for(r=Object.getOwnPropertySymbols(f);g<r.length;g++)i.indexOf(r[g])<0&&Object.prototype.propertyIsEnumerable.call(f,r[g])&&(s[r[g]]=f[r[g]])}return s}(vt.value,["html"]),_e=Object.assign(Object.assign({}
1,Xt),{get canRemove$(){return tt()}});it.next(At.find(We=>We.value===vt.value.value)?At:[...At,_e])}),(0,Ft.R)(Mt)).subscribe(),_t.pipe((0,Q.h)(vt=>"removeOption"===vt.name),(0,Te.M)(it),(0,W.b)(([vt,At])=>it.next(At.filter(({value:wt})=>wt!==vt.value.value))),(0,Ft.R)(Mt)).subscribe();const ee=(vt,At)=>`<span class="sl8d-de-em">${At.replace(vt,wt=>`<span class="sl8d-text">${wt}</span>`)}</span>`,ue=g?(null===(O=s===X.c.investor?null===(F=null==g?void 0:g.project_object)||void 0===F?void 0:F.location_tags:null==g?void 0:g.filter_location)||void 0===O?void 0:O.map(({slug:vt,name:At})=>({value:vt,name:At})))||[]:r.map(({name:vt,slug:At})=>({name:vt,value:At}));return Object.assign({type:"chips",name:"filter_location",label:"Location",value:ue,removable:!0,events$:_t,max:6,options:{removable:!0},options$:vt=>it.pipe((0,yt.w)(At=>(vt?this.findTags(Wt.$G.locations,vt,{type:"regions",limit:5}):(0,z.of)([])).pipe((0,ct.U)(wt=>wt.filter(ne=>!At.find(Xt=>Xt.value===ne.value))),(0,ct.U)(([wt])=>{const ne=new RegExp(vt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),Xt=At.filter(({name:_e})=>ne.test(_e));return At.length<6&&wt?[...Xt,Object.assign(Object.assign({},wt),{html:`Add: ${ee(ne,wt.name)}`,canRemove:!1})]:vt?At.filter(({name:_e})=>ne.test(_e)):At}),(0,ct.U)(wt=>wt.length?wt:vt.length?[{value:null,name:"Please try another term",disabled:!0,canRemove:!1}]:[]))),(0,Ft.R)(Mt))},D||{})}createUserScoreField(s){var r;return{type:"score",name:"filter_min_user_score",label:"Minimum role score",value:null!==(r=null==s?void 0:s.filter_min_user_score)&&void 0!==r?r:0,min:0,max:99,step:1}}valueToSlug(s){return{slug:null==s?void 0:s.value}}stringToSlug(s){return{slug:s}}createRequestModel(s,r){switch(s){case X.c.cast:return this.createCastRequest(r);case X.c.crew:return this.createCrewRequest(r);case X.c.investor:return this.createInvRequest(r);case X.c.distributor:return this.createDistRequest(r)}}createCastRequest(s){var r,g,D,F,O,it,tt,_t,pt,Mt;return{is_active:!0,description:s.description,filter_age_ranges:null!==(g=null===(r=s.filter_age_ranges)||void 0===r?void 0:r.map(this.stringToSlug))&&void 0!==g?g:[],filter_billing:s.filter_billing?{slug:s.filter_billing}:null,filter_ethnicities:null!==(F=null===(D=s.filter_ethnicities)||void 0===D?void 0:D.map(this.valueToSlug))&&void 0!==F?F:[],filter_gender:s.filter_gender||null,filter_location:null!==(it=null===(O=s.filter_location)||void 0===O?void 0:O.map(this.valueToSlug))&&void 0!==it?it:[],filter_min_user_score:s.filter_min_user_score||0,filter_skills:null!==(_t=null===(tt=s.filter_skills)||void 0===tt?void 0:tt.map(this.stringToSlug))&&void 0!==_t?_t:[],filter_spoken_languages:null!==(Mt=null===(pt=s.filter_spoken_languages)||void 0===pt?void 0:pt.map(this.valueToSlug))&&void 0!==Mt?Mt:[],name:s.name||"",role_tag:s.role_tag}}createCrewRequest(s){var r,g;return{is_active:!0,description:s.description,filter_location:null!==(g=null===(r=s.filter_location)||void 0===r?void 0:r.map(this.valueToSlug))&&void 0!==g?g:[],filter_min_user_score:s.filter_min_user_score||0,role_tag:s.role_tag}}createDistRequest(s){var r,g,D,F;return{is_active:!0,description:s.description,filter_distribution_rights:null!==(g=null===(r=s.filter_distribution_rights)||void 0===r?void 0:r.map(this.valueToSlug))&&void 0!==g?g:[],filter_distribution_territories:null!==(F=null===(D=s.filter_distribution_territories)||void 0===D?void 0:D.map(this.valueToSlug))&&void 0!==F?F:[],filter_min_user_score:s.filter_min_user_score||0,role_type:s.role_type}}createInvRequest(s){var r,g,D;const F="string"==typeof s.production_start_date?(0,je.Z)(s.production_start_date):s.production_start_date,O=F&&(0,Ee.Z)(F)?F.getTime():null;return{is_active:!0,is_investor:!0,description:s.description,business_details:{production_start_date:O?(0,Ce.Z)(O,"yyyy-MM-dd"):null},investment_profile:{min_investment:s.min_investment||0,total_budget:s.total_budget||0},project:{location_tags:null!==(g=null===(r=s.filter_location)||void 0===r?void 0:r.map(this.valueToSlug))&&void 0!==g?g:[]},project_financing_stage:s.project_financing_stage||"",project_financing_types:(null===(D=s.project_financing_types)||void 0===D?void 0:D.map(this.valueToSlug))||[]}}}return f.\u0275fac=function(s){return new(s||f)(d.LFG(Oe.QM),d.LFG(Wt.vO),d.LFG(fe.yh))},f.\u0275prov=d.Yz7({token:f,factory:f.\u0275fac,providedIn:Qt}),f})();var Be=n(92278),$e=n(64416),oe=n(40520);let C=(()=>{class f{constructor(s,r,g,D,F,O,it,tt){this.http=s,this.store=r,this.errorHandler=g,this.bottomSheet=D,this.bottomSheetOpportunityFieldsService=F,this.analyticsService=O,this.opportunitiesService=it,this.projectPageSupportService=tt}openOpportunityBottomSheet(s,r,g=null,D){const F=new I.x,O=new k.X("-"),it=new k.X("completeMatches"),tt=new I.x;F.pipe((0,W.b)(({valid:pt,key:Mt})=>{const ee=["name","description","filter_skills"].includes(Mt);(!pt||ee)&&(it.next("completeMatches"),ee||O.next("-"))}),(0,Q.h)(({key:pt})=>!["name","description","filter_skills"].includes(pt)),(0,Q.h)(({valid:pt})=>pt),(0,W.b)(()=>it.next("pendingMatches")),(0,ct.U)(({model:pt})=>this.bottomSheetOpportunityFieldsService.createRequestModel(s,pt)),(0,yt.w)(pt=>(0,st.a)([this.http.post(`/api/v2/films/${r.id}/opportunity-matches/`,pt),(0,nt.H)(250)]).pipe((0,ct.U)(([{count:Mt}])=>Mt),(0,jt.K)(()=>(0,z.of)("-")))),(0,W.b)(()=>it.next("completeMatches")),(0,W.b)(pt=>O.next(pt)),(0,Ft.R)(tt.pipe((0,Q.h)(pt=>"destroy"===pt.name)))).subscribe();const _t=this.bottomSheet.open(T,{data:{type:s,rows:this.createFields(r,s,g),matches$:O,update$:F,action$:tt,state$:it,send:pt=>D(_t,pt),validateOnInit:!!g},panelClass:"opportunity-bottom-sheet"})}openCreatingOpportunityBottomSheet(s,r){this.openOpportunityBottomSheet(s,r,null,(g,D)=>{g.disableClose=!0,this.opportunitiesService.create$(r.id,this.bottomSheetOpportunityFieldsService.createRequestModel(s,D)).pipe((0,W.b)(F=>this.store.dispatch((0,ge.Sn)(F))),(0,W.b)(F=>this.analyticsService.sendGtmEvent({event:"updated_opportunity",opportunity_id:F.id})),(0,yt.w)(()=>this.updateLocations$(r,D)),(0,W.b)(()=>this.store.dispatch((0,Se.U9)())),(0,W.b)(()=>g.disableClose=!1),(0,W.b)(()=>g.dismiss()),(0,jt.K)(F=>(g.disableClose=!1,this.errorHandler.handle(F,()=>{if(409===F.status)return"You already created one opportunity. Refresh the page to edit it."}),(0,z.of)(!0)))).subscribe()})}openEditingOpportunityBottomSheet(s,r,g){this.openOpportunityBottomSheet(s,g,r,(D,F)=>{D.disableClose=!0,this.opportunitiesService.update$(g.id,r.id,this.bottomSheetOpportunityFieldsService.createRequestModel(s,F)).pipe((0,W.b)(()=>X.c.investor===s&&this.store.dispatch((0,ye.O5)({}))),(0,W.b)(O=>this.store.dispatch((0,ge.Sn)(O))),(0,W.b)(O=>this.analyticsService.sendGtmEvent({event:"updated_opportunity",opportunity_id:O.id})),(0,W.b)(()=>{var O;(null===(O=g.investment_profile)||void 0===O?void 0:O.total_budget)&&this.projectPageSupportService.checkSimulationUpdates(g.id,g.investment_profile.total_budget)}),(0,yt.w)(()=>this.updateLocations$(g,F)),(0,W.b)(()=>D.instance.bottomSheetRef.disableClose=!1),(0,W.b)(()=>D.dismiss()),(0,jt.K)(O=>(D.instance.bottomSheetRef.disableClose=!1,this.errorHandler.handle(O,()=>
1{if(404===O.status)return"The opportunity doesn't exist."}),(0,z.of)(!0)))).subscribe()})}compareLocations(s,r){return Array.isArray(s)&&Array.isArray(r)&&s.length===r.length&&s.every(({slug:g})=>!!r.find(({value:D})=>g===D))}updateLocations$(s,r){return r.filter_location_options$?(r=r).filter_location_options$("").pipe((0,se.q)(1),(0,yt.w)(D=>(D&&this.compareLocations(s.location_tags,D)||this.store.dispatch((0,ye.Hh)({updateScore:!1,fetchAnalysis:!1,data:{location_tags:D.map(({value:O})=>({slug:O}))}})),(0,z.of)(!0)))):(0,z.of)(!0)}createFields(s,r,g){switch(r){case"CAST":return this.bottomSheetOpportunityFieldsService.createCastFields(s,g);case"CREW":return this.bottomSheetOpportunityFieldsService.createCrewFields(s,g);case"DIST":return this.bottomSheetOpportunityFieldsService.createDistFields(s,g);case"INV":return this.bottomSheetOpportunityFieldsService.createInvestorFields(s,g)}}}return f.\u0275fac=function(s){return new(s||f)(d.LFG(oe.eN),d.LFG(fe.yh),d.LFG(Oe.qL),d.LFG(t.ch),d.LFG(De),d.LFG(me.yD),d.LFG(Be.U),d.LFG($e.G))},f.\u0275prov=d.Yz7({token:f,factory:f.\u0275fac,providedIn:Qt}),f})()},69370:(Nt,gt,n)=>{n.d(gt,{u:()=>t});var d=n(5e3);let t=(()=>{class N{}return N.\u0275fac=function(Q){return new(Q||N)},N.\u0275mod=d.oAB({type:N}),N.\u0275inj=d.cJS({}),N})()},78316:(Nt,gt,n)=>{n.d(gt,{f:()=>t});var d=n(5e3);let t=(()=>{class N{transform(Q,W){if(!Q)return null;const X=null==W?void 0:W.find(({low:R,high:G})=>(R=R?1e3*R:null,null===(G=G?1e3*G:null)&&Q>=R||null===R&&Q<G||Q>=R&&Q<G));return null==X?void 0:X.name}}return N.\u0275fac=function(Q){return new(Q||N)},N.\u0275pipe=d.Yjl({name:"budgetRange",type:N,pure:!0}),N})()},24877:(Nt,gt,n)=>{n.d(gt,{E:()=>zt});var d=n(95113),t=n(5e3),N=n(93075),k=n(48966),Q=n(26991),W=n(44987),X=n(54968),R=n(39300),G=n(18505),V=n(95698),K=n(54004),L=n(85746),mt=n(39566),et=n(75853),q=n(79402),rt=n(60848),Ct=n(3596),ht=n(30896),Rt=n(84666),ut=n(69808),$t=n(67631),kt=n(77446),It=n(47423),Ht=n(20773);function Dt(p,m){1&p&&(t.TgZ(0,"p"),t._uU(1,"Film marked as 100% financed."),t.qZA())}function T(p,m){if(1&p&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&p){const o=m.$implicit;t.xp6(1),t.Oqu(o)}}function b(p,m){if(1&p&&(t.ynx(0),t.YNc(1,T,2,1,"div",15),t.BQk()),2&p){const o=t.oxw(4);t.xp6(1),t.Q6J("ngForOf",o.error.errors)}}function ot(p,m){if(1&p&&t._uU(0),2&p){const o=t.oxw(4);t.Oqu(o.errorMessage.processing)}}function Jt(p,m){if(1&p&&(t.YNc(0,b,2,1,"ng-container",2),t.YNc(1,ot,1,1,"ng-template",null,14,t.W1O)),2&p){const o=t.MAs(2),E=t.oxw(3);t.Q6J("ngIf",null==E.error.errors?null:E.error.errors.length)("ngIfElse",o)}}function H(p,m){1&p&&(t.TgZ(0,"sl-promotion",12),t.YNc(1,Jt,3,2,"ng-template",null,13,t.W1O),t.qZA())}function B(p,m){if(1&p&&t.YNc(0,H,3,0,"sl-promotion",11),2&p){const o=t.oxw(),E=t.MAs(6);t.Q6J("ngIf",o.error)("ngIfElse",E)}}function Z(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"p",16),t._uU(1,"You've completed fundraising for your project. Is this correct?"),t.qZA(),t.TgZ(2,"mat-checkbox",17),t.NdJ("ngModelChange",function(Y){return t.CHM(o),t.oxw().metInvestorOnSlated=Y}),t._uU(3,"Yes and I met an investor on Slated"),t.qZA(),t.TgZ(4,"mat-checkbox",18),t.NdJ("ngModelChange",function(Y){return t.CHM(o),t.oxw().metUsefulIndustryContactOnSlated=Y}),t._uU(5,"Yes and I made a useful industry contact on Slated"),t.qZA()}if(2&p){const o=t.oxw();t.xp6(2),t.Q6J("disabled",o.pending)("ngModel",o.metInvestorOnSlated),t.xp6(2),t.Q6J("disabled",o.pending)("ngModel",o.metUsefulIndustryContactOnSlated)}}function Pt(p,m){if(1&p&&(t.TgZ(0,"button",19)(1,"span",20),t._uU(2,"No"),t.TgZ(3,"span",21),t._uU(4,", still raising"),t.qZA()()()),2&p){const o=t.oxw();t.Q6J("disabled",o.dialogRef.disableClose||o.pending)("mat-dialog-close",!1)}}function Tt(p,m){1&p&&t._UZ(0,"mat-spinner",22)}function j(p,m){1&p&&(t.ynx(0),t._uU(1,"Ok"),t.BQk())}function dt(p,m){1&p&&(t._uU(0,"Yes"),t.TgZ(1,"span",21),t._uU(2,", we're 100% funded"),t.qZA())}let Et=class extends rt.v{constructor(m,o,E,Y){super(m),this.dialogRef=m,this.data=o,this.actions$=E,this.cdr=Y,this.metInvestorOnSlated=!1,this.metUsefulIndustryContactOnSlated=!1,this.errorMessage=Ct.B,this.pending=!1,this.error=!1}ngOnDestroy(){}submit(){this.pending=!0,this.actions$.pipe((0,Q.l4)(ht.M9),(0,W.t)(this),(0,R.h)(m=>!m.data.status.pending),(0,G.b)(m=>{m.data.status.error?this.error=m.data.status.error:this.markFullyFundedSuccess=!0,this.pending=!1,this.cdr.markForCheck()}),(0,V.q)(1)).subscribe(),this.data.submit(this.metInvestorOnSlated,this.metUsefulIndustryContactOnSlated)}};Et.\u0275fac=function(m){return new(m||Et)(t.Y36(k.so),t.Y36(k.WI),t.Y36(Q.eX),t.Y36(t.sBO))},Et.\u0275cmp=t.Xpm({type:Et,selectors:[["dialog-fully-funded"]],features:[t.qOj],decls:15,vars:8,consts:[["title","Congratulations!",3,"disableClose"],[1,"sl8d-body-2"],[4,"ngIf","ngIfElse"],["notSentCasesTmpl",""],["defaultCaseTmpl",""],["mat-dialog-actions","",1,"sl8d-padding-top","sl8d-justify-content-end"],["mat-button","","class","sl8d-base-link-btn sl8d-flex-basis-50p-xs","disableRipple","",3,"disabled","mat-dialog-close",4,"ngIf"],["mat-flat-button","","color","accent",1,"sl8d-flex-basis-50p-xs",3,"disabled","click"],[1,"sl8d-flex","sl8d-align-items-center","sl8d-justify-content-center"],["color","steel","class","sl8d-margin-right-xs","diameter","20",4,"ngIf"],["submitBtnTmpl",""],["icon","error","color","error",4,"ngIf","ngIfElse"],["icon","error","color","error"],["content",""],["defaultErrorTmpl",""],[4,"ngFor","ngForOf"],[1,"sl8d-margin-bottom"],[1,"sl8d-margin-bottom-xxs","sl8d-block",3,"disabled","ngModel","ngModelChange"],[1,"sl8d-checkbox-wrap",3,"disabled","ngModel","ngModelChange"],["mat-button","","disableRipple","",1,"sl8d-base-link-btn","sl8d-flex-basis-50p-xs",3,"disabled","mat-dialog-close"],[1,"sl8d-flex","sl8d-justify-content-center"],[1,"sl8d-hide-xs"],["color","steel","diameter","20",1,"sl8d-margin-right-xs"]],template:function(m,o){if(1&m&&(t._UZ(0,"dialog-header",0),t.TgZ(1,"div",1),t.YNc(2,Dt,2,0,"p",2),t.YNc(3,B,1,2,"ng-template",null,3,t.W1O),t.YNc(5,Z,
16,4,"ng-template",null,4,t.W1O),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Pt,5,2,"button",6),t.TgZ(9,"button",7),t.NdJ("click",function(){return o.markFullyFundedSuccess||o.error?o.dialogRef.close():o.submit()}),t.TgZ(10,"span",8),t.YNc(11,Tt,1,0,"mat-spinner",9),t.YNc(12,j,2,0,"ng-container",2),t.YNc(13,dt,3,0,"ng-template",null,10,t.W1O),t.qZA()()()),2&m){const E=t.MAs(4),Y=t.MAs(14);t.Q6J("disableClose",o.dialogRef.disableClose),t.xp6(2),t.Q6J("ngIf",o.markFullyFundedSuccess)("ngIfElse",E),t.xp6(6),t.Q6J("ngIf",!o.markFullyFundedSuccess&&!o.error),t.xp6(1),t.Q6J("disabled",o.dialogRef.disableClose||o.pending),t.xp6(2),t.Q6J("ngIf",o.pending),t.xp6(1),t.Q6J("ngIf",o.markFullyFundedSuccess||o.error)("ngIfElse",Y)}},directives:[Rt.A,ut.O5,$t.e,ut.sg,kt.oG,N.JJ,N.On,k.H8,It.lW,k.ZT,Ht.Ou],encapsulation:2,changeDetection:0}),Et=function(p,m,o,E){var Ot,Y=arguments.length,$=Y<3?m:null===E?E=Object.getOwnPropertyDescriptor(m,o):E;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)$=Reflect.decorate(p,m,o,E);else for(var St=p.length-1;St>=0;St--)(Ot=p[St])&&($=(Y<3?Ot($):Y>3?Ot(m,o,$):Ot(m,o))||$);return Y>3&&$&&Object.defineProperty(m,o,$),$}([(0,W.c)(),function(p,m){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata("design:paramtypes",m)}(0,[k.so,Object,Q.eX,t.sBO])],Et);var re=n(64416),Bt=n(9224),Lt=n(25245),Qt=n(1402),I=n(53140),st=n(97034),nt=n(28702),z=n(32368);let ct=(()=>{class p{transform({view:o,context:E,project:Y}){var $,Ot;if(E&&Y&&o)return Y.profile.film_type===et.sX.marketing?"sample":o.is_admin?"widget":"completed"===(null===($=Y.stage)||void 0===$?void 0:$.slug)?"completed":E.is_authenticated?Y.financial_opportunity||(null===(Ot=Y.investment_profile)||void 0===Ot?void 0:Ot.total_budget)?E.user_is_investor?"widget":"non_investor":"not_exists":"register"}}return p.\u0275fac=function(o){return new(o||p)},p.\u0275pipe=t.Yjl({name:"financingWidgetView",type:p,pure:!0}),p})();var yt=n(18325),jt=n(78316);function Se(p,m){1&p&&t.GkF(0)}function ye(p,m){if(1&p&&t.GkF(0,21),2&p){t.oxw(3);const o=t.MAs(20);t.Q6J("ngTemplateOutlet",o)}}function ge(p,m){if(1&p&&t.GkF(0,21),2&p){t.oxw(3);const o=t.MAs(14);t.Q6J("ngTemplateOutlet",o)}}function Oe(p,m){if(1&p&&(t.ynx(0),t.YNc(1,ye,1,1,"ng-container",19),t.ALo(2,"async"),t.YNc(3,ge,1,1,"ng-template",null,20,t.W1O),t.BQk()),2&p){const o=t.MAs(4),E=t.oxw(2);t.xp6(1),t.Q6J("ngIf",t.lcZ(2,2,E.isDesktopChartView$))("ngIfElse",o)}}const me=function(){return{min:!0,max:!1}},fe=function(p,m,o){return{current:p,max:m,remaining:!1,reachText:"Fully financed",hideMinText:!0,hideText:o}},le=function(p){return{$implicit:p}};function je(p,m){if(1&p&&(t.ynx(0),t.TgZ(1,"div",15),t._uU(2,"Total Production budget"),t.qZA(),t.TgZ(3,"h2",16),t._uU(4),t.ALo(5,"budget"),t.qZA(),t.YNc(6,Se,1,0,"ng-container",17),t.YNc(7,Oe,5,4,"ng-container",18),t.BQk()),2&p){const o=t.oxw(),E=t.MAs(18);t.xp6(1),t.ekj("sl8d-margin-bottom-xl",o.isEditMode),t.xp6(3),t.hij("$",t.lcZ(5,6,o.budgetValue||"\u2014"),""),t.xp6(2),t.Q6J("ngTemplateOutlet",E)("ngTemplateOutletContext",t.VKq(13,le,t.kEZ(9,fe,o.budgetValue,o.budgetValue,t.DdM(8,me)))),t.xp6(1),t.Q6J("ngIf",o.canSeeChart)}}function Ee(p,m){1&p&&(t.TgZ(0,"div",24),t._uU(1,"Total Production budget range"),t.qZA())}function Ce(p,m){if(1&p&&(t.ynx(0),t.YNc(1,Ee,2,0,"div",22),t.TgZ(2,"div",23)(3,"h2"),t._uU(4),t.qZA()(),t.BQk()),2&p){const o=m.ngIf;t.xp6(1),t.Q6J("ngIf",o.range),t.xp6(1),t.ekj("sl8d-margin-top",!o.range),t.xp6(2),t.Oqu(o.range?o.range:"COMPLETED")}}function Fe(p,m){1&p&&t.GkF(0)}const we=function(p){return{range:p}},Te=function(p){return{min:!0,max:p}},Wt=function(p){return{current:1,max:1,reachText:"Fully financed",hideText:p}};function ve(p,m){if(1&p&&(t.ynx(0),t.YNc(1,Ce,5,4,"ng-container",18),t.ALo(2,"budgetRange"),t.YNc(3,Fe,1,0,"ng-container",17),t.BQk()),2&p){const o=t.oxw(),E=t.MAs(18);t.xp6(1),t.Q6J("ngIf",t.VKq(6,we,(null==o.view?null:o.view.has_financing_opportunity_matches)&&t.xi3(2,3,o.budgetValue||0,o.budgetRanges))),t.xp6(2),t.Q6J("ngTemplateOutlet",E)("ngTemplateOutletContext",t.VKq(12,le,t.VKq(10,Wt,t.VKq(8,Te,!o.isFullyFunded))))}}const Ue=function(p){return{next:p}};function Me(p,m){if(1&p&&(t.ynx(0),t.TgZ(1,"div",25)(2,"mat-icon",26),t._uU(3,"lock"),t.qZA(),t._uU(4,"Sign in or join Slated to access financing opportunities."),t.qZA(),t.TgZ(5,"div",27)(6,"a",28),t._uU(7,"Sign in"),t.qZA(),t.TgZ(8,"a",29),t._uU(9,"Join"),t.qZA()(),t.BQk()),2&p){const o=t.oxw();
1t.xp6(6),t.Q6J("queryParams",t.VKq(1,Ue,o.next))}}function Ae(p,m){1&p&&(t.TgZ(0,"div",30),t._uU(1,"Financial information has not yet been added"),t.qZA())}function Ie(p,m){1&p&&t.GkF(0)}function Ze(p,m){if(1&p&&t.GkF(0,21),2&p){t.oxw(2);const o=t.MAs(20);t.Q6J("ngTemplateOutlet",o)}}function Gt(p,m){if(1&p&&t.GkF(0,21),2&p){t.oxw(2);const o=t.MAs(24);t.Q6J("ngTemplateOutlet",o)}}function he(p,m){if(1&p&&t.GkF(0,21),2&p){t.oxw(2);const o=t.MAs(22);t.Q6J("ngTemplateOutlet",o)}}function Re(p,m){if(1&p&&t.GkF(0,21),2&p){t.oxw(2);const o=t.MAs(14);t.Q6J("ngTemplateOutlet",o)}}const De=function(p,m,o,E){return{forceAchievedTotal:p,current:m,max:o,remaining:!0,reachText:E,hideText:!1}};function Be(p,m){if(1&p&&(t.ynx(0),t.GkF(1,21),t.YNc(2,Ie,1,0,"ng-container",17),t.YNc(3,Ze,1,1,"ng-container",31),t.ALo(4,"async"),t.YNc(5,Gt,1,1,"ng-container",31),t.YNc(6,he,1,1,"ng-container",31),t.YNc(7,Re,1,1,"ng-container",31),t.ALo(8,"async"),t.GkF(9,21),t.BQk()),2&p){const o=t.oxw(),E=t.MAs(16),Y=t.MAs(18),$=t.MAs(26),Ot=t.MAs(28);t.xp6(1),t.Q6J("ngTemplateOutlet",E),t.xp6(1),t.Q6J("ngTemplateOutlet",Y)("ngTemplateOutletContext",t.VKq(17,le,t.l5B(12,De,o.isFullyFunded,(null==o.budget?null:o.budget.raised)||0,o.budgetValue,o.isFullyFunded?"Fully financed":"$0 remaining"))),t.xp6(1),t.Q6J("ngIf",t.lcZ(4,8,o.canSeeChart&&o.isDesktopChartView$)),t.xp6(2),t.Q6J("ngIf",o.view.can_edit&&!o.isFullyFunded),t.xp6(1),t.Q6J("ngIf",!(null!=o.budget&&o.budget.is_fully_funded)||o.budgetValue),t.xp6(1),t.Q6J("ngIf",o.canSeeChart&&!t.lcZ(8,10,o.isDesktopChartView$)),t.xp6(2),t.Q6J("ngTemplateOutlet",o.isProjectAdmin?$:Ot)}}function $e(p,m){1&p&&t.GkF(0)}const oe=function(p,m,o){return{forceAchievedTotal:p,max:m,reachText:"Fully financed",hideText:o}};function C(p,m){if(1&p&&(t.ynx(0),t.YNc(1,$e,1,0,"ng-container",17),t.BQk()),2&p){const o=t.oxw(2),E=t.MAs(18);t.xp6(1),t.Q6J("ngTemplateOutlet",E)("ngTemplateOutletContext",t.VKq(7,le,t.kEZ(3,oe,o.isFullyFunded,o.budgetValue,t.DdM(2,me))))}}function f(p,m){if(1&p&&t.GkF(0,21),2&p){t.oxw(2);const o=t.MAs(22);t.Q6J("ngTemplateOutlet",o)}}
1function i(p,m){if(1&p&&(t.ynx(0),t.GkF(1,21),t.YNc(2,C,2,9,"ng-container",18),t.YNc(3,f,1,1,"ng-container",31),t.GkF(4,21),t.BQk()),2&p){const o=t.oxw(),E=t.MAs(16),Y=t.MAs(30);t.xp6(1),t.Q6J("ngTemplateOutlet",E),t.xp6(1),t.Q6J("ngIf",o.showBudgetSummaryForNonInvestor),t.xp6(1),t.Q6J("ngIf",!(null!=o.budget&&o.budget.is_fully_funded)||!o.budget&&o.budgetValue),t.xp6(1),t.Q6J("ngTemplateOutlet",Y)}}function s(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"div",32)(1,"button",33),t.NdJ("click",function(){return t.CHM(o),t.oxw().openChartSubpage()}),t._uU(2," Financial Details"),t.TgZ(3,"mat-icon",34),t._uU(4,"chevron_right"),t.qZA()()()}}function r(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",41),t.NdJ("click",function(){return t.CHM(o),t.oxw(3).enterEditMode()}),t.TgZ(1,"mat-icon"),t._uU(2,"edit"),t.qZA()()}}function g(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",42),t.NdJ("click",function(){return t.CHM(o),t.oxw(3).enterEditMode()}),t._uU(1,"Add budget"),t.qZA()}}function D(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"div",37)(1,"h2",38),t.NdJ("click",function(){return t.CHM(o),t.oxw(2).enterEditMode()}),t._uU(2),t.ALo(3,"budget"),t.qZA(),t.YNc(4,r,3,0,"button",39),t.YNc(5,g,2,0,"button",40),t.qZA()}if(2&p){const o=t.oxw(2);t.xp6(2),t.hij("$",t.lcZ(3,3,o.budgetValue||"\u2014"),""),t.xp6(2),t.Q6J("ngIf",o.view.can_edit&&o.budgetValue),t.xp6(1),t.Q6J("ngIf",o.view.can_edit&&!o.budgetValue)}}function F(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"form-budget",43),t.NdJ("updateBudgetTotal",function(Y){return t.CHM(o),t.oxw(2).updateBudgetTotal(Y)}),t.qZA()}if(2&p){const o=t.oxw(2);t.Q6J("budget",o.budget)}}function O(p,m){if(1&p&&(t.TgZ(0,"div",24),t._uU(1,"Total Production budget"),t.qZA(),t.YNc(2,D,6,5,"div",35),t.YNc(3,F,1,1,"form-budget",36)),2&p){const o=t.oxw();t.ekj("sl8d-margin-bottom-xl",o.isEditMode),t.xp6(2),t.Q6J("ngIf",o.isReadMode),t.xp6(1),t.Q6J("ngIf",o.isEditMode)}}function it(p,m){if(1&p&&t._UZ(0,"budget-summary",45),2&p){const o=t.oxw().$implicit;t.Q6J("fullWidth",!0)("forceAchievedTotal",o.forceAchievedTotal)("current",o.current)("max",o.max)("remaining",o.remaining)("reachText",o.reachText)("hideText",o.hideText)}}function tt(p,m){if(1&p&&t.YNc(0,it,1,7,"budget-summary",44),2&p){const o=t.oxw();t.Q6J("ngIf",o.isReadMode)}}function _t(p,m){if(1&p&&(t.O4$(),t.kcU(),t.TgZ(0,"div",56)(1,"div",57),t._uU(2),t.qZA()()),2&p){const o=t.oxw(4);t.Udp("opacity",o.showTooltip?1:0),t.xp6(1),t.Udp("transform",o.tooltipTransform),t.ekj("_left",o.currentInvestmentItem.tooltip.isLeftSide),t.xp6(1),t.Oqu(o.currentInvestmentItem.label)}}function pt(p,m){if(1&p&&(t.TgZ(0,"div",52)(1,"div",53),t.O4$(),t._UZ(2,"
1svg",54),t.YNc(3,_t,3,7,"div",55),t.qZA()()),2&p){const o=t.oxw(3);t.xp6(3),t.Q6J("ngIf",o.currentInvestmentItem)}}function Mt(p,m){if(1&p&&(t.TgZ(0,"div",58),t._UZ(1,"span",59),t.TgZ(2,"span",60),t._uU(3),t.qZA(),t.TgZ(4,"span"),t._uU(5),t.ALo(6,"budget"),t.qZA()()),2&p){const o=m.$implicit;t.xp6(1),t.Udp("background-color",o.color),t.xp6(2),t.Oqu(o.key),t.xp6(2),t.Oqu(t.lcZ(6,4,o.value))}}function ee(p,m){if(1&p&&(t.TgZ(0,"div",58),t._UZ(1,"span",59),t.TgZ(2,"span",60),t._uU(3),t.qZA(),t.TgZ(4,"span"),t._uU(5),t.ALo(6,"budget"),t.qZA()()),2&p){const o=t.oxw().ngIf,E=t.oxw(2);t.xp6(3),t.Oqu(E.isFullyFunded?"Unknown":"Remaining"),t.xp6(2),t.Oqu(t.lcZ(6,2,o.breakdowns.Remaining))}}function ue(p,m){if(1&p&&(t.TgZ(0,"div",47),t.YNc(1,pt,4,1,"div",48),t.TgZ(2,"div",49),t.YNc(3,Mt,7,6,"div",50),t.YNc(4,ee,7,4,"div",51),t.qZA()()),2&p){const o=m.ngIf,E=t.oxw(2);t.xp6(1),t.Q6J("ngIf",E.budgetValue||o.breakdowns["Total Raised"]),t.xp6(2),t.Q6J("ngForOf",null==E.budget?null:E.budget.financingBreakdowns),t.xp6(1),t.Q6J("ngIf",o.breakdowns.Remaining>0)}}function vt(p,m){if(1&p&&t.YNc(0,ue,5,3,"div",46),2&p){const o=t.oxw();t.Q6J("ngIf",null==o.budget?null:o.budget.investor_breakdown)}}function At(p,m){if(1&p&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"date"),t.qZA()),2&p){const o=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,o.project.business_details.production_start_date)," ")}}function wt(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",65),t.NdJ("click",function(){return t.CHM(o),t.oxw(3).addOrEditOpportunity()}),t._uU(1,"Add"),t.qZA()}}function ne(p,m){if(1&p&&(t.TgZ(0,"div",62)(1,"span"),t._uU(2,"Production starts"),t.qZA(),t.YNc(3,At,3,3,"span",63),t.YNc(4,wt,2,0,"ng-template",null,64,t.W1O),t.qZA()),2&p){const o=t.MAs(5),E=t.oxw(2);t.xp6(3),t.Q6J("ngIf",E.project.business_details.production_start_date)("ngIfElse",o)}}function Xt(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",65),t.NdJ("click",function(){return t.CHM(o),t.oxw(3).addOrEditOpportunity()}),t._uU(1,"Add"),t.qZA()}}function _e(p,m){if(1&p&&(t.ynx(0),t._uU(1),t.ALo(2,"budget"),t.BQk()),2&p){const o=t.oxw(4);t.xp6(1),t.hij("$",t.lcZ(2,1,o.project.investment_profile.min_investment),"")}}function We(p,m){if(1&p&&t.YNc(0,_e,3,3,"ng-container",18),2&p){const o=t.oxw(3);t.Q6J("ngIf",o.project.investment_profile.min_investment>0)}}function Ye(p,m){if(1&p&&(t.TgZ(0,"div",62)(1,"span"),t._uU(2,"Minimum investment"),t.qZA(),t.YNc(3,Xt,2,0,"button",66),t.YNc(4,We,1,1,"ng-template",null,67,t.W1O),t.qZA()),2&p){const o=t.MAs(5),E=t.oxw(2);t.xp6(3),t.Q6J("ngIf",E.isProjectAdmin&&!(null!=E.project.investment_profile&&E.project.investment_profile.min_investment))("ngIfElse",o)}}function Le(p,m){if(1&p&&(t.YNc(0,ne,6,2,"div",61),t.YNc(1,Ye,6,2,"div",61)),2&p){const o=t.oxw();t.Q6J("ngIf",o.isProjectAdmin||o.project.business_details.production_start_date),t.xp6(1),t.Q6J("ngIf",o.isProjectAdmin||o.context.user_is_investor&&(null==o.project.investment_profile?null:o.project.investment_profile.min_investment)&&!o.isFullyFunded)}}function Ne(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"div",68)(1,"span",69),t._uU(2,"Financing opportunity"),t.qZA(),t.TgZ(3,"custom-tooltip",70),t.ynx(4,71),t.TgZ(5,"button",65),t.NdJ("click",function(){return t.CHM(o),t.oxw().unhide()}),t._uU(6,"Unhide your project"),t.qZA(),t._uU(7," to use matching "),t.BQk(),t.TgZ(8,"mat-slide-toggle",72),t.NdJ("toggleChange",function(){return t.CHM(o),t.oxw().toggleOpportunity()}),t.qZA()()()}if(2&p){const o=t.oxw();t.xp6(3),t.Q6J("tooltipShouldBeOpened",o.hidden),t.xp6(5),t.Q6J("formControl",o.activeCtrl)("disabled",o.hidden||o.statuses.toggleOpportunity)}}function Je(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",77),t.NdJ("click",function(){return t.CHM(o),t.oxw(2).addOrEditOpportunity()}),t._uU(1),t.qZA()}if(2&p){const o=t.oxw(2);t.xp6(1),t.hij(" ",o.hasOpportunity?"Edit":"Create"," Financing Opportunity ")}}function Qe(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",78),t.NdJ("click",function(){return t.CHM(o),t.oxw(2).markAsFinanced()}),t._uU(1,"Mark As 100% Financed"),t.qZA()}}function Kt(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",79),t.NdJ("click",function(){return t.CHM(o),t.oxw(2).resetFinancingStatus()}),t._uU(1,"Reset Financing Status"),t.qZA()}}
1function ae(p,m){if(1&p){const o=t.EpF();t.YNc(0,Je,2,1,"button",73),t.TgZ(1,"button",74),t.NdJ("click",function(){return t.CHM(o),t.oxw().addInvestor()}),t._uU(2,"Add Investor"),t.qZA(),t.YNc(3,Qe,2,0,"button",75),t.YNc(4,Kt,2,0,"button",76)}if(2&p){const o=t.oxw();t.Q6J("ngIf",!o.isFullyFunded),t.xp6(3),t.Q6J("ngIf",o.isSuperAdminView&&!(null!=o.budget&&o.budget.is_fully_funded)&&o.hasOpportunity),t.xp6(1),t.Q6J("ngIf",o.isSuperAdminView&&(null==o.budget?null:o.budget.is_fully_funded)&&o.hasOpportunity)}}function Ve(p,m){if(1&p){const o=t.EpF();t.TgZ(0,"button",83),t.NdJ("click",function(){return t.CHM(o),t.oxw(3).sendInterest()}),t._uU(1,"Send Interest"),t.qZA()}if(2&p){const o=t.oxw(3);t.Q6J("disabled",o.statuses.sendInterest)}}function ke(p,m){if(1&p&&(t.ynx(0),t.YNc(1,Ve,2,1,"button",82),t.BQk()),2&p){t.oxw();const o=t.MAs(2),E=t.oxw();t.xp6(1),t.Q6J("ngIf",!E.project.financial_opportunity.reasons)("ngIfElse",o)}}function He(p,m){1&p&&(t.TgZ(0,"div",85),t._uU(1,"You are not a match for this opportunity."),t.qZA())}function Xe(p,m){if(1&p&&t.YNc(0,He,2,0,"div",84),2&p){t.oxw();const o=t.MAs(4),E=t.oxw();t.Q6J("ngIf",E.isNotMatch)("ngIfElse",o)}}function ze(p,m){if(1&p&&(t.TgZ(0,"div",85),t._uU(1,"This opportunity does not match your interest."),t.qZA(),t.TgZ(2,"a",86),t._uU(3,"Edit Your Interests"),t.qZA()),2&p){const o=t.oxw(2);t.xp6(2),t.Q6J("href",o.profileUrl,t.LSH)}}function qe(p,m){if(1&p&&(t.YNc(0,ke,2,2,"ng-container",18),t.YNc(1,Xe,1,2,"ng-template",null,80,t.W1O),t.YNc(3,ze,4,1,"ng-template",null,81,t.W1O)),2&p){const o=t.oxw();t.Q6J("ngIf",(null==o.project.financial_opportunity?null:o.project.financial_opportunity.is_active)&&o.canSendInterest)}}function tn(p,m){if(1&p&&(t.TgZ(0,"div",87)(1,"mat-icon",26),t._uU(2,"lock"),t.qZA(),t._uU(3,"Only accredited investors can view this investment opportunity."),t.qZA(),t.TgZ(4,"a",88),t._uU(5,"Apply for Investor Status"),t.qZA()),2&p){const o=t.oxw();t.xp6(4),t.MGl("routerLink","/people/",o.context.user_id,"?investor")}}const Pe=function(p,m,o,E){return{view:p,project:m,context:o,budgetRanges:E}};let zt=class{constructor(m,o,E,Y,$,Ot,St,de){this.actions$=m,this.cdr=o,this.dialog=E,this.elRef=Y,this.fb=$,this.breakpointObserver=Ot,this.projectPageSupportService=St,this.zone=de,this.hasMobileSubpageWithChart=!1,this.isSuperAdminView=!1,this.action=new t.vpe,this.statuses={},this.activeCtrl=this.fb.control(!1),this.mode="read"}ngOnDestroy(){}ngAfterViewInit(){this.initializeChart()}ngOnChanges(m){var o,E,Y,$,Ot,St,de,be;const xt=m.project;(null==xt?void 0:xt.currentValue)&&(null===(E=null===(o=xt.currentValue)||void 0===o?void 0:o.financial_opportunity)||void 0===E?void 0:E.is_active)!==(null===($=null===(Y=xt.previousValue)||void 0===Y?void 0:Y.financial_opportunity)||void 0===$?void 0:$.is_active)&&this.activeCtrl.setValue(null!==(St=null===(Ot=xt.currentValue.financial_opportunity)||void 0===Ot?void 0:Ot.is_active)&&void 0!==St&&St);const ce=m.budget;(null==ce?void 0:ce.currentValue)&&(this.budgetValue=ce.currentValue.remaining<0?ce.currentValue.total+Math.abs(ce.currentValue.remaining):ce.currentValue.total,setTimeout(()=>this.initializeChart()));const qt=m.view;(null===(de=null==qt?void 0:qt.currentValue)||void 0===de?void 0:de.is_admin)!==(null===(be=null==qt?void 0:qt.previousValue)||void 0===be?void 0:be.is_admin)&&setTimeout(()=>this.initializeChart())}fullyFundedFundsUpdateConfirmation(){this.action.emit({name:"reset-confirmation"})}fullyFundedBudgetUpdateConfirmation(){this.action.emit({name:"reset-confirmation",value:"This project has been marked as fully financed. If you would like to edit the budget, please chat with customer service."})}enterEditMode(){var m;if(this.isFullyFunded&&!this.isSuperAdminView&&(null===(m=this.budget)||void 0===m?void 0:m.total))return this.fullyFundedBudgetUpdateConfirmation();this.view.can_edit&&(this.mode="edit")}addOrEditOpportunity(){return this.action.emit(this.hasOpportunity?{name:"edit-opportunity"}:{name:"create-opportunity"})}updateBudgetTotal(m){var o;this.view.can_edit&&(null===(o=this.budget)||void 0===o?void 0:o.total)!==m&&this.action.emit({name:"update-total",value:m}),this.mode="read"}sendInterest(){this.action.emit({name:"send-interest"})}addInvestor(){this.action.emit({name:"add-investor"})}markAsFinanced(){const m=this.dialog.open(Et,{maxWidth:480,width:"calc(100% - 16px)",data:{submit:(o,E)=>{m.disableClose=!0,this.actions$.pipe((0,Q.l4)(ht.M9),(0,W.t)(this),(0,R.h)(Y=>!Y.data.status.pending),(0,G.b)(()=>m.disableClose=!1),(0,V.q)(1)).subscribe(),this.action.emit({name:"mark-fully-funded",value:{opportunityId:this.project.financial_opportunity.id,data:{investment_profile:{fully_funded:{contact:E,funded:!0,investor:o}},is_active:!1}}})}}})}resetFinancingStatus(){this.action.emit({name:"reset-financing-status"})}toggleOpportunity(){return this.hasOpportunity?(this.resetActiveStatus(this.activeCtrl.value),this.action.emit({name:"toggle-opportunity"})):(this.resetActiveStatus(),this.action.emit({name:"create-opportunity"}))}
1resetActiveStatus(m=!1){requestAnimationFrame(()=>this.activeCtrl.setValue(m))}openChartSubpage(){this.projectPageSupportService.subpages.financing.open()}get isFullyFunded(){var m;return null===(m=this.budget)||void 0===m?void 0:m.is_fully_funded}get isProjectAdmin(){return this.view.is_admin}get next(){return(0,q.KP)()}get isStandardProject(){return this.project.profile.film_type===et.sX.standard}get canSeeOrEditOrFullyFunded(){return this.view.can_view_investor_opportunities||this.view.can_edit||this.isFullyFunded}get cannotSeeBudget(){return this.isStandardProject&&!this.canSeeOrEditOrFullyFunded}get canSeeBudget(){return this.isStandardProject&&this.canSeeOrEditOrFullyFunded}get isReadMode(){return"read"===this.mode}get isEditMode(){return"edit"===this.mode}get isDesktopChartView$(){return this.breakpointObserver.observe(mt.b3).pipe((0,K.U)(({matches:m})=>m&&this.hasMobileSubpageWithChart||!this.hasMobileSubpageWithChart))}get canSeeChart(){var m,o;return!((null===(m=this.project.stage)||void 0===m?void 0:m.id)===et.FH.completed||!(null===(o=this.budget)||void 0===o?void 0:o.raised)||(this.project.profile.film_type===et.sX.marketing||this.isFullyFunded&&this.budget.isUnknownInvestment)&&!(this.project.investment_profile.has_verified_production_stage_investments&&(this.view.is_admin||this.context.user_is_investor)))}get showBudgetSummaryForNonInvestor(){var m;return this.context.is_authenticated&&!this.context.user_is_investor&&this.isFullyFunded&&"released"===(null===(m=this.project.stage)||void 0===m?void 0:m.slug)}get profileUrl(){var m;return`/people/${null===(m=this.context)||void 0===m?void 0:m.user_id}/interests/`}get hasOpportunity(){return!!this.project.financial_opportunity}get isNotMatch(){var m;return((null===(m=this.project.financial_opportunity)||void 0===m?void 0:m.reasons)||{}).hasOwnProperty("user_score_too_low")}get hidden(){return this.project.profile.privacy===L.P8.hidden}get canSendInterest(){var m;const o=null===(m=this.project.financial_opportunity)||void 0===m?void 0:m.opportunity_connection.interest_status;return null===o||"N"===o}unhide(){this.action.emit({name:"unhide"})}get tooltipTransform(){return`translateY(${(this.currentInvestmentItem.tooltip.isLeftSide?-6:6)-13}px) translateX(${120*this.currentInvestmentItem.tooltip.coordinates[0]}px) translateY(${120*this.currentInvestmentItem.tooltip.coordinates[1]}px) rotate(90deg) ${this.currentInvestmentItem.tooltip.isLeftSide?"translateX(-100%)":""}`}initializeChart(){const m=this.elRef.nativeElement.querySelector("#budgetChart");m&&(this.generateChart(m),this.bindChartEvents(m))}bindChartEvents(m){const o=m.querySelectorAll("path");let E;this.zone.runOutsideAngular(()=>{o.forEach(Y=>{(0,X.R)(Y,"mouseleave").pipe((0,W.t)(this)).subscribe($=>{E=setTimeout(()=>{this.showTooltip=!1,this.cdr.detectChanges()})}),(0,X.R)(Y,"mouseenter").pipe((0,W.t)(this)).subscribe($=>{clearTimeout(E),this.currentInvestmentItem=this.chartPaths[+$.target.getAttribute("index")],this.showTooltip=!0,this.cdr.detectChanges()})})})}generateChart(m){var o;let E=0;m.innerHTML="",this.chartPaths=null===(o=this.budget)||void 0===o?void 0:o.investor_breakdown.data.map((Y,$)=>{var Ot,St,de;const[be,xt]=this.getCoordinatesForPercent(E),[ce,qt]=this.getCoordinatesForPercent(E+Y.percent/2);Y.tooltip={coordinates:[ce/2,qt/2],isLeftSide:qt>0},E+=Y.percent;const[pe,Vt]=this.getCoordinatesForPercent(E),at=[`M ${be} ${xt}`,`A 1 1 0 ${Y.percent>.5?1:0} 1 ${pe} ${Vt}`,"L 0 0"].join(" "),Yt=document.createElementNS("http://www.w3.org/2000/svg","path");return(null===(Ot=this.budget)||void 0===Ot?void 0:Ot.investor_breakdown.data.length)>1?Yt.setAttribute("d",at):((null===(St=this.budget)||void 0===St?void 0:St.is_fully_funded)||1===(null===(de=this.budget)||void 0===de?void 0:de.investor_breakdown.data.length))&&Yt.setAttribute("d","M 1 0 A 1 1 0 1 1 1 -1e-16 L 0 0"),Yt.setAttribute("index",`${$}`),Yt.setAttribute("fill",Y.color),m.appendChild(Yt),Y})}getCoordinatesForPercent(m){return[Math.cos(2*Math.PI*m),Math.sin(2*Math.PI*m)]}};zt.\u0275fac=function(m){return new(m||zt)(t.Y36(Q.eX),t.Y36(t.sBO),t.Y36(k.uw),t.Y36(t.SBq),t.Y36(N.qu),t.Y36(d.Yg),t.Y36(re.G),t.Y36(t.R0b))},zt.\u0275cmp=t.Xpm({type:zt,selectors:[["sl-financing-widget"]],inputs:{budgetRanges:"budgetRanges",context:"context",project:"project",budget:"budget",view:"view",hasMobileSubpageWithChart:"hasMobileSubpageWithChart",isSuperAdminView:"isSuperAdminView",statuses:"statuses"},outputs:{action:"action"},features:[t.TTD],decls:31,vars:14,consts:[[1,"financing","sl8d-margin-bottom"],[1,"sl8d-padding-bottom-xxs"],[1,"sl8d-h2"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","sl8d-caption sl8d-de-em-dark sl8d-margin-bottom-xs sl8d-margin-top",4,"ngSwitchCase"],["financingDetailsLink",""],["totalBudget",""],["budgetSummary",""],["budgetChart",""],["dateAndInvestment",""],["opportunityToggle",""],["adminActions",""],["memberActions",""],["applyInvestor",""],[1,"sl8d-overline","sl8d-margin-top","sl8d-de-em-dark"],[1,"sl8d-margin-top-xxs","sl8d-margin-bottom"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngIf"],[3,"ngTemplateOutlet",4,"ngIf","ngIfElse"],["mobileLinkTmpl",""],[3,"ngTemplateOutlet"],["class","sl8d-overline sl8d-margin-top sl8d-margin-bottom-xxs sl8d-de-em-dark",4,"ngIf"],[1,"sl8d-padding-bottom-xs"],[1,"sl8d-overline","sl8d-margin-top","sl8d-margin-bottom-xxs","sl8d-de-em-dark"],[1,"sl8d-caption","sl8d-de-em-dark","sl8d-margin-top","sl8d-flex","sl8d-align-items-start"],[1,"lock"],[1,"sl8d-flex"],["routerLink","/login/","mat-button","",1,"sl8d-margin-top","sl8d-full-width","sl8d-flat","_smaller",3,"queryParams"],["routerLink","/register/","mat-button","",1,"sl8d-margin-top","sl8d-full-width","sl8d-flat","_smaller","sl8d-margin-left-xs"],[1,"sl8d-caption","sl8d-de-em-dark","sl8d-margin-bottom-xs","sl8d-margin-top"],[3,"ngTemplateOutlet",4,"ngIf"],[1,"sl8d-padding-top-xxs","sl8d-flex","sl8d-justify-content-end"],["type","button",1,"sl8d-link","sl8d-overline",3,"click"],[1,"chevron","sl8d-margin-right-xxs-negative"],["class","sl8d-padding-bottom-xs sl8d-flex sl8d-align-items-center",4,"ngIf"],[3,"budget","updateBudgetTotal",4,"ngIf"],[1,"sl8d-padding-bottom-xs","sl8d-flex","sl8d-align-items-center"],[3,"click"],["mat-icon-button","","type","button","class","control-btn sl8d-margin-left-xxxs sl8d-padding-bottom-xxxs","aria-label","Edit budget",3,"click",4,"ngIf"],["type","button","class","sl8d-margin-left-auto sl8d-link sl8d-caption","aria-label","Add budget",3,"click",4,"ngIf"],["mat-icon-button","","type","button","aria-label","Edit budget",1,"control-btn","sl8d-margin-left-xxxs","sl8d-padding-bottom-xxxs",3,"click"],["type","button","aria-label","Add budget",1,"sl8d-margin-left-auto","sl8d-link","sl8d-caption",3,"click"],[3,"budget","updateBudgetTotal"],["class","sl8d-margin-bottom-xl sl8d-block sl8d-padding-bottom-xxxs",3,"fullWidth","forceAchievedTotal","current","max","remaining","reachText","hideText",4,"ngIf"],[1,"sl8d-margin-bottom-xl","sl8d-block","sl8d-padding-bottom-xxxs",3,"fullWidth","forceAchievedTotal","current","max","remaining","reachText","hideText"],["class","data-table sl8d-margin-top sl8d-margin-bottom-xl",4,"ngIf"],[1,"data-table","sl8d-margin-top","sl8d-margin-bottom-xl"],["class","chart-wrap sl8d-margin-top sl8d-margin-bottom",4,"ngIf"],[1,"breakdown-detail
1s"],["class","sl8d-flex sl8d-align-items-center sl8d-padding-top-xs",4,"ngFor","ngForOf"],["class","sl8d-flex sl8d-align-items-center sl8d-padding-top-xs",4,"ngIf"],[1,"chart-wrap","sl8d-margin-top","sl8d-margin-bottom"],[1,"chart-wrap-inner"],["id","budgetChart","viewBox","-1 -1 2 2",1,"budget-chart",2,"transform","rotate(-90deg)"],["class","tooltip",3,"opacity",4,"ngIf"],[1,"tooltip"],[1,"tooltip-inner"],[1,"sl8d-flex","sl8d-align-items-center","sl8d-padding-top-xs"],[1,"marker"],[1,"sl8d-margin-right-auto","sl8d-body-2","sl8d-padding-right-sm"],["class","sl8d-margin-bottom-xs sl8d-de-em-dark sl8d-flex sl8d-justify-content-space-between sl8d-align-items-center",4,"ngIf"],[1,"sl8d-margin-bottom-xs","sl8d-de-em-dark","sl8d-flex","sl8d-justify-content-space-between","sl8d-align-items-center"],[4,"ngIf","ngIfElse"],["addDateBtnTmpl",""],["type","button",1,"sl8d-link","sl8d-caption",3,"click"],["class","sl8d-link sl8d-caption","type","button",3,"click",4,"ngIf","ngIfElse"],["minInvestmentSetTmpl",""],[1,"sl8d-margin-bottom","sl8d-flex"],[1,"sl8d-body-1","sl8d-margin-right-auto"],["className","sl8d-full-name",3,"tooltipShouldBeOpened"],["tooltip",""],[3,"formControl","disabled","toggleChange"],["type","button","aria-label","Open add or edit financing opportunity dialog","mat-button","","class","sl8d-margin-top sl8d-full-width sl8d-flat _xs",3,"click",4,"ngIf"],["aria-label","Open add investor dialog","mat-button","",1,"sl8d-margin-top-xs","sl8d-full-width","sl8d-flat","_xs",3,"click"],["aria-label","Mark as 100% financed","class","sl8d-margin-top-xs sl8d-full-width sl8d-flat _xs","mat-button","",3,"click",4,"ngIf"],["aria-label","Reset Financing Status","class","sl8d-margin-top-xs sl8d-full-width sl8d-flat _xs","mat-button","",3,"click",4,"ngIf"],["type","button","aria-label","Open add or edit financing opportunity dialog","mat-button","",1,"sl8d-margin-top","sl8d-full-width","sl8d-flat","_xs",3,"click"],["aria-label","Mark as 100% financed","mat-button","",1,"sl8d-margin-top-xs","sl8d-full-width","sl8d-flat","_xs",3,"click"],["aria-label","Reset Financing Status","mat-button","",1,"sl8d-margin-top-xs","sl8d-full-width","sl8d-flat","_xs",3,"click"],["notMatch",""],["editInterests",""],["mat-flat-button","","color","accent","aria-label","Open send interest dialog","class","sl8d-margin-top sl8d-full-width","type","button",3,"disabled","click",4,"ngIf","ngIfElse"],["mat-flat-button","","color","accent","aria-label","Open send interest dialog","type","button",1,"sl8d-margin-top","sl8d-full-width",3,"disabled","click"],["class","sl8d-margin-top sl8d-de-em-dark",4,"ngIf","ngIfElse"],[1,"sl8d-margin-top","sl8d-de-em-dark"],["mat-button","",1,"sl8d-margin-top","sl8d-full-width","sl8d-flat","_xs",3,"href"],[1,"sl8d-caption","sl8d-margin-top-xl","sl8d-flex"],["mat-button","",1,"sl8d-margin-top","sl8d-full-width","sl8d-flat","_smaller",3,"routerLink"]],template:function(m,o){1&m&&(t.TgZ(0,"mat-card",0)(1,"mat-card-header",1)(2,"div",2),t._uU(3,"Financing"),t.qZA()(),t.TgZ(4,"mat-card-content",3),t.ALo(5,"financingWidgetView"),t._UZ(6,"div"),t.YNc(7,je,8,15,"ng-container",4),t.YNc(8,ve,4,14,"ng-container",4),t.YNc(9,Me,10,3,"ng-container",4),t.YNc(10,Ae,2,0,"div",5),t.YNc(11,Be,10,19,"ng-container",4),t.YNc(12,i,5,4,"ng-container",4),t.qZA(),t.YNc(13,s,5,0,"ng-template",null,6,t.W1O),t.YNc(15,O,4,4,"ng-template",null,7,t.W1O),t.YNc(17,tt,1,1,"ng-template",null,8,t.W1O),t.YNc(19,vt,1,1,"ng-template",null,9,t.W1O),t.YNc(21,Le,2,2,"ng-template",null,10,t.W1O),t.YNc(23,Ne,9,3,"ng-template",null,11,t.W1O),t.YNc(25,ae,5,3,"ng-template",null,12,t.W1O),t.YNc(27,qe,5,1,"ng-template",null,13,t.W1O),t.YNc(29,tn,6,1,"ng-template",null,14,t.W1O),t.qZA()),2&m&&(t.xp6(4),t.Q6J("ngSwitch",t.lcZ(5,7,t.l5B(9,Pe,o.view,o.project,o.context,o.budgetRanges))),t.xp6(3),t.Q6J("ngSwitchCase","sample"),t.xp6(1),t.Q6J("ngSwitchCase","completed"),t.xp6(1),t.Q6J("ngSwitchCase","register"),t.xp6(1),t.Q6J("ngSwitchCase","not_exists"),t.xp6(1),t.Q6J("ngSwitchCase","widget"),t.xp6(1),t.Q6J("ngSwitchCase","non_investor"))},directives:[Bt.a8,Bt.dk,Bt.dn,ut.RF,ut.n9,ut.tP,ut.O5,Lt.Hw,Qt.yS,It.zs,It.lW,I.K,st.b,ut.sg,nt.X,z.Rr,N.JJ,N.oH],pipes:[ct,yt.C,ut.Ov,jt.f,ut.uU],styles:['[_nghost-%COMP%] .mat-card-header-text{display:none}.financing[_ngcontent-%COMP%]{display:block}.financing[_ngcontent-%COMP%] budget-summary[_ngcontent-%COMP%] .hint{font-size:1.4rem}.financing[_ngcontent-%COMP%] .mat-tab-label{min-width:50px;padding:0 12px}.financing[_ngcontent-%COMP%] div.budget-progress-wrapper .background{background:rgba(100,182,149,.25)}.marker[_ngcontent-%COMP%]{background-color:#ccc;width:16px;height:16px;margin-right:8px;border-radius:8px}.lock[_ngcontent-%COMP%]{transform:scale(.75);margin-left:-6px;margin-right:4px;position:relative;top:-6px;margin-bottom:-9px;color:#212121}.control-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px}
1.control-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transform:scale(.75);color:#218eb7;display:block}.data-table[_ngcontent-%COMP%]{text-align:center}.breakdown-details[_ngcontent-%COMP%]{min-width:190px;display:inline-block}.chart-wrap[_ngcontent-%COMP%]{padding-top:68%;position:relative;width:100%}.chart-wrap-inner[_ngcontent-%COMP%]{position:absolute;left:0;width:100%;top:0}.chevron[_ngcontent-%COMP%]{position:relative;top:8px}.budget-chart[_ngcontent-%COMP%]{width:70%;margin:0 auto;border-radius:50%}.budget-chart[_ngcontent-%COMP%] path{transition:filter .2s ease-out}.budget-chart[_ngcontent-%COMP%] path:hover{filter:brightness(.94)}.tooltip[_ngcontent-%COMP%]{position:absolute;left:50%;top:50%;width:0;height:0;transform:rotate(-90deg);transition:opacity .2s ease-out;pointer-events:none;touch-action:none}.tooltip-inner[_ngcontent-%COMP%]{background:rgba(0,0,0,.9);padding:5px 8px;border-radius:5px;color:#fff;font-size:14px;display:inline-block;position:absolute;left:0;top:0;white-space:nowrap;transition:transform .2s ease-out;transform-origin:left center}.tooltip-inner[_ngcontent-%COMP%]:before{content:"";width:6px;height:10px;border-top:5px solid transparent;border-bottom:5px solid transparent;position:absolute;top:50%;transform:translateY(-50%)}.tooltip-inner._left[_ngcontent-%COMP%]:before{left:100%;border-left:6px solid rgba(0,0,0,.85)}.tooltip-inner[_ngcontent-%COMP%]:not(._left):before{right:100%;border-right:6px solid rgba(0,0,0,.85)}'],changeDetection:0}),zt=function(p,m,o,E){var Ot,Y=arguments.length,$=Y<3?m:null===E?E=Object.getOwnPropertyDescriptor(m,o):E;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)$=Reflect.decorate(p,m,o,E);else for(var St=p.length-1;St>=0;St--)(Ot=p[St])&&($=(Y<3?Ot($):Y>3?Ot(m,o,$):Ot(m,o))||$);return Y>3&&$&&Object.defineProperty(m,o,$),$}([(0,W.c)(),function(p,m){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata("design:paramtypes",m)}(0,[Q.eX,t.sBO,k.uw,t.SBq,N.qu,d.Yg,re.G,t.R0b])],zt)},50809:(Nt,gt,n)=>{n.d(gt,{t:()=>Rt});var d=n(69808),t=n(93075),N=n(47423),k=n(9224),Q=n(48966),W=n(67322),X=n(25245),R=n(98833),G=n(32368),V=n(1402),K=n(65835),L=n(50703),mt=n(496),et=n(22183),q=n(88298),rt=n(69370),Ct=n(53040),ht=n(5e3);let Rt=(()=>{class ut{}return ut.\u0275fac=function(kt){return new(kt||ut)},ut.\u0275mod=ht.oAB({type:ut}),ut.\u0275inj=ht.cJS({providers:[d.H9],imports:[[L.Y,q.Jy,mt.H,rt.u,d.ez,K.zh,t.u5,Ct.Y,N.ot,et.mU,k.QW,Q.Is,W.lN,X.Ps,R.c,G.rP,t.UX,V.Bz]]}),ut})()},96296:(Nt,gt,n)=>{n.d(gt,{R:()=>ot});var d=n(26991),t=n(39841),N=n(61135),k=n(39646),Q=n(34782),W=n(54004),X=n(95698),R=n(18505),G=n(28746),V=n(63900),K=n(70262),L=n(39300),mt=n(11365),et=n(65620),q=n(24394),rt=n(53092),Ct=n(17400),ht=n(1982),Rt=n(83476),ut=n(22183),$t=n(88298),kt=n(5526),It=n(50809),Ht=n(92278),ie=n(64416),e=n(30896),Dt=n(83829),T=n(5e3),b=n(67399);let ot=(()=>{class Jt{constructor(B,Z,Pt,Tt,j,dt,Et,re,Bt,Lt,Qt){this.actions$=B,this.bottomSheet=Z,this.bottomSheetOpportunityService=Pt,this.errorHandler=Tt,this.matchesService=j,this.opportunitiesService=dt,this.snackbar=Et,this.store=re,this.projectPageSupportService=Bt,this.baseLayoutService=Lt,this.superAdminViewService=Qt,this.project$=this.store.select(e.iV),this.budget$=this.store.pipe((0,et.Ys)(e.Fx)),this.view$=this.store.select(e.rp),this.context$=this.store.pipe((0,et.Ys)(rt.x_),(0,Q.d)(1)),this.canEditBudget$=(0,t.a)([this.budget$,this.superAdminViewService.superAdminView$]).pipe((0,W.U)(([I,st])=>!(null==I?void 0:I.is_fully_funded)||st||!(null==I?void 0:I.total))),this.statuses$=new N.X({})}updateFinancialStatuses(B,Z){const Pt=this.statuses$.getValue();this.statuses$.next(Object.assign(Object.assign({},Pt),{[B]:Z}))}handle(B){switch(B.name){case"update-total":this.updateTotal(B.value);break;case"create-opportunity":this.createOpportunity();break;case"send-interest":this.sendInterest();break;case"edit-opportunity":this.editOpportunity();break;case"toggle-opportunity":this.toggleOpportunity();break;case"mark-fully-funded":this.markFullyFunded(B.value);break;case"add-investor":this.addInvestor();break;case"reset-financing-status":this.resetFinancingStatus();break;case"reset-confirmation":this.opportunitiesService.resetFinancingStatusConfirmation(B.value);break;case"unhide":this.openPrivaciesSettings();break;default:{const Z=B.name;console.warn(`Add new type: ${Z}`),this.store.dispatch((0,q.F0)({message:"FilmProfile - financing widget - unregistered case",data:Z}
1))}}}openPrivaciesSettings(){this.projectPageSupportService.subpages.projectSettings.open(B=>{B.querySelector("mat-expansion-panel-header").click(),this.baseLayoutService.scrollToElement(B.querySelector(".mat-expansion-panel"),B.querySelector("sl-base-layout-subpage"),{offset:65})})}addInvestor(){this.updateFinancialStatuses("addInvestor",!0),(0,t.a)([this.project$,this.context$,this.view$]).pipe((0,X.q)(1),(0,R.b)(([B,Z,Pt])=>{this.bottomSheet.open(kt.S,{data:{project:B,context:Z,view:Pt,step:1,verifyOnly:!1,investor:null,fetchInvestors:Tt=>this.store.dispatch((0,e.LU)({data:{role:Tt}})),updateScore:()=>this.store.dispatch((0,e.h_)()),action:Tt=>this.handleAddInvestorAction(Tt)}})}),(0,G.x)(()=>this.updateFinancialStatuses("addInvestor",!1))).subscribe()}handleAddInvestorAction({type:B,data:Z}){switch(B){case e.e2.type:this.store.dispatch((0,e.e2)(Z));break;case e.aL.type:this.store.dispatch((0,e.aL)(Z));break;case e.MQ.type:this.store.dispatch((0,e.MQ)(Z));break;case e.VL.type:this.store.dispatch((0,e.VL)(Z));break;default:console.warn(`Add new type: ${B}`),this.store.dispatch((0,q.F0)({message:"Financing widget - add investor action - unregistered case",data:B}))}}resetFinancingStatus(){this.updateFinancialStatuses("resetFinancingStatus",!0),(0,t.a)([this.project$,this.fetchInvestorOpportunityIfNeeded$()]).pipe((0,X.q)(1),(0,V.w)(([{id:B},Z])=>this.opportunitiesService.resetFinancingStatus$(B,Z.id)),(0,R.b)(B=>this.store.dispatch((0,Dt.Sn)(B))),(0,K.K)(B=>(this.errorHandler.handle(B,()=>404===B.status&&"The opportunity doesn't exist."),(0,k.of)(!0))),(0,G.x)(()=>this.updateFinancialStatuses("resetFinancingStatus",!1))).subscribe()}markFullyFunded(B){this.store.dispatch((0,e.Jz)(B))}toggleOpportunity(){this.canEditBudget$.pipe((0,X.q)(1),(0,R.b)(B=>!B&&this.opportunitiesService.resetFinancingStatusConfirmation()),(0,L.h)(B=>B),(0,R.b)(()=>this.updateFinancialStatuses("toggleOpportunity",!0)),(0,V.w)(()=>(0,t.a)([this.project$,this.fetchInvestorOpportunityIfNeeded$()])),(0,X.q)(1),(0,V.w)(([{id:B},Z])=>this.opportunitiesService.toggle$(B,Z.id,!Z.is_active)),(0,R.b)(B=>this.store.dispatch((0,Dt.Sn)(B))),(0,K.K)(B=>(this.errorHandler.handle(B,()=>404===B.status&&"The opportunity doesn't exist."),(0,k.of)(!0))),(0,G.x)(()=>this.updateFinancialStatuses("toggleOpportunity",!1))).subscribe()}editOpportunity(){this.canEditBudget$.pipe((0,X.q)(1),(0,R.b)(B=>!B&&this.opportunitiesService.resetFinancingStatusConfirmation()),(0,L.h)(B=>B),(0,R.b)(()=>this.updateFinancialStatuses("editOpportunity",!0)),(0,V.w)(()=>this.fetchInvestorOpportunityIfNeeded$()),(0,R.b)(B=>!B&&this.snackbar.message("Opportunity was removed")),(0,L.h)(B=>!!B),(0,mt.M)(this.project$),(0,R.b)(([B,Z])=>this.bottomSheetOpportunityService.openEditingOpportunityBottomSheet(Ct.c.investor,B,Z)),(0,G.x)(()=>this.updateFinancialStatuses("editOpportunity",!1))).subscribe()}sendInterest(){this.updateFinancialStatuses("sendInterest",!0),(0,t.a)([this.project$,this.context$]).pipe((0,X.q)(1),(0,V.w)(([B,Z])=>this.fetchInvestorOpportunityIfNeeded$().pipe((0,V.w)(Pt=>this.matchesService.onMemberToFilmAction$("send-interest",{status:Pt.status,message_thread_url:Pt.opportunity_connection.message_thread_url,interest:{id:Pt.interest},opportunity:{id:Pt.id,role:Pt.role,film:{id:B.id,image_url:B.profile_image_url,name:B.name}}},{messagingToken:Z.messaging_token,sendOnEnter:Z.send_message_by_enter,member:{id:Z.user_id,email:Z.user_email,user:{first_name:Z.user_first_name,last_name:Z.user_last_name},small_image:Z.small_image_url}})))),(0,X.q)(1),(0,L.h)(B=>!!B),(0,R.b)(B=>this.store.dispatch((0,Dt._d)(Object.assign({id:B.opportunity.id},B)))),(0,G.x)(()=>this.updateFinancialStatuses("sendInterest",!1))).subscribe()}createOpportunity(){this.updateFinancialStatuses("createOpportunity",!0),this.project$.pipe((0,X.q)(1),(0,R.b)(B=>this.bottomSheetOpportunityService.openCreatingOpportunityBottomSheet(Ct.c.investor,B)),(0,G.x)(()=>this.updateFinancialStatuses("createOpportunity",!1))).subscribe()}
1updateTotal(B){this.canEditBudget$.pipe((0,X.q)(1),(0,R.b)(Z=>!Z&&this.opportunitiesService.resetFinancingStatusConfirmation()),(0,L.h)(Z=>Z),(0,R.b)(()=>this.updateFinancialStatuses("updateTotal",!0)),(0,V.w)(()=>(0,t.a)([this.project$,this.fetchInvestorOpportunityIfNeeded$()])),(0,X.q)(1),(0,V.w)(([{id:Z,investment_profile:Pt},Tt])=>(null==Tt?void 0:Tt.id)?this.opportunitiesService.updateBudget$(Z,Tt.id,B).pipe((0,R.b)(j=>this.store.dispatch((0,Dt.Sn)(j))),(0,R.b)(()=>this.store.dispatch((0,e.xu)())),(0,R.b)(()=>this.projectPageSupportService.checkSimulationUpdates(Z,Pt.total_budget)),(0,K.K)(()=>(0,k.of)(!0))):(this.store.dispatch((0,e.D)({id:Z,initial_budget:Pt.total_budget,investment_profile:{total_budget:B}})),(0,k.of)(!0))),(0,G.x)(()=>this.updateFinancialStatuses("updateTotal",!1))).subscribe()}fetchInvestorOpportunityIfNeeded$(){return this.store.select(Dt.Sf).pipe((0,X.q)(1),(0,V.w)(B=>B?(0,k.of)(B):(this.store.dispatch((0,Dt.OB)()),this.actions$.pipe((0,d.l4)(Dt.qf),(0,X.q)(1),(0,V.w)(()=>this.store.pipe((0,et.Ys)(Dt.Sf))),(0,X.q)(1)))))}}return Jt.\u0275fac=function(B){return new(B||Jt)(T.LFG(d.eX),T.LFG(b.ch),T.LFG($t.Sc),T.LFG
1(ht.qL),T.LFG(ut.Re),T.LFG(Ht.U),T.LFG(ht.cw),T.LFG(et.yh),T.LFG(ie.G),T.LFG(Rt.N),T.LFG(ht.X6))},Jt.\u0275prov=T.Yz7({token:Jt,factory:Jt.\u0275fac,providedIn:It.t}),Jt})()},53140:(Nt,gt,n)=>{n.d(gt,{K:()=>K});var d=n(5e3),t=n(93075),N=n(17898),k=n(67322),Q=n(98833),W=n(65835),X=n(69808),R=n(47423);function G(L,mt){1&L&&(d.TgZ(0,"mat-error"),d._uU(1," Total budget must be higher than total investments "),d.qZA())}const V=function(){return{prefix:"$ ",thousands:",",allowNegative:!1,precision:0,align:"left"}};let K=(()=>{class L{constructor(et){this.fb=et,this.updateBudgetTotal=new d.vpe,this.maxBudget=3e8,this.transformBudgetFns={k:q=>1e3*q,m:q=>1e6*q},this.budgetCtrl=this.fb.control(null,[q=>{var rt,Ct;return t.kI.min(null!==(Ct=null===(rt=this.budget)||void 0===rt?void 0:rt.raised)&&void 0!==Ct?Ct:0)(q)},t.kI.max(this.maxBudget)]),this.randomName=(0,N.O)()}ngOnInit(){this.budgetCtrl.markAsTouched()}ngOnChanges(et){const q=et.budget;if(null==q?void 0:q.currentValue){const rt=q.currentValue.remaining<0?q.currentValue.total+Math.abs(q.currentValue.remaining):q.currentValue.total;this.budgetCtrl.setValue(null!=rt?rt:null)}}budgetKeydown(et,q){var rt;const Ct=null===(rt=et.key)||void 0===rt?void 0:rt.toLowerCase(),ht=this.transformBudgetFns[Ct];if("function"==typeof ht){const Rt=ht(q.value||1);q.patchValue(Rt>this.maxBudget?this.maxBudget:Rt)}}}return L.\u0275fac=function(et){return new(et||L)(d.Y36(t.qu))},L.\u0275cmp=d.Xpm({type:L,selectors:[["form-budget"]],inputs:{budget:"budget"},outputs:{updateBudgetTotal:"updateBudgetTotal"},features:[d.TTD],decls:8,vars:6,consts:[[1,"sl8d-margin-bottom-xl","sl8d-flex","sl8d-align-items-start",3,"submit"],["appearance","outline",1,"sl8d-padding-right-xs","budget-field"],["matInput","","currencyMask","",1,"sl8d-full-width","sl8d-title-sm","sl8d-padding-right-xs",3,"formControl","name","options","keydown"],[4,"ngIf"],["mat-flat-button","","color","accent",1,"sl8d-caption","sl8d-flex-shrink-0","save-budget-btn",3,"disabled"]],template:function(et,q){1&et&&(d.TgZ(0,"form",0),d.NdJ("submit",function(){return q.updateBudgetTotal.emit(q.budgetCtrl.value)}),d.TgZ(1,"mat-form-field",1)(2,"input",2),d.NdJ("keydown",function(Ct){return q.budgetKeydown(Ct,q.budgetCtrl)}),d.qZA(),d.TgZ(3,"mat-hint"),d._uU(4,"US dollars"),d.qZA(),d.YNc(5,G,2,0,"mat-error",3),d.qZA(),d.TgZ(6,"button",4),d._uU(7,"Save"),d.qZA()()),2&et&&(d.xp6(2),d.Q6J("formControl",q.budgetCtrl)("name",q.randomName)("options",d.DdM(5,V)),d.xp6(3),d.Q6J("ngIf",q.budgetCtrl.invalid&&q.budgetCtrl.errors.min),d.xp6(1),d.Q6J("disabled",q.budgetCtrl.invalid||!q.budgetCtrl.value))},directives:[t._Y,t.JL,t.F,k.KE,Q.Nt,t.Fj,W.g1,t.JJ,t.oH,k.bx,X.O5,k.TO,R.lW],styles:[".budget-field[_ngcontent-%COMP%] .mat-form-field-wrapper, .budget-field[_ngcontent-%COMP%] .mat-form-field-flex{margin:0}.budget-field[_ngcontent-%COMP%] .mat-form-field-outline{top:0}.budget-field[_ngcontent-%COMP%] .mat-form-field-infix{width:auto;border-top:0;height:36px;padding:0;line-height:36px}.budget-field[_ngcontent-%COMP%] .mat-input-element{height:36px}"],changeDetection:0}),L})()},54024:(Nt,gt,n)=>{n.d(gt,{RE:()=>N.R,td:()=>d.t});var d=n(50809),N=(n(24877),n(96296))},83829:(Nt,gt,n)=>{n.d(gt,{qf:()=>ht,OB:()=>rt,Jd:()=>G,cD:()=>Qt,MB:()=>q,T0:()=>V,F2:()=>K,Sn:()=>L,ng:()=>mt,_d:()=>et,Sf:()=>ot,Yi:()=>b,xs:()=>Dt,WZ:()=>kt,jx:()=>e});var d=n(65620),t=n(12915),N=n(17400),k=n(97714),Q=n(54706),W=n(57579),X=n(87474),R=n(24394);const G=(0,d.PH)((0,R.dt)("[Project Opportunities] Fetch Opportunities"),(0,d.Ky)()),V=(0,d.PH)((0,R.dt)("[Project Opportunities] Set Opportunities Response"),(0,d.Ky)()),K=(0,d.PH)((0,R.dt)("[Project Opportunities] Set or Add Opportunity"),(0,d.Ky)()),L=(0,d.PH)((0,R.dt)("[Project Opportunities] Set Patches Opp
1ortunity Response"),(0,d.Ky)()),mt=(0,d.PH)((0,R.dt)("[Project Opportunities] Update Opportunity Field"),(0,d.Ky)()),et=(0,d.PH)((0,R.dt)("[Project Opportunities] Update Match Status"),(0,d.Ky)()),q=(0,d.PH)((0,R.dt)("[Project Opportunities] Remove an Opportunity from the list"),(0,d.Ky)()),rt=(0,d.PH)((0,R.dt)("[Project Opportunities] Fetch Investor Opportunity")),Ct=(0,d.PH)((0,R.dt)("[Project Opportunities] Pending Status for the Investor Opportunity")),ht=(0,d.PH)((0,R.dt)("[Project Opportunities] Complete|None Status for the Investor Opportunity"),(0,d.Ky)());function Rt(){return{opportunities:null,investorOppStatus:k.iF.none}}var ut=function(I,st){var nt={};for(var z in I)Object.prototype.hasOwnProperty.call(I,z)&&st.indexOf(z)<0&&(nt[z]=I[z]);if(null!=I&&"function"==typeof Object.getOwnPropertySymbols){var ct=0;for(z=Object.getOwnPropertySymbols(I);ct<z.length;ct++)st.indexOf(z[ct])<0&&Object.prototype.propertyIsEnumerable.call(I,z[ct])&&(nt[z[ct]]=I[z[ct]])}return nt};const $t=I=>Object.assign(Object.assign({},I),{role:I.role||I.role_type&&{id:null,name:I.role_type.name,slug:null,role_type:{name:I.role_type.name,slug:null,group:N.c.distributor}},tags:I.tags.reduce((st,nt)=>[...st,...nt.items],[]),status:(0,t.X)({sent:I.opportunity_connection.interest_status,sent_date:I.opportunity_connection.interest_status_updated,received:I.opportunity_connection.opportunity_status,received_date:I.opportunity_connection.opportunity_status_updated})}),kt=(0,d.Lq)(Rt(),(0,d.on)(X.zY,()=>Rt()),(0,d.on)(V,(I,st)=>{var nt,z,yt=ut(st,["type"]);return Object.assign(Object.assign({},I),{opportunities:(0,Q.R6)(yt,null!==(z=null===(nt=(0,W.yA)(yt))||void 0===nt?void 0:nt.map($t))&&void 0!==z?z:[])})}),(0,d.on)(K,(I,st)=>Object.assign(Object.assign({},I),{opportunities:I.opportunities?(0,Q.R6)(I.opportunities,(0,W.yA)(I.opportunities).find(({id:nt})=>st.id===nt)?(0,W.yA)(I.opportunities).map(nt=>nt.id===st.id?$t(st):nt):[...(0,W.yA)(I.opportunities),$t(st)]):(0,Q.XG)([$t(st)])})),(0,d.on)(L,(I,st)=>{var nt,z,yt=ut(st,["type"]);return Object.assign(Object.assign({},I),{opportunities:I.opportunities?(0,Q.R6)(I.opportunities,[...null!==(z=null===(nt=(0,W.yA)(I.opportunities))||void 0===nt?void 0:nt.filter(jt=>jt.id!==yt.id))&&void 0!==z?z:[],$t(yt)]):I.opportunities})}),(0,d.on)(q,(I,{opportunityId:st})=>{var nt,z;return Object.assign(Object.assign({},I),{opportunities:(0,Q.R6)(I.opportunities,null!==(z=null===(nt=(0,W.yA)(I.opportunities))||void 0===nt?void 0:nt.filter(ct=>ct.id!==st))&&void 0!==z?z:[])})}),(0,d.on)(et,(I,{id:st,status:nt})=>{var z;return Object.assign(Object.assign({},I),{opportunities:(0,Q.R6)(I.opportunities,null===(z=(0,W.yA)(I.opportunities))||void 0===z?void 0:z.map(ct=>ct.id===st?Object.assign(Object.assign({},ct),{status:nt}):ct))})}),(0,d.on)(mt,(I,st)=>{var nt,{id:z}=st,yt=ut(st,["id","type"]);return Object.assign(Object.assign({},I),{opportunities:(0,Q.R6)(I.opportunities,null===(nt=(0,W.yA)(I.opportunities))||void 0===nt?void 0:nt.map(jt=>jt.id===z?Object.assign(Object.assign({},jt),yt):jt))})}),(0,d.on)(Ct,I=>Object.assign(Object.assign({},I),{investorOppStatus:"pending"})),(0,d.on)(rt,I=>Object.assign(Object.assign({},I),{investorOppStatus:"pending"})),(0,d.on)(ht,(I,{exists:st=!1})=>Object.assign(Object.assign({},I),{investorOppStatus:st?k.iF.completed:k.iF.none})));var It=n(44257);const Ht=(0,d.P1)(It.V9,I=>I.opportunities),ie=(0,d.P1)(Ht,I=>I.opportunities),e=(0,d.P1)(ie,I=>(0,W.mW)(I)),Dt=(0,d.P1)(ie,I=>(0,W.yA)(I)),T=I=>{var st,nt;return`${null!==(nt=null===(st=I.filter_billing)||void 0===st?void 0:st.name)&&void 0!==nt?nt:""} ${I.role.name} ${I.name||I.id}`.toLowerCase().trim()},b=(0,d.P1)(Dt,I=>{var st;return null!==(st=null==I?void 0:I.sort((nt,z)=>{const ct=nt.role.name.toLowerCase(),yt=z.role.name.toLowerCase();return ct===yt?T(nt)>T(z)?1:-1:ct>yt?1:-1}).reduce((nt,z)=>Object.assign(Object.assign({},nt),{[z.role.role_type.group]:[...nt[z.role.role_type.group]||[],z]}),{}))&&void 0!==st?st:{}}),ot=(0,d.P1)(Dt,I=>null==I?void 0:I.find(st=>st.role.role_type.group===N.c.investor));(0,d.P1)(Ht,I=>I.investorOppStatus);var H=n(26991),B=n(39646),Z=n(11365),Pt=n(39300),Tt=n(18505),j=n(63900),dt=n(54004),Et=n(70262),re=n(65967),Bt=n(53092),Lt=n(5e3);let Qt=(()=>{class I{constructor(nt,z,ct){this.actions$=nt,this.projectsApi=z,this.store=ct,this.fetchOpportunities$=(0,H.GW)(()=>this.actions$.pipe((0,H.l4)(G),(0,Z.M)(this.store.pipe((0,d.Ys)(Bt.x_)),this.store.pipe((0,d.Ys)(It.Sx))),(0,Pt.h)(([yt,jt])=>!!jt.user_id),(0,Tt.b)(([{withPending:yt}])=>yt&&this.store.dispatch(V((0,Q.HW)()))),(0,j.w)(([yt,jt,Ft])=>this.projectsApi.fetchOpportunities$(Ft).pipe((0,dt.U)(se=>
1V((0,Q.XG)(se.results))),(0,Et.K)(se=>403===se.status?(0,B.of)(V((0,Q.XG)([]))):(this.store.dispatch((0,R.F0)({message:"Error on load opportunities",data:se})),(0,B.of)(V((0,Q.MI)(se))))))))),this.fetchInvestorOpportunity$=(0,H.GW)(()=>this.actions$.pipe((0,H.l4)(rt),(0,Z.M)(this.store.pipe((0,d.Ys)(It.Sx))),(0,j.w)(([yt,jt])=>this.projectsApi.fetchFinancialOpportunity$(jt).pipe((0,dt.U)(Ft=>null==Ft?void 0:Ft[0]),(0,Tt.b)(Ft=>Ft&&this.store.dispatch(K(Ft))),(0,dt.U)(Ft=>ht({exists:!!Ft})),(0,Et.K)(Ft=>(0,B.of)((0,R.bR)(rt,Ft),ht({exists:!1})))))))}}return I.\u0275fac=function(nt){return new(nt||I)(Lt.LFG(H.eX),Lt.LFG(re.lV),Lt.LFG(d.yh))},I.\u0275prov=Lt.Yz7({token:I,factory:I.\u0275fac}),I})()},70095:(Nt,gt,n)=>{n.d(gt,{m:()=>N});var d=n(5e3),t=n(93075);let N=(()=>{class k{set max(W){this._validator=t.kI.max(parseInt(W,10))}validate(W){return this._validator(W)}}return k.\u0275fac=function(W){return new(W||k)},k.\u0275dir=d.lG2({type:k,selectors:[["","max","","ngModel",""]],inputs:{max:"max"},features:[d._Bn([{provide:t.Cf,useExisting:(0,d.Gpc)(()=>k),multi:!0}])]}),k})()},13528:(Nt,gt,n)=>{n.d(gt,{K:()=>N});var d=n(5e3),t=n(93075);let N=(()=>{class k{set min(W){this._validator=t.kI.min(parseInt(W,10))}validate(W){return this._validator(W)}}return k.\u0275fac=function(W){return new(W||k)},k.\u0275dir=d.lG2({type:k,selectors:[["","min","","ngModel",""]],inputs:{min:"min"},features:[d._Bn([{provide:t.Cf,useExisting:(0,d.Gpc)(()=>k),multi:!0}])]}),k})()},18303:(Nt,gt,n)=>{n.d(gt,{h:()=>R});var d=n(5e3),t=n(54968),N=n(44987);const W=[[["","header",""]],[["","content",""]],[["","footer",""]]];let R=class{constructor(V,K){this.cdr=V,this.elRef=K,this.scrolled=!1}ngAfterViewInit(){(0,t.R)(this.elRef.nativeElement,"scroll").pipe((0,N.t)(this)).subscribe(V=>{this.scrolled=V.target.scrollTop>10,this.cdr.markForCheck()})}ngOnDestroy(){}};R.\u0275fac=function(V){return new(V||R)(d.Y36(d.sBO),d.Y36(d.SBq))},R.\u0275cmp=d.Xpm({type:R,selectors:[["sl-base-layout-subpage"]],ngContentSelectors:["[header]","[content]","[footer]"],decls:4,vars:2,consts:[[1,"sticky"]],template:function(V,K){1&V&&(d.F$t(W),d.TgZ(0,"div",0),d.Hsn(1),d.qZA(),d.Hsn(2,1),d.Hsn(3,2)),2&V&&d.ekj("_scrolled",K.scrolled)},styles:["[_nghost-%COMP%]{position:relative;flex-grow:1;display:block;overflow-y:auto;overflow-x:hidden}[_nghost-%COMP%] .sticky[_ngcontent-%COMP%]{position:sticky;top:0;left:0;right:0;z-index:3;transition:box-shadow .1s ease-out}[_nghost-%COMP%] .sticky._scrolled[_ngcontent-%COMP%]{transition:box-shadow .3s ease-out;box-shadow:0 3px 3px #0000004d}"],changeDetection:0}),R=function(G,V,K,L){var q,mt=arguments.length,et=mt<3?V:null===L?L=Object.getOwnPropertyDescriptor(V,K):L;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)et=Reflect.decorate(G,V,K,L);else for(var rt=G.length-1;rt>=0;rt--)(q=G[rt])&&(et=(mt<3?q(et):mt>3?q(V,K,et):q(V,K))||et);return mt>3&&et&&Object.defineProperty(V,K,et),et}([(0,N.c)(),function(G,V){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata("design:paramtypes",V)}(0,[d.sBO,d.SBq])],R)},87125:(Nt,gt,n)=>{n.d(gt,{Z:()=>W});var d=n(91998),t=n(80953),N=n(40833);function k(X,R){(0,N.Z)(2,arguments);var G=(0,t.Z)(X),V=(0,d.Z)(R);return isNaN(V)?new Date(NaN):(V&&G.setDate(G.getDate()+V),G)}var Q=n(85866);function W(X,R){if((0,N.Z)(2,arguments),!R||"object"!=typeof R)return new Date(NaN);var G=R.years?(0,d.Z)(R.years):0,V=R.months?(0,d.Z)(R.months):0,K=R.weeks?(0,d.Z)(R.weeks):0,L=R.days?(0,d.Z)(R.days):0,mt=R.hours?(0,d.Z)(R.hours):0,et=R.minutes?(0,d.Z)(R.minutes):0,q=R.seconds?(0,d.Z)(R.seconds):0,rt=(0,t.Z)(X),Ct=V||G?(0,Q.Z)(rt,V+12*G):rt,ht=L||K?k(Ct,L+7*K):Ct,Rt=et+60*mt,ut=q+60*Rt,$t=1e3*ut,kt=new Date(ht.getTime()+$t);return kt}}}]);
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.