angular-t9n
Version:
A translation tool for Angular i18n
4 lines (3 loc) • 6.87 kB
JavaScript
import{a as Ce,b as Oe}from"./chunk-F2SF46VB.js";import{a as Re}from"./chunk-5YNGG6ZH.js";import{c as ae,d as re}from"./chunk-IC7VJKW2.js";import{a as ne,b as ie,g as oe,h as _e}from"./chunk-CE7MWEFF.js";import{a as le,b as de,c as me,d as se,e as ce,f as Te,g as Me,h as Ae,i as ue,j as ge,k as pe,l as fe,m as Se,n as Ee}from"./chunk-5X2CMPER.js";import{a as z,b as q}from"./chunk-2GFTPPRY.js";import{a as k,e as x}from"./chunk-3UMPV344.js";import{b as B,c as O,e as V,f as j,j as K,k as J,m as Q,n as W,o as Y,p as Z,q as ee,r as te}from"./chunk-IIDNLDIX.js";import"./chunk-SWXDJEZV.js";import"./chunk-IZB6ZOII.js";import"./chunk-OHHIBRCV.js";import{Db as i,Dc as w,Eb as o,Fb as u,Fc as X,Gb as c,Hb as T,Mb as D,Nb as L,Ob as l,Pb as v,Rb as F,Ya as _,Za as R,ac as g,bc as p,cc as H,eb as y,ec as C,hc as f,i as E,ic as S,sb as s,ub as a}from"./chunk-XN5ZPBP6.js";import"./chunk-4CLCTAJ7.js";var Ne=()=>["id","description","meaning","source"];function Pe(e,n){e&1&&(i(0,"mat-error"),l(1,4),o())}function he(e,n){e&1&&(i(0,"mat-error"),l(1,5),o())}function Ie(e,n){e&1&&u(0,"mat-spinner")}function Ge(e,n){e&1&&(c(0),i(1,"h4"),l(2,6),o(),T())}function Ue(e,n){e&1&&(i(0,"th",28),l(1,8),o())}function $e(e,n){if(e&1&&(i(0,"td",29),g(1),o()),e&2){let t=n.$implicit;a("matTooltip",t.locations==null?null:t.locations.join(`
`))("matTooltipDisabled",!(t.locations!=null&&t.locations.length)),_(),H(" ",t.id," ")}}function be(e,n){e&1&&(i(0,"th",28),l(1,9),o())}function ye(e,n){if(e&1&&(i(0,"td",30),g(1),o()),e&2){let t=n.$implicit;_(),p(t.description)}}function De(e,n){e&1&&(i(0,"th",28),l(1,10),o())}function Le(e,n){if(e&1&&(i(0,"td",30),g(1),o()),e&2){let t=n.$implicit;_(),p(t.meaning)}}function ve(e,n){e&1&&(i(0,"th",28),l(1,11),o())}function Fe(e,n){if(e&1&&(i(0,"td",30),g(1),o()),e&2){let t=n.$implicit;_(),p(t.source)}}function He(e,n){e&1&&u(0,"tr",31)}function we(e,n){e&1&&u(0,"tr",32)}function Xe(e,n){if(e&1&&(c(0),i(1,"h4"),l(2,7),o(),i(3,"div",17)(4,"table",18),c(5,19),s(6,Ue,2,0,"th",20)(7,$e,2,3,"td",21),T(),c(8,22),s(9,be,2,0,"th",20)(10,ye,2,1,"td",23),T(),c(11,24),s(12,De,2,0,"th",20)(13,Le,2,1,"td",23),T(),c(14,25),s(15,ve,2,0,"th",20)(16,Fe,2,1,"td",23),T(),s(17,He,1,0,"tr",26)(18,we,1,0,"tr",27),o()(),T()),e&2){let t=F().ngIf;_(4),a("dataSource",t),_(13),a("matHeaderRowDef",C(4,Ne))("matHeaderRowDefSticky",!0),_(),a("matRowDefColumns",C(5,Ne))}}function ke(e,n){if(e&1&&(c(0),s(1,Ge,3,0,"ng-container",15)(2,Xe,19,6,"ng-container",15),T()),e&2){let t=n.ngIf;_(),a("ngIf",!t.length),_(),a("ngIf",t.length)}}var st=(()=>{class e{constructor(t,d){this._sourceOrphansService=t,this.loading=new E(!1),this.migrations=new E(null),this.configuration=d.group({distanceThreshold:[0,[O.min(0),O.required]]})}autoMigrate(){this.loading.next(!0);let t=+this.configuration.get("distanceThreshold").value;this._sourceOrphansService.autoMigrateOrphans(t).subscribe(d=>{this.migrations.next(d),this.loading.next(!1)})}static{this.\u0275fac=function(d){return new(d||e)(R(Re),R(ee))}}static{this.\u0275cmp=y({type:e,selectors:[["t9n-auto-migrate"]],decls:19,vars:12,consts:()=>{let t;t=$localize`:␟b526d031b42722e7cf8f52258430151b09155310␟8720444212022970709:Auto-Migration`;let d;d=$localize`:␟645da333888a6046d72b7f15fd1e87a9867f6e0b␟3354447976218397931: Migrate orphans which are below or equal to the distance threshold. The distance is according to the ${"\uFFFD#4\uFFFD"}:START_LINK:levenshtein algorithm${"\uFFFD/#4\uFFFD"}:CLOSE_LINK:. It will skip the auto-migration for a unit if multiple units with the same distance are found.
`;let m;m=$localize`:␟d7889457595bfbba70a08a2fda7900d9a03c145d␟1566498821816930256:Distance Threshold`;let M;M=$localize`:␟e3edd3e19833c7f464489875500c01f419dc5bf9␟6106421584531086998: Auto-Migrate `;let A;A=$localize`:␟f65037cd7d8696da381c6bbfdb16a64e68cfd8f9␟8169327733416527426:The distance threshold is required`;let N;N=$localize`:␟9798f27134a0031635334c98475b181d4b5fde46␟5286185694292962955:The distance threshold must be greater or equal to 0`;let P;P=$localize`:␟7a0a2c89ce48e66e873d5af4ab5586dc2325c019␟190365802837090999:No orphans met conditions.`;let h;h=$localize`:␟a449a33f34e3a6c40b82058c0d69ff39a9f1e925␟2250356394431390492:Similar units`;let I;I=$localize`:␟4d56cc943bf3b8863ab0a40c3e30d1a75763c968␟693184310236136215:Successful migrations`;let G;G=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let U;U=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let $;$=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let b;return b=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`,[t,d,m,M,A,N,P,I,G,U,$,b,["href","https://en.wikipedia.org/wiki/Levenshtein_distance"],[3,"ngSubmit","formGroup"],["matInput","","type","number","formControlName","distanceThreshold","required","","min","0"],[4,"ngIf"],["mat-raised-button","","color","primary",3,"disabled"],[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label",h,3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled",4,"matCellDef"],["matColumnDef","description"],["mat-cell","",4,"matCellDef"],["matColumnDef","meaning"],["matColumnDef","source"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["mat-header-row",""],["mat-row",""]]},template:function(d,m){if(d&1&&(i(0,"h2"),l(1,0),o(),i(2,"p"),D(3,1),u(4,"a",12),L(),o(),i(5,"form",13),v("ngSubmit",function(){return m.autoMigrate()}),i(6,"mat-form-field")(7,"mat-label"),l(8,2),o(),u(9,"input",14),s(10,Pe,2,0,"mat-error",15)(11,he,2,0,"mat-error",15),o(),i(12,"button",16),f(13,"async"),l(14,3),o()(),s(15,Ie,1,0,"mat-spinner",15),f(16,"async"),s(17,ke,3,2,"ng-container",15),f(18,"async")),d&2){let M,A;_(5),a("formGroup",m.configuration),_(5),a("ngIf",(M=m.configuration.get("distanceThreshold"))==null||M.errors==null?null:M.errors.required),_(),a("ngIf",(A=m.configuration.get("distanceThreshold"))==null||A.errors==null?null:A.errors.min),_(),a("disabled",S(13,6,m.loading)&&m.configuration.valid),_(3),a("ngIf",S(16,8,m.loading)),_(2),a("ngIf",S(18,10,m.migrations))}},dependencies:[te,K,B,J,V,j,Z,Y,Q,W,_e,oe,ne,ie,re,ae,w,x,k,Oe,Ce,Ee,se,Te,ge,Me,ce,pe,Ae,ue,fe,Se,me,le,de,q,z,X],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem}form[_ngcontent-%COMP%]{margin-bottom:1rem}form[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{display:block;margin-top:2rem}"],changeDetection:0})}}return e})();export{st as AutoMigrateComponent};