UNPKG

otus-localization

Version:

A translation tool for Angular i18n(angular-t9n)

1 lines 25.4 kB
"use strict";(self.webpackChunkotus_translation=self.webpackChunkotus_translation||[]).push([[156],{7125:(j,_,o)=>{o.d(_,{C:()=>m});var T=o(9862);function m(d){let c=new T.LE;return d.page&&(c=c.set("page",d.page.toString())),d.entriesPerPage&&(c=c.set("entriesPerPage",d.entriesPerPage.toString())),d.sort&&d.sort.active&&d.sort.direction&&(c=c.set("sort",`${"desc"===d.sort.direction?"!":""}${d.sort.active}`)),d.filter&&(c=Object.keys(d.filter).filter(g=>d.filter[g]).reduce((g,e)=>g.set(e,d.filter[e]),c)),c}},8343:(j,_,o)=>{o.r(_),o.d(_,{ImportComponent:()=>Ee});var T=o(5861),m=o(6814),d=o(6223),c=o(2296),g=o(3680),e=o(5879),D=o(8337),f=o(2495),v=o(8645),Z=o(7394);let z=0;const M=new e.OlP("CdkAccordion");let $=(()=>{class n{constructor(){this._stateChanges=new v.x,this._openCloseAllActions=new v.x,this.id="cdk-accordion-"+z++,this._multi=!1}get multi(){return this._multi}set multi(t){this._multi=(0,f.Ig)(t)}openAll(){this._multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(t){this._stateChanges.next(t)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275dir=e.lG2({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:"multi"},exportAs:["cdkAccordion"],features:[e._Bn([{provide:M,useExisting:n}]),e.TTD]})}}return n})(),X=0,G=(()=>{class n{get expanded(){return this._expanded}set expanded(t){t=(0,f.Ig)(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,f.Ig)(t)}constructor(t,i,a){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=a,this._openCloseAllSubscription=Z.w0.EMPTY,this.closed=new e.vpe,this.opened=new e.vpe,this.destroyed=new e.vpe,this.expandedChange=new e.vpe,this.id="cdk-accordion-child-"+X++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=a.listen((r,s)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===s&&this.id!==r&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}static{this.\u0275fac=function(i){return new(i||n)(e.Y36(M,12),e.Y36(e.sBO),e.Y36(D.A8))}}static{this.\u0275dir=e.lG2({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[e._Bn([{provide:M,useValue:void 0}])]})}}return n})(),V=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({})}}return n})();var P=o(8484),w=o(4300),K=o(3997),O=o(7921),b=o(2181),H=o(8180),C=o(6028),W=o(6232),q=o(3019),p=o(6825);const ee=["body"];function te(n,l){}const ne=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],ie=["mat-expansion-panel-header","*","mat-action-row"];function ae(n,l){if(1&n&&e._UZ(0,"span",2),2&n){const t=e.oxw();e.Q6J("@indicatorRotate",t._getExpandedState())}}const oe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],se=["mat-panel-title","mat-panel-description","*"],E=new e.OlP("MAT_ACCORDION"),S="225ms cubic-bezier(0.4,0.0,0.2,1)",F={indicatorRotate:(0,p.X$)("indicatorRotate",[(0,p.SB)("collapsed, void",(0,p.oB)({transform:"rotate(0deg)"})),(0,p.SB)("expanded",(0,p.oB)({transform:"rotate(180deg)"})),(0,p.eR)("expanded <=> collapsed, void => collapsed",(0,p.jt)(S))]),bodyExpansion:(0,p.X$)("bodyExpansion",[(0,p.SB)("collapsed, void",(0,p.oB)({height:"0px",visibility:"hidden"})),(0,p.SB)("expanded",(0,p.oB)({height:"*",visibility:""})),(0,p.eR)("expanded <=> collapsed, void => collapsed",(0,p.jt)(S))])},N=new e.OlP("MAT_EXPANSION_PANEL");let re=(()=>{class n{constructor(t,i){this._template=t,this._expansionPanel=i}static{this.\u0275fac=function(i){return new(i||n)(e.Y36(e.Rgc),e.Y36(N,8))}}static{this.\u0275dir=e.lG2({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}}return n})(),de=0;const k=new e.OlP("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let B=(()=>{class n extends G{get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=(0,f.Ig)(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}constructor(t,i,a,r,s,x,A){super(t,i,a),this._viewContainerRef=r,this._animationMode=x,this._hideToggle=!1,this.afterExpand=new e.vpe,this.afterCollapse=new e.vpe,this._inputChanges=new v.x,this._headerId="mat-expansion-panel-header-"+de++,this._bodyAnimationDone=new v.x,this.accordion=t,this._document=s,this._bodyAnimationDone.pipe((0,K.x)((u,h)=>u.fromState===h.fromState&&u.toState===h.toState)).subscribe(u=>{"void"!==u.fromState&&("expanded"===u.toState?this.afterExpand.emit():"collapsed"===u.toState&&this.afterCollapse.emit())}),A&&(this.hideToggle=A.hideToggle)}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe((0,O.O)(null),(0,b.h)(()=>this.expanded&&!this._portal),(0,H.q)(1)).subscribe(()=>{this._portal=new P.UE(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}static{this.\u0275fac=function(i){return new(i||n)(e.Y36(E,12),e.Y36(e.sBO),e.Y36(D.A8),e.Y36(e.s_b),e.Y36(m.K0),e.Y36(e.QbO,8),e.Y36(k,8))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(i,a,r){if(1&i&&e.Suo(r,re,5),2&i){let s;e.iGM(s=e.CRH())&&(a._lazyContent=s.first)}},viewQuery:function(i,a){if(1&i&&e.Gf(ee,5),2&i){let r;e.iGM(r=e.CRH())&&(a._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(i,a){2&i&&e.ekj("mat-expanded",a.expanded)("_mat-animation-noopable","NoopAnimations"===a._animationMode)("mat-expansion-panel-spacing",a._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[e._Bn([{provide:E,useValue:void 0},{provide:N,useExisting:n}]),e.qOj,e.TTD],ngContentSelectors:ie,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(i,a){1&i&&(e.F$t(ne),e.Hsn(0),e.TgZ(1,"div",0,1),e.NdJ("@bodyExpansion.done",function(s){return a._bodyAnimationDone.next(s)}),e.TgZ(3,"div",2),e.Hsn(4,1),e.YNc(5,te,0,0,"ng-template",3),e.qZA(),e.Hsn(6,2),e.qZA()),2&i&&(e.xp6(1),e.Q6J("@bodyExpansion",a._getExpandedState())("id",a.id),e.uIk("aria-labelledby",a._headerId),e.xp6(4),e.Q6J("cdkPortalOutlet",a._portal))},dependencies:[P.Pl],styles:['.mat-expansion-panel{--mat-expansion-container-shape:4px;box-sizing:content-box;display:block;margin:0;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative;background:var(--mat-expansion-container-background-color);color:var(--mat-expansion-container-text-color);border-radius:var(--mat-expansion-container-shape)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape);border-top-left-radius:var(--mat-expansion-container-shape)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape);border-bottom-left-radius:var(--mat-expansion-container-shape)}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;font-family:var(--mat-expansion-container-text-font);font-size:var(--mat-expansion-container-text-size);font-weight:var(--mat-expansion-container-text-weight);line-height:var(--mat-expansion-container-text-line-height);letter-spacing:var(--mat-expansion-container-text-tracking)}.mat-expansion-panel-content[style*="visibility: hidden"] *{visibility:hidden !important}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color)}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}'],encapsulation:2,data:{animation:[F.bodyExpansion]},changeDetection:0})}}return n})();class le{}const pe=(0,g.sb)(le);let U=(()=>{class n extends pe{constructor(t,i,a,r,s,x,A){super(),this.panel=t,this._element=i,this._focusMonitor=a,this._changeDetectorRef=r,this._animationMode=x,this._parentChangeSubscription=Z.w0.EMPTY;const u=t.accordion?t.accordion._stateChanges.pipe((0,b.h)(h=>!(!h.hideToggle&&!h.togglePosition))):W.E;this.tabIndex=parseInt(A||"")||0,this._parentChangeSubscription=(0,q.T)(t.opened,t.closed,u,t._inputChanges.pipe((0,b.h)(h=>!!(h.hideToggle||h.disabled||h.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe((0,b.h)(()=>t._containsFocus())).subscribe(()=>a.focusVia(i,"program")),s&&(this.expandedHeight=s.expandedHeight,this.collapsedHeight=s.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case C.L_:case C.K5:(0,C.Vb)(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}static{this.\u0275fac=function(i){return new(i||n)(e.Y36(B,1),e.Y36(e.SBq),e.Y36(w.tE),e.Y36(e.sBO),e.Y36(k,8),e.Y36(e.QbO,8),e.$8M("tabindex"))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(i,a){1&i&&e.NdJ("click",function(){return a._toggle()})("keydown",function(s){return a._keydown(s)}),2&i&&(e.uIk("id",a.panel._headerId)("tabindex",a.tabIndex)("aria-controls",a._getPanelId())("aria-expanded",a._isExpanded())("aria-disabled",a.panel.disabled),e.Udp("height",a._getHeaderHeight()),e.ekj("mat-expanded",a._isExpanded())("mat-expansion-toggle-indicator-after","after"===a._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===a._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===a._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[e.qOj],ngContentSelectors:se,decls:5,vars:3,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(i,a){1&i&&(e.F$t(oe),e.TgZ(0,"span",0),e.Hsn(1),e.Hsn(2,1),e.Hsn(3,2),e.qZA(),e.YNc(4,ae,1,1,"span",1)),2&i&&(e.ekj("mat-content-hide-toggle",!a._showToggle()),e.xp6(4),e.Q6J("ngIf",a._showToggle()))},dependencies:[m.O5],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-expansion-header-collapsed-state-height);font-family:var(--mat-expansion-header-text-font);font-size:var(--mat-expansion-header-text-size);font-weight:var(--mat-expansion-header-text-weight);line-height:var(--mat-expansion-header-text-line-height);letter-spacing:var(--mat-expansion-header-text-tracking)}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color)}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color)}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color)}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color)}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color)}.cdk-high-contrast-active .mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}'],encapsulation:2,data:{animation:[F.indicatorRotate]},changeDetection:0})}}return n})(),ce=(()=>{class n extends ${constructor(){super(...arguments),this._ownHeaders=new e.n_E,this._hideToggle=!1,this.displayMode="default",this.togglePosition="after"}get hideToggle(){return this._hideToggle}set hideToggle(t){this._hideToggle=(0,f.Ig)(t)}ngAfterContentInit(){this._headers.changes.pipe((0,O.O)(this._headers)).subscribe(t=>{this._ownHeaders.reset(t.filter(i=>i.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new w.Em(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(t){this._keyManager.onKeydown(t)}_handleHeaderFocus(t){this._keyManager.updateActiveItem(t)}ngOnDestroy(){super.ngOnDestroy(),this._keyManager?.destroy(),this._ownHeaders.destroy()}static{this.\u0275fac=function(){let t;return function(a){return(t||(t=e.n5z(n)))(a||n)}}()}static{this.\u0275dir=e.lG2({type:n,selectors:[["mat-accordion"]],contentQueries:function(i,a,r){if(1&i&&e.Suo(r,U,5),2&i){let s;e.iGM(s=e.CRH())&&(a._headers=s)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(i,a){2&i&&e.ekj("mat-accordion-multi",a.multi)},inputs:{multi:"multi",hideToggle:"hideToggle",displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[e._Bn([{provide:E,useExisting:n}]),e.qOj]})}}return n})(),me=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=e.oAB({type:n})}static{this.\u0275inj=e.cJS({imports:[m.ez,g.BQ,V,P.eL]})}}return n})();var y=o(5683),I=o(1919),R=o(5940),Y=o(8525),he=o(1896),L=o(5619),ge=o(4664),ue=o(9397),J=o(9992),Q=o(2939),xe=o(7289),fe=o(9862);function _e(n,l){1&n&&(e.TgZ(0,"p"),e._uU(1," The import expects the columns to be in order of "),e.TgZ(2,"code"),e._uU(3,"Id, Description, Meaning, Source, Target"),e.qZA(),e._uU(4,". The first row is skipped, since it is assumed to be a header row.\n"),e.qZA())}function ve(n,l){1&n&&e._UZ(0,"mat-spinner")}function be(n,l){if(1&n&&(e.TgZ(0,"mat-list-item"),e._uU(1),e.qZA()),2&n){const t=l.$implicit;e.xp6(1),e.Oqu(t)}}function ye(n,l){if(1&n&&(e.TgZ(0,"mat-expansion-panel")(1,"mat-expansion-panel-header"),e._uU(2,"Files for which the import failed (e.g. invalid, empty or malformed file)"),e.qZA(),e.TgZ(3,"mat-list"),e.YNc(4,be,2,1,"mat-list-item",10),e.qZA()()),2&n){const t=e.oxw().ngIf;e.xp6(4),e.Q6J("ngForOf",t.failedFiles)}}function Ae(n,l){if(1&n&&(e.TgZ(0,"mat-list-item")(1,"h4",11),e._uU(2),e.qZA(),e.TgZ(3,"p",11),e._uU(4),e.qZA()()),2&n){const t=l.$implicit;e.xp6(2),e.Oqu(t.id),e.xp6(2),e.Oqu(t.source)}}function Te(n,l){if(1&n&&(e.TgZ(0,"mat-expansion-panel")(1,"mat-expansion-panel-header"),e._uU(2,"Units for which the import failed (e.g. unit id does not exist)"),e.qZA(),e.TgZ(3,"mat-list"),e.YNc(4,Ae,5,2,"mat-list-item",10),e.qZA()()),2&n){const t=e.oxw().ngIf;e.xp6(4),e.Q6J("ngForOf",t.failedUnits)}}function Me(n,l){if(1&n&&(e.TgZ(0,"mat-list-item")(1,"h4",11),e._uU(2),e.qZA(),e.TgZ(3,"p",11),e._uU(4),e.qZA()()),2&n){const t=l.$implicit;e.xp6(2),e.Oqu(t.id),e.xp6(2),e.Oqu(t.source)}}function Pe(n,l){if(1&n&&(e.TgZ(0,"mat-expansion-panel")(1,"mat-expansion-panel-header"),e._uU(2,"Imported units"),e.qZA(),e.TgZ(3,"mat-list"),e.YNc(4,Me,5,2,"mat-list-item",10),e.qZA()()),2&n){const t=e.oxw().ngIf;e.xp6(4),e.Q6J("ngForOf",t.importedUnits)}}function Ce(n,l){if(1&n&&(e.ynx(0),e.TgZ(1,"h3"),e._uU(2,"Import result"),e.qZA(),e.TgZ(3,"mat-accordion",9),e.YNc(4,ye,5,1,"mat-expansion-panel",2),e.YNc(5,Te,5,1,"mat-expansion-panel",2),e.YNc(6,Pe,5,1,"mat-expansion-panel",2),e.qZA(),e.BQk()),2&n){const t=l.ngIf;e.xp6(4),e.Q6J("ngIf",t.failedFiles.length),e.xp6(1),e.Q6J("ngIf",t.failedUnits.length),e.xp6(1),e.Q6J("ngIf",t.importedUnits.length)}}let Ee=(()=>{class n{constructor(t,i,a,r){this._importService=t,this.common=i,this.http=a,this.snackBar=r,this.dragging=!1,this.importing=new L.X(!1),this.importResult=new L.X(void 0),this.targetState=new d.p4("translated")}onDragOver(t){t.preventDefault(),t.stopPropagation(),this.dragging=!0}onDragLeave(t){t.preventDefault(),t.stopPropagation(),this.dragging=!1}onDrop(t){t.preventDefault(),t.stopPropagation(),this.dragging=!1,t.dataTransfer?.files.length&&this._import(t.dataTransfer.files)}onInput(t){t?.target?.files&&this._import(t.target.files)}_import(t){var i=this;return(0,T.Z)(function*(){i.importResult.next(void 0),i.importing.next(!0),i.common.fileFormat.pipe((0,H.q)(1),(0,ge.w)(a=>"Excel"===a?i._importService.import(t,i.targetState.value):i._importService.importJson(t,i.targetState.value))).subscribe({next:a=>{i.importResult.next(a)},complete:()=>{i.importing.next(!1)}})})()}loadFile(){this.http.get("/api/targets/loadTranslatedFile",{responseType:"arraybuffer"}).pipe((0,ue.b)(()=>{this.common.loading$.next(!0)})).subscribe({next:t=>{const i=[new File([t],"target.json")];this._importService.importJson(i,"translated").then(()=>{this.snackBar.open("Load Success","",{horizontalPosition:"center",verticalPosition:"top",duration:2e3})}).catch(()=>{this.snackBar.open("Load Failed","ERROR",{horizontalPosition:"center",verticalPosition:"top",duration:3e3})})},error:()=>{this.snackBar.open("Load Failed","ERROR",{horizontalPosition:"center",verticalPosition:"top",duration:3e3})}})}static{this.\u0275fac=function(i){return new(i||n)(e.Y36(J.Y),e.Y36(xe.v),e.Y36(fe.eN),e.Y36(Q.ux))}}static{this.\u0275cmp=e.Xpm({type:n,selectors:[["t9n-import"]],hostVars:2,hostBindings:function(i,a){1&i&&e.NdJ("dragover",function(s){return a.onDragOver(s)})("dragleave",function(s){return a.onDragLeave(s)})("drop",function(s){return a.onDrop(s)}),2&i&&e.ekj("dragging",a.dragging)},standalone:!0,features:[e._Bn([J.Y]),e.jDz],decls:40,vars:26,consts:[["type","button","mat-raised-button","",3,"click"],["routerLink","../export"],[4,"ngIf"],[3,"formControl"],["value","translated"],["value","reviewed"],["value","final"],["type","file","multiple","",3,"accept","change"],["fileInput",""],["multi","true"],[4,"ngFor","ngForOf"],["mat-line",""]],template:function(i,a){if(1&i){const r=e.EpF();e.TgZ(0,"h2"),e._uU(1),e.ALo(2,"async"),e.qZA(),e.TgZ(3,"button",0),e.NdJ("click",function(){return a.loadFile()}),e._uU(4,"Auto Load File(\u52a0\u8f7d\u6587\u4ef6)"),e.qZA(),e._UZ(5,"br"),e.TgZ(6,"p"),e._uU(7),e.ALo(8,"async"),e.TgZ(9,"a",1),e._uU(10,"Export"),e.qZA(),e._uU(11,".\n"),e.qZA(),e.YNc(12,_e,5,0,"p",2),e.ALo(13,"async"),e.TgZ(14,"p"),e._uU(15),e.ALo(16,"lowercase"),e.ALo(17,"async"),e.qZA(),e.TgZ(18,"mat-form-field")(19,"mat-label"),e._uU(20,"Target state"),e.qZA(),e.TgZ(21,"mat-select",3)(22,"mat-option",4),e._uU(23,"Translated"),e.qZA(),e.TgZ(24,"mat-option",5),e._uU(25,"Reviewed"),e.qZA(),e.TgZ(26,"mat-option",6),e._uU(27,"Final"),e.qZA()(),e.TgZ(28,"mat-hint"),e._uU(29,"The imported units will be assigned to this state"),e.qZA()(),e.TgZ(30,"button",0),e.NdJ("click",function(){e.CHM(r);const x=e.MAs(33);return e.KtG(x.click())}),e._uU(31,"Choose File"),e.qZA(),e.TgZ(32,"input",7,8),e.NdJ("change",function(x){return a.onInput(x)}),e.ALo(34,"async"),e.ALo(35,"async"),e.qZA(),e.YNc(36,ve,1,0,"mat-spinner",2),e.ALo(37,"async"),e.YNc(38,Ce,7,3,"ng-container",2),e.ALo(39,"async")}2&i&&(e.xp6(1),e.hij("Import translation units from ",e.lcZ(2,8,a.common.fileFormat),""),e.xp6(6),e.hij(" Import all translation units from an ",e.lcZ(8,10,a.common.fileFormat)," file. This is intended to be used with "),e.xp6(5),e.Q6J("ngIf","Excel"===e.lcZ(13,12,a.common.fileFormat)),e.xp6(3),e.hij(".",e.lcZ(16,14,e.lcZ(17,16,a.common.fileFormat))," files can be dragged and dropped onto this area."),e.xp6(6),e.Q6J("formControl",a.targetState),e.xp6(11),e.Q6J("accept","Excel"===e.lcZ(34,18,a.common.fileFormat)?".xlsx,.csv":"."+e.lcZ(35,20,a.common.fileFormat)),e.xp6(4),e.Q6J("ngIf",e.lcZ(37,22,a.importing)),e.xp6(2),e.Q6J("ngIf",e.lcZ(39,24,a.importResult)))},dependencies:[he.rH,y.lN,y.KE,y.hX,y.bx,Y.LD,Y.gD,g.ey,d.UX,d.JJ,d.oH,g.Ng,c.ot,c.lW,m.O5,R.Cq,R.Ou,me,ce,B,U,I.ie,I.i$,I.Tg,m.ax,m.Ov,m.i8,Q.ZX],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem 1.5rem 0;min-height:100%;margin-top:-1.5rem}.dragging[_nghost-%COMP%]{background-color:#c5cae9}button[_ngcontent-%COMP%]{display:block;margin-top:2rem;margin-bottom:1rem}input[_ngcontent-%COMP%]{display:none}"],changeDetection:0})}}return n})()}}]);