@mtgame/core 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function m(t,e){function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){return(f=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e,n,i){var o,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(r<3?o(a):r>3?o(e,n,a):o(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function h(t,e){return function(n,i){e(n,i,t)}}function g(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{u(i.next(t))}catch(t){r(t)}}function s(t){try{u(i.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))}function v(t,e){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function _(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function b(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}var k=function(){function t(t){var e,n;if(t)try{for(var i=_(Object.keys(t)),o=i.next();!o.done;o=i.next()){var r=o.value;this[r]=t[r]}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}return t.toFront=function(t){},t.toBack=function(t){},t}();function T(t){return{toFront:function(e){return isNaN(+e)?t[e]:e},toBack:function(e){return isNaN(+e)?e:t[e]}}}function S(t){return{toFront:function(e){return Array.isArray(e)?t.toFront(e):[]},toBack:function(e){return Array.isArray(e)?t.toBack(e):[]}}}var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){return t?new Date(t):void 0},e.toBack=function(t){return t?new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())).toISOString().slice(0,10):void 0},e}(k),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){return t?new Date(t):void 0},e.toBack=function(t){if(t){new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()));return t.toISOString()}},e}(k);function w(t){return function(e){t&&(t.mappingFields&&(e._mapping_fields_=t.mappingFields),t.relation&&(e._relation_=t.relation),e._to_front_=function(t,n){return function t(e,n,i){var o,r;if(Array.isArray(n))return n.map((function(n){return t(e,n)}));var a=new e,s=e._mapping_fields_,u=e._relation_;if(s)try{for(var l=_(Object.keys(s)),c=l.next();!c.done;c=l.next()){var p=c.value,m=s[p],f=B(p,n);u&&u.hasOwnProperty(m)?a[m]=u[m].toFront(f):a[m]=f}}catch(t){o={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return a}(e,t)},e._to_back_=function(t,n){return function t(e,n,i){var o,r;if(!n)return n;if(Array.isArray(n))return n.map((function(n){return t(e,n)}));var a={},s=e._mapping_fields_,u=e._relation_;if(s)try{for(var l=_(Object.keys(s)),c=l.next();!c.done;c=l.next()){var p=c.value,m=s[p];u&&u.hasOwnProperty(m)&&void 0!==n[m]?a[p]=u[m].toBack(n[m]):a[p]=n[m]}}catch(t){o={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return a}(e,t)})}}var C,I=function(t,e,n){return{value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t._to_front_;if(i)return i(e[0],e.length>1?e[1]:void 0)}}},U=function(t,e,n){return{value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t._to_back_;if(i)return i(e[0])}}};function B(t,e){var n,i;if(e){var o=t.split(".");if(1===o.length)return t in e?e[t]:void 0;try{for(var r=_(o),a=r.next();!a.done;a=r.next()){var s=a.value;if(!e||!(s in e))return;e=e[s]}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return e}}(C=t.FileEngine||(t.FileEngine={}))[C.django=1]="django",C[C.s3=2]="s3";var G,j=function(){function e(){}return e.toFront=function(t){return null},e.toBack=function(t){return null},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",path:"path",mime_type:"mimeType",size:"size",engine:"engine"},relation:{engine:T(t.FileEngine)}})],e)}();(G=t.SportTypes||(t.SportTypes={}))[G.basketball=1]="basketball",G[G.volleyball=2]="volleyball",G[G.classic_basketball=3]="classic_basketball",G[G.streetball=4]="streetball";var L,A,V=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.prototype.isBasketball=function(){return this.id===t.SportTypes.basketball||this.parentId===t.SportTypes.basketball},n.prototype.isClassicBasketball=function(){return this.id===t.SportTypes.classic_basketball},n.prototype.isVolleyball=function(){return this.id===t.SportTypes.volleyball||this.parentId===t.SportTypes.volleyball},n.prototype.isStreetball=function(){return this.id===t.SportTypes.streetball},n.toFront=function(t){return null},n.toBack=function(t){return null},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",name:"name",parent_id:"parentId",sub_sports:"subSports"}})],n)}(k),x=function(){function t(){}return t.toFront=function(t){},t.toBack=function(t){},d([I],t,"toFront",null),d([U],t,"toBack",null),t=d([w({mappingFields:{id:"id",user_id:"userId",height:"height",weight:"weight"}})],t)}(),O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name"}})],e)}(k);(L=t.GameBasketballPosition||(t.GameBasketballPosition={}))[L.point_guard=1]="point_guard",L[L.shooting_guard=2]="shooting_guard",L[L.small_forward=3]="small_forward",L[L.power_forward=4]="power_forward",L[L.center=5]="center",(A=t.WorkHand||(t.WorkHand={}))[A.left=1]="left",A[A.right=2]="right";var E,H,N=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",user_id:"userId",position:"position",work_hand:"workHand"},relation:{position:T(t.GameBasketballPosition),workHand:T(t.WorkHand)}})],n)}(k);(E=t.GameVolleyballPosition||(t.GameVolleyballPosition={}))[E.setter=1]="setter",E[E.libero=2]="libero",E[E.middle_player=3]="middle_player",E[E.receiver_attacker=4]="receiver_attacker",E[E.dioganal=5]="dioganal",(H=t.VolleyballWorkHand||(t.VolleyballWorkHand={}))[H.left=1]="left",H[H.right=2]="right";var z,D=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",user_id:"userId",position:"position",work_hand:"workHand"},relation:{position:T(t.GameVolleyballPosition),workHand:T(t.VolleyballWorkHand)}})],n)}(k);(z=t.UserGender||(t.UserGender={}))[z.male=1]="male",z[z.female=2]="female";var R,M,q,W,$=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){return null},n.toBack=function(t){return null},Object.defineProperty(n.prototype,"fullName",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shortName",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"initials",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).map((function(t){return t.substr(0,1)})).join("")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"age",{get:function(){if(!this.birthDate)return null;var t=(new Date).getTime()-this.birthDate.getTime();return Math.floor(t/31536e6)},enumerable:!0,configurable:!0}),d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",last_name:"lastName",first_name:"firstName",middle_name:"middleName",email:"email",phone:"phone",birth_date:"birthDate",photo:"photo",profile:"profile",basketball_profile:"basketballProfile",volleyball_profile:"volleyballProfile",wizards:"wizards",city:"city",gender:"gender",is_active:"isActive"},relation:{birthDate:F,photo:j,profile:x,basketballProfile:N,volleyballProfile:D,city:O,gender:T(t.UserGender)}})],n)}(k),X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.getEmptyLogoClass=function(){var t=["empty-logo"];return this.sport.isBasketball()&&t.push("empty-logo-basketball"),this.sport.isVolleyball()&&t.push("empty-logo-volleyball"),t.join(" ")},e.toFront=function(t){return null},e.toBack=function(t){return null},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",sport:"sport",logo:"logo",owner:"owner",city:"city",users_count:"usersCount",won_games_count:"wonGamesCount",games_count:"gamesCount",score_sum:"scoreSum",closest_game_datetime:"closestGameDatetime"},relation:{sport:V,logo:j,owner:$,city:O,closestGameDatetime:F}})],e)}(k),J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",owner_id:"ownerId",owner:"owner"},relation:{owner:$}})],e)}(k),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},Object.defineProperty(e.prototype,"vkLink",{get:function(){return this.socialLinks.find((function(t){return"https://vk.com/"===t.substr(0,15)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fbLink",{get:function(){return this.socialLinks.find((function(t){return"https://www.facebook.com/"===t.substr(0,25)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"instaLink",{get:function(){return this.socialLinks.find((function(t){return"https://www.instagram.com"===t.substr(0,25)}))},enumerable:!0,configurable:!0}),d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",logo:"logo",contact_email:"contactEmail",contact_phone:"contactPhone",name:"name",alias:"alias",sport:"sport",description:"description",social_links:"socialLinks",links:"links",organization:"organization",tournaments_count:"tournamentsCount",closest_game_datetime:"closestGameDatetime",cover:"cover"},relation:{organization:J,logo:j,cover:j,sport:V}})],e)}(k);(R=t.TournamentTypes||(t.TournamentTypes={})).group="group",R.elimination="elimination",R.fiba="fiba",(M=t.TournamentStatuses||(t.TournamentStatuses={}))[M.open=0]="open",M[M.in_progress=1]="in_progress",M[M.closed=2]="closed",(q=t.TournamentGender||(t.TournamentGender={}))[q.male=1]="male",q[q.female=2]="female",q[q.all=3]="all",(W=t.BasketballStatisticTypes||(t.BasketballStatisticTypes={}))[W.standard=1]="standard",W[W.light=2]="light",W[W.extended=3]="extended";var Z,K=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",gender:"gender",age_from:"ageFrom",age_to:"ageTo",max_team_players:"maxTeamPlayers",max_game_players:"maxGamePlayers",type:"type",tours_count:"toursCount",periods_count:"periodsCount",period_time:"periodTime",overtime_type:"overtimeType",overtime_time:"overtimeTime",overtime_score:"overtimeScore",game_type:"gameType",timeout_count:"timeoutCount",timeout_time:"timeoutTime",substitute_count:"substituteCount",game_up_to_score:"gameUpToScore",volleyball_score_in_set:"volleyballScoreInSet",volleyball_score_in_last_set:"volleyballScoreInLastSet",manage_team_application:"manageTeamApplication",recruitment_is_open:"recruitmentIsOpen",transfer_is_open:"transferIsOpen",basketball_statistic_type:"basketballStatisticType",shot_clock_enabled:"shotClockEnabled"},relation:{type:T(t.TournamentTypes),gender:T(t.TournamentGender),basketballStatisticType:T(t.BasketballStatisticTypes)}})],n)}(k),Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_id:"teamId",tournament_id:"tournamentId",team:"team",points:"points"},relation:{team:X}})],e)}(k),tt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.prototype.getEmptyLogoClass=function(){var t=["empty-logo"];return this.sport.isBasketball()&&t.push("empty-logo-basketball"),this.sport.isVolleyball()&&t.push("empty-logo-volleyball"),t.join(" ")},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",name:"name",alias:"alias",logo:"logo",cover:"cover",preview_image:"previewImage",city:"city",sport:"sport",location:"location",description:"description",date:"date",price:"price",regulation_files:"regulationFiles",settings:"settings",league:"league",teams_count:"teamsCount",closest_game_datetime:"closestGameDatetime",status:"status",team_winner:"teamWinner"},relation:{logo:j,cover:j,city:O,sport:V,regulationFile:j,settings:K,date:P,league:Y,status:T(t.TournamentStatuses),teamWinner:Q}})],n)}(k);(Z=t.OvertimeTypes||(t.OvertimeTypes={}))[Z.to_score_total=1]="to_score_total",Z[Z.to_score_diff=2]="to_score_diff",Z[Z.time=3]="time";var et,nt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{periods_count:"periodsCount",period_time:"periodTime",game_up_to_score:"gameUpToScore",overtime_type:"overtimeType",overtime_time:"overtimeTime",overtime_score:"overtimeScore",max_game_players:"maxGamePlayers",timeout_count:"timeoutCount",overtime_timeout_count:"overtimeTimeoutCount",timeout_time:"timeoutTime",statistic_type:"statisticType",shot_clock_enabled:"shotClockEnabled"},relation:{overtimeType:T(t.OvertimeTypes),statisticType:T(t.BasketballStatisticTypes)}})],n)}(k);(et=t.VolleyballGameTypes||(t.VolleyballGameTypes={}))[et.best_of_five=1]="best_of_five",et[et.best_of_three=2]="best_of_three";var it,ot,rt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"setsCount",{get:function(){return this.gameType===t.VolleyballGameTypes.best_of_three?3:5},enumerable:!0,configurable:!0}),n.prototype.getSetMaxScore=function(t){return t===this.setsCount?this.scoreInLastSet:this.scoreInSet},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{game_type:"gameType",timeout_count:"timeoutCount",timeout_time:"timeoutTime",substitute_count:"substituteCount",score_in_set:"scoreInSet",score_in_last_set:"scoreInLastSet"},relation:{gameType:T(t.VolleyballGameTypes)}})],n)}(k),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",address:"address",league_id:"leagueId"}})],e)}(k),st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"isVideo",{get:function(){return Boolean(this.videoUrl)},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",original_photo:"originalPhoto",list_photo:"listPhoto",detail_photo:"detailPhoto",game:"game",tournament:"tournament",game_id:"gameId",tournament_id:"tournament_id",video_url:"videoUrl",video_preview:"videoPreview"},relation:{originalPhoto:j,listPhoto:j,detailPhoto:j,videoPreview:j}})],e)}(k);(it=t.GameStatuses||(t.GameStatuses={}))[it.open=1]="open",it[it.in_progress=2]="in_progress",it[it.closed=3]="closed",it[it.archived=4]="archived",it[it.draft=5]="draft",(ot=t.GameResultTypes||(t.GameResultTypes={}))[ot.team_won=1]="team_won",ot[ot.competitor_team_won=2]="competitor_team_won",ot[ot.team_technical_defeat=3]="team_technical_defeat",ot[ot.competitor_team_technical_defeat=4]="competitor_team_technical_defeat";var ut,lt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"scoreByPeriodList",{get:function(){var t=this;return this.scoreByPeriod?Object.keys(this.scoreByPeriod).map((function(e){return{period:+e,teamScore:t.scoreByPeriod[e][0],competitorTeamScore:t.scoreByPeriod[e][1]}})):[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isClosed",{get:function(){return this.status===t.GameStatuses.closed},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isTeamWon",{get:function(){return this.teamScore>this.competitorTeamScore},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isCompetitorTeamWon",{get:function(){return this.competitorTeamScore>this.teamScore},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"teamWinnerId",{get:function(){return this.status!==t.GameStatuses.closed||this.teamScore===this.competitorTeamScore?null:this.team.id?this.teamScore>this.competitorTeamScore?this.team.id:this.competitorTeam.id:this.teamScore>this.competitorTeamScore?this.teamId:this.competitorTeamId},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",status:"status",team:"team",team_id:"teamId",competitor_team:"competitorTeam",competitor_team_id:"competitorTeamId",competitor_team_name:"competitorTeamName",datetime:"datetime",location:"location",team_score:"teamScore",competitor_team_score:"competitorTeamScore",result_type:"resultType",playoff_number:"playoffNumber",tournament_id:"tournamentId",tournament_tour:"tournamentTour",basketball_game_config:"basketballGameConfig",volleyball_game_config:"volleyballGameConfig",score_by_period:"scoreByPeriod",playoff_stage:"playoffStage",tournament_stage_id:"tournamentStageId",tournament_playoff_id:"tournamentPlayoffId",tournament_court:"tournamentCourt",media_count:"mediaCount",media:"media"},relation:{status:T(t.GameStatuses),team:X,competitorTeam:X,datetime:P,resultType:T(t.GameResultTypes),basketballGameConfig:nt,volleyballGameConfig:rt,tournamentCourt:at,media:S(st)}})],n)}(k);(ut=t.TeamUserRole||(t.TeamUserRole={}))[ut.member=1]="member",ut[ut.moderator=2]="moderator",ut[ut.admin=3]="admin";var ct=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",team_id:"teamId",user:"user",role:"role",number:"number",team:"team"},relation:{user:$,team:X,role:T(t.TeamUserRole)}})],n)}(k),pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",tournament_stage_id:"tournamentStageId"}})],e)}(k),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"gamesWonPercent",{get:function(){return this.gamesCount?Math.floor(1e3*this.wonGamesCount/this.gamesCount)/10:0},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_id:"teamId",tournament_id:"tournamentId",tournament:"tournament",team:"team",group:"group",games_count:"gamesCount",won_games_count:"wonGamesCount",last_games_count:"lastGamesCount",last_games_won:"lastGamesWon",score_sum:"scoreSum",missed_sum:"missedSum",score_points_sum:"scorePointsSum",missed_points_sum:"missedPointsSum",points:"points",users_count:"usersCount",games:"games",notifications_count:"notificationsCount"},relation:{tournament:tt,team:X,group:pt,games:lt}})],e)}(k),ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team_user_id:"tournamentTeamUserId",date_from:"dateFrom",date_to:"dateTo",matches_count:"matchesCount"},relation:{dateFrom:F,dateTo:F}})],e)}(k),dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"fullName",{get:function(){return[this.lastName,this.firstName,this.middleName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shortName",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initials",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).map((function(t){return t.substr(0,1)})).join("")},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team:"tournamentTeam",team_user:"teamUser",disqualified:"disqualified",first_name:"firstName",last_name:"lastName",middle_name:"middleName",photo:"photo",disqualification:"disqualification",has_changes:"hasChanges"},relation:{tournamentTeam:mt,teamUser:ct,photo:j,disqualification:ft}})],e)}(k),ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",game_id:"gameId",team_user:"teamUser",tournament_team_user:"tournamentTeamUser",updated_at:"updatedAt"},relation:{teamUser:ct,tournamentTeamUser:dt,updatedAt:P}})],e)}(k);function gt(t,e,n,i){return void 0===n&&(n=!1),Array.isArray(t)?t.map((function(t){if(i&&kt(i)){if(!i(t))return t}else if(t.id!==e.id)return t;return t.updatedAt&&e.updatedAt&&!n&&t.updatedAt>e.updatedAt?t:e})):t}function vt(t,e,n,i){return void 0===n&&(n=!1),e.forEach((function(e){t=gt(t,e,n,i)})),t}function _t(t,e,n,i){return void 0===n&&(n=!1),Array.isArray(t)?t.find((function(t){return kt(i)?i(t):t.id===e.id}))?t:n?b(t,[e]):b([e],t):[e]}function yt(t,e,n,i){return void 0===n&&(n=!1),(n?e:Object.assign([],e).reverse()).forEach((function(e){t=_t(t,e,n,i)})),t}function bt(t,e){return Array.isArray(t)?kt(e)?t.filter((function(t){return!e(t)})):t.filter((function(t){return t.id!==e.id})):[]}function kt(t){return t&&"[object Function]"==={}.toString.call(t)}var Tt,St=function(){function t(t){this.engine=t,this.data={}}return t.prototype.get=function(t){return this.getSubject(t).pipe(i.filter((function(t){return void 0!==t})))},t.prototype.value=function(t){return this.getSubject(t).value},t.prototype.save=function(t,e){this.getSubject(t).next(e),this.engine&&this.engine.save(t,e)},t.prototype.appendItem=function(t,e,n){this.save(t,_t(this.value(t)||[],e,!0,n))},t.prototype.appendItems=function(t,e,n){this.save(t,yt(this.value(t)||[],e,!0))},t.prototype.prependItem=function(t,e,n){this.save(t,_t(this.value(t)||[],e,!1,n))},t.prototype.prependItems=function(t,e,n){this.save(t,yt(this.value(t)||[],e,!1,n))},t.prototype.updateItem=function(t,e,n,i){this.save(t,gt(this.value(t)||[],e,n,i))},t.prototype.updateItems=function(t,e,n,i){this.save(t,vt(this.value(t)||[],e,n,i))},t.prototype.deleteItem=function(t,e){this.save(t,bt(this.value(t)||[],e))},t.prototype.dispose=function(){var t,e;try{for(var n=_(Object.keys(this.data)),i=n.next();!i.done;i=n.next()){var o=i.value;this.data[o].complete(),delete this.data[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.clearStorageData=function(){this.engine&&this.engine.clear()},t.prototype.getEngine=function(){return this.engine},t.prototype.getSubject=function(t){return this.data[t]||(this.data[t]=new o.BehaviorSubject(this.engine?this.engine.get(t):void 0)),this.data[t]},t}(),Ft=function(){function t(){this.store=new St}return t.prototype.dispose=function(){this.store.dispose()},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Pt=function(t){function n(e){var n=t.call(this)||this;return n.configData=e,e&&n.initialize(e),n}return m(n,t),Object.defineProperty(n.prototype,"config$",{get:function(){return this.store.get("config")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"config",{get:function(){return this.store.value("config")||{}},enumerable:!0,configurable:!0}),n.prototype.initialize=function(t){this.store.save("config",t)},n.prototype.set=function(t,e){var n;this.store.save("config",f(f({},this.config),((n={})[t]=e,n)))},n.prototype.get=function(t){return this.store.value("config")&&this.store.value("config")[t]},n.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:["mtg-core-config-data"]}]}]},n.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new n(e.ɵɵinject("mtg-core-config-data",8))},token:n,providedIn:"root"}),n=d([e.Injectable({providedIn:"root"}),h(0,e.Optional()),h(0,e.Inject("mtg-core-config-data"))],n)}(Ft),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"totalFouls",{get:function(){return this.personalFouls+this.technicalFouls+this.unsportsmanlikeFouls},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{tournament_team_user:"tournamentTeamUser",team:"team",team_user:"teamUser",user:"user",tournament_team:"tournamentTeam",month:"month",win_lose:"winLose",games_count:"gamesCount",won_games_count:"wonGamesCount",points:"points",two_points_made:"twoPointsMade",three_points_made:"threePointsMade",free_throws_made:"freeThrowsMade",one_points_made:"onePointsMade",two_point_attempts:"twoPointAttempts",three_point_attempts:"threePointAttempts",free_throw_attempts:"freeThrowAttempts",one_point_attempts:"onePointAttempts",two_point_percent:"twoPointPercent",three_point_percent:"threePointPercent",free_throw_percent:"freeThrowPercent",one_point_percent:"onePointPercent",assists:"assists",blocks:"blocks",rebounds:"rebounds",offensive_rebounds:"offensiveRebounds",defensive_rebounds:"defensiveRebounds",steals:"steals",turnovers:"turnovers",personal_fouls:"personalFouls",technical_fouls:"technicalFouls",unsportsmanlike_fouls:"unsportsmanlikeFouls",newbie:"newbie"},relation:{tournamentTeamUser:dt,team:X,teamUser:ct,user:$,tournamentTeam:mt,month:F}})],e)}(k),Ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",competitor_team:"competitorTeam"},relation:{team:wt,competitorTeam:wt}})],e)}(k),It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.gameUserId},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},Object.defineProperty(e.prototype,"totalFouls",{get:function(){return(this.personalFouls||0)+(this.technicalFouls||0)+(this.unsportsmanlikeFouls||0)},enumerable:!0,configurable:!0}),d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{game_user_id:"gameUserId",points:"points",free_throws_made:"freeThrowsMade",two_points_made:"twoPointsMade",three_points_made:"threePointsMade",one_points_made:"onePointsMade",two_point_attempts:"twoPointAttempts",three_point_attempts:"threePointAttempts",free_throw_attempts:"freeThrowAttempts",one_point_attempts:"onePointAttempts",assists:"assists",blocks:"blocks",rebounds:"rebounds",offensive_rebounds:"offensiveRebounds",defensive_rebounds:"defensiveRebounds",steals:"steals",turnovers:"turnovers",personal_fouls:"personalFouls",technical_fouls:"technicalFouls",unsportsmanlike_fouls:"unsportsmanlikeFouls",updated_at:"updatedAt"},relation:{updatedAt:P}})],e)}(k);(Tt=t.BasketballGameLogTypes||(t.BasketballGameLogTypes={}))[Tt.enter_game=1]="enter_game",Tt[Tt.exit_game=2]="exit_game",Tt[Tt.remove_game=3]="remove_game",Tt[Tt.two_point_made=4]="two_point_made",Tt[Tt.three_point_made=5]="three_point_made",Tt[Tt.free_throw_made=6]="free_throw_made",Tt[Tt.two_point_attempt=7]="two_point_attempt",Tt[Tt.three_point_attempt=8]="three_point_attempt",Tt[Tt.free_throw_attempt=9]="free_throw_attempt",Tt[Tt.assist=10]="assist",Tt[Tt.block=11]="block",Tt[Tt.rebound=12]="rebound",Tt[Tt.offensive_rebound=13]="offensive_rebound",Tt[Tt.defensive_rebound=14]="defensive_rebound",Tt[Tt.steal=15]="steal",Tt[Tt.turnover=16]="turnover",Tt[Tt.personal_foul=17]="personal_foul",Tt[Tt.technical_foul=18]="technical_foul",Tt[Tt.unsportsmanlike_foul=19]="unsportsmanlike_foul",Tt[Tt.one_point_attempt=20]="one_point_attempt",Tt[Tt.one_point_made=21]="one_point_made",Tt[Tt.timeout=22]="timeout";var Ut,Bt=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.active=!0,t}return m(n,e),n.prototype.isPointsType=function(){return[t.BasketballGameLogTypes.two_point_made,t.BasketballGameLogTypes.three_point_made,t.BasketballGameLogTypes.free_throw_made,t.BasketballGameLogTypes.one_point_made].indexOf(this.logType)>-1},n.prototype.isReboundType=function(){return[t.BasketballGameLogTypes.rebound,t.BasketballGameLogTypes.offensive_rebound,t.BasketballGameLogTypes.defensive_rebound].indexOf(this.logType)>-1},n.prototype.isFoulType=function(){return[t.BasketballGameLogTypes.personal_foul,t.BasketballGameLogTypes.technical_foul,t.BasketballGameLogTypes.unsportsmanlike_foul].indexOf(this.logType)>-1},n.prototype.getScore=function(){var e;return((e={})[t.BasketballGameLogTypes.one_point_made]=1,e[t.BasketballGameLogTypes.free_throw_made]=1,e[t.BasketballGameLogTypes.two_point_made]=2,e[t.BasketballGameLogTypes.three_point_made]=3,e)[this.logType]},n.prototype.compare=function(t){return this.time===t.time&&this.period===t.period?this.datetime.getTime()<t.datetime.getTime()?1:-1:this.period===t.period?this.time<t.time?1:-1:this.period<t.period?1:-1},Object.defineProperty(n.prototype,"timeFormatted",{get:function(){var t=Math.floor(this.time/60),e=this.time-60*t;return(t<10?"0":"")+t+":"+(e<10?"0":"")+e},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",unique_id:"uniqueId",game_id:"gameId",game_user_id:"gameUserId",team_id:"teamId",log_type:"logType",datetime:"datetime",time:"time",period:"period",active:"active",is_highlight:"isHighlight"},relation:{datetime:P,logType:T(t.BasketballGameLogTypes)}})],n)}(k),Gt=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/").pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},t.prototype.getUsers=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_game/"+t+"/users/").pipe(i.map((function(t){return ht.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/team_statistic/").pipe(i.map((function(t){return Ct.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/user_statistic/").pipe(i.map((function(t){return It.toFront(t)}))).toPromise()]}))}))},t.prototype.getLogs=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/logs/").pipe(i.map((function(t){return Bt.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),jt=function(){function t(){}return t.toFront=function(t){return null},t.toBack=function(t){return null},d([I],t,"toFront",null),d([U],t,"toBack",null),t=d([w({mappingFields:{id:"id",theme:"theme",message:"message",files:"files"},relation:{files:j}})],t)}(),Lt=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.sendFeedback=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/feedback/",jt.toBack(t)).pipe(i.map((function(t){return jt.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),At=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.upload=function(t,e){return g(this,void 0,void 0,(function(){var n;return v(this,(function(o){return(n=new FormData).append("file",t,e),[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/file/",n).pipe(i.map((function(t){return j.toFront(t)}))).toPromise()]}))}))},t.prototype.createZipArchive=function(t){return g(this,void 0,void 0,(function(){var e,n,i,o,r,a;return v(this,(function(s){e=new FormData;try{for(n=_(t),i=n.next();!i.done;i=n.next())o=i.value,e.append("files",o.file,o.filename)}catch(t){r={error:t}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/file/zip_archive/",e,{responseType:"blob"}).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",title:"title",datetime:"datetime",preview_text:"previewText",detail_text:"detailText",picture:"picture",cover:"cover",is_main:"isMain",tournaments:"tournaments"},relation:{datetime:P,picture:j,cover:j,tournaments:S(tt)}})],e)}(k);(Ut=t.TournamentEventTypes||(t.TournamentEventTypes={}))[Ut.game_closed=1]="game_closed",Ut[Ut.media_added=2]="media_added",Ut[Ut.news=3]="news";var xt,Ot=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",game:"game",news:"news",league:"league",tournaments:"tournaments",event:"event",datetime:"datetime"},relation:{game:lt,news:Vt,league:Y,tournaments:S(tt),datetime:F,event:T(t.TournamentEventTypes)}})],n)}(k),Et=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.getByAlias=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/").pipe(i.map((function(t){return Y.toFront(t)}))).toPromise()]}))}))},o.prototype.getByDomain=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/by_domain/"+t+"/").pipe(i.map((function(t){return Y.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournaments=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/tournaments/").pipe(i.map((function(t){return tt.toFront(t)}))).toPromise()]}))}))},o.prototype.getEvents=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.event&&(s=s.set("event",t.TournamentEventTypes[a.event])),a.search&&(s=s.set("search",a.search))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+e+"/events/",{params:s,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:Ot.toFront(t.body)}}))).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}(),Ht=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getLeagueNewsList=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/news/",{observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:Vt.toFront(t.body)}}))).toPromise()]}))}))},t.prototype.getMainLeagueNews=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/news/?is_main=true").pipe(i.map((function(t){return t&&t.length>0?Vt.toFront(t[0]):null}))).toPromise()]}))}))},t.prototype.getNewsById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league_news/"+t).pipe(i.map((function(t){return Vt.toFront(t)}))).toPromise()]}))}))},t.prototype.getTournamentNewsList=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/news/",{observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:Vt.toFront(t.body)}}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Nt=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.getMedia=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/media/"+t+"/").pipe(i.map((function(t){return st.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentGameMedia=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.tournamentTour&&(s=s.set("tournament_tour",a.tournamentTour.toString())),a.teamId&&(s=s.set("team_id",a.teamId.toString())),a.tournamentStageId&&(s=s.set("tournament_stage_id",a.tournamentStageId.toString())),a.playoffId&&(s=s.set("playoff_id",a.playoffId.toString())),a.playoffStage&&(s=s.set("playoff_stage",a.playoffStage.toString())),a.status&&(s=s.set("status",t.GameStatuses[a.status]))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+e+"/game_media/",{observe:"response",params:s}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:lt.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getLeagueGameMedia=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.tournamentTour&&(s=s.set("tournament_tour",a.tournamentTour.toString())),a.teamId&&(s=s.set("team_id",a.teamId.toString())),a.tournamentStageId&&(s=s.set("tournament_stage_id",a.tournamentStageId.toString())),a.playoffId&&(s=s.set("playoff_id",a.playoffId.toString())),a.playoffStage&&(s=s.set("playoff_stage",a.playoffStage.toString())),a.status&&(s=s.set("status",t.GameStatuses[a.status]))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+e+"/game_media/",{observe:"response",params:s}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:lt.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getGameMediaById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/game_media/"+t+"/").pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},o.prototype.getGameMedia=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_game/"+t+"/media/").pipe(i.map((function(t){return st.toFront(t)}))).toPromise()]}))}))},o.prototype.createZip=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/media/zip/",t,{responseType:"blob"}).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}();(xt=t.PollStatuses||(t.PollStatuses={}))[xt.open=1]="open",xt[xt.closed=2]="closed",xt[xt.archived=3]="archived";var zt,Dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{uuid:"uuid",name:"name"}})],e)}(k),Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",answer_uuid:"answerUuid",user:"user",poll_id:"pollId"},relation:{user:$}})],e)}(k),Mt=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.variantsWithAnswers=[],t}return m(n,e),Object.defineProperty(n.prototype,"variants",{get:function(){return this._variants},set:function(t){this._variants=t||[],this._answers&&this.calculateAnswersPercentage()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"answers",{get:function(){return this._answers},set:function(t){this._answers=t||[],this._variants&&this.calculateAnswersPercentage()},enumerable:!0,configurable:!0}),n.prototype.calculateAnswersPercentage=function(){var t=this;if(this._answers.length){var e=this._variants.map((function(t){return t.uuid})),n=this._answers.reduce((function(t,n){return e.indexOf(n.answerUuid)<0||(t[n.answerUuid]||(t[n.answerUuid]=0),t[n.answerUuid]++),t}),{});this.variantsWithAnswers=this._variants.map((function(e){return{variant:e,percent:n[e.uuid]?Math.round(100*n[e.uuid]/t._answers.length):0}})).sort((function(t,e){return t.percent>e.percent?-1:1}))}},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",active:"active",status:"status",team_id:"teamId",name:"name",description:"description",variants:"variants",author:"author",answers:"answers",multiple_answer:"multipleAnswer",anonymous:"anonymous",created_at:"createdAt"},relation:{status:T(t.PollStatuses),variants:Dt,author:$,answers:Rt,createdAt:P}})],n)}(k),qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",user_id:"userId",user:"user",team:"team",team_id:"teamId",user_accept:"userAccept",team_accept:"teamAccept",users_count:"usersCount",games_count:"gamesCount",won_games_count:"wonGamesCount",score_sum:"scoreSum",created_at:"createdAt",updated_at:"updatedAt"},relation:{user:$,team:X,createdAt:P,updateAt:P}})],e)}(k);(zt=t.GameInviteStatus||(t.GameInviteStatus={}))[zt.accepted=1]="accepted",zt[zt.declined=2]="declined";var Wt,$t,Xt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",team_user:"teamUser",game_id:"gameId",game:"game",status:"status"},relation:{game:lt,teamUser:ct,status:T(t.GameInviteStatus)}})],n)}(k);(Wt=t.TeamEventTypes||(t.TeamEventTypes={}))[Wt.training=1]="training",Wt[Wt.other=2]="other";var Jt,Yt=(($t={})[t.TeamEventTypes.training]="Тренировка",$t[t.TeamEventTypes.other]="Другое",$t),Zt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return this.eventType===t.TeamEventTypes.other?this.eventCustomName:Yt[this.eventType]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isClosed",{get:function(){return this.datetime.getTime()<(new Date).getTime()},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",team_id:"teamId",team:"team",event_type:"eventType",event_custom_name:"eventCustomName",description:"description",datetime:"datetime",location:"location"},relation:{eventType:T(t.TeamEventTypes),team:X,datetime:P}})],n)}(k);(Jt=t.TeamEventInviteStatuses||(t.TeamEventInviteStatuses={}))[Jt.accepted=1]="accepted",Jt[Jt.declined=2]="declined";var Kt,Qt,te=function(){function e(){}return e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_event_id:"teamEventId",team_user_id:"teamUserId",status:"status"},relation:{status:T(t.TeamEventInviteStatuses)}})],e)}(),ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team_invite_id:"tournamentTeamInviteId",tournament_team_id:"tournamentTeamId",team_user:"teamUser",accepted:"accepted"},relation:{teamUser:ct}})],e)}(k),ne=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return(null===this.teamAccept||null===this.organizationAccept)&&!1!==this.teamAccept&&!1!==this.organizationAccept},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team:"team",tournament:"tournament",team_accept:"teamAccept",organization_accept:"organizationAccept",user_invites_count:"userInvitesCount",user_invites:"userInvites",notifications_count:"notificationsCount"},relation:{team:X,tournament:tt,userInvites:ee}})],e)}(k);(Kt=t.NotificationType||(t.NotificationType={}))[Kt.team_updated=1]="team_updated",Kt[Kt.team_invited=2]="team_invited",Kt[Kt.team_join_request=3]="team_join_request",Kt[Kt.team_join_declined_by_team=4]="team_join_declined_by_team",Kt[Kt.team_join_declined_by_user=5]="team_join_declined_by_user",Kt[Kt.team_join_canceled_by_team=6]="team_join_canceled_by_team",Kt[Kt.team_join_canceled_by_user=7]="team_join_canceled_by_user",Kt[Kt.team_joined_for_user=8]="team_joined_for_user",Kt[Kt.team_joined_for_team=9]="team_joined_for_team",Kt[Kt.team_user_role_changed_for_user=10]="team_user_role_changed_for_user",Kt[Kt.team_user_role_changed_for_team=11]="team_user_role_changed_for_team",Kt[Kt.team_user_number_changed=12]="team_user_number_changed",Kt[Kt.team_user_deleted_for_user=13]="team_user_deleted_for_user",Kt[Kt.team_user_deleted_for_team=14]="team_user_deleted_for_team",Kt[Kt.team_user_left=15]="team_user_left",Kt[Kt.game_updated=16]="game_updated",Kt[Kt.game_invited=17]="game_invited",Kt[Kt.game_invite_accepted=18]="game_invite_accepted",Kt[Kt.game_invite_declined=19]="game_invite_declined",Kt[Kt.game_remind=20]="game_remind",Kt[Kt.game_won=21]="game_won",Kt[Kt.game_losing=22]="game_losing",Kt[Kt.game_tech_defeat=23]="game_tech_defeat",Kt[Kt.game_tech_victory=24]="game_tech_victory",Kt[Kt.poll_created=25]="poll_created",Kt[Kt.poll_closed=26]="poll_closed",Kt[Kt.team_event_invited=27]="team_event_invited",Kt[Kt.team_event_accepted=28]="team_event_accepted",Kt[Kt.team_event_declined=29]="team_event_declined",Kt[Kt.team_event_remind=30]="team_event_remind",Kt[Kt.tournament_invited=31]="tournament_invited",Kt[Kt.tournament_joined=32]="tournament_joined",Kt[Kt.tournament_join_declined=33]="tournament_join_declined",Kt[Kt.tournament_join_canceled=34]="tournament_join_canceled",Kt[Kt.tournament_user_invited=35]="tournament_user_invited",Kt[Kt.tournament_user_accepted_for_team=36]="tournament_user_accepted_for_team",Kt[Kt.tournament_user_accepted_for_user=37]="tournament_user_accepted_for_user",Kt[Kt.tournament_user_added=38]="tournament_user_added",Kt[Kt.tournament_user_declined_for_team=39]="tournament_user_declined_for_team",Kt[Kt.tournament_user_declined_for_user=40]="tournament_user_declined_for_user",Kt[Kt.tournament_user_invite_deleted=41]="tournament_user_invite_deleted",Kt[Kt.tournament_user_deleted=42]="tournament_user_deleted",Kt[Kt.tournament_user_disqualified_for_team=43]="tournament_user_disqualified_for_team",Kt[Kt.tournament_user_disqualified_for_user=44]="tournament_user_disqualified_for_user",Kt[Kt.tournament_user_disqualification_updated_for_team=45]="tournament_user_disqualification_updated_for_team",Kt[Kt.tournament_user_disqualification_updated_for_user=46]="tournament_user_disqualification_updated_for_user",Kt[Kt.tournament_team_deleted=47]="tournament_team_deleted",Kt[Kt.org_tournament_invite_created=48]="org_tournament_invite_created",Kt[Kt.org_tournament_invite_declined=49]="org_tournament_invite_declined",Kt[Kt.org_tournament_invite_deleted=50]="org_tournament_invite_deleted",Kt[Kt.org_tournament_invite_changed=51]="org_tournament_invite_changed",Kt[Kt.org_tournament_user_deleted=52]="org_tournament_user_deleted",Kt[Kt.org_tournament_user_invited=53]="org_tournament_user_invited",Kt[Kt.org_tournament_user_has_changes=54]="org_tournament_user_has_changes",Kt[Kt.org_tournament_team_leave=55]="org_tournament_team_leave",(Qt=t.NotificationServiceEnum||(t.NotificationServiceEnum={}))[Qt.public=1]="public",Qt[Qt.org=2]="org";var ie,oe=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"important",{get:function(){return!0},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",event_type:"event",data:"data",initiator:"initiator",team:"team",team_invite:"teamInvite",team_user:"teamUser",poll:"poll",game:"game",game_invite:"gameInvite",team_event:"teamEvent",team_event_invite:"teamEventInvite",tournament:"tournament",tournament_invite:"tournamentInvite",tournament_team:"tournamentTeam",viewed:"viewed",protected:"protected",service:"service",created_at:"createdAt"},relation:{event:T(t.NotificationType),initiator:$,team:X,teamInvite:qt,teamUser:ct,poll:Mt,game:lt,gameInvite:Xt,teamEvent:Zt,teamEventInvite:te,tournament:tt,tournamentInvite:ne,tournamentTeam:mt,service:T(t.NotificationServiceEnum),createdAt:P}})],n)}(k);(ie=t.NotificationAllowTypes||(t.NotificationAllowTypes={}))[ie.all=1]="all",ie[ie.important=2]="important",ie[ie.none=3]="none";var re,ae=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{user_id:"userId",popup:"popup",sound:"sound",browser:"browser",email:"email"},relation:{sound:T(t.NotificationAllowTypes),browser:T(t.NotificationAllowTypes)}})],n)}(k),se=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getCount=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/count/").pipe(i.map((function(t){return+t}))).toPromise()]}))}))},t.prototype.getList=function(t,e,o){return void 0===o&&(o={}),g(this,void 0,void 0,(function(){var r,a,s,u,l,c;return v(this,(function(p){r=(new n.HttpParams).set("page",t.toString()).set("size",e.toString());try{for(a=_(Object.keys(o)),s=a.next();!s.done;s=a.next())u=s.value,r=r.set(u,o[u])}catch(t){l={error:t}}finally{try{s&&!s.done&&(c=a.return)&&c.call(a)}finally{if(l)throw l.error}}return[2,this.httpClient.get(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/",{params:r,observe:"response"}).pipe(i.map((function(t){var e=oe.toFront(t.body);return{total:+t.headers.get("x-page-count"),data:e}}))).toPromise()]}))}))},t.prototype.markViewed=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/"+t+"/viewed/",{viewed:e}).pipe(i.map((function(t){return oe.toFront(t)}))).toPromise()]}))}))},t.prototype.markAllViewed=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.post(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/viewed/",{}).pipe(i.map((function(t){return oe.toFront(t)}))).toPromise()]}))}))},t.prototype.getNotificationSettings=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(""+this.configService.get("apiUrl")+this.apiUrl+"/notification_settings/").pipe(i.map((function(t){return ae.toFront(t)}))).toPromise()]}))}))},t.prototype.updateNotificationSettings=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(""+this.configService.get("apiUrl")+this.apiUrl+"/notification_settings/",ae.toBack(t)).pipe(i.map((function(t){return ae.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),ue=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.apiUrl="/api/v1",e}return m(i,t),i.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new i(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:i,providedIn:"root"}),i=d([e.Injectable({providedIn:"root"})],i)}(se),le=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.apiUrl="/org/api/v1",e}return m(i,t),i.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new i(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:i,providedIn:"root"}),i=d([e.Injectable({providedIn:"root"})],i)}(se),ce=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getCities=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/reference/cities/").pipe(i.map((function(t){return O.toFront(t)}))).toPromise()]}))}))},t.prototype.getSports=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/sport/").pipe(i.map((function(t){return V.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_id:"teamId",email:"email",first_name:"firstName",last_name:"lastName"}})],e)}(k),me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",team_user:"teamUser",tournament_team_user:"tournamentTeamUser",tournament_team:"tournamentTeam",user:"user",month:"month",win_lose:"winLose",games_count:"gamesCount",won_games_count:"wonGamesCount",serve_hits:"serveHits",serve_faults:"serveFaults",serve_aces:"serveAces",serve_percent:"servePercent",ace_percent:"acePercent",stuff_blocks:"stuffBlocks",block_faults:"blockFaults",block_rebounds:"blockRebounds",block_percent:"blockPercent",attack_spikes:"attackSpikes",attack_faults:"attackFaults",attack_shots:"attackShots",attack_percent:"attackPercent",receives:"receives",receive_faults:"receiveFaults",excellent_receives:"excellentReceives",receive_percent:"receivePercent",serve_receives:"serveReceives",serve_receive_faults:"serveReceiveFaults",excellent_serve_receives:"excellentServeReceives",serve_receive_percent:"serveReceivePercent",points:"points",faults:"faults",newbie:"newbie"},relation:{team:X,teamUser:ct,tournamentTeamUser:dt,tournamentTeam:mt,user:$,month:F}})],e)}(k);(re=t.TeamPermissionTypes||(t.TeamPermissionTypes={}))[re.for_all=1]="for_all",re[re.for_users=2]="for_users",re[re.for_team=3]="for_team";var fe,de=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{players:"players",games:"games",statistic:"statistic",polls:"polls",events:"events"},relation:{players:T(t.TeamPermissionTypes),games:T(t.TeamPermissionTypes),statistic:T(t.TeamPermissionTypes),polls:T(t.TeamPermissionTypes),events:T(t.TeamPermissionTypes)}})],n)}(k),he=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{can_edit:"canEdit",can_view_users:"canViewUsers",can_manage_permission:"canManagePermission",can_change_owner:"canChangeOwner",can_delete:"canDelete",can_manage_invites:"canManageInvites",can_view_invites:"canViewInvites",can_manage_polls:"canManagePolls",can_view_polls:"canViewPolls",can_answer_poll:"canAnswerPoll",can_manage_games:"canManageGames",can_view_games:"canViewGames",can_view_statistic:"canViewStatistic",can_promote_users:"canPromoteUsers",can_edit_users:"canEditUsers",can_delete_users:"canDeleteUsers",can_view_events:"canViewEvents",can_manage_events:"canManageEvents",can_view_tournaments:"canViewTournaments",can_manage_tournaments:"canManageTournaments",role:"role"},relation:{role:T(t.TeamUserRole)}})],n)}(k),ge=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.search=function(t,e){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o=(new n.HttpParams).set("search",t),e&&(o=o.set("sport",e.toString())),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/",{params:o}).pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},o.prototype.create=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/",X.toBack(t)).pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},o.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/").pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},o.prototype.getTeamAccess=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/access/").pipe(i.map((function(t){return he.toFront(t)}))).toPromise()]}))}))},o.prototype.update=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/",X.toBack(e)).pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},o.prototype.delete=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/team/"+t.id+"/").toPromise()]}))}))},o.prototype.getPermission=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/permission/").pipe(i.map((function(t){return de.toFront(t)}))).toPromise()]}))}))},o.prototype.updatePermission=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/permission/",de.toBack(e)).pipe(i.map((function(t){return de.toFront(t)}))).toPromise()]}))}))},o.prototype.getUsers=function(t,e){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o=new n.HttpParams,e&&(o=o.set("tournament_id",e.toString())),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/users/",{params:o}).pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.updateUserRole=function(e,n,o){return g(this,void 0,void 0,(function(){return v(this,(function(r){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+e+"/users/"+n+"/role/",{role:t.TeamUserRole[o]}).pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.updateUserNumber=function(t,e,n){return g(this,void 0,void 0,(function(){return v(this,(function(o){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/users/"+e+"/number/",{number:n.toString()}).pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.deleteUser=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/team/"+t.teamId+"/users/"+t.id+"/").toPromise()]}))}))},o.prototype.changeOwner=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/owner/",{id:e.id}).pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},o.prototype.getInvites=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites/").pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.sendInvite=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites/",{user:e}).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.acceptInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_invite/"+t.id+"/accept/",{}).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.declineInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_invite/"+t.id+"/decline/",{}).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.resendInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_invite/"+t.id+"/resend/",{}).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.getInvitesExternal=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites_external/").pipe(i.map((function(t){return pe.toFront(t)}))).toPromise()]}))}))},o.prototype.sendInviteExternal=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites_external/",pe.toBack(e)).pipe(i.map((function(t){return pe.toFront(t)}))).toPromise()]}))}))},o.prototype.deleteInviteExternal=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/invites_external/"+t.id+"/").toPromise()]}))}))},o.prototype.resendInviteExternal=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/invites_external/"+t.id+"/resend/",{}).pipe(i.map((function(t){return pe.toFront(t)}))).toPromise()]}))}))},o.prototype.getPolls=function(t,e){return void 0===e&&(e=!1),g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/polls/"+(e?"?archive=1":"")).pipe(i.map((function(t){return Mt.toFront(t)}))).toPromise()]}))}))},o.prototype.createPoll=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/polls/",Mt.toBack(e)).pipe(i.map((function(t){return Mt.toFront(t)}))).toPromise()]}))}))},o.prototype.getUsersStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/statistics/").pipe(i.map((function(t){return wt.toFront(t)}))).toPromise()]}))}))},o.prototype.getVolleyballStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/volleyball_statistics/").pipe(i.map((function(t){return me.toFront(t)}))).toPromise()]}))}))},o.prototype.joinTeam=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/join/",{}).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.leaveTeam=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/leave/",{}).toPromise()]}))}))},o.prototype.getGames=function(t,e){return void 0===e&&(e=!1),g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/games/"+(e?"?archive=1":"")).pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},o.prototype.createGame=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/games/",lt.toBack(e)).pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},o.prototype.getTeamEvents=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/events/").pipe(i.map((function(t){return Zt.toFront(t)}))).toPromise()]}))}))},o.prototype.createTeamEvent=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/events/",Zt.toBack(e)).pipe(i.map((function(t){return Zt.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournaments=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournaments/").pipe(i.map((function(t){return tt.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournament_teams/").pipe(i.map((function(t){return mt.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentInvites=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournament_invites/").pipe(i.map((function(t){return ne.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentGames=function(t,e,o,r){return g(this,void 0,void 0,(function(){var a;return v(this,(function(s){return a=(new n.HttpParams).set("page",o.toString()),r&&(a=a.set("size",r.toString())),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournaments/"+e+"/games/",{params:a,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:lt.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.acceptTournamentInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/tournament_invite/"+t+"/accept/",{}).pipe(i.map((function(t){return ne.toFront(t)}))).toPromise()]}))}))},o.prototype.declineTournamentInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/tournament_invite/"+t+"/decline/",{}).pipe(i.map((function(t){return ne.toFront(t)}))).toPromise()]}))}))},o.prototype.registerLazyUser=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/lazy_user/",{user:$.toBack(e)}).pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.getLazyUser=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.updateLazyUser=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/",{user:$.toBack(e)}).pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.deleteLazyUser=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/").toPromise()]}))}))},o.prototype.resendLazyUserEmail=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/resend_email/",{}).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}(),ve=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getTeamEvent=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/").pipe(i.map((function(t){return Zt.toFront(t)}))).toPromise()]}))}))},t.prototype.updateTeamEvent=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team_event/"+t.id+"/",Zt.toBack(t)).pipe(i.map((function(t){return Zt.toFront(t)}))).toPromise()]}))}))},t.prototype.deleteTeamEvent=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/").toPromise()]}))}))},t.prototype.getTeamEventInvites=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/invites/").pipe(i.map((function(t){return te.toFront(t)}))).toPromise()]}))}))},t.prototype.createTeamEventInvite=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/invites/",{team_user_id:e}).pipe(i.map((function(t){return te.toFront(t)}))).toPromise()]}))}))},t.prototype.acceptTeamEventInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_event_invite/"+t.id+"/accept/",{}).pipe(i.map((function(t){return te.toFront(t)}))).toPromise()]}))}))},t.prototype.declineTeamEventInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_event_invite/"+t.id+"/decline/",{}).pipe(i.map((function(t){return te.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),_e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",title:"title",picture:"picture",text:"text",author:"author",created_at:"createdAt"},relation:{picture:j,author:$,createdAt:P}})],e)}(k),ye=function(){function t(){}return t.toFront=function(t){},t.toBack=function(t){},d([I],t,"toFront",null),d([U],t,"toBack",null),t=d([w({mappingFields:{stage_id:"stageId",tours_count:"toursCount",playoff_stages_count:"playoffStagesCount"}})],t)}(),be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{tours_count:"toursCount",playoff_stages_count:"playoffStagesCount",current_tour:"currentTour",current_playoff_stage:"currentPlayoffStage",stages:"stages",tournament_stage_id:"tournamentStageId"},relation:{stages:S(ye)}})],e)}(k);(fe=t.TournamentStageStatuses||(t.TournamentStageStatuses={}))[fe.open=0]="open",fe[fe.in_progress=1]="in_progress",fe[fe.closed=2]="closed";var ke=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",name:"name",date:"date",tournament_id:"tournamentId",status:"status"},relation:{date:F,status:T(t.TournamentStageStatuses)}})],n)}(k);function Te(t){return t<=0?[]:Array.apply(null,Array(t)).map((function(t,e){return e+1}))}var Se,Fe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{rounds:"rounds",final_rounds:"finalRounds",third_place_rounds:"thirdPlaceRounds",teams_count:"teamsCount"}})],e)}(k),Pe=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stages=[],e}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},Object.defineProperty(e.prototype,"stagesCount",{get:function(){return Math.log(this.settings.teamsCount)/Math.log(2)},enumerable:!0,configurable:!0}),e.prototype.getPlayoffStages=function(){var t=this;if(0===this.stages.length&&this.settings.teamsCount){var e=Math.log(this.settings.teamsCount)/Math.log(2);this.stages=Te(e).map((function(e){var n=t.settings.teamsCount/Math.pow(2,e);return{value:e,title:1===n?"Финал":"1 / "+n}}))}return this.stages},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",settings:"settings",tournament_id:"tournamentId",tournament_stage_id:"tournamentStageId",is_official:"isOfficial"},relation:{settings:Fe}})],e)}(k),we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"gamesWonPercent",{get:function(){return this.gamesCount?Math.floor(1e3*this.wonGamesCount/this.gamesCount)/10:0},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team:"tournamentTeam",group:"group",tournament_stage_id:"tournamentStageId",games_count:"gamesCount",won_games_count:"wonGamesCount",score_sum:"scoreSum",missed_sum:"missedSum",last_games_count:"lastGamesCount",last_games_won:"lastGamesWon",points:"points",final_standing:"finalStanding",received_points:"receivedPoints"},relation:{tournamentTeam:mt,group:pt}})],e)}(k),Ce=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.getByAlias=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/").pipe(i.map((function(t){return tt.toFront(t)}))).toPromise()]}))}))},o.prototype.getNews=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/news/").pipe(i.map((function(t){return _e.toFront(t)}))).toPromise()]}))}))},o.prototype.getEvents=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.event&&(s=s.set("event",t.TournamentEventTypes[a.event])),a.search&&(s=s.set("search",a.search))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+e+"/events/",{params:s,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:Ot.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getTournamentStages=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/stages/").pipe(i.map((function(t){return ke.toFront(t)}))).toPromise()]}))}))},o.prototype.getPlayoff=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/playoff/").pipe(i.map((function(t){return Pe.toFront(t)}))).toPromise()]}))}))},o.prototype.getPlayoffGames=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_playoff/"+t+"/games/").pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},o.prototype.getGamesStages=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/games_stages/").pipe(i.map((function(t){return be.toFront(t)}))).toPromise()]}))}))},o.prototype.getGames=function(e,o,r,a){return void 0===a&&(a={}),g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()),r&&(s=s.set("size",r.toString())),a.tournamentStageId&&(s=s.set("tournament_stage_id",a.tournamentStageId.toString())),a.tournamentTour&&(s=s.set("tournament_tour",a.tournamentTour.toString())),a.playoffStage&&(s=s.set("playoff_stage",a.playoffStage.toString())),a.teamId&&(s=s.set("team_id",a.teamId.toString())),a.status&&(s=s.set("status",t.GameStatuses[a.status])),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+e+"/games/",{params:s,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:lt.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/teams/").pipe(i.map((function(t){return mt.toFront(t)}))).toPromise()]}))}))},o.prototype.getStageTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/stage_teams/").pipe(i.map((function(t){return we.toFront(t)}))).toPromise()]}))}))},o.prototype.getTeamById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_team/"+t+"/").pipe(i.map((function(t){return mt.toFront(t)}))).toPromise()]}))}))},o.prototype.getUserById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_team_user/"+t+"/").pipe(i.map((function(t){return dt.toFront(t)}))).toPromise()]}))}))},o.prototype.getUserGames=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_team_user/"+t+"/games/").pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},o.prototype.getBasketballStatistic=function(t){return g(this,void 0,void 0,(function(){var e,o,r,a,s,u;return v(this,(function(l){if(e=new n.HttpParams,t){try{for(o=_(Object.keys(t)),r=o.next();!r.done;r=o.next())a=r.value,t[a]&&(e=e.set(a,t[a]))}catch(t){s={error:t}}finally{try{r&&!r.done&&(u=o.return)&&u.call(o)}finally{if(s)throw s.error}}void 0!==t.per_game&&(e=e.set("per_game",t.per_game?"1":"0"))}return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/basketball_statistic/",{params:e}).pipe(i.map((function(t){return wt.toFront(t)}))).toPromise()]}))}))},o.prototype.getVolleyballStatistic=function(t){return g(this,void 0,void 0,(function(){var e,o,r,a,s,u;return v(this,(function(l){if(e=new n.HttpParams,t){try{for(o=_(Object.keys(t)),r=o.next();!r.done;r=o.next())a=r.value,t[a]&&(e=e.set(a,t[a]))}catch(t){s={error:t}}finally{try{r&&!r.done&&(u=o.return)&&u.call(o)}finally{if(s)throw s.error}}void 0!==t.per_game&&(e=e.set("per_game",t.per_game?"1":"0"))}return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/volleyball_statistic/",{params:e}).pipe(i.map((function(t){return me.toFront(t)}))).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}(),Ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"usersCount",{get:function(){return this.validUsersCount+this.invalidUsersCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.hasAccess&&!this.inviteSent&&!this.alreadyInTournament},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{valid_users_count:"validUsersCount",invalid_users_count:"invalidUsersCount",has_access:"hasAccess",invite_sent:"inviteSent",already_in_tournament:"alreadyInTournament"}})],e)}(k),Ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",join_data:"joinData"},relation:{team:X,joinData:Ie}})],e)}(k),Be=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getTeamsForJoin=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/teams_for_join/").pipe(i.map((function(t){return Ue.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamUsers=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/users/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},t.prototype.joinTournament=function(t,e,n){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o={team:{id:e},user_invites:ee.toBack(n)},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/join/",o).pipe(i.map((function(t){return ne.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Ge=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/").pipe(i.map((function(t){return ke.toFront(t)}))).toPromise()]}))}))},t.prototype.getGroups=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/groups/").pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},t.prototype.getPlayoffs=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/playoff/").pipe(i.map((function(t){return Pe.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/teams/").pipe(i.map((function(t){return we.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),je=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{edit:"edit",personal_data:"personalData",teams:"teams",statistic:"statistic",games:"games"}})],e)}(k);(Se=t.UserPermissionTypes||(t.UserPermissionTypes={}))[Se.denied=1]="denied",Se[Se.for_all=2]="for_all",Se[Se.for_users=3]="for_users",Se[Se.for_team=4]="for_team";var Le,Ae=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",personal_data:"personalData",games:"games",teams:"teams",statistic:"statistic"},relation:{personalData:T(t.UserPermissionTypes),games:T(t.UserPermissionTypes),teams:T(t.UserPermissionTypes),statistic:T(t.UserPermissionTypes)}})],n)}(k),Ve=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getCurrentUser=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/").pipe(i.map((function(t){return $.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/").pipe(i.map((function(t){return $.toFront(t)}))).toPromise()]}))}))},t.prototype.getAccess=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+(t||"current")+"/access/").pipe(i.map((function(t){return je.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUser=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/",$.toBack(e)).pipe(i.map((function(t){return $.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserPhoto=function(t,e){return g(this,void 0,void 0,(function(){var n;return v(this,(function(o){return(n=new FormData).append("file",t,e),[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/photo/",n).pipe(i.map((function(t){return j.toFront(t)}))).toPromise()]}))}))},t.prototype.changePassword=function(t,e,n,i){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o={old_password:e,password:n,password_confirm:i},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/change_password/",o).toPromise()]}))}))},t.prototype.changeEmail=function(t,e,n){return g(this,void 0,void 0,(function(){var i;return v(this,(function(o){return i={email:e,password:n},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/change_email/",i).toPromise()]}))}))},t.prototype.changeEmailConfirm=function(t,e,n,i){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o={email:e,password:n,token:i},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/change_email_confirm/",o).toPromise()]}))}))},t.prototype.getUserProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/profile/").pipe(i.map((function(t){return x.toFront(t)}))).toPromise()]}))}))},t.prototype.getBasketballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/basketball_profile/").pipe(i.map((function(t){return N.toFront(t)}))).toPromise()]}))}))},t.prototype.getVolleyballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/volleyball_profile/").pipe(i.map((function(t){return D.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t.userId+"/profile/",x.toBack(t)).pipe(i.map((function(t){return x.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserBasketballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t.userId+"/basketball_profile/",N.toBack(t)).pipe(i.map((function(t){return N.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserVolleyballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t.userId+"/volleyball_profile/",D.toBack(t)).pipe(i.map((function(t){return D.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserPermissions=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+(t||"current")+"/permission/").pipe(i.map((function(t){return Ae.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserPermission=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/current/permission/",Ae.toBack(t)).pipe(i.map((function(t){return Ae.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/teams/").pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},t.prototype.getInvites=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/invites/").pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},t.prototype.acceptInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/invites/"+t+"/accept/",{}).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},t.prototype.declineInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/invites/"+t+"/decline/",{}).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},t.prototype.getStatistics=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/statistics/").pipe(i.map((function(t){return wt.toFront(t)}))).toPromise()]}))}))},t.prototype.getStreetballStatistics=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/streetball_statistics/").pipe(i.map((function(t){return wt.toFront(t)}))).toPromise()]}))}))},t.prototype.getVolleyballStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/volleyball_statistics/").pipe(i.map((function(t){return me.toFront(t)}))).toPromise()]}))}))},t.prototype.getGames=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/games/").pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},t.prototype.getGameInvites=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/game_invites/").pipe(i.map((function(t){return Xt.toFront(t)}))).toPromise()]}))}))},t.prototype.acceptGameInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/game_invites/"+t+"/accept/",{}).pipe(i.map((function(t){return Xt.toFront(t)}))).toPromise()]}))}))},t.prototype.declineGameInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/game_invites/"+t+"/decline/",{}).pipe(i.map((function(t){return Xt.toFront(t)}))).toPromise()]}))}))},t.prototype.searchUsers=function(t){return g(this,void 0,void 0,(function(){var e;return v(this,(function(o){return e=(new n.HttpParams).set("search",t),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/",{params:e}).pipe(i.map((function(t){return $.toFront(t)}))).toPromise()]}))}))},t.prototype.setWizardShowed=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.put(this.configService.get("apiUrl")+"/api/v1/user/current/wizards/",{wizard:t}).pipe(i.map((function(t){return $.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamEvents=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/team_events/").pipe(i.map((function(t){return Zt.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",competitor_team:"competitorTeam"},relation:{team:me,competitorTeam:me}})],e)}(k),Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.gameUserId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attacks",{get:function(){return this.attackSpikes+this.attackShots},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blocks",{get:function(){return this.stuffBlocks+this.blockRebounds},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"totalReceives",{get:function(){return this.receives+this.excellentReceives},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{game_user_id:"gameUserId",serve_hits:"serveHits",serve_faults:"serveFaults",serve_aces:"serveAces",stuff_blocks:"stuffBlocks",block_faults:"blockFaults",block_rebounds:"blockRebounds",attack_spikes:"attackSpikes",attack_faults:"attackFaults",attack_shots:"attackShots",receives:"receives",receive_faults:"receiveFaults",excellent_receives:"excellentReceives",serve_receives:"serveReceives",serve_receive_faults:"serveReceiveFaults",excellent_serve_receives:"excellentServeReceives",points:"points",faults:"faults"}})],e)}(k);(Le=t.VolleyballGameLogType||(t.VolleyballGameLogType={}))[Le.enter_game=1]="enter_game",Le[Le.exit_game=2]="exit_game",Le[Le.remove_game=3]="remove_game",Le[Le.serve_hit=4]="serve_hit",Le[Le.serve_fault=5]="serve_fault",Le[Le.serve_ace=6]="serve_ace",Le[Le.stuff_block=7]="stuff_block",Le[Le.block_fault=8]="block_fault",Le[Le.block_rebound=9]="block_rebound",Le[Le.attack_spike=10]="attack_spike",Le[Le.attack_fault=11]="attack_fault",Le[Le.attack_shot=12]="attack_shot",Le[Le.receive=13]="receive",Le[Le.receive_fault=14]="receive_fault",Le[Le.excellent_receive=15]="excellent_receive",Le[Le.point=16]="point",Le[Le.fault=17]="fault",Le[Le.serve_receive=18]="serve_receive",Le[Le.serve_receive_fault=19]="serve_receive_fault",Le[Le.excellent_serve_receive=20]="excellent_serve_receive",Le[Le.timeout=21]="timeout";var Ee,He,Ne,ze,De,Re,Me,qe,We,$e,Xe,Je=[t.VolleyballGameLogType.serve_ace,t.VolleyballGameLogType.stuff_block,t.VolleyballGameLogType.attack_spike,t.VolleyballGameLogType.point],Ye=[t.VolleyballGameLogType.serve_fault,t.VolleyballGameLogType.attack_fault,t.VolleyballGameLogType.block_fault,t.VolleyballGameLogType.receive_fault,t.VolleyballGameLogType.fault,t.VolleyballGameLogType.serve_receive_fault],Ze=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.active=!0,t}return m(n,e),n.prototype.compare=function(t){return this.rally===t.rally&&this.set===t.set?this.datetime&&t.datetime?this.datetime.getTime()<t.datetime.getTime()?1:-1:this.id<t.id?1:-1:this.set===t.set?this.rally<t.rally?1:-1:this.set<t.set?1:-1},n.prototype.isScoreType=function(){return Je.includes(this.logType)},n.prototype.isFaultType=function(){return Ye.includes(this.logType)},n.prototype.isServe=function(){return[t.VolleyballGameLogType.serve_hit,t.VolleyballGameLogType.serve_ace,t.VolleyballGameLogType.serve_fault].includes(this.logType)},n.prototype.isAttack=function(){return[t.VolleyballGameLogType.attack_fault,t.VolleyballGameLogType.attack_spike,t.VolleyballGameLogType.attack_shot].includes(this.logType)},n.prototype.isReceive=function(){return[t.VolleyballGameLogType.receive_fault,t.VolleyballGameLogType.receive,t.VolleyballGameLogType.excellent_receive].includes(this.logType)},n.prototype.isServeReceive=function(){return[t.VolleyballGameLogType.serve_receive_fault,t.VolleyballGameLogType.serve_receive,t.VolleyballGameLogType.excellent_serve_receive].includes(this.logType)},n.prototype.isBlock=function(){return[t.VolleyballGameLogType.block_fault,t.VolleyballGameLogType.block_rebound,t.VolleyballGameLogType.stuff_block].includes(this.logType)},n.prototype.isEnterExit=function(){return[t.VolleyballGameLogType.enter_game,t.VolleyballGameLogType.exit_game,t.VolleyballGameLogType.timeout].includes(this.logType)},n.prototype.isComboType=function(){return![t.VolleyballGameLogType.receive,t.VolleyballGameLogType.serve_receive].includes(this.logType)},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",unique_id:"uniqueId",game_id:"gameId",game_user_id:"gameUserId",log_type:"logType",set:"set",rally:"rally",position:"position",team_id:"teamId",datetime:"datetime"},relation:{logType:T(t.VolleyballGameLogType),datetime:P}})],n)}(k),Ke=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/").pipe(i.map((function(t){return lt.toFront(t)}))).toPromise()]}))}))},t.prototype.getUsers=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_game/"+t+"/users/").pipe(i.map((function(t){return ht.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/team_statistic/").pipe(i.map((function(t){return xe.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/user_statistic/").pipe(i.map((function(t){return Oe.toFront(t)}))).toPromise()]}))}))},t.prototype.getLogs=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/logs/").pipe(i.map((function(t){return Ze.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Qe=((Ee={})[t.BasketballGameLogTypes.enter_game]="Выход на площадку",Ee[t.BasketballGameLogTypes.exit_game]="Ушел с площадки",Ee[t.BasketballGameLogTypes.remove_game]="Удаление с площадки",Ee[t.BasketballGameLogTypes.two_point_attempt]="Бросок 2 очка",Ee[t.BasketballGameLogTypes.three_point_attempt]="Бросок 3 очка",Ee[t.BasketballGameLogTypes.free_throw_attempt]="Штрафной бросок",Ee[t.BasketballGameLogTypes.one_point_attempt]="Бросок 1 очко",Ee[t.BasketballGameLogTypes.two_point_made]="2 очка",Ee[t.BasketballGameLogTypes.three_point_made]="3 очка",Ee[t.BasketballGameLogTypes.free_throw_made]="1 очко, штрафной",Ee[t.BasketballGameLogTypes.one_point_made]="1 очко",Ee[t.BasketballGameLogTypes.assist]="Передача",Ee[t.BasketballGameLogTypes.block]="Блокшот",Ee[t.BasketballGameLogTypes.rebound]="Подбор",Ee[t.BasketballGameLogTypes.offensive_rebound]="Подбор в нападении",Ee[t.BasketballGameLogTypes.defensive_rebound]="Подбор в защите",Ee[t.BasketballGameLogTypes.steal]="Перехват",Ee[t.BasketballGameLogTypes.turnover]="Потеря",Ee[t.BasketballGameLogTypes.personal_foul]="Фол",Ee[t.BasketballGameLogTypes.technical_foul]="Технический фол",Ee[t.BasketballGameLogTypes.unsportsmanlike_foul]="Неспортиный фол",Ee[t.BasketballGameLogTypes.timeout]="Таймаут",Ee),tn=((He={})[t.OvertimeTypes.to_score_diff]="До разницы в N мячей",He[t.OvertimeTypes.to_score_total]="До N очков",He[t.OvertimeTypes.time]="По времени",He),en=((Ne={})[t.TeamUserRole.moderator]="Модератор",Ne[t.TeamUserRole.member]="Пользователь",Ne[t.TeamUserRole.admin]="Владелец",Ne),nn=((ze={})[t.GameBasketballPosition.point_guard]="Разыгрывающий защитник",ze[t.GameBasketballPosition.shooting_guard]="Атакующий защитник",ze[t.GameBasketballPosition.small_forward]="Легкий форвард",ze[t.GameBasketballPosition.power_forward]="Мощный форвард",ze[t.GameBasketballPosition.center]="Центровой",ze),on=((De={})[t.GameBasketballPosition.point_guard]="PG",De[t.GameBasketballPosition.shooting_guard]="SG",De[t.GameBasketballPosition.small_forward]="SF",De[t.GameBasketballPosition.power_forward]="PF",De[t.GameBasketballPosition.center]="C",De),rn=((Re={})[t.WorkHand.left]="Левая",Re[t.WorkHand.right]="Правая",Re),an=((Me={})[t.GameVolleyballPosition.setter]="Связующий",Me[t.GameVolleyballPosition.libero]="Либеро",Me[t.GameVolleyballPosition.middle_player]="Центральный блокирующий",Me[t.GameVolleyballPosition.receiver_attacker]="Доигровщик",Me[t.GameVolleyballPosition.dioganal]="Диагональный",Me),sn=((qe={})[t.GameVolleyballPosition.setter]="S",qe[t.GameVolleyballPosition.libero]="L",qe[t.GameVolleyballPosition.middle_player]="MP",qe[t.GameVolleyballPosition.receiver_attacker]="RA",qe[t.GameVolleyballPosition.dioganal]="D",qe),un=((We={})[t.GameVolleyballPosition.setter]="связ.",We[t.GameVolleyballPosition.libero]="либеро",We[t.GameVolleyballPosition.middle_player]="блок.",We[t.GameVolleyballPosition.receiver_attacker]="доигр.",We[t.GameVolleyballPosition.dioganal]="диаг.",We),ln=(($e={})[t.VolleyballWorkHand.left]="Левая",$e[t.VolleyballWorkHand.right]="Правая",$e),cn=((Xe={})[t.VolleyballGameLogType.enter_game]="Выход на площадку",Xe[t.VolleyballGameLogType.exit_game]="Уход с площадки",Xe[t.VolleyballGameLogType.remove_game]="Удаление с площадки",Xe[t.VolleyballGameLogType.serve_ace]="Эйс",Xe[t.VolleyballGameLogType.serve_hit]="Подача",Xe[t.VolleyballGameLogType.serve_fault]="Ошибка на подаче",Xe[t.VolleyballGameLogType.attack_spike]="Результативная атака",Xe[t.VolleyballGameLogType.attack_shot]="Успешная атака",Xe[t.VolleyballGameLogType.attack_fault]="Ошибка атаки",Xe[t.VolleyballGameLogType.stuff_block]="Результативный блок",Xe[t.VolleyballGameLogType.block_rebound]="Успешный блок",Xe[t.VolleyballGameLogType.block_fault]="Ошибка на блоке",Xe[t.VolleyballGameLogType.excellent_receive]="Отличный прием",Xe[t.VolleyballGameLogType.receive]="Прием",Xe[t.VolleyballGameLogType.receive_fault]="Ошибка на приеме",Xe[t.VolleyballGameLogType.serve_receive]="Прием подачи",Xe[t.VolleyballGameLogType.excellent_serve_receive]="Отличный прием подачи",Xe[t.VolleyballGameLogType.serve_receive_fault]="Ошибка приема подачи",Xe[t.VolleyballGameLogType.point]="Очко",Xe[t.VolleyballGameLogType.fault]="Ошибка",Xe[t.VolleyballGameLogType.timeout]="Таймаут",Xe),pn=function(){function t(t,e){this.httpClient=t,this.configService=e,this.channels$={},this.subscriptions={}}return t.prototype.listen=function(t){var e=this;if(t in this.channels$)return this.channels$[t];this.channels$[t]=new r.Subject;var n=this.connect().subscribe((function(i){e.subscriptions[t]=e.addEngineSubscription(t),setTimeout((function(){n.unsubscribe()}))}));return this.channels$[t]},t.prototype.unsubscribe=function(t){this.subscriptions[t]&&(this.subscriptions[t].unsubscribe(),delete this.subscriptions[t]),this.channels$[t]&&(this.channels$[t].complete(),delete this.channels$[t])},t.prototype.connect=function(){var t=this;return this.initializeEngineSubject||(this.initializeEngineSubject=new a.ReplaySubject(1),this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/centrifugo/").subscribe((function(e){t.initializeEngine({url:t.configService.get("centrifugoUrl"),user:e.user,timestamp:e.timestamp,token:e.token,transports:["websocket"]}),t.centrifuge.connect(),t.centrifuge.on("connect",(function(){t.initializeEngineSubject.next(!0)}))}))),this.initializeEngineSubject},t.prototype.publish=function(t,e){var n=this;return new o.Observable((function(i){n.connect().subscribe((function(){n.subscriptions[t]||(n.subscriptions[t]=n.addEngineSubscription(t)),n.subscriptions[t].publish(e).then((function(t){i.next(t),i.complete()}),(function(t){throw t}))}))}))},t.prototype.disconnect=function(){this.centrifuge.disconnect(),this.initializeEngineSubject=void 0,this.channels$={},this.subscriptions={}},t.prototype.initializeEngine=function(t){this.centrifuge=new s(t)},t.prototype.addEngineSubscription=function(t){return this.centrifuge.subscribe(t,this.resolveMessage.bind(this))},t.prototype.resolveMessage=function(t){var e=t.channel;this.channels$[e]&&this.channels$[e].next(t.data)},t.ctorParameters=function(){return[{type:n.HttpClient},{type:Pt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(Pt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),mn=function(){function t(t,e){this.modelClass=e,this.defaultValue=t}return t.prototype.toFront=function(t){return this.modelClass?this.modelClass.toFront(t):t},t.prototype.toBack=function(t){return this.modelClass?this.modelClass.toBack(t):t},t}(),fn=function(){function t(t,e){this.name=t,this.fields=e}return t.prototype.addField=function(t,e){this.fields[t]=e},t.prototype.save=function(t,e){this.fields[t]&&this.setItem(this.name+"_"+t,this.fields[t].toBack(e))},t.prototype.get=function(t){if(this.fields[t]){var e=this.getItem(this.name+"_"+t);return null===e&&(e=this.fields[t].defaultValue),null==e?e:this.fields[t].toFront(e)}},t.prototype.clear=function(){var t,e;try{for(var n=_(Object.keys(this.fields)),i=n.next();!i.done;i=n.next()){var o=i.value;this.removeItem(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.getItem=function(t){throw new Error("Function getItem for store engine "+typeof this+" not implemented")},t.prototype.setItem=function(t,e){throw new Error("Function setItem for store engine "+typeof this+" not implemented")},t.prototype.removeItem=function(t){throw new Error("Function deleteItem for store engine "+typeof this+" not implemented")},t}(),dn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.setItem=function(t,e){localStorage.setItem(t,JSON.stringify(e))},e.prototype.getItem=function(t){try{return JSON.parse(localStorage.getItem(t))}catch(t){return}},e.prototype.removeItem=function(t){localStorage.removeItem(t)},e}(fn);function hn(t){var e=("; "+document.cookie).split("; "+t+"=");return 2===e.length?e.pop().split(";").shift():null}function gn(t){return[{rel:"apple-touch-icon",sizes:"180x180",href:"/assets/favicon/"+t+"apple-touch-icon.png"},{rel:"icon",type:"image/png",sizes:"32x32",href:"/assets/favicon/"+t+"favicon-32x32.png"},{rel:"icon",type:"image/png",sizes:"16x16",href:"/assets/favicon/"+t+"favicon-16x16.png"},{rel:"shortcut icon",href:"/assets/favicon/"+t+"favicon.ico"},{rel:"manifest",href:"/assets/favicon/"+t+"site.webmanifest"},{rel:"mask-icon",href:"/assets/favicon/"+t+"safari-pinned-tab.svg",color:"#ff0000"}]}var vn=function(){function t(t,e){this.injector=t,this.platformId=e,this.isBrowser=c.isPlatformBrowser(this.platformId)}return t.prototype.intercept=function(t,e){if(!this.isBrowser)return e.handle(t);t=t.clone({withCredentials:!0});var n=hn("csrftoken");return n&&(t=t.clone({setHeaders:{"X-CSRFToken":n}})),e.handle(t)},t.ctorParameters=function(){return[{type:e.Injector},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t=d([e.Injectable(),h(1,e.Inject(e.PLATFORM_ID))],t)}();t.BaseModel=k,t.BaseService=Ft,t.BasketballGameApi=Gt,t.BasketballGameConfig=nt,t.BasketballGameLog=Bt,t.BasketballGameLogTypeLocalization=Qe,t.BasketballGameStatistic=It,t.BasketballGameTeamStatistic=Ct,t.BasketballProfile=N,t.BasketballStatistic=wt,t.CONFIG_DATA="mtg-core-config-data",t.CentrifugoService=pn,t.City=O,t.ConfigService=Pt,t.DateField=F,t.DateTimeField=P,t.FAULT_LOG_TYPES=Ye,t.Feedback=jt,t.FeedbackApi=Lt,t.File=j,t.FileApi=At,t.Game=lt,t.GameBasketballPositionLocalization=nn,t.GameBasketballPositionShortLocalization=on,t.GameInvite=Xt,t.GameTimelineStageItem=ye,t.GameTimelineStages=be,t.GameUser=ht,t.GameVolleyballPositionLocalization=an,t.GameVolleyballPositionShortLocalization=sn,t.GameVolleyballPositionShortRuLocalization=un,t.HttpCookieInterceptor=vn,t.League=Y,t.LeagueApi=Et,t.LeagueCourt=at,t.LeagueNews=Vt,t.LeagueNewsApi=Ht,t.LocalStorageEngine=dn,t.MediaApi=Nt,t.MediaItem=st,t.ModelInstance=w,t.Notification=oe,t.NotificationApi=ue,t.NotificationBaseApi=se,t.NotificationSettings=ae,t.OrgNotificationApi=le,t.Organization=J,t.OvertimeTypeLocalization=tn,t.Playoff=Pe,t.PlayoffSettings=Fe,t.Poll=Mt,t.PollAnswer=Rt,t.PollVariant=Dt,t.ReferenceApi=ce,t.SCORE_LOG_TYPES=Je,t.Sport=V,t.StorageEngine=fn,t.StorageEngineField=mn,t.Store=St,t.Team=X,t.TeamAccess=he,t.TeamApi=ge,t.TeamEvent=Zt,t.TeamEventApi=ve,t.TeamEventInvite=te,t.TeamEventTypeLocalization=Yt,t.TeamInvite=qt,t.TeamInviteExternal=pe,t.TeamPermission=de,t.TeamUser=ct,t.TeamUserRoleLocalization=en,t.ToBackHook=U,t.ToFrontHook=I,t.Tournament=tt,t.TournamentApi=Ce,t.TournamentDisqualification=ft,t.TournamentEvent=Ot,t.TournamentGroup=pt,t.TournamentInvite=ne,t.TournamentJoinApi=Be,t.TournamentJoinData=Ie,t.TournamentJoinTeam=Ue,t.TournamentNews=_e,t.TournamentSettings=K,t.TournamentStage=ke,t.TournamentStageApi=Ge,t.TournamentStageTeam=we,t.TournamentTeam=mt,t.TournamentTeamUser=dt,t.TournamentTeamUserInvite=ee,t.TournamentTeamWinner=Q,t.UntilDestroy=function(t){var e,n=(e=t).ɵcmp||e.ɵdir,i=n.onDestroy;t.__componentDestroyed$=new r.Subject,n.onDestroy=function(){t.__componentDestroyed$.next(),t.__componentDestroyed$.complete(),i.apply(this)}},t.User=$,t.UserAccess=je,t.UserApi=Ve,t.UserPermission=Ae,t.UserProfile=x,t.VolleyballGameApi=Ke,t.VolleyballGameConfig=rt,t.VolleyballGameLog=Ze,t.VolleyballGameLogTypeLocalization=cn,t.VolleyballGameStatistic=Oe,t.VolleyballGameTeamStatistic=xe,t.VolleyballProfile=D,t.VolleyballStatistic=me,t.VolleyballWorkHandLocalization=ln,t.WorkHandLocalization=rn,t.addItemInArray=_t,t.changeFavicons=function(t,e){var n,i,o,r,a="";"ablmoscow"===e&&(a="abl/");var s=gn(a);try{for(var u=_(s),l=u.next();!l.done;l=u.next()){var c=l.value,p=t.createElement("link");try{for(var m=(o=void 0,_(Object.keys(c))),f=m.next();!f.done;f=m.next()){var d=f.value;p.setAttribute(d,c[d])}}catch(t){o={error:t}}finally{try{f&&!f.done&&(r=m.return)&&r.call(m)}finally{if(o)throw o.error}}t.head.appendChild(p)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}},t.componentDestroyed=function(t){if(t.constructor.__componentDestroyed$)return t.constructor.__componentDestroyed$;throw new Error("Use @UntilDestroy decorator in class")},t.deleteItemFromArray=bt,t.enumField=T,t.fileSizeValidator=function(t){return function(t){if(!t.value)return null}},t.generateArray=Te,t.getArrayChunks=function(t,e){var n=[],i=Math.ceil(t.length/e);if(0===i)return[t];for(var o=0;o<i;o++)n.push(t.slice(o*e,(o+1)*e));return n},t.getCookie=hn,t.getEnumOptions=function(t){return Object.keys(t).map((function(e){return t[e]})).filter((function(t){return!1===isNaN(+t)})).map((function(t){return+t}))},t.getIconsData=gn,t.handleError=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),(!t||0!==t.status&&404!==t.status||e&&0!==t.status)&&u.captureException(t),n||console.error(t)},t.isTouchDevice=function(){var t=" -webkit- -moz- -o- -ms- ".split(" ");if("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch)return!0;var e,n=["(",t.join("touch-enabled),("),"heartz",")"].join("");return e=n,window.matchMedia(e).matches},t.listField=S,t.markFormGroupTouched=function t(e){Object.values(e.controls).forEach((function(e){e.markAsTouched(),e.markAsDirty(),e instanceof l.FormGroup?t(e):e.controls&&e.controls.forEach((function(e){e instanceof l.FormGroup?t(e):(e.markAsTouched(),e.markAsDirty())}))}))},t.minLengthArrayValidator=function(t){return function(e){return e.value.length<t?{minLengthArray:{valid:!1}}:null}},t.patchItemInArray=function(t,e,n){return Array.isArray(t)?t.map((function(t){if(n&&kt(n)){if(!n(t))return t}else if(t.id!==e.id)return t;return Object.assign(t,e)})):t},t.updateItemInArray=gt,t.updateItemsInArray=vt,t.validateDate=function(t){return!t.value||/\d{2}\.\d{2}\.\d{4}/gi.test(t.value)?null:{invalidDate:{valid:!1}}},t.validateEmail=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=[]);var r=o.of(null).pipe(i.delay(500));return function(a){return n.indexOf(a.value)>-1?o.of(null):r.pipe(i.switchMap((function(){return t.checkEmail(a.value,e).pipe(i.map((function(t){return t?null:{emailTaken:!0}})))})))}},t.validatePhone=function(t){return t.value?11===(""+t.value).replace(/\D/gi,"").length?null:{invalidPhone:{valid:!1}}:null},t.validateUrl=function(t){return!t.value||/^(?:http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(t.value)?null:{invalidUrl:!0}},Object.defineProperty(t,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function m(t,e){function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){return(f=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function d(t,e,n,i){var o,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(r<3?o(a):r>3?o(e,n,a):o(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function h(t,e){return function(n,i){e(n,i,t)}}function g(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{u(i.next(t))}catch(t){r(t)}}function s(t){try{u(i.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))}function v(t,e){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function _(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function b(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}var k=function(){function t(t){var e,n;if(t)try{for(var i=_(Object.keys(t)),o=i.next();!o.done;o=i.next()){var r=o.value;this[r]=t[r]}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}return t.toFront=function(t){},t.toBack=function(t){},t}();function T(t){return{toFront:function(e){return isNaN(+e)?t[e]:e},toBack:function(e){return isNaN(+e)?e:t[e]}}}function S(t){return{toFront:function(e){return Array.isArray(e)?t.toFront(e):[]},toBack:function(e){return Array.isArray(e)?t.toBack(e):[]}}}var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){return t?new Date(t):void 0},e.toBack=function(t){return t?new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())).toISOString().slice(0,10):void 0},e}(k),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){return t?new Date(t):void 0},e.toBack=function(t){if(t){new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()));return t.toISOString()}},e}(k);function w(t){return function(e){t&&(t.mappingFields&&(e._mapping_fields_=t.mappingFields),t.relation&&(e._relation_=t.relation),e._to_front_=function(t,n){return function t(e,n,i){var o,r;if(Array.isArray(n))return n.map((function(n){return t(e,n)}));var a=new e,s=e._mapping_fields_,u=e._relation_;if(s)try{for(var l=_(Object.keys(s)),c=l.next();!c.done;c=l.next()){var p=c.value,m=s[p],f=B(p,n);u&&u.hasOwnProperty(m)?a[m]=u[m].toFront(f):a[m]=f}}catch(t){o={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return a}(e,t)},e._to_back_=function(t,n){return function t(e,n,i){var o,r;if(!n)return n;if(Array.isArray(n))return n.map((function(n){return t(e,n)}));var a={},s=e._mapping_fields_,u=e._relation_;if(s)try{for(var l=_(Object.keys(s)),c=l.next();!c.done;c=l.next()){var p=c.value,m=s[p];u&&u.hasOwnProperty(m)&&void 0!==n[m]?a[p]=u[m].toBack(n[m]):a[p]=n[m]}}catch(t){o={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return a}(e,t)})}}var C,I=function(t,e,n){return{value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t._to_front_;if(i)return i(e[0],e.length>1?e[1]:void 0)}}},U=function(t,e,n){return{value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t._to_back_;if(i)return i(e[0])}}};function B(t,e){var n,i;if(e){var o=t.split(".");if(1===o.length)return t in e?e[t]:void 0;try{for(var r=_(o),a=r.next();!a.done;a=r.next()){var s=a.value;if(!e||!(s in e))return;e=e[s]}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return e}}(C=t.FileEngine||(t.FileEngine={}))[C.django=1]="django",C[C.s3=2]="s3";var G,j=function(){function e(){}return e.toFront=function(t){return null},e.toBack=function(t){return null},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",path:"path",mime_type:"mimeType",size:"size",engine:"engine"},relation:{engine:T(t.FileEngine)}})],e)}();(G=t.SportTypes||(t.SportTypes={}))[G.basketball=1]="basketball",G[G.volleyball=2]="volleyball",G[G.classic_basketball=3]="classic_basketball",G[G.streetball=4]="streetball";var L,A,V=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.prototype.isBasketball=function(){return this.id===t.SportTypes.basketball||this.parentId===t.SportTypes.basketball},n.prototype.isClassicBasketball=function(){return this.id===t.SportTypes.classic_basketball},n.prototype.isVolleyball=function(){return this.id===t.SportTypes.volleyball||this.parentId===t.SportTypes.volleyball},n.prototype.isStreetball=function(){return this.id===t.SportTypes.streetball},n.toFront=function(t){return null},n.toBack=function(t){return null},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",name:"name",parent_id:"parentId",sub_sports:"subSports"}})],n)}(k),x=function(){function t(){}return t.toFront=function(t){},t.toBack=function(t){},d([I],t,"toFront",null),d([U],t,"toBack",null),t=d([w({mappingFields:{id:"id",user_id:"userId",height:"height",weight:"weight"}})],t)}(),O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name"}})],e)}(k);(L=t.GameBasketballPosition||(t.GameBasketballPosition={}))[L.point_guard=1]="point_guard",L[L.shooting_guard=2]="shooting_guard",L[L.small_forward=3]="small_forward",L[L.power_forward=4]="power_forward",L[L.center=5]="center",(A=t.WorkHand||(t.WorkHand={}))[A.left=1]="left",A[A.right=2]="right";var E,H,N=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",user_id:"userId",position:"position",work_hand:"workHand"},relation:{position:T(t.GameBasketballPosition),workHand:T(t.WorkHand)}})],n)}(k);(E=t.GameVolleyballPosition||(t.GameVolleyballPosition={}))[E.setter=1]="setter",E[E.libero=2]="libero",E[E.middle_player=3]="middle_player",E[E.receiver_attacker=4]="receiver_attacker",E[E.dioganal=5]="dioganal",(H=t.VolleyballWorkHand||(t.VolleyballWorkHand={}))[H.left=1]="left",H[H.right=2]="right";var z,D=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",user_id:"userId",position:"position",work_hand:"workHand"},relation:{position:T(t.GameVolleyballPosition),workHand:T(t.VolleyballWorkHand)}})],n)}(k);(z=t.UserGender||(t.UserGender={}))[z.male=1]="male",z[z.female=2]="female";var R,M,q,W,$,X=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){return null},n.toBack=function(t){return null},Object.defineProperty(n.prototype,"fullName",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shortName",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"initials",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).map((function(t){return t.substr(0,1)})).join("")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"age",{get:function(){if(!this.birthDate)return null;var t=(new Date).getTime()-this.birthDate.getTime();return Math.floor(t/31536e6)},enumerable:!0,configurable:!0}),d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",last_name:"lastName",first_name:"firstName",middle_name:"middleName",email:"email",phone:"phone",birth_date:"birthDate",photo:"photo",profile:"profile",basketball_profile:"basketballProfile",volleyball_profile:"volleyballProfile",wizards:"wizards",city:"city",gender:"gender",is_active:"isActive"},relation:{birthDate:F,photo:j,profile:x,basketballProfile:N,volleyballProfile:D,city:O,gender:T(t.UserGender)}})],n)}(k),J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.getEmptyLogoClass=function(){var t=["empty-logo"];return this.sport.isBasketball()&&t.push("empty-logo-basketball"),this.sport.isVolleyball()&&t.push("empty-logo-volleyball"),t.join(" ")},e.toFront=function(t){return null},e.toBack=function(t){return null},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",sport:"sport",logo:"logo",owner:"owner",city:"city",users_count:"usersCount",won_games_count:"wonGamesCount",games_count:"gamesCount",score_sum:"scoreSum",closest_game_datetime:"closestGameDatetime"},relation:{sport:V,logo:j,owner:X,city:O,closestGameDatetime:F}})],e)}(k),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",owner_id:"ownerId",owner:"owner"},relation:{owner:X}})],e)}(k),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},Object.defineProperty(e.prototype,"vkLink",{get:function(){return this.socialLinks.find((function(t){return"https://vk.com/"===t.substr(0,15)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fbLink",{get:function(){return this.socialLinks.find((function(t){return"https://www.facebook.com/"===t.substr(0,25)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"instaLink",{get:function(){return this.socialLinks.find((function(t){return"https://www.instagram.com"===t.substr(0,25)}))},enumerable:!0,configurable:!0}),d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",logo:"logo",contact_email:"contactEmail",contact_phone:"contactPhone",name:"name",alias:"alias",sport:"sport",description:"description",social_links:"socialLinks",links:"links",organization:"organization",tournaments_count:"tournamentsCount",closest_game_datetime:"closestGameDatetime",cover:"cover",about:"about"},relation:{organization:Y,logo:j,cover:j,sport:V}})],e)}(k);(R=t.TournamentTypes||(t.TournamentTypes={})).group="group",R.elimination="elimination",R.fiba="fiba",(M=t.TournamentStatuses||(t.TournamentStatuses={}))[M.open=0]="open",M[M.in_progress=1]="in_progress",M[M.closed=2]="closed",(q=t.TournamentGender||(t.TournamentGender={}))[q.male=1]="male",q[q.female=2]="female",q[q.all=3]="all",(W=t.BasketballStatisticTypes||(t.BasketballStatisticTypes={}))[W.standard=1]="standard",W[W.light=2]="light",W[W.extended=3]="extended",($=t.GameTimeTypes||(t.GameTimeTypes={}))[$.clean=1]="clean",$[$.dirty=2]="dirty";var K,Q=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",gender:"gender",age_from:"ageFrom",age_to:"ageTo",max_team_players:"maxTeamPlayers",max_game_players:"maxGamePlayers",type:"type",tours_count:"toursCount",periods_count:"periodsCount",period_time:"periodTime",overtime_type:"overtimeType",overtime_time:"overtimeTime",overtime_score:"overtimeScore",game_type:"gameType",timeout_count:"timeoutCount",timeout_time:"timeoutTime",substitute_count:"substituteCount",game_up_to_score:"gameUpToScore",volleyball_score_in_set:"volleyballScoreInSet",volleyball_score_in_last_set:"volleyballScoreInLastSet",manage_team_application:"manageTeamApplication",recruitment_is_open:"recruitmentIsOpen",transfer_is_open:"transferIsOpen",basketball_statistic_type:"basketballStatisticType",shot_clock_enabled:"shotClockEnabled",game_time_type:"gameTimeType"},relation:{type:T(t.TournamentTypes),gender:T(t.TournamentGender),basketballStatisticType:T(t.BasketballStatisticTypes),gameTimeType:T(t.GameTimeTypes)}})],n)}(k),tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_id:"teamId",tournament_id:"tournamentId",team:"team",points:"points"},relation:{team:J}})],e)}(k),et=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.prototype.getEmptyLogoClass=function(){var t=["empty-logo"];return this.sport.isBasketball()&&t.push("empty-logo-basketball"),this.sport.isVolleyball()&&t.push("empty-logo-volleyball"),t.join(" ")},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",name:"name",alias:"alias",logo:"logo",cover:"cover",preview_image:"previewImage",city:"city",sport:"sport",location:"location",description:"description",date:"date",price:"price",regulation_files:"regulationFiles",settings:"settings",league:"league",teams_count:"teamsCount",closest_game_datetime:"closestGameDatetime",status:"status",team_winner:"teamWinner"},relation:{logo:j,cover:j,city:O,sport:V,regulationFile:j,settings:Q,date:P,league:Z,status:T(t.TournamentStatuses),teamWinner:tt}})],n)}(k);(K=t.OvertimeTypes||(t.OvertimeTypes={}))[K.to_score_total=1]="to_score_total",K[K.to_score_diff=2]="to_score_diff",K[K.time=3]="time";var nt,it=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{periods_count:"periodsCount",period_time:"periodTime",game_up_to_score:"gameUpToScore",overtime_type:"overtimeType",overtime_time:"overtimeTime",overtime_score:"overtimeScore",max_game_players:"maxGamePlayers",timeout_count:"timeoutCount",overtime_timeout_count:"overtimeTimeoutCount",timeout_time:"timeoutTime",statistic_type:"statisticType",shot_clock_enabled:"shotClockEnabled",game_time_type:"gameTimeType"},relation:{overtimeType:T(t.OvertimeTypes),statisticType:T(t.BasketballStatisticTypes),gameTimeType:T(t.GameTimeTypes)}})],n)}(k);(nt=t.VolleyballGameTypes||(t.VolleyballGameTypes={}))[nt.best_of_five=1]="best_of_five",nt[nt.best_of_three=2]="best_of_three";var ot,rt,at=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"setsCount",{get:function(){return this.gameType===t.VolleyballGameTypes.best_of_three?3:5},enumerable:!0,configurable:!0}),n.prototype.getSetMaxScore=function(t){return t===this.setsCount?this.scoreInLastSet:this.scoreInSet},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{game_type:"gameType",timeout_count:"timeoutCount",timeout_time:"timeoutTime",substitute_count:"substituteCount",score_in_set:"scoreInSet",score_in_last_set:"scoreInLastSet"},relation:{gameType:T(t.VolleyballGameTypes)}})],n)}(k),st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",address:"address",league_id:"leagueId"}})],e)}(k),ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"isVideo",{get:function(){return Boolean(this.videoUrl)},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",original_photo:"originalPhoto",list_photo:"listPhoto",detail_photo:"detailPhoto",game:"game",tournament:"tournament",game_id:"gameId",tournament_id:"tournament_id",video_url:"videoUrl",video_preview:"videoPreview"},relation:{originalPhoto:j,listPhoto:j,detailPhoto:j,videoPreview:j}})],e)}(k);(ot=t.GameStatuses||(t.GameStatuses={}))[ot.open=1]="open",ot[ot.in_progress=2]="in_progress",ot[ot.closed=3]="closed",ot[ot.archived=4]="archived",ot[ot.draft=5]="draft",(rt=t.GameResultTypes||(t.GameResultTypes={}))[rt.team_won=1]="team_won",rt[rt.competitor_team_won=2]="competitor_team_won",rt[rt.team_technical_defeat=3]="team_technical_defeat",rt[rt.competitor_team_technical_defeat=4]="competitor_team_technical_defeat";var lt,ct=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"scoreByPeriodList",{get:function(){var t=this;return this.scoreByPeriod?Object.keys(this.scoreByPeriod).map((function(e){return{period:+e,teamScore:t.scoreByPeriod[e][0],competitorTeamScore:t.scoreByPeriod[e][1]}})):[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isClosed",{get:function(){return this.status===t.GameStatuses.closed},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isTeamWon",{get:function(){return this.teamScore>this.competitorTeamScore},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isCompetitorTeamWon",{get:function(){return this.competitorTeamScore>this.teamScore},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"teamWinnerId",{get:function(){return this.status!==t.GameStatuses.closed||this.teamScore===this.competitorTeamScore?null:this.team.id?this.teamScore>this.competitorTeamScore?this.team.id:this.competitorTeam.id:this.teamScore>this.competitorTeamScore?this.teamId:this.competitorTeamId},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",status:"status",team:"team",team_id:"teamId",competitor_team:"competitorTeam",competitor_team_id:"competitorTeamId",competitor_team_name:"competitorTeamName",datetime:"datetime",location:"location",team_score:"teamScore",competitor_team_score:"competitorTeamScore",result_type:"resultType",playoff_number:"playoffNumber",tournament_id:"tournamentId",tournament_tour:"tournamentTour",basketball_game_config:"basketballGameConfig",volleyball_game_config:"volleyballGameConfig",score_by_period:"scoreByPeriod",playoff_stage:"playoffStage",tournament_stage_id:"tournamentStageId",tournament_playoff_id:"tournamentPlayoffId",tournament_court:"tournamentCourt",media_count:"mediaCount",media:"media"},relation:{status:T(t.GameStatuses),team:J,competitorTeam:J,datetime:P,resultType:T(t.GameResultTypes),basketballGameConfig:it,volleyballGameConfig:at,tournamentCourt:st,media:S(ut)}})],n)}(k);(lt=t.TeamUserRole||(t.TeamUserRole={}))[lt.member=1]="member",lt[lt.moderator=2]="moderator",lt[lt.admin=3]="admin";var pt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",team_id:"teamId",user:"user",role:"role",number:"number",team:"team"},relation:{user:X,team:J,role:T(t.TeamUserRole)}})],n)}(k),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",tournament_stage_id:"tournamentStageId"}})],e)}(k),ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"gamesWonPercent",{get:function(){return this.gamesCount?Math.floor(1e3*this.wonGamesCount/this.gamesCount)/10:0},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_id:"teamId",tournament_id:"tournamentId",tournament:"tournament",team:"team",group:"group",games_count:"gamesCount",won_games_count:"wonGamesCount",last_games_count:"lastGamesCount",last_games_won:"lastGamesWon",score_sum:"scoreSum",missed_sum:"missedSum",score_points_sum:"scorePointsSum",missed_points_sum:"missedPointsSum",points:"points",users_count:"usersCount",games:"games",notifications_count:"notificationsCount"},relation:{tournament:et,team:J,group:mt,games:ct}})],e)}(k),dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team_user_id:"tournamentTeamUserId",date_from:"dateFrom",date_to:"dateTo",matches_count:"matchesCount"},relation:{dateFrom:F,dateTo:F}})],e)}(k),ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"fullName",{get:function(){return[this.lastName,this.firstName,this.middleName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shortName",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initials",{get:function(){return[this.lastName,this.firstName].filter((function(t){return t})).map((function(t){return t.substr(0,1)})).join("")},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team:"tournamentTeam",team_user:"teamUser",disqualified:"disqualified",first_name:"firstName",last_name:"lastName",middle_name:"middleName",photo:"photo",disqualification:"disqualification",has_changes:"hasChanges"},relation:{tournamentTeam:ft,teamUser:pt,photo:j,disqualification:dt}})],e)}(k),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",game_id:"gameId",team_user:"teamUser",tournament_team_user:"tournamentTeamUser",updated_at:"updatedAt"},relation:{teamUser:pt,tournamentTeamUser:ht,updatedAt:P}})],e)}(k);function vt(t,e,n,i){return void 0===n&&(n=!1),Array.isArray(t)?t.map((function(t){if(i&&Tt(i)){if(!i(t))return t}else if(t.id!==e.id)return t;return t.updatedAt&&e.updatedAt&&!n&&t.updatedAt>e.updatedAt?t:e})):t}function _t(t,e,n,i){return void 0===n&&(n=!1),e.forEach((function(e){t=vt(t,e,n,i)})),t}function yt(t,e,n,i){return void 0===n&&(n=!1),Array.isArray(t)?t.find((function(t){return Tt(i)?i(t):t.id===e.id}))?t:n?b(t,[e]):b([e],t):[e]}function bt(t,e,n,i){return void 0===n&&(n=!1),(n?e:Object.assign([],e).reverse()).forEach((function(e){t=yt(t,e,n,i)})),t}function kt(t,e){return Array.isArray(t)?Tt(e)?t.filter((function(t){return!e(t)})):t.filter((function(t){return t.id!==e.id})):[]}function Tt(t){return t&&"[object Function]"==={}.toString.call(t)}var St,Ft=function(){function t(t){this.engine=t,this.data={}}return t.prototype.get=function(t){return this.getSubject(t).pipe(i.filter((function(t){return void 0!==t})))},t.prototype.value=function(t){return this.getSubject(t).value},t.prototype.save=function(t,e){this.getSubject(t).next(e),this.engine&&this.engine.save(t,e)},t.prototype.appendItem=function(t,e,n){this.save(t,yt(this.value(t)||[],e,!0,n))},t.prototype.appendItems=function(t,e,n){this.save(t,bt(this.value(t)||[],e,!0))},t.prototype.prependItem=function(t,e,n){this.save(t,yt(this.value(t)||[],e,!1,n))},t.prototype.prependItems=function(t,e,n){this.save(t,bt(this.value(t)||[],e,!1,n))},t.prototype.updateItem=function(t,e,n,i){this.save(t,vt(this.value(t)||[],e,n,i))},t.prototype.updateItems=function(t,e,n,i){this.save(t,_t(this.value(t)||[],e,n,i))},t.prototype.deleteItem=function(t,e){this.save(t,kt(this.value(t)||[],e))},t.prototype.dispose=function(){var t,e;try{for(var n=_(Object.keys(this.data)),i=n.next();!i.done;i=n.next()){var o=i.value;this.data[o].complete(),delete this.data[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.clearStorageData=function(){this.engine&&this.engine.clear()},t.prototype.getEngine=function(){return this.engine},t.prototype.getSubject=function(t){return this.data[t]||(this.data[t]=new o.BehaviorSubject(this.engine?this.engine.get(t):void 0)),this.data[t]},t}(),Pt=function(){function t(){this.store=new Ft}return t.prototype.dispose=function(){this.store.dispose()},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),wt=function(t){function n(e){var n=t.call(this)||this;return n.configData=e,e&&n.initialize(e),n}return m(n,t),Object.defineProperty(n.prototype,"config$",{get:function(){return this.store.get("config")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"config",{get:function(){return this.store.value("config")||{}},enumerable:!0,configurable:!0}),n.prototype.initialize=function(t){this.store.save("config",t)},n.prototype.set=function(t,e){var n;this.store.save("config",f(f({},this.config),((n={})[t]=e,n)))},n.prototype.get=function(t){return this.store.value("config")&&this.store.value("config")[t]},n.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:["mtg-core-config-data"]}]}]},n.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new n(e.ɵɵinject("mtg-core-config-data",8))},token:n,providedIn:"root"}),n=d([e.Injectable({providedIn:"root"}),h(0,e.Optional()),h(0,e.Inject("mtg-core-config-data"))],n)}(Pt),Ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"totalFouls",{get:function(){return this.personalFouls+this.technicalFouls+this.unsportsmanlikeFouls},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{tournament_team_user:"tournamentTeamUser",team:"team",team_user:"teamUser",user:"user",tournament_team:"tournamentTeam",month:"month",win_lose:"winLose",games_count:"gamesCount",won_games_count:"wonGamesCount",points:"points",two_points_made:"twoPointsMade",three_points_made:"threePointsMade",free_throws_made:"freeThrowsMade",one_points_made:"onePointsMade",two_point_attempts:"twoPointAttempts",three_point_attempts:"threePointAttempts",free_throw_attempts:"freeThrowAttempts",one_point_attempts:"onePointAttempts",two_point_percent:"twoPointPercent",three_point_percent:"threePointPercent",free_throw_percent:"freeThrowPercent",one_point_percent:"onePointPercent",assists:"assists",blocks:"blocks",rebounds:"rebounds",offensive_rebounds:"offensiveRebounds",defensive_rebounds:"defensiveRebounds",steals:"steals",turnovers:"turnovers",personal_fouls:"personalFouls",technical_fouls:"technicalFouls",unsportsmanlike_fouls:"unsportsmanlikeFouls",newbie:"newbie"},relation:{tournamentTeamUser:ht,team:J,teamUser:pt,user:X,tournamentTeam:ft,month:F}})],e)}(k),It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",competitor_team:"competitorTeam"},relation:{team:Ct,competitorTeam:Ct}})],e)}(k),Ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.gameUserId},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},Object.defineProperty(e.prototype,"totalFouls",{get:function(){return(this.personalFouls||0)+(this.technicalFouls||0)+(this.unsportsmanlikeFouls||0)},enumerable:!0,configurable:!0}),d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{game_user_id:"gameUserId",points:"points",free_throws_made:"freeThrowsMade",two_points_made:"twoPointsMade",three_points_made:"threePointsMade",one_points_made:"onePointsMade",two_point_attempts:"twoPointAttempts",three_point_attempts:"threePointAttempts",free_throw_attempts:"freeThrowAttempts",one_point_attempts:"onePointAttempts",assists:"assists",blocks:"blocks",rebounds:"rebounds",offensive_rebounds:"offensiveRebounds",defensive_rebounds:"defensiveRebounds",steals:"steals",turnovers:"turnovers",personal_fouls:"personalFouls",technical_fouls:"technicalFouls",unsportsmanlike_fouls:"unsportsmanlikeFouls",updated_at:"updatedAt"},relation:{updatedAt:P}})],e)}(k);(St=t.BasketballGameLogTypes||(t.BasketballGameLogTypes={}))[St.enter_game=1]="enter_game",St[St.exit_game=2]="exit_game",St[St.remove_game=3]="remove_game",St[St.two_point_made=4]="two_point_made",St[St.three_point_made=5]="three_point_made",St[St.free_throw_made=6]="free_throw_made",St[St.two_point_attempt=7]="two_point_attempt",St[St.three_point_attempt=8]="three_point_attempt",St[St.free_throw_attempt=9]="free_throw_attempt",St[St.assist=10]="assist",St[St.block=11]="block",St[St.rebound=12]="rebound",St[St.offensive_rebound=13]="offensive_rebound",St[St.defensive_rebound=14]="defensive_rebound",St[St.steal=15]="steal",St[St.turnover=16]="turnover",St[St.personal_foul=17]="personal_foul",St[St.technical_foul=18]="technical_foul",St[St.unsportsmanlike_foul=19]="unsportsmanlike_foul",St[St.one_point_attempt=20]="one_point_attempt",St[St.one_point_made=21]="one_point_made",St[St.timeout=22]="timeout";var Bt,Gt=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.active=!0,t}return m(n,e),n.prototype.isPointsType=function(){return[t.BasketballGameLogTypes.two_point_made,t.BasketballGameLogTypes.three_point_made,t.BasketballGameLogTypes.free_throw_made,t.BasketballGameLogTypes.one_point_made].indexOf(this.logType)>-1},n.prototype.isReboundType=function(){return[t.BasketballGameLogTypes.rebound,t.BasketballGameLogTypes.offensive_rebound,t.BasketballGameLogTypes.defensive_rebound].indexOf(this.logType)>-1},n.prototype.isFoulType=function(){return[t.BasketballGameLogTypes.personal_foul,t.BasketballGameLogTypes.technical_foul,t.BasketballGameLogTypes.unsportsmanlike_foul].indexOf(this.logType)>-1},n.prototype.getScore=function(){var e;return((e={})[t.BasketballGameLogTypes.one_point_made]=1,e[t.BasketballGameLogTypes.free_throw_made]=1,e[t.BasketballGameLogTypes.two_point_made]=2,e[t.BasketballGameLogTypes.three_point_made]=3,e)[this.logType]},n.prototype.compare=function(t){return this.time===t.time&&this.period===t.period?this.datetime.getTime()<t.datetime.getTime()?1:-1:this.period===t.period?this.time<t.time?1:-1:this.period<t.period?1:-1},Object.defineProperty(n.prototype,"timeFormatted",{get:function(){var t=Math.floor(this.time/60),e=this.time-60*t;return(t<10?"0":"")+t+":"+(e<10?"0":"")+e},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",unique_id:"uniqueId",game_id:"gameId",game_user_id:"gameUserId",team_id:"teamId",log_type:"logType",datetime:"datetime",time:"time",period:"period",active:"active",is_highlight:"isHighlight"},relation:{datetime:P,logType:T(t.BasketballGameLogTypes)}})],n)}(k),jt=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},t.prototype.getUsers=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_game/"+t+"/users/").pipe(i.map((function(t){return gt.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/team_statistic/").pipe(i.map((function(t){return It.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/user_statistic/").pipe(i.map((function(t){return Ut.toFront(t)}))).toPromise()]}))}))},t.prototype.getLogs=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_basketball_game/"+t+"/logs/").pipe(i.map((function(t){return Gt.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Lt=function(){function t(){}return t.toFront=function(t){return null},t.toBack=function(t){return null},d([I],t,"toFront",null),d([U],t,"toBack",null),t=d([w({mappingFields:{id:"id",theme:"theme",message:"message",files:"files"},relation:{files:j}})],t)}(),At=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.sendFeedback=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/feedback/",Lt.toBack(t)).pipe(i.map((function(t){return Lt.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Vt=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.upload=function(t,e){return g(this,void 0,void 0,(function(){var n;return v(this,(function(o){return(n=new FormData).append("file",t,e),[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/file/",n).pipe(i.map((function(t){return j.toFront(t)}))).toPromise()]}))}))},t.prototype.createZipArchive=function(t){return g(this,void 0,void 0,(function(){var e,n,i,o,r,a;return v(this,(function(s){e=new FormData;try{for(n=_(t),i=n.next();!i.done;i=n.next())o=i.value,e.append("files",o.file,o.filename)}catch(t){r={error:t}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/file/zip_archive/",e,{responseType:"blob"}).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",title:"title",datetime:"datetime",preview_text:"previewText",detail_text:"detailText",picture:"picture",cover:"cover",is_main:"isMain",tournaments:"tournaments"},relation:{datetime:P,picture:j,cover:j,tournaments:S(et)}})],e)}(k);(Bt=t.TournamentEventTypes||(t.TournamentEventTypes={}))[Bt.game_closed=1]="game_closed",Bt[Bt.media_added=2]="media_added",Bt[Bt.news=3]="news";var Ot,Et=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",game:"game",news:"news",league:"league",tournaments:"tournaments",event:"event",datetime:"datetime"},relation:{game:ct,news:xt,league:Z,tournaments:S(et),datetime:F,event:T(t.TournamentEventTypes)}})],n)}(k),Ht=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.getByAlias=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/").pipe(i.map((function(t){return Z.toFront(t)}))).toPromise()]}))}))},o.prototype.getByDomain=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/by_domain/"+t+"/").pipe(i.map((function(t){return Z.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournaments=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/tournaments/").pipe(i.map((function(t){return et.toFront(t)}))).toPromise()]}))}))},o.prototype.getEvents=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.event&&(s=s.set("event",t.TournamentEventTypes[a.event])),a.search&&(s=s.set("search",a.search))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+e+"/events/",{params:s,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:Et.toFront(t.body)}}))).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}(),Nt=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getLeagueNewsList=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/news/",{observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:xt.toFront(t.body)}}))).toPromise()]}))}))},t.prototype.getMainLeagueNews=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+t+"/news/?is_main=true").pipe(i.map((function(t){return t&&t.length>0?xt.toFront(t[0]):null}))).toPromise()]}))}))},t.prototype.getNewsById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league_news/"+t+"/").pipe(i.map((function(t){return xt.toFront(t)}))).toPromise()]}))}))},t.prototype.getTournamentNewsList=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/news/",{observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:xt.toFront(t.body)}}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),zt=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.getMedia=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/media/"+t+"/").pipe(i.map((function(t){return ut.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentGameMedia=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.tournamentTour&&(s=s.set("tournament_tour",a.tournamentTour.toString())),a.teamId&&(s=s.set("team_id",a.teamId.toString())),a.tournamentStageId&&(s=s.set("tournament_stage_id",a.tournamentStageId.toString())),a.playoffId&&(s=s.set("playoff_id",a.playoffId.toString())),a.playoffStage&&(s=s.set("playoff_stage",a.playoffStage.toString())),a.status&&(s=s.set("status",t.GameStatuses[a.status]))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+e+"/game_media/",{observe:"response",params:s}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:ct.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getLeagueGameMedia=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.tournamentTour&&(s=s.set("tournament_tour",a.tournamentTour.toString())),a.teamId&&(s=s.set("team_id",a.teamId.toString())),a.tournamentStageId&&(s=s.set("tournament_stage_id",a.tournamentStageId.toString())),a.playoffId&&(s=s.set("playoff_id",a.playoffId.toString())),a.playoffStage&&(s=s.set("playoff_stage",a.playoffStage.toString())),a.status&&(s=s.set("status",t.GameStatuses[a.status]))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/league/"+e+"/game_media/",{observe:"response",params:s}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:ct.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getGameMediaById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/game_media/"+t+"/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.getGameMedia=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_game/"+t+"/media/").pipe(i.map((function(t){return ut.toFront(t)}))).toPromise()]}))}))},o.prototype.createZip=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/media/zip/",t,{responseType:"blob"}).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}();(Ot=t.PollStatuses||(t.PollStatuses={}))[Ot.open=1]="open",Ot[Ot.closed=2]="closed",Ot[Ot.archived=3]="archived";var Dt,Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{uuid:"uuid",name:"name"}})],e)}(k),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",answer_uuid:"answerUuid",user:"user",poll_id:"pollId"},relation:{user:X}})],e)}(k),qt=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.variantsWithAnswers=[],t}return m(n,e),Object.defineProperty(n.prototype,"variants",{get:function(){return this._variants},set:function(t){this._variants=t||[],this._answers&&this.calculateAnswersPercentage()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"answers",{get:function(){return this._answers},set:function(t){this._answers=t||[],this._variants&&this.calculateAnswersPercentage()},enumerable:!0,configurable:!0}),n.prototype.calculateAnswersPercentage=function(){var t=this;if(this._answers.length){var e=this._variants.map((function(t){return t.uuid})),n=this._answers.reduce((function(t,n){return e.indexOf(n.answerUuid)<0||(t[n.answerUuid]||(t[n.answerUuid]=0),t[n.answerUuid]++),t}),{});this.variantsWithAnswers=this._variants.map((function(e){return{variant:e,percent:n[e.uuid]?Math.round(100*n[e.uuid]/t._answers.length):0}})).sort((function(t,e){return t.percent>e.percent?-1:1}))}},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",active:"active",status:"status",team_id:"teamId",name:"name",description:"description",variants:"variants",author:"author",answers:"answers",multiple_answer:"multipleAnswer",anonymous:"anonymous",created_at:"createdAt"},relation:{status:T(t.PollStatuses),variants:Rt,author:X,answers:Mt,createdAt:P}})],n)}(k),Wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",user_id:"userId",user:"user",team:"team",team_id:"teamId",user_accept:"userAccept",team_accept:"teamAccept",users_count:"usersCount",games_count:"gamesCount",won_games_count:"wonGamesCount",score_sum:"scoreSum",created_at:"createdAt",updated_at:"updatedAt"},relation:{user:X,team:J,createdAt:P,updateAt:P}})],e)}(k);(Dt=t.GameInviteStatus||(t.GameInviteStatus={}))[Dt.accepted=1]="accepted",Dt[Dt.declined=2]="declined";var $t,Xt,Jt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",team_user:"teamUser",game_id:"gameId",game:"game",status:"status"},relation:{game:ct,teamUser:pt,status:T(t.GameInviteStatus)}})],n)}(k);($t=t.TeamEventTypes||(t.TeamEventTypes={}))[$t.training=1]="training",$t[$t.other=2]="other";var Yt,Zt=((Xt={})[t.TeamEventTypes.training]="Тренировка",Xt[t.TeamEventTypes.other]="Другое",Xt),Kt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return this.eventType===t.TeamEventTypes.other?this.eventCustomName:Zt[this.eventType]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isClosed",{get:function(){return this.datetime.getTime()<(new Date).getTime()},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",team_id:"teamId",team:"team",event_type:"eventType",event_custom_name:"eventCustomName",description:"description",datetime:"datetime",location:"location"},relation:{eventType:T(t.TeamEventTypes),team:J,datetime:P}})],n)}(k);(Yt=t.TeamEventInviteStatuses||(t.TeamEventInviteStatuses={}))[Yt.accepted=1]="accepted",Yt[Yt.declined=2]="declined";var Qt,te,ee=function(){function e(){}return e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_event_id:"teamEventId",team_user_id:"teamUserId",status:"status"},relation:{status:T(t.TeamEventInviteStatuses)}})],e)}(),ne=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team_invite_id:"tournamentTeamInviteId",tournament_team_id:"tournamentTeamId",team_user:"teamUser",accepted:"accepted"},relation:{teamUser:pt}})],e)}(k),ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return(null===this.teamAccept||null===this.organizationAccept)&&!1!==this.teamAccept&&!1!==this.organizationAccept},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team:"team",tournament:"tournament",team_accept:"teamAccept",organization_accept:"organizationAccept",user_invites_count:"userInvitesCount",user_invites:"userInvites",notifications_count:"notificationsCount"},relation:{team:J,tournament:et,userInvites:ne}})],e)}(k);(Qt=t.NotificationType||(t.NotificationType={}))[Qt.team_updated=1]="team_updated",Qt[Qt.team_invited=2]="team_invited",Qt[Qt.team_join_request=3]="team_join_request",Qt[Qt.team_join_declined_by_team=4]="team_join_declined_by_team",Qt[Qt.team_join_declined_by_user=5]="team_join_declined_by_user",Qt[Qt.team_join_canceled_by_team=6]="team_join_canceled_by_team",Qt[Qt.team_join_canceled_by_user=7]="team_join_canceled_by_user",Qt[Qt.team_joined_for_user=8]="team_joined_for_user",Qt[Qt.team_joined_for_team=9]="team_joined_for_team",Qt[Qt.team_user_role_changed_for_user=10]="team_user_role_changed_for_user",Qt[Qt.team_user_role_changed_for_team=11]="team_user_role_changed_for_team",Qt[Qt.team_user_number_changed=12]="team_user_number_changed",Qt[Qt.team_user_deleted_for_user=13]="team_user_deleted_for_user",Qt[Qt.team_user_deleted_for_team=14]="team_user_deleted_for_team",Qt[Qt.team_user_left=15]="team_user_left",Qt[Qt.game_updated=16]="game_updated",Qt[Qt.game_invited=17]="game_invited",Qt[Qt.game_invite_accepted=18]="game_invite_accepted",Qt[Qt.game_invite_declined=19]="game_invite_declined",Qt[Qt.game_remind=20]="game_remind",Qt[Qt.game_won=21]="game_won",Qt[Qt.game_losing=22]="game_losing",Qt[Qt.game_tech_defeat=23]="game_tech_defeat",Qt[Qt.game_tech_victory=24]="game_tech_victory",Qt[Qt.poll_created=25]="poll_created",Qt[Qt.poll_closed=26]="poll_closed",Qt[Qt.team_event_invited=27]="team_event_invited",Qt[Qt.team_event_accepted=28]="team_event_accepted",Qt[Qt.team_event_declined=29]="team_event_declined",Qt[Qt.team_event_remind=30]="team_event_remind",Qt[Qt.tournament_invited=31]="tournament_invited",Qt[Qt.tournament_joined=32]="tournament_joined",Qt[Qt.tournament_join_declined=33]="tournament_join_declined",Qt[Qt.tournament_join_canceled=34]="tournament_join_canceled",Qt[Qt.tournament_user_invited=35]="tournament_user_invited",Qt[Qt.tournament_user_accepted_for_team=36]="tournament_user_accepted_for_team",Qt[Qt.tournament_user_accepted_for_user=37]="tournament_user_accepted_for_user",Qt[Qt.tournament_user_added=38]="tournament_user_added",Qt[Qt.tournament_user_declined_for_team=39]="tournament_user_declined_for_team",Qt[Qt.tournament_user_declined_for_user=40]="tournament_user_declined_for_user",Qt[Qt.tournament_user_invite_deleted=41]="tournament_user_invite_deleted",Qt[Qt.tournament_user_deleted=42]="tournament_user_deleted",Qt[Qt.tournament_user_disqualified_for_team=43]="tournament_user_disqualified_for_team",Qt[Qt.tournament_user_disqualified_for_user=44]="tournament_user_disqualified_for_user",Qt[Qt.tournament_user_disqualification_updated_for_team=45]="tournament_user_disqualification_updated_for_team",Qt[Qt.tournament_user_disqualification_updated_for_user=46]="tournament_user_disqualification_updated_for_user",Qt[Qt.tournament_team_deleted=47]="tournament_team_deleted",Qt[Qt.org_tournament_invite_created=48]="org_tournament_invite_created",Qt[Qt.org_tournament_invite_declined=49]="org_tournament_invite_declined",Qt[Qt.org_tournament_invite_deleted=50]="org_tournament_invite_deleted",Qt[Qt.org_tournament_invite_changed=51]="org_tournament_invite_changed",Qt[Qt.org_tournament_user_deleted=52]="org_tournament_user_deleted",Qt[Qt.org_tournament_user_invited=53]="org_tournament_user_invited",Qt[Qt.org_tournament_user_has_changes=54]="org_tournament_user_has_changes",Qt[Qt.org_tournament_team_leave=55]="org_tournament_team_leave",(te=t.NotificationServiceEnum||(t.NotificationServiceEnum={}))[te.public=1]="public",te[te.org=2]="org";var oe,re=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),Object.defineProperty(n.prototype,"important",{get:function(){return!0},enumerable:!0,configurable:!0}),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",event_type:"event",data:"data",initiator:"initiator",team:"team",team_invite:"teamInvite",team_user:"teamUser",poll:"poll",game:"game",game_invite:"gameInvite",team_event:"teamEvent",team_event_invite:"teamEventInvite",tournament:"tournament",tournament_invite:"tournamentInvite",tournament_team:"tournamentTeam",viewed:"viewed",protected:"protected",service:"service",created_at:"createdAt"},relation:{event:T(t.NotificationType),initiator:X,team:J,teamInvite:Wt,teamUser:pt,poll:qt,game:ct,gameInvite:Jt,teamEvent:Kt,teamEventInvite:ee,tournament:et,tournamentInvite:ie,tournamentTeam:ft,service:T(t.NotificationServiceEnum),createdAt:P}})],n)}(k);(oe=t.NotificationAllowTypes||(t.NotificationAllowTypes={}))[oe.all=1]="all",oe[oe.important=2]="important",oe[oe.none=3]="none";var ae,se=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{user_id:"userId",popup:"popup",sound:"sound",browser:"browser",email:"email"},relation:{sound:T(t.NotificationAllowTypes),browser:T(t.NotificationAllowTypes)}})],n)}(k),ue=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getCount=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/count/").pipe(i.map((function(t){return+t}))).toPromise()]}))}))},t.prototype.getList=function(t,e,o){return void 0===o&&(o={}),g(this,void 0,void 0,(function(){var r,a,s,u,l,c;return v(this,(function(p){r=(new n.HttpParams).set("page",t.toString()).set("size",e.toString());try{for(a=_(Object.keys(o)),s=a.next();!s.done;s=a.next())u=s.value,r=r.set(u,o[u])}catch(t){l={error:t}}finally{try{s&&!s.done&&(c=a.return)&&c.call(a)}finally{if(l)throw l.error}}return[2,this.httpClient.get(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/",{params:r,observe:"response"}).pipe(i.map((function(t){var e=re.toFront(t.body);return{total:+t.headers.get("x-page-count"),data:e}}))).toPromise()]}))}))},t.prototype.markViewed=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/"+t+"/viewed/",{viewed:e}).pipe(i.map((function(t){return re.toFront(t)}))).toPromise()]}))}))},t.prototype.markAllViewed=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.post(""+this.configService.get("apiUrl")+this.apiUrl+"/notification/viewed/",{}).pipe(i.map((function(t){return re.toFront(t)}))).toPromise()]}))}))},t.prototype.getNotificationSettings=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(""+this.configService.get("apiUrl")+this.apiUrl+"/notification_settings/").pipe(i.map((function(t){return se.toFront(t)}))).toPromise()]}))}))},t.prototype.updateNotificationSettings=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(""+this.configService.get("apiUrl")+this.apiUrl+"/notification_settings/",se.toBack(t)).pipe(i.map((function(t){return se.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),le=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.apiUrl="/api/v1",e}return m(i,t),i.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new i(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:i,providedIn:"root"}),i=d([e.Injectable({providedIn:"root"})],i)}(ue),ce=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.apiUrl="/org/api/v1",e}return m(i,t),i.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new i(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:i,providedIn:"root"}),i=d([e.Injectable({providedIn:"root"})],i)}(ue),pe=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getCities=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/reference/cities/").pipe(i.map((function(t){return O.toFront(t)}))).toPromise()]}))}))},t.prototype.getSports=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/sport/").pipe(i.map((function(t){return V.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",team_id:"teamId",email:"email",first_name:"firstName",last_name:"lastName"}})],e)}(k),fe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",team_user:"teamUser",tournament_team_user:"tournamentTeamUser",tournament_team:"tournamentTeam",user:"user",month:"month",win_lose:"winLose",games_count:"gamesCount",won_games_count:"wonGamesCount",serve_hits:"serveHits",serve_faults:"serveFaults",serve_aces:"serveAces",serve_percent:"servePercent",ace_percent:"acePercent",stuff_blocks:"stuffBlocks",block_faults:"blockFaults",block_rebounds:"blockRebounds",block_percent:"blockPercent",attack_spikes:"attackSpikes",attack_faults:"attackFaults",attack_shots:"attackShots",attack_percent:"attackPercent",receives:"receives",receive_faults:"receiveFaults",excellent_receives:"excellentReceives",receive_percent:"receivePercent",serve_receives:"serveReceives",serve_receive_faults:"serveReceiveFaults",excellent_serve_receives:"excellentServeReceives",serve_receive_percent:"serveReceivePercent",points:"points",faults:"faults",newbie:"newbie"},relation:{team:J,teamUser:pt,tournamentTeamUser:ht,tournamentTeam:ft,user:X,month:F}})],e)}(k);(ae=t.TeamPermissionTypes||(t.TeamPermissionTypes={}))[ae.for_all=1]="for_all",ae[ae.for_users=2]="for_users",ae[ae.for_team=3]="for_team";var de,he=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{players:"players",games:"games",statistic:"statistic",polls:"polls",events:"events"},relation:{players:T(t.TeamPermissionTypes),games:T(t.TeamPermissionTypes),statistic:T(t.TeamPermissionTypes),polls:T(t.TeamPermissionTypes),events:T(t.TeamPermissionTypes)}})],n)}(k),ge=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{can_edit:"canEdit",can_view_users:"canViewUsers",can_manage_permission:"canManagePermission",can_change_owner:"canChangeOwner",can_delete:"canDelete",can_manage_invites:"canManageInvites",can_view_invites:"canViewInvites",can_manage_polls:"canManagePolls",can_view_polls:"canViewPolls",can_answer_poll:"canAnswerPoll",can_manage_games:"canManageGames",can_view_games:"canViewGames",can_view_statistic:"canViewStatistic",can_promote_users:"canPromoteUsers",can_edit_users:"canEditUsers",can_delete_users:"canDeleteUsers",can_view_events:"canViewEvents",can_manage_events:"canManageEvents",can_view_tournaments:"canViewTournaments",can_manage_tournaments:"canManageTournaments",role:"role"},relation:{role:T(t.TeamUserRole)}})],n)}(k),ve=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.search=function(t,e){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o=(new n.HttpParams).set("search",t),e&&(o=o.set("sport",e.toString())),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/",{params:o}).pipe(i.map((function(t){return J.toFront(t)}))).toPromise()]}))}))},o.prototype.create=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/",J.toBack(t)).pipe(i.map((function(t){return J.toFront(t)}))).toPromise()]}))}))},o.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/").pipe(i.map((function(t){return J.toFront(t)}))).toPromise()]}))}))},o.prototype.getTeamAccess=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/access/").pipe(i.map((function(t){return ge.toFront(t)}))).toPromise()]}))}))},o.prototype.update=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/",J.toBack(e)).pipe(i.map((function(t){return J.toFront(t)}))).toPromise()]}))}))},o.prototype.delete=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/team/"+t.id+"/").toPromise()]}))}))},o.prototype.getPermission=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/permission/").pipe(i.map((function(t){return he.toFront(t)}))).toPromise()]}))}))},o.prototype.updatePermission=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/permission/",he.toBack(e)).pipe(i.map((function(t){return he.toFront(t)}))).toPromise()]}))}))},o.prototype.getUsers=function(t,e){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o=new n.HttpParams,e&&(o=o.set("tournament_id",e.toString())),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/users/",{params:o}).pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},o.prototype.updateUserRole=function(e,n,o){return g(this,void 0,void 0,(function(){return v(this,(function(r){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+e+"/users/"+n+"/role/",{role:t.TeamUserRole[o]}).pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},o.prototype.updateUserNumber=function(t,e,n){return g(this,void 0,void 0,(function(){return v(this,(function(o){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/users/"+e+"/number/",{number:n.toString()}).pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},o.prototype.deleteUser=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/team/"+t.teamId+"/users/"+t.id+"/").toPromise()]}))}))},o.prototype.changeOwner=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/owner/",{id:e.id}).pipe(i.map((function(t){return J.toFront(t)}))).toPromise()]}))}))},o.prototype.getInvites=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites/").pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},o.prototype.sendInvite=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites/",{user:e}).pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},o.prototype.acceptInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_invite/"+t.id+"/accept/",{}).pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},o.prototype.declineInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_invite/"+t.id+"/decline/",{}).pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},o.prototype.resendInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_invite/"+t.id+"/resend/",{}).pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},o.prototype.getInvitesExternal=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites_external/").pipe(i.map((function(t){return me.toFront(t)}))).toPromise()]}))}))},o.prototype.sendInviteExternal=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/invites_external/",me.toBack(e)).pipe(i.map((function(t){return me.toFront(t)}))).toPromise()]}))}))},o.prototype.deleteInviteExternal=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/invites_external/"+t.id+"/").toPromise()]}))}))},o.prototype.resendInviteExternal=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/invites_external/"+t.id+"/resend/",{}).pipe(i.map((function(t){return me.toFront(t)}))).toPromise()]}))}))},o.prototype.getPolls=function(t,e){return void 0===e&&(e=!1),g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/polls/"+(e?"?archive=1":"")).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.createPoll=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/polls/",qt.toBack(e)).pipe(i.map((function(t){return qt.toFront(t)}))).toPromise()]}))}))},o.prototype.getUsersStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/statistics/").pipe(i.map((function(t){return Ct.toFront(t)}))).toPromise()]}))}))},o.prototype.getVolleyballStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/volleyball_statistics/").pipe(i.map((function(t){return fe.toFront(t)}))).toPromise()]}))}))},o.prototype.joinTeam=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/join/",{}).pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},o.prototype.leaveTeam=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/leave/",{}).toPromise()]}))}))},o.prototype.getGames=function(t,e){return void 0===e&&(e=!1),g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/games/"+(e?"?archive=1":"")).pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.createGame=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/games/",ct.toBack(e)).pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.getTeamEvents=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/events/").pipe(i.map((function(t){return Kt.toFront(t)}))).toPromise()]}))}))},o.prototype.createTeamEvent=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/events/",Kt.toBack(e)).pipe(i.map((function(t){return Kt.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournaments=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournaments/").pipe(i.map((function(t){return et.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournament_teams/").pipe(i.map((function(t){return ft.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentInvites=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournament_invites/").pipe(i.map((function(t){return ie.toFront(t)}))).toPromise()]}))}))},o.prototype.getTournamentGames=function(t,e,o,r){return g(this,void 0,void 0,(function(){var a;return v(this,(function(s){return a=(new n.HttpParams).set("page",o.toString()),r&&(a=a.set("size",r.toString())),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/tournaments/"+e+"/games/",{params:a,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:ct.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.acceptTournamentInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/tournament_invite/"+t+"/accept/",{}).pipe(i.map((function(t){return ie.toFront(t)}))).toPromise()]}))}))},o.prototype.declineTournamentInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/tournament_invite/"+t+"/decline/",{}).pipe(i.map((function(t){return ie.toFront(t)}))).toPromise()]}))}))},o.prototype.registerLazyUser=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/lazy_user/",{user:X.toBack(e)}).pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},o.prototype.getLazyUser=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/").pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},o.prototype.updateLazyUser=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/",{user:X.toBack(e)}).pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},o.prototype.deleteLazyUser=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/").toPromise()]}))}))},o.prototype.resendLazyUserEmail=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/lazy_user/"+t+"/resend_email/",{}).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}(),_e=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getTeamEvent=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/").pipe(i.map((function(t){return Kt.toFront(t)}))).toPromise()]}))}))},t.prototype.updateTeamEvent=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/team_event/"+t.id+"/",Kt.toBack(t)).pipe(i.map((function(t){return Kt.toFront(t)}))).toPromise()]}))}))},t.prototype.deleteTeamEvent=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.delete(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/").toPromise()]}))}))},t.prototype.getTeamEventInvites=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/invites/").pipe(i.map((function(t){return ee.toFront(t)}))).toPromise()]}))}))},t.prototype.createTeamEventInvite=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_event/"+t+"/invites/",{team_user_id:e}).pipe(i.map((function(t){return ee.toFront(t)}))).toPromise()]}))}))},t.prototype.acceptTeamEventInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_event_invite/"+t.id+"/accept/",{}).pipe(i.map((function(t){return ee.toFront(t)}))).toPromise()]}))}))},t.prototype.declineTeamEventInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/team_event_invite/"+t.id+"/decline/",{}).pipe(i.map((function(t){return ee.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),ye=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",title:"title",picture:"picture",text:"text",author:"author",created_at:"createdAt"},relation:{picture:j,author:X,createdAt:P}})],e)}(k),be=function(){function t(){}return t.toFront=function(t){},t.toBack=function(t){},d([I],t,"toFront",null),d([U],t,"toBack",null),t=d([w({mappingFields:{stage_id:"stageId",tours_count:"toursCount",playoff_stages_count:"playoffStagesCount"}})],t)}(),ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{tours_count:"toursCount",playoff_stages_count:"playoffStagesCount",current_tour:"currentTour",current_playoff_stage:"currentPlayoffStage",stages:"stages",tournament_stage_id:"tournamentStageId"},relation:{stages:S(be)}})],e)}(k);(de=t.TournamentStageStatuses||(t.TournamentStageStatuses={}))[de.open=0]="open",de[de.in_progress=1]="in_progress",de[de.closed=2]="closed";var Te=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",name:"name",date:"date",tournament_id:"tournamentId",status:"status"},relation:{date:F,status:T(t.TournamentStageStatuses)}})],n)}(k);function Se(t){return t<=0?[]:Array.apply(null,Array(t)).map((function(t,e){return e+1}))}var Fe,Pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{rounds:"rounds",final_rounds:"finalRounds",third_place_rounds:"thirdPlaceRounds",teams_count:"teamsCount"}})],e)}(k),we=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stages=[],e}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},Object.defineProperty(e.prototype,"stagesCount",{get:function(){return Math.log(this.settings.teamsCount)/Math.log(2)},enumerable:!0,configurable:!0}),e.prototype.getPlayoffStages=function(){var t=this;if(0===this.stages.length&&this.settings.teamsCount){var e=Math.log(this.settings.teamsCount)/Math.log(2);this.stages=Se(e).map((function(e){var n=t.settings.teamsCount/Math.pow(2,e);return{value:e,title:1===n?"Финал":"1 / "+n}}))}return this.stages},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",name:"name",settings:"settings",tournament_id:"tournamentId",tournament_stage_id:"tournamentStageId",is_official:"isOfficial"},relation:{settings:Pe}})],e)}(k),Ce=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"gamesWonPercent",{get:function(){return this.gamesCount?Math.floor(1e3*this.wonGamesCount/this.gamesCount)/10:0},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{id:"id",tournament_team:"tournamentTeam",group:"group",tournament_stage_id:"tournamentStageId",games_count:"gamesCount",won_games_count:"wonGamesCount",score_sum:"scoreSum",missed_sum:"missedSum",last_games_count:"lastGamesCount",last_games_won:"lastGamesWon",points:"points",final_standing:"finalStanding",received_points:"receivedPoints"},relation:{tournamentTeam:ft,group:mt}})],e)}(k),Ie=function(){function o(t,e){this.httpClient=t,this.configService=e}return o.prototype.getByAlias=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/").pipe(i.map((function(t){return et.toFront(t)}))).toPromise()]}))}))},o.prototype.getNews=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/news/").pipe(i.map((function(t){return ye.toFront(t)}))).toPromise()]}))}))},o.prototype.getEvents=function(e,o,r,a){return g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()).set("size",r.toString()),a&&(a.event&&(s=s.set("event",t.TournamentEventTypes[a.event])),a.search&&(s=s.set("search",a.search))),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+e+"/events/",{params:s,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:Et.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getTournamentStages=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/stages/").pipe(i.map((function(t){return Te.toFront(t)}))).toPromise()]}))}))},o.prototype.getPlayoff=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/playoff/").pipe(i.map((function(t){return we.toFront(t)}))).toPromise()]}))}))},o.prototype.getPlayoffGames=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_playoff/"+t+"/games/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.getGamesStages=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/games_stages/").pipe(i.map((function(t){return ke.toFront(t)}))).toPromise()]}))}))},o.prototype.getGames=function(e,o,r,a){return void 0===a&&(a={}),g(this,void 0,void 0,(function(){var s;return v(this,(function(u){return s=(new n.HttpParams).set("page",o.toString()),r&&(s=s.set("size",r.toString())),a.tournamentStageId&&(s=s.set("tournament_stage_id",a.tournamentStageId.toString())),a.tournamentTour&&(s=s.set("tournament_tour",a.tournamentTour.toString())),a.playoffStage&&(s=s.set("playoff_stage",a.playoffStage.toString())),a.teamId&&(s=s.set("team_id",a.teamId.toString())),a.status&&(s=s.set("status",t.GameStatuses[a.status])),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+e+"/games/",{params:s,observe:"response"}).pipe(i.map((function(t){return{total:+t.headers.get("X-Page-Count"),data:ct.toFront(t.body)}}))).toPromise()]}))}))},o.prototype.getTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/teams/").pipe(i.map((function(t){return ft.toFront(t)}))).toPromise()]}))}))},o.prototype.getStageTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/stage_teams/").pipe(i.map((function(t){return Ce.toFront(t)}))).toPromise()]}))}))},o.prototype.getTeamById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_team/"+t+"/").pipe(i.map((function(t){return ft.toFront(t)}))).toPromise()]}))}))},o.prototype.getUserById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_team_user/"+t+"/").pipe(i.map((function(t){return ht.toFront(t)}))).toPromise()]}))}))},o.prototype.getUserGames=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_team_user/"+t+"/games/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},o.prototype.getBasketballStatistic=function(t){return g(this,void 0,void 0,(function(){var e,o,r,a,s,u;return v(this,(function(l){if(e=new n.HttpParams,t){try{for(o=_(Object.keys(t)),r=o.next();!r.done;r=o.next())a=r.value,t[a]&&(e=e.set(a,t[a]))}catch(t){s={error:t}}finally{try{r&&!r.done&&(u=o.return)&&u.call(o)}finally{if(s)throw s.error}}void 0!==t.per_game&&(e=e.set("per_game",t.per_game?"1":"0"))}return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/basketball_statistic/",{params:e}).pipe(i.map((function(t){return Ct.toFront(t)}))).toPromise()]}))}))},o.prototype.getVolleyballStatistic=function(t){return g(this,void 0,void 0,(function(){var e,o,r,a,s,u;return v(this,(function(l){if(e=new n.HttpParams,t){try{for(o=_(Object.keys(t)),r=o.next();!r.done;r=o.next())a=r.value,t[a]&&(e=e.set(a,t[a]))}catch(t){s={error:t}}finally{try{r&&!r.done&&(u=o.return)&&u.call(o)}finally{if(s)throw s.error}}void 0!==t.per_game&&(e=e.set("per_game",t.per_game?"1":"0"))}return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/volleyball_statistic/",{params:e}).pipe(i.map((function(t){return fe.toFront(t)}))).toPromise()]}))}))},o.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},o.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new o(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:o,providedIn:"root"}),o=d([e.Injectable({providedIn:"root"})],o)}(),Ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"usersCount",{get:function(){return this.validUsersCount+this.invalidUsersCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.hasAccess&&!this.inviteSent&&!this.alreadyInTournament},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{valid_users_count:"validUsersCount",invalid_users_count:"invalidUsersCount",has_access:"hasAccess",invite_sent:"inviteSent",already_in_tournament:"alreadyInTournament"}})],e)}(k),Be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",join_data:"joinData"},relation:{team:J,joinData:Ue}})],e)}(k),Ge=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getTeamsForJoin=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/teams_for_join/").pipe(i.map((function(t){return Be.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamUsers=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/team/"+t+"/users/").pipe(i.map((function(t){return pt.toFront(t)}))).toPromise()]}))}))},t.prototype.joinTournament=function(t,e,n){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o={team:{id:e},user_invites:ne.toBack(n)},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/tournament/"+t+"/join/",o).pipe(i.map((function(t){return ie.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),je=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/").pipe(i.map((function(t){return Te.toFront(t)}))).toPromise()]}))}))},t.prototype.getGroups=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/groups/").pipe(i.map((function(t){return mt.toFront(t)}))).toPromise()]}))}))},t.prototype.getPlayoffs=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/playoff/").pipe(i.map((function(t){return we.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_stage/"+t+"/teams/").pipe(i.map((function(t){return Ce.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{edit:"edit",personal_data:"personalData",teams:"teams",statistic:"statistic",games:"games"}})],e)}(k);(Fe=t.UserPermissionTypes||(t.UserPermissionTypes={}))[Fe.denied=1]="denied",Fe[Fe.for_all=2]="for_all",Fe[Fe.for_users=3]="for_users",Fe[Fe.for_team=4]="for_team";var Ae,Ve=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return m(n,e),n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",personal_data:"personalData",games:"games",teams:"teams",statistic:"statistic"},relation:{personalData:T(t.UserPermissionTypes),games:T(t.UserPermissionTypes),teams:T(t.UserPermissionTypes),statistic:T(t.UserPermissionTypes)}})],n)}(k),xe=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getCurrentUser=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/").pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/").pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},t.prototype.getAccess=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+(t||"current")+"/access/").pipe(i.map((function(t){return Le.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUser=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(n){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/",X.toBack(e)).pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserPhoto=function(t,e){return g(this,void 0,void 0,(function(){var n;return v(this,(function(o){return(n=new FormData).append("file",t,e),[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/photo/",n).pipe(i.map((function(t){return j.toFront(t)}))).toPromise()]}))}))},t.prototype.changePassword=function(t,e,n,i){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o={old_password:e,password:n,password_confirm:i},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/change_password/",o).toPromise()]}))}))},t.prototype.changeEmail=function(t,e,n){return g(this,void 0,void 0,(function(){var i;return v(this,(function(o){return i={email:e,password:n},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/change_email/",i).toPromise()]}))}))},t.prototype.changeEmailConfirm=function(t,e,n,i){return g(this,void 0,void 0,(function(){var o;return v(this,(function(r){return o={email:e,password:n,token:i},[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/change_email_confirm/",o).toPromise()]}))}))},t.prototype.getUserProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/profile/").pipe(i.map((function(t){return x.toFront(t)}))).toPromise()]}))}))},t.prototype.getBasketballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/basketball_profile/").pipe(i.map((function(t){return N.toFront(t)}))).toPromise()]}))}))},t.prototype.getVolleyballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/volleyball_profile/").pipe(i.map((function(t){return D.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t.userId+"/profile/",x.toBack(t)).pipe(i.map((function(t){return x.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserBasketballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t.userId+"/basketball_profile/",N.toBack(t)).pipe(i.map((function(t){return N.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserVolleyballProfile=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/"+t.userId+"/volleyball_profile/",D.toBack(t)).pipe(i.map((function(t){return D.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserPermissions=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+(t||"current")+"/permission/").pipe(i.map((function(t){return Ve.toFront(t)}))).toPromise()]}))}))},t.prototype.updateUserPermission=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.patch(this.configService.get("apiUrl")+"/api/v1/user/current/permission/",Ve.toBack(t)).pipe(i.map((function(t){return Ve.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeams=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/teams/").pipe(i.map((function(t){return J.toFront(t)}))).toPromise()]}))}))},t.prototype.getInvites=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/invites/").pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},t.prototype.acceptInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/invites/"+t+"/accept/",{}).pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},t.prototype.declineInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/invites/"+t+"/decline/",{}).pipe(i.map((function(t){return Wt.toFront(t)}))).toPromise()]}))}))},t.prototype.getStatistics=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/statistics/").pipe(i.map((function(t){return Ct.toFront(t)}))).toPromise()]}))}))},t.prototype.getStreetballStatistics=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/streetball_statistics/").pipe(i.map((function(t){return Ct.toFront(t)}))).toPromise()]}))}))},t.prototype.getVolleyballStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/volleyball_statistics/").pipe(i.map((function(t){return fe.toFront(t)}))).toPromise()]}))}))},t.prototype.getGames=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/"+t+"/games/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},t.prototype.getGameInvites=function(){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/game_invites/").pipe(i.map((function(t){return Jt.toFront(t)}))).toPromise()]}))}))},t.prototype.acceptGameInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/game_invites/"+t+"/accept/",{}).pipe(i.map((function(t){return Jt.toFront(t)}))).toPromise()]}))}))},t.prototype.declineGameInvite=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.post(this.configService.get("apiUrl")+"/api/v1/user/current/game_invites/"+t+"/decline/",{}).pipe(i.map((function(t){return Jt.toFront(t)}))).toPromise()]}))}))},t.prototype.searchUsers=function(t){return g(this,void 0,void 0,(function(){var e;return v(this,(function(o){return e=(new n.HttpParams).set("search",t),[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/",{params:e}).pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},t.prototype.setWizardShowed=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.put(this.configService.get("apiUrl")+"/api/v1/user/current/wizards/",{wizard:t}).pipe(i.map((function(t){return X.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamEvents=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/user/current/team_events/").pipe(i.map((function(t){return Kt.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{team:"team",competitor_team:"competitorTeam"},relation:{team:fe,competitorTeam:fe}})],e)}(k),Ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.gameUserId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attacks",{get:function(){return this.attackSpikes+this.attackShots},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blocks",{get:function(){return this.stuffBlocks+this.blockRebounds},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"totalReceives",{get:function(){return this.receives+this.excellentReceives},enumerable:!0,configurable:!0}),e.toFront=function(t){},e.toBack=function(t){},d([I],e,"toFront",null),d([U],e,"toBack",null),e=d([w({mappingFields:{game_user_id:"gameUserId",serve_hits:"serveHits",serve_faults:"serveFaults",serve_aces:"serveAces",stuff_blocks:"stuffBlocks",block_faults:"blockFaults",block_rebounds:"blockRebounds",attack_spikes:"attackSpikes",attack_faults:"attackFaults",attack_shots:"attackShots",receives:"receives",receive_faults:"receiveFaults",excellent_receives:"excellentReceives",serve_receives:"serveReceives",serve_receive_faults:"serveReceiveFaults",excellent_serve_receives:"excellentServeReceives",points:"points",faults:"faults"}})],e)}(k);(Ae=t.VolleyballGameLogType||(t.VolleyballGameLogType={}))[Ae.enter_game=1]="enter_game",Ae[Ae.exit_game=2]="exit_game",Ae[Ae.remove_game=3]="remove_game",Ae[Ae.serve_hit=4]="serve_hit",Ae[Ae.serve_fault=5]="serve_fault",Ae[Ae.serve_ace=6]="serve_ace",Ae[Ae.stuff_block=7]="stuff_block",Ae[Ae.block_fault=8]="block_fault",Ae[Ae.block_rebound=9]="block_rebound",Ae[Ae.attack_spike=10]="attack_spike",Ae[Ae.attack_fault=11]="attack_fault",Ae[Ae.attack_shot=12]="attack_shot",Ae[Ae.receive=13]="receive",Ae[Ae.receive_fault=14]="receive_fault",Ae[Ae.excellent_receive=15]="excellent_receive",Ae[Ae.point=16]="point",Ae[Ae.fault=17]="fault",Ae[Ae.serve_receive=18]="serve_receive",Ae[Ae.serve_receive_fault=19]="serve_receive_fault",Ae[Ae.excellent_serve_receive=20]="excellent_serve_receive",Ae[Ae.timeout=21]="timeout";var He,Ne,ze,De,Re,Me,qe,We,$e,Xe,Je,Ye=[t.VolleyballGameLogType.serve_ace,t.VolleyballGameLogType.stuff_block,t.VolleyballGameLogType.attack_spike,t.VolleyballGameLogType.point],Ze=[t.VolleyballGameLogType.serve_fault,t.VolleyballGameLogType.attack_fault,t.VolleyballGameLogType.block_fault,t.VolleyballGameLogType.receive_fault,t.VolleyballGameLogType.fault,t.VolleyballGameLogType.serve_receive_fault],Ke=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.active=!0,t}return m(n,e),n.prototype.compare=function(t){return this.rally===t.rally&&this.set===t.set?this.datetime&&t.datetime?this.datetime.getTime()<t.datetime.getTime()?1:-1:this.id<t.id?1:-1:this.set===t.set?this.rally<t.rally?1:-1:this.set<t.set?1:-1},n.prototype.isScoreType=function(){return Ye.includes(this.logType)},n.prototype.isFaultType=function(){return Ze.includes(this.logType)},n.prototype.isServe=function(){return[t.VolleyballGameLogType.serve_hit,t.VolleyballGameLogType.serve_ace,t.VolleyballGameLogType.serve_fault].includes(this.logType)},n.prototype.isAttack=function(){return[t.VolleyballGameLogType.attack_fault,t.VolleyballGameLogType.attack_spike,t.VolleyballGameLogType.attack_shot].includes(this.logType)},n.prototype.isReceive=function(){return[t.VolleyballGameLogType.receive_fault,t.VolleyballGameLogType.receive,t.VolleyballGameLogType.excellent_receive].includes(this.logType)},n.prototype.isServeReceive=function(){return[t.VolleyballGameLogType.serve_receive_fault,t.VolleyballGameLogType.serve_receive,t.VolleyballGameLogType.excellent_serve_receive].includes(this.logType)},n.prototype.isBlock=function(){return[t.VolleyballGameLogType.block_fault,t.VolleyballGameLogType.block_rebound,t.VolleyballGameLogType.stuff_block].includes(this.logType)},n.prototype.isEnterExit=function(){return[t.VolleyballGameLogType.enter_game,t.VolleyballGameLogType.exit_game,t.VolleyballGameLogType.timeout].includes(this.logType)},n.prototype.isComboType=function(){return![t.VolleyballGameLogType.receive,t.VolleyballGameLogType.serve_receive].includes(this.logType)},n.toFront=function(t){},n.toBack=function(t){},d([I],n,"toFront",null),d([U],n,"toBack",null),n=d([w({mappingFields:{id:"id",unique_id:"uniqueId",game_id:"gameId",game_user_id:"gameUserId",log_type:"logType",set:"set",rally:"rally",position:"position",team_id:"teamId",datetime:"datetime"},relation:{logType:T(t.VolleyballGameLogType),datetime:P}})],n)}(k),Qe=function(){function t(t,e){this.httpClient=t,this.configService=e}return t.prototype.getById=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/").pipe(i.map((function(t){return ct.toFront(t)}))).toPromise()]}))}))},t.prototype.getUsers=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_game/"+t+"/users/").pipe(i.map((function(t){return gt.toFront(t)}))).toPromise()]}))}))},t.prototype.getTeamStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/team_statistic/").pipe(i.map((function(t){return Oe.toFront(t)}))).toPromise()]}))}))},t.prototype.getUserStatistic=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/user_statistic/").pipe(i.map((function(t){return Ee.toFront(t)}))).toPromise()]}))}))},t.prototype.getLogs=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/tournament_volleyball_game/"+t+"/logs/").pipe(i.map((function(t){return Ke.toFront(t)}))).toPromise()]}))}))},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),tn=((He={})[t.BasketballGameLogTypes.enter_game]="Выход на площадку",He[t.BasketballGameLogTypes.exit_game]="Ушел с площадки",He[t.BasketballGameLogTypes.remove_game]="Удаление с площадки",He[t.BasketballGameLogTypes.two_point_attempt]="Бросок 2 очка",He[t.BasketballGameLogTypes.three_point_attempt]="Бросок 3 очка",He[t.BasketballGameLogTypes.free_throw_attempt]="Штрафной бросок",He[t.BasketballGameLogTypes.one_point_attempt]="Бросок 1 очко",He[t.BasketballGameLogTypes.two_point_made]="2 очка",He[t.BasketballGameLogTypes.three_point_made]="3 очка",He[t.BasketballGameLogTypes.free_throw_made]="1 очко, штрафной",He[t.BasketballGameLogTypes.one_point_made]="1 очко",He[t.BasketballGameLogTypes.assist]="Передача",He[t.BasketballGameLogTypes.block]="Блокшот",He[t.BasketballGameLogTypes.rebound]="Подбор",He[t.BasketballGameLogTypes.offensive_rebound]="Подбор в нападении",He[t.BasketballGameLogTypes.defensive_rebound]="Подбор в защите",He[t.BasketballGameLogTypes.steal]="Перехват",He[t.BasketballGameLogTypes.turnover]="Потеря",He[t.BasketballGameLogTypes.personal_foul]="Фол",He[t.BasketballGameLogTypes.technical_foul]="Технический фол",He[t.BasketballGameLogTypes.unsportsmanlike_foul]="Неспортиный фол",He[t.BasketballGameLogTypes.timeout]="Таймаут",He),en=((Ne={})[t.OvertimeTypes.to_score_diff]="До разницы в N мячей",Ne[t.OvertimeTypes.to_score_total]="До N очков",Ne[t.OvertimeTypes.time]="По времени",Ne),nn=((ze={})[t.TeamUserRole.moderator]="Модератор",ze[t.TeamUserRole.member]="Пользователь",ze[t.TeamUserRole.admin]="Владелец",ze),on=((De={})[t.GameBasketballPosition.point_guard]="Разыгрывающий защитник",De[t.GameBasketballPosition.shooting_guard]="Атакующий защитник",De[t.GameBasketballPosition.small_forward]="Легкий форвард",De[t.GameBasketballPosition.power_forward]="Мощный форвард",De[t.GameBasketballPosition.center]="Центровой",De),rn=((Re={})[t.GameBasketballPosition.point_guard]="PG",Re[t.GameBasketballPosition.shooting_guard]="SG",Re[t.GameBasketballPosition.small_forward]="SF",Re[t.GameBasketballPosition.power_forward]="PF",Re[t.GameBasketballPosition.center]="C",Re),an=((Me={})[t.WorkHand.left]="Левая",Me[t.WorkHand.right]="Правая",Me),sn=((qe={})[t.GameVolleyballPosition.setter]="Связующий",qe[t.GameVolleyballPosition.libero]="Либеро",qe[t.GameVolleyballPosition.middle_player]="Центральный блокирующий",qe[t.GameVolleyballPosition.receiver_attacker]="Доигровщик",qe[t.GameVolleyballPosition.dioganal]="Диагональный",qe),un=((We={})[t.GameVolleyballPosition.setter]="S",We[t.GameVolleyballPosition.libero]="L",We[t.GameVolleyballPosition.middle_player]="MP",We[t.GameVolleyballPosition.receiver_attacker]="RA",We[t.GameVolleyballPosition.dioganal]="D",We),ln=(($e={})[t.GameVolleyballPosition.setter]="связ.",$e[t.GameVolleyballPosition.libero]="либеро",$e[t.GameVolleyballPosition.middle_player]="блок.",$e[t.GameVolleyballPosition.receiver_attacker]="доигр.",$e[t.GameVolleyballPosition.dioganal]="диаг.",$e),cn=((Xe={})[t.VolleyballWorkHand.left]="Левая",Xe[t.VolleyballWorkHand.right]="Правая",Xe),pn=((Je={})[t.VolleyballGameLogType.enter_game]="Выход на площадку",Je[t.VolleyballGameLogType.exit_game]="Уход с площадки",Je[t.VolleyballGameLogType.remove_game]="Удаление с площадки",Je[t.VolleyballGameLogType.serve_ace]="Эйс",Je[t.VolleyballGameLogType.serve_hit]="Подача",Je[t.VolleyballGameLogType.serve_fault]="Ошибка на подаче",Je[t.VolleyballGameLogType.attack_spike]="Результативная атака",Je[t.VolleyballGameLogType.attack_shot]="Успешная атака",Je[t.VolleyballGameLogType.attack_fault]="Ошибка атаки",Je[t.VolleyballGameLogType.stuff_block]="Результативный блок",Je[t.VolleyballGameLogType.block_rebound]="Успешный блок",Je[t.VolleyballGameLogType.block_fault]="Ошибка на блоке",Je[t.VolleyballGameLogType.excellent_receive]="Отличный прием",Je[t.VolleyballGameLogType.receive]="Прием",Je[t.VolleyballGameLogType.receive_fault]="Ошибка на приеме",Je[t.VolleyballGameLogType.serve_receive]="Прием подачи",Je[t.VolleyballGameLogType.excellent_serve_receive]="Отличный прием подачи",Je[t.VolleyballGameLogType.serve_receive_fault]="Ошибка приема подачи",Je[t.VolleyballGameLogType.point]="Очко",Je[t.VolleyballGameLogType.fault]="Ошибка",Je[t.VolleyballGameLogType.timeout]="Таймаут",Je),mn=function(){function t(t,e){this.httpClient=t,this.configService=e,this.channels$={},this.subscriptions={}}return t.prototype.listen=function(t){var e=this;if(t in this.channels$)return this.channels$[t];this.channels$[t]=new r.Subject;var n=this.connect().subscribe((function(i){e.subscriptions[t]=e.addEngineSubscription(t),setTimeout((function(){n.unsubscribe()}))}));return this.channels$[t]},t.prototype.unsubscribe=function(t){this.subscriptions[t]&&(this.subscriptions[t].unsubscribe(),delete this.subscriptions[t]),this.channels$[t]&&(this.channels$[t].complete(),delete this.channels$[t])},t.prototype.connect=function(){var t=this;return this.initializeEngineSubject||(this.initializeEngineSubject=new a.ReplaySubject(1),this.httpClient.get(this.configService.get("apiUrl")+"/api/v1/centrifugo/").subscribe((function(e){t.initializeEngine({url:t.configService.get("centrifugoUrl"),user:e.user,timestamp:e.timestamp,token:e.token,transports:["websocket"]}),t.centrifuge.connect(),t.centrifuge.on("connect",(function(){t.initializeEngineSubject.next(!0)}))}))),this.initializeEngineSubject},t.prototype.publish=function(t,e){var n=this;return new o.Observable((function(i){n.connect().subscribe((function(){n.subscriptions[t]||(n.subscriptions[t]=n.addEngineSubscription(t)),n.subscriptions[t].publish(e).then((function(t){i.next(t),i.complete()}),(function(t){throw t}))}))}))},t.prototype.disconnect=function(){this.centrifuge.disconnect(),this.initializeEngineSubject=void 0,this.channels$={},this.subscriptions={}},t.prototype.initializeEngine=function(t){this.centrifuge=new s(t)},t.prototype.addEngineSubscription=function(t){return this.centrifuge.subscribe(t,this.resolveMessage.bind(this))},t.prototype.resolveMessage=function(t){var e=t.channel;this.channels$[e]&&this.channels$[e].next(t.data)},t.ctorParameters=function(){return[{type:n.HttpClient},{type:wt}]},t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(n.HttpClient),e.ɵɵinject(wt))},token:t,providedIn:"root"}),t=d([e.Injectable({providedIn:"root"})],t)}(),fn=function(){function t(t,e){this.modelClass=e,this.defaultValue=t}return t.prototype.toFront=function(t){return this.modelClass?this.modelClass.toFront(t):t},t.prototype.toBack=function(t){return this.modelClass?this.modelClass.toBack(t):t},t}(),dn=function(){function t(t,e){this.name=t,this.fields=e}return t.prototype.addField=function(t,e){this.fields[t]=e},t.prototype.save=function(t,e){this.fields[t]&&this.setItem(this.name+"_"+t,this.fields[t].toBack(e))},t.prototype.get=function(t){if(this.fields[t]){var e=this.getItem(this.name+"_"+t);return null===e&&(e=this.fields[t].defaultValue),null==e?e:this.fields[t].toFront(e)}},t.prototype.clear=function(){var t,e;try{for(var n=_(Object.keys(this.fields)),i=n.next();!i.done;i=n.next()){var o=i.value;this.removeItem(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.getItem=function(t){throw new Error("Function getItem for store engine "+typeof this+" not implemented")},t.prototype.setItem=function(t,e){throw new Error("Function setItem for store engine "+typeof this+" not implemented")},t.prototype.removeItem=function(t){throw new Error("Function deleteItem for store engine "+typeof this+" not implemented")},t}(),hn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.setItem=function(t,e){localStorage.setItem(t,JSON.stringify(e))},e.prototype.getItem=function(t){try{return JSON.parse(localStorage.getItem(t))}catch(t){return}},e.prototype.removeItem=function(t){localStorage.removeItem(t)},e}(dn);function gn(t){var e=("; "+document.cookie).split("; "+t+"=");return 2===e.length?e.pop().split(";").shift():null}function vn(t){return[{rel:"apple-touch-icon",sizes:"180x180",href:"/assets/favicon/"+t+"apple-touch-icon.png"},{rel:"icon",type:"image/png",sizes:"32x32",href:"/assets/favicon/"+t+"favicon-32x32.png"},{rel:"icon",type:"image/png",sizes:"16x16",href:"/assets/favicon/"+t+"favicon-16x16.png"},{rel:"shortcut icon",href:"/assets/favicon/"+t+"favicon.ico"},{rel:"manifest",href:"/assets/favicon/"+t+"site.webmanifest"},{rel:"mask-icon",href:"/assets/favicon/"+t+"safari-pinned-tab.svg",color:"#ff0000"}]}var _n=function(){function t(t,e){this.injector=t,this.platformId=e,this.isBrowser=c.isPlatformBrowser(this.platformId)}return t.prototype.intercept=function(t,e){if(!this.isBrowser)return e.handle(t);t=t.clone({withCredentials:!0});var n=gn("csrftoken");return n&&(t=t.clone({setHeaders:{"X-CSRFToken":n}})),e.handle(t)},t.ctorParameters=function(){return[{type:e.Injector},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t=d([e.Injectable(),h(1,e.Inject(e.PLATFORM_ID))],t)}();t.BaseModel=k,t.BaseService=Pt,t.BasketballGameApi=jt,t.BasketballGameConfig=it,t.BasketballGameLog=Gt,t.BasketballGameLogTypeLocalization=tn,t.BasketballGameStatistic=Ut,t.BasketballGameTeamStatistic=It,t.BasketballProfile=N,t.BasketballStatistic=Ct,t.CONFIG_DATA="mtg-core-config-data",t.CentrifugoService=mn,t.City=O,t.ConfigService=wt,t.DateField=F,t.DateTimeField=P,t.FAULT_LOG_TYPES=Ze,t.Feedback=Lt,t.FeedbackApi=At,t.File=j,t.FileApi=Vt,t.Game=ct,t.GameBasketballPositionLocalization=on,t.GameBasketballPositionShortLocalization=rn,t.GameInvite=Jt,t.GameTimelineStageItem=be,t.GameTimelineStages=ke,t.GameUser=gt,t.GameVolleyballPositionLocalization=sn,t.GameVolleyballPositionShortLocalization=un,t.GameVolleyballPositionShortRuLocalization=ln,t.HttpCookieInterceptor=_n,t.League=Z,t.LeagueApi=Ht,t.LeagueCourt=st,t.LeagueNews=xt,t.LeagueNewsApi=Nt,t.LocalStorageEngine=hn,t.MediaApi=zt,t.MediaItem=ut,t.ModelInstance=w,t.Notification=re,t.NotificationApi=le,t.NotificationBaseApi=ue,t.NotificationSettings=se,t.OrgNotificationApi=ce,t.Organization=Y,t.OvertimeTypeLocalization=en,t.Playoff=we,t.PlayoffSettings=Pe,t.Poll=qt,t.PollAnswer=Mt,t.PollVariant=Rt,t.ReferenceApi=pe,t.SCORE_LOG_TYPES=Ye,t.Sport=V,t.StorageEngine=dn,t.StorageEngineField=fn,t.Store=Ft,t.Team=J,t.TeamAccess=ge,t.TeamApi=ve,t.TeamEvent=Kt,t.TeamEventApi=_e,t.TeamEventInvite=ee,t.TeamEventTypeLocalization=Zt,t.TeamInvite=Wt,t.TeamInviteExternal=me,t.TeamPermission=he,t.TeamUser=pt,t.TeamUserRoleLocalization=nn,t.ToBackHook=U,t.ToFrontHook=I,t.Tournament=et,t.TournamentApi=Ie,t.TournamentDisqualification=dt,t.TournamentEvent=Et,t.TournamentGroup=mt,t.TournamentInvite=ie,t.TournamentJoinApi=Ge,t.TournamentJoinData=Ue,t.TournamentJoinTeam=Be,t.TournamentNews=ye,t.TournamentSettings=Q,t.TournamentStage=Te,t.TournamentStageApi=je,t.TournamentStageTeam=Ce,t.TournamentTeam=ft,t.TournamentTeamUser=ht,t.TournamentTeamUserInvite=ne,t.TournamentTeamWinner=tt,t.UntilDestroy=function(t){var e,n=(e=t).ɵcmp||e.ɵdir,i=n.onDestroy;t.__componentDestroyed$=new r.Subject,n.onDestroy=function(){t.__componentDestroyed$.next(),t.__componentDestroyed$.complete(),i.apply(this)}},t.User=X,t.UserAccess=Le,t.UserApi=xe,t.UserPermission=Ve,t.UserProfile=x,t.VolleyballGameApi=Qe,t.VolleyballGameConfig=at,t.VolleyballGameLog=Ke,t.VolleyballGameLogTypeLocalization=pn,t.VolleyballGameStatistic=Ee,t.VolleyballGameTeamStatistic=Oe,t.VolleyballProfile=D,t.VolleyballStatistic=fe,t.VolleyballWorkHandLocalization=cn,t.WorkHandLocalization=an,t.addItemInArray=yt,t.changeFavicons=function(t,e){var n,i,o,r,a="";"ablmoscow"===e&&(a="abl/");var s=vn(a);try{for(var u=_(s),l=u.next();!l.done;l=u.next()){var c=l.value,p=t.createElement("link");try{for(var m=(o=void 0,_(Object.keys(c))),f=m.next();!f.done;f=m.next()){var d=f.value;p.setAttribute(d,c[d])}}catch(t){o={error:t}}finally{try{f&&!f.done&&(r=m.return)&&r.call(m)}finally{if(o)throw o.error}}t.head.appendChild(p)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}},t.componentDestroyed=function(t){if(t.constructor.__componentDestroyed$)return t.constructor.__componentDestroyed$;throw new Error("Use @UntilDestroy decorator in class")},t.deleteItemFromArray=kt,t.enumField=T,t.fileSizeValidator=function(t){return function(t){if(!t.value)return null}},t.generateArray=Se,t.getArrayChunks=function(t,e){var n=[],i=Math.ceil(t.length/e);if(0===i)return[t];for(var o=0;o<i;o++)n.push(t.slice(o*e,(o+1)*e));return n},t.getCookie=gn,t.getEnumOptions=function(t){return Object.keys(t).map((function(e){return t[e]})).filter((function(t){return!1===isNaN(+t)})).map((function(t){return+t}))},t.getIconsData=vn,t.handleError=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),(!t||0!==t.status&&404!==t.status||e&&0!==t.status)&&u.captureException(t),n||console.error(t)},t.isTouchDevice=function(){var t=" -webkit- -moz- -o- -ms- ".split(" ");if("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch)return!0;var e,n=["(",t.join("touch-enabled),("),"heartz",")"].join("");return e=n,window.matchMedia(e).matches},t.listField=S,t.markFormGroupTouched=function t(e){Object.values(e.controls).forEach((function(e){e.markAsTouched(),e.markAsDirty(),e instanceof l.FormGroup?t(e):e.controls&&e.controls.forEach((function(e){e instanceof l.FormGroup?t(e):(e.markAsTouched(),e.markAsDirty())}))}))},t.minLengthArrayValidator=function(t){return function(e){return e.value.length<t?{minLengthArray:{valid:!1}}:null}},t.patchItemInArray=function(t,e,n){return Array.isArray(t)?t.map((function(t){if(n&&Tt(n)){if(!n(t))return t}else if(t.id!==e.id)return t;return Object.assign(t,e)})):t},t.updateItemInArray=vt,t.updateItemsInArray=_t,t.validateDate=function(t){return!t.value||/\d{2}\.\d{2}\.\d{4}/gi.test(t.value)?null:{invalidDate:{valid:!1}}},t.validateEmail=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=[]);var r=o.of(null).pipe(i.delay(500));return function(a){return n.indexOf(a.value)>-1?o.of(null):r.pipe(i.switchMap((function(){return t.checkEmail(a.value,e).pipe(i.map((function(t){return t?null:{emailTaken:!0}})))})))}},t.validatePhone=function(t){return t.value?11===(""+t.value).replace(/\D/gi,"").length?null:{invalidPhone:{valid:!1}}:null},t.validateUrl=function(t){return!t.value||/^(?:http(s)?:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(t.value)?null:{invalidUrl:!0}},Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=mtgame-core.umd.min.js.map