angular-t9n
Version:
A translation tool for Angular i18n
4 lines (3 loc) • 6.79 kB
JavaScript
import{a as Oe,b as Ne}from"./chunk-UIP5H4DX.js";import{a as ge}from"./chunk-CEPTD2R3.js";import{c as le,d as re}from"./chunk-C3OFSFHS.js";import{a as ne,b as oe,g as ae,j as _e}from"./chunk-3MB47J2U.js";import{a as de,b as me,c as se,d as Te,e as ce,f as Me,g as Ae,h as ue,i as Ce,j as Se,k as Ee,l as fe,m as pe,n as Re}from"./chunk-34LVLGVL.js";import{a as q,b as B}from"./chunk-27GPMXRH.js";import{b as x,c as z}from"./chunk-MFJLYQLJ.js";import{b as V,c as h,e as j,f as K,i as J,j as Q,l as W,m as Y,n as Z,o as ee,p as te,q as ie}from"./chunk-SML6JUFJ.js";import"./chunk-QTUSJNUZ.js";import"./chunk-DK3NDEDW.js";import"./chunk-MLPE3OCH.js";import"./chunk-RVNPJH6Y.js";import{$ as N,Bb as S,Cb as E,Cc as k,Gb as y,Hb as F,Ib as l,Jb as w,Kb as v,Qa as a,Yb as f,Zb as p,_b as X,bb as H,bc as P,ec as R,fc as g,g as O,gb as A,pb as s,qb as T,ub as c,vb as n,wb as o,xb as u}from"./chunk-KWXDDR2S.js";import"./chunk-4CLCTAJ7.js";var Pe=()=>["id","description","meaning","source"];function he(e,i){e&1&&(n(0,"mat-error"),l(1,4),o())}function Ie(e,i){e&1&&(n(0,"mat-error"),l(1,5),o())}function Ge(e,i){e&1&&u(0,"mat-spinner")}function Ue(e,i){e&1&&(n(0,"h4"),l(1,6),o())}function $e(e,i){e&1&&(n(0,"th",27),l(1,8),o())}function be(e,i){if(e&1&&(n(0,"td",28),f(1),o()),e&2){let t=i.$implicit;c("matTooltip",t.locations==null?null:t.locations.join(`
`))("matTooltipDisabled",!(t.locations!=null&&t.locations.length)),a(),X(" ",t.id," ")}}function De(e,i){e&1&&(n(0,"th",27),l(1,9),o())}function Le(e,i){if(e&1&&(n(0,"td",29),f(1),o()),e&2){let t=i.$implicit;a(),p(t.description)}}function He(e,i){e&1&&(n(0,"th",27),l(1,10),o())}function ye(e,i){if(e&1&&(n(0,"td",29),f(1),o()),e&2){let t=i.$implicit;a(),p(t.meaning)}}function Fe(e,i){e&1&&(n(0,"th",27),l(1,11),o())}function we(e,i){if(e&1&&(n(0,"td",29),f(1),o()),e&2){let t=i.$implicit;a(),p(t.source)}}function ve(e,i){e&1&&u(0,"tr",30)}function Xe(e,i){e&1&&u(0,"tr",31)}function ke(e,i){if(e&1&&(n(0,"h4"),l(1,7),o(),n(2,"div",16)(3,"table",17),S(4,18),A(5,$e,2,0,"th",19)(6,be,2,3,"td",20),E(),S(7,21),A(8,De,2,0,"th",19)(9,Le,2,1,"td",22),E(),S(10,23),A(11,He,2,0,"th",19)(12,ye,2,1,"td",22),E(),S(13,24),A(14,Fe,2,0,"th",19)(15,we,2,1,"td",22),E(),A(16,ve,1,0,"tr",25)(17,Xe,1,0,"tr",26),o()()),e&2){let t=v();a(3),c("dataSource",t),a(13),c("matHeaderRowDef",P(4,Pe))("matHeaderRowDefSticky",!0),a(),c("matRowDefColumns",P(5,Pe))}}function xe(e,i){if(e&1&&(s(0,Ue,2,0,"h4"),s(1,ke,18,6)),e&2){let t=i;T(t.length?-1:0),a(),T(t.length?1:-1)}}var Tt=(()=>{class e{constructor(){this._sourceOrphansService=N(ge),this.loading=new O(!1),this.migrations=new O(null);let t=N(te);this.configuration=t.group({distanceThreshold:[0,[h.min(0),h.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)}}static{this.\u0275cmp=H({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 r;r=$localize`:␟d7889457595bfbba70a08a2fda7900d9a03c145d␟1566498821816930256:Distance Threshold`;let m;m=$localize`:␟e3edd3e19833c7f464489875500c01f419dc5bf9␟6106421584531086998: Auto-Migrate `;let M;M=$localize`:␟f65037cd7d8696da381c6bbfdb16a64e68cfd8f9␟8169327733416527426:The distance threshold is required`;let C;C=$localize`:␟9798f27134a0031635334c98475b181d4b5fde46␟5286185694292962955:The distance threshold must be greater or equal to 0`;let I;I=$localize`:␟7a0a2c89ce48e66e873d5af4ab5586dc2325c019␟190365802837090999:No orphans met conditions.`;let G;G=$localize`:␟a449a33f34e3a6c40b82058c0d69ff39a9f1e925␟2250356394431390492:Similar units`;let U;U=$localize`:␟4d56cc943bf3b8863ab0a40c3e30d1a75763c968␟693184310236136215:Successful migrations`;let $;$=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let b;b=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let D;D=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let L;return L=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`,[t,d,r,m,M,C,I,U,$,b,D,L,["href","https://en.wikipedia.org/wiki/Levenshtein_distance"],[3,"ngSubmit","formGroup"],["matInput","","type","number","formControlName","distanceThreshold","required","","min","0"],["mat-raised-button","","color","primary",3,"disabled"],[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label",G,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,r){if(d&1&&(n(0,"h2"),l(1,0),o(),n(2,"p"),y(3,1),u(4,"a",12),F(),o(),n(5,"form",13),w("ngSubmit",function(){return r.autoMigrate()}),n(6,"mat-form-field")(7,"mat-label"),l(8,2),o(),u(9,"input",14),s(10,he,2,0,"mat-error"),s(11,Ie,2,0,"mat-error"),o(),n(12,"button",15),R(13,"async"),l(14,3),o()(),s(15,Ge,1,0,"mat-spinner"),R(16,"async"),s(17,xe,2,2),R(18,"async")),d&2){let m,M,C;a(5),c("formGroup",r.configuration),a(5),T(!((m=r.configuration.get("distanceThreshold"))==null||m.errors==null)&&m.errors.required?10:-1),a(),T(!((M=r.configuration.get("distanceThreshold"))==null||M.errors==null)&&M.errors.min?11:-1),a(),c("disabled",g(13,6,r.loading)&&r.configuration.valid),a(3),T(g(16,8,r.loading)?15:-1),a(2),T((C=g(18,10,r.migrations))?17:-1,C)}},dependencies:[ie,J,V,Q,j,K,ee,Z,Y,W,_e,ae,ne,oe,re,le,z,x,Ne,Oe,Re,Te,Me,Se,Ae,ce,Ee,ue,Ce,fe,pe,se,de,me,B,q,k],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{Tt as AutoMigrateComponent};