@uipath/du-validation-station-wc 1.0.0-beta.2 → 1.0.0-beta.3

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.
@@ -1,2 +1,2 @@
1
- import{a as Yi,b as kn}from"./chunk-GUD4Q5ED.js";import{a as Zi,b as Gn,c as xe,d as en,e as Tt,f as nn,i as pt,j as Mt,k as he,l as ut,m as on,n as an,o as rn,p as ln,q as sn,r as dn,s as cn,t as pn,u as un,v as qn}from"./chunk-MEJRHTNP.js";import{a as qi,b as $i,c as zi,d as Wi}from"./chunk-OCUVVNK2.js";import{b as Ke,c as Pi,d as wi,e as Fi,f as Ui,g as Ri,h as Ni,j as Un,k as Ji,l as Hn,n as tn,o as Kn}from"./chunk-6AEFIYR5.js";import{$ as x,$a as l,$e as et,$j as Ce,A as qe,Ab as f,Ae as ii,Af as gi,Ai as Li,Bb as j,Be as ni,Bf as vi,Bk as Xi,Cb as V,Ce as oi,Ck as An,Df as fi,Eb as P,Ed as Yt,Ef as Ci,Fa as U,Fb as O,Fd as Ae,Ff as xi,Gb as C,Gd as Qt,H as Vt,Hb as Ie,Hd as Qe,Id as Ct,If as hi,Jb as se,Jc as Kt,Kb as Ut,Kh as Ei,La as $e,Lb as Rt,Lf as ht,Lh as Fn,Mb as pe,Mf as Te,Mh as Ii,Nb as Le,Nd as K,Nf as Si,Nh as Di,Ni as Rn,O as Et,Ob as Nt,Oc as qt,Od as q,Oh as Oi,Pb as Lt,Pc as $t,Pd as $,Qa as Ot,Ra as E,Re as ae,Ri as we,Rj as Me,Sb as m,Se as Y,Si as Ai,Sj as Nn,Ta as S,Tb as _,Te as ee,U as vt,Ub as X,Ui as at,Va as y,Vc as zt,Vf as St,Vi as H,Wb as At,Wi as z,Xa as Pt,Xi as ki,Ya as J,Yi as rt,Za as Z,Zb as c,Zi as Bi,_a as u,_b as ue,_e as Oe,_i as de,a as bt,ab as d,af as ke,ak as Gi,ba as g,bb as D,bc as ft,bk as Q,ca as v,cc as M,ch as Pe,cj as Hi,dc as je,dh as Mi,dj as ge,dk as Ki,ee as Je,ef as ai,ej as lt,ek as Fe,fb as k,fd as De,fe as Ze,ff as ri,fj as st,ga as It,gb as B,ge as N,gf as li,gg as yi,gh as yt,gk as Ue,hb as wt,hh as bi,ia as G,ib as b,ka as wn,ke as A,kf as si,kg as Ti,kh as Vi,kk as ji,kl as Qi,l as Ve,lb as T,lc as R,le as L,lf as di,lh as He,mb as s,mc as kt,mf as tt,mg as me,mk as Ln,ml as Bn,na as Ne,nd as Ye,nf as it,o as gt,of as nt,pd as ne,pf as xt,qc as Bt,qd as oe,qf as ci,qh as F,ra as Dt,rf as Be,rj as dt,sa as a,sc as Ht,se as Jt,sf as pi,sh as ot,sj as ct,tc as Gt,ub as ze,uc as Xe,ue as Zt,uh as _e,uj as ve,vb as We,vj as W,w as Ee,wb as ce,xb as Ft,xd as Wt,xf as ui,yb as ie,yd as jt,ye as ei,yf as mi,yh as Ge,yj as fe,zd as Xt,ze as ti,zf as _i}from"./chunk-5LGMGLPM.js";import"./chunk-ZOBGFIAP.js";import"./chunk-7LF7TUYR.js";import"./chunk-QSPXPEUM.js";import"./chunk-MHF6VH7J.js";import"./chunk-OC2CZ3QN.js";import"./chunk-S75KSQCC.js";import"./chunk-F3WKVTVT.js";import"./chunk-TX6COQKF.js";import"./chunk-B3JIB7CB.js";import"./chunk-AV2XMJZK.js";import"./chunk-TLNUV6LJ.js";import"./chunk-X3MDAFQV.js";import"./chunk-LE344D6P.js";import"./chunk-BSSTUKEO.js";import"./chunk-SLCVE5JY.js";import"./chunk-NWYS2Y26.js";import"./chunk-5ORQKHAE.js";import"./chunk-NNIW76YM.js";import"./chunk-GN4LVN6F.js";import"./chunk-Q3TZ5E3J.js";import"./chunk-THUL57GX.js";import"./chunk-7FN55G7Q.js";import"./chunk-JA4SO6QN.js";import"./chunk-DJJWZ6ME.js";import"./chunk-BME7YW2F.js";import"./chunk-ZHEQ3EZZ.js";import"./chunk-LIP7LW4Z.js";import"./chunk-OCJB2TQU.js";import"./chunk-UFSYSDPG.js";import"./chunk-NVYUSY5M.js";import"./chunk-DP4VB7EI.js";import"./chunk-FBLIPTM4.js";import"./chunk-3JRA4PLP.js";import"./chunk-RQKBBL3R.js";import"./chunk-ZTKCIUS4.js";import"./chunk-FEFKMD5S.js";import"./chunk-5ORJAWGA.js";import"./chunk-YTZYL6W2.js";import"./chunk-JBS3UN52.js";import{a as w,b as ye,f as le}from"./chunk-3ONYU5UZ.js";function Wn(i,r){i&1&&(D(0,"mat-progress-spinner",4),m(1,"translate"),m(2,"translate")),i&2&&(u("matTooltip",_(1,2,"VS_COMPACT_BUSINESS_RULES_LOADING")),E("aria-label",_(2,4,"VS_COMPACT_BUSINESS_RULES_LOADING")))}function jn(i,r){if(i&1){let e=b();l(0,"mat-chip-listbox",9),m(1,"translate"),T("change",function(n){g(e);let o=s();return v(o.setFilterValue(n))}),l(2,"mat-chip-option",10),f(3),m(4,"translate"),d(),l(5,"mat-chip-option",11),f(6),m(7,"translate"),d()()}if(i&2){let e=s();E("aria-label",_(1,5,"VS_COMPACT_BUSINESS_RULES_CHIPS_GROUP_ARIA_LABEL")),a(2),u("value",e.AlertType.Error),a(),V(" ",X(4,7,"VS_COMPACT_BUSINESS_RULES_ERRORS",pe(13,mn,e.nrOfErrors()))," "),a(2),u("value",e.AlertType.Warning),a(),V(" ",X(7,10,"VS_COMPACT_BUSINESS_RULES_WARNINGS",pe(15,mn,e.nrOfWarnings()))," ")}}function Xn(i,r){if(i&1){let e=b();l(0,"ui-alert-bar",12),T("clicked",function(){let n=g(e).$implicit,o=s();return v(o.onRuleClick(n))}),f(1),m(2,"translate"),d()}if(i&2){let e=r.$implicit;u("focusable",!0)("status",e.level)("showCloseButton",!1),E("data-testid","business-rule-item_"+e.id),a(),V(" ",X(2,5,e.messageKey,e.messageParams)," ")}}function Yn(i,r){if(i&1&&(l(0,"ui-alert-bar",8),f(1),m(2,"translate"),d()),i&2){let e=s();u("status",e.AlertType.Info)("showCloseButton",!1),a(),V(" ",_(2,3,"VS_COMPACT_BUSINESS_RULES_ALL_HONOURED")," ")}}var mn,zn,_n,gn=le(()=>{"use strict";R();oe();nt();Ri();ee();li();$();L();de();fe();He();R();Ri();nt();ee();$();oe();li();L();mn=i=>({nr:i}),zn=(i,r)=>r.id;_n=(()=>{class i{_rulesManagerService=x(st);_extractionValidationService=x(ve);toggle=ft();ruleClick=ft();AlertType=Pe;filteredRules=c(()=>this._allInvalidRules().filter(e=>!this._selectedAlertTypeFilter()||e.level===this._selectedAlertTypeFilter()));nrOfErrors=c(()=>this._allInvalidRules().filter(e=>e.level===Pe.Error).length);nrOfWarnings=c(()=>this._allInvalidRules().filter(e=>e.level===Pe.Warning).length);rulesLoaded=c(()=>this._rulesManagerService.status().loaded);_allRuleSets=c(()=>Bi(this._extractionValidationService.validationResultsAsEvaluatedRuleSets(),this._rulesManagerService.entities()));_allInvalidRules=c(()=>this._allRuleSets()?.filter(e=>!e.isValid)?.flatMap(e=>e.rules.filter(t=>!t.isValid).map(t=>({id:`${e.fieldId}-${e.valueIndex}-${t.name}`,fieldId:e.fieldId,fieldValueIndex:e.valueIndex,level:this._getAlertLevelForRuleSet(e),messageKey:t.message?.key??"",messageParams:t.message?.params??{}})))??[]);_selectedAlertTypeFilter=G(null);_expansionPanelElement=je.required(Ke);onExpansionPanelToggle(e){this.toggle.emit(e)}setFilterValue(e){this._selectedAlertTypeFilter.set(e.value??null),this._expansionPanelElement().open()}onRuleClick(e){this.ruleClick.emit(e)}_getAlertLevelForRuleSet(e){switch(e.criticality){case"Must":return Pe.Error;default:return Pe.Warning}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-business-rules"]],viewQuery:function(t,n){t&1&&ze(n._expansionPanelElement,Ke,5),t&2&&We()},outputs:{toggle:"toggle",ruleClick:"ruleClick"},decls:22,vars:14,consts:[["businessRulesPanel",""],["hideToggle","","togglePosition","before",1,"compact-business-rules-panel",3,"opened","afterCollapse"],["role","group"],["mat-icon-button","","data-testid","business-rules-expand-toggle",3,"matTooltip"],["mode","indeterminate","diameter","19","strokeWidth","2","data-testid","business-rules-loading-spinner","tabIndex","0",3,"matTooltip"],["hideSingleSelectionIndicator",""],["data-testid","business-rules-list",1,"rules-list"],[3,"focusable","status","showCloseButton"],[3,"status","showCloseButton"],["hideSingleSelectionIndicator","",3,"change"],["data-testid","business-rules-filter-errors","uiKeydownStopEventPropagation","",3,"value"],["data-testid","business-rules-filter-warnings","uiKeydownStopEventPropagation","",3,"value"],[3,"clicked","focusable","status","showCloseButton"]],template:function(t,n){if(t&1){let o=b();P(0),m(1,"translate"),l(2,"mat-expansion-panel",1,0),T("opened",function(){return g(o),v(n.onExpansionPanelToggle(!0))})("afterCollapse",function(){return g(o),v(n.onExpansionPanelToggle(!1))}),l(4,"mat-expansion-panel-header",2)(5,"mat-panel-title"),P(6),m(7,"translate"),P(8),m(9,"translate"),l(10,"button",3)(11,"mat-icon"),f(12),d()(),l(13,"span"),f(14),d()(),l(15,"mat-panel-description"),S(16,Wn,3,6,"mat-progress-spinner",4)(17,jn,8,17,"mat-chip-listbox",5),d()(),l(18,"div",6),J(19,Xn,3,8,"ui-alert-bar",7,zn,!1,Yn,3,5,"ui-alert-bar",8),d()()}if(t&2){let o=ce(3),p=_(1,8,"VS_COMPACT_BUSINESS_RULES_TITLE");a(4),E("aria-label",p);let h=_(7,10,"VS_COMPACT_BUSINESS_RULES_COLLAPSE_TOOLTIP"),I=_(9,12,"VS_COMPACT_BUSINESS_RULES_EXPAND_TOOLTIP");a(6),u("matTooltip",o.expanded?h:I),E("aria-label",o.expanded?h:I)("aria-expanded",o.expanded),a(2),j(o.expanded?"expand_less":"expand_more"),a(2),j(p),a(2),y(n.rulesLoaded()?17:16),a(3),Z(n.filteredRules())}},dependencies:[Ui,Ke,Pi,Fi,wi,it,tt,di,Y,ae,q,K,ne,De,ri,ai,A,Mi,yi,N],styles:[`:host{display:flex;flex-direction:column;overflow:hidden;font-size:14px;height:100%}.compact-business-rules-panel.mat-expansion-panel{display:flex;flex-direction:column;height:100%}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header{background-color:var(--mat-expansion-header-hover-state-layer-color);min-height:38px;flex-shrink:0;padding-left:0}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-content-hide-toggle{margin-left:0}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-expansion-panel-header-title{background-color:unset}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{flex-grow:1;flex-shrink:0;justify-content:end}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-expansion-panel-header-description .mat-mdc-chip-selected{background-color:var(--color-selection-indicator)}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-collapsed-state-height)}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-content-wrapper{height:100%;overflow:auto}.compact-business-rules-panel.mat-expansion-panel mat-chip-option{padding-left:8px;padding-right:8px;font-weight:400}.compact-business-rules-panel.mat-expansion-panel .rules-list{display:flex;flex-direction:column;gap:4px;margin-top:4px;overflow:auto}.compact-business-rules-panel.mat-expansion-panel .rules-list ui-alert-bar{cursor:pointer}
1
+ import{a as Yi,b as kn}from"./chunk-A7SW22GE.js";import{a as Zi,b as Gn,c as xe,d as en,e as Tt,f as nn,i as pt,j as Mt,k as he,l as ut,m as on,n as an,o as rn,p as ln,q as sn,r as dn,s as cn,t as pn,u as un,v as qn}from"./chunk-Z4Q2KRL4.js";import{a as qi,b as $i,c as zi,d as Wi}from"./chunk-2EG2XMZA.js";import{d as Ke,e as Pi,f as wi,g as Fi,h as Ui,i as Ri,j as Ni,l as Un,m as Ji,n as Hn,p as tn,q as Kn}from"./chunk-YYFDQWK6.js";import{$a as Z,$b as At,$c as Kt,$d as Ae,$f as fi,A as qe,Ab as ie,Ae as Je,Aj as rt,Bc as Ht,Be as Ze,Bj as Bi,Cb as f,Cc as Gt,Ce as N,Cf as ai,Cj as de,Db as j,Dc as Xe,Df as ri,Dk as Ce,Eb as V,Ef as li,Ek as Gi,Fg as yi,Fk as Q,Ge as A,Gh as Pe,Gj as Hi,H as Vt,Ha as U,He as L,Hh as Mi,Hj as ge,Hk as Ki,Id as Ye,If as si,Ij as lt,Ik as Fe,Jb as P,Jf as di,Jg as Ti,Jj as st,Kb as O,Kd as ne,Kf as tt,Kh as yt,Kk as Ue,Lb as C,Ld as oe,Lf as it,Lg as me,Lh as bi,Mb as Ie,Mf as nt,Na as $e,Nf as xt,Ob as se,Oe as Jt,Of as ci,Oh as Vi,Ok as ji,Ol as Qi,P as Et,Pb as Ut,Pf as Be,Ph as He,Qb as Rt,Qf as pi,Qk as Ln,Ql as Bn,Rb as pe,Re as Zt,Sa as Ot,Sb as Le,Sd as Wt,Ta as E,Tb as Nt,Ub as Lt,Ud as jt,Uh as F,V as vt,Va as S,Vd as Xt,Vf as ui,Vj as dt,We as ei,Wf as mi,Wh as ot,Wj as ct,Xa as y,Xb as m,Xe as ti,Xf as _i,Yb as _,Ye as ii,Yf as gi,Yh as _e,Yj as ve,Za as Pt,Zb as X,Ze as ni,Zf as vi,Zj as W,_a as J,_d as Yt,_e as oi,a as bt,aa as x,ab as u,ae as Qt,ag as Ci,ai as Ge,ak as fe,bb as l,be as Qe,bg as xi,cb as d,ce as Ct,cj as Li,da as g,db as D,dc as c,dl as Xi,ea as v,ec as ue,eg as hi,el as An,fd as qt,gd as $t,hb as k,hc as ft,he as K,hg as ht,ia as It,ib as B,ic as M,ie as q,ig as Te,jb as wt,jc as je,je as $,ka as G,kb as b,kg as Si,l as Ve,ma as wn,md as zt,mi as Ei,nb as T,nf as ae,ni as Fn,o as gt,ob as s,of as Y,oi as Ii,pa as Ne,pf as ee,pi as Di,pj as Rn,qi as Oi,sg as St,ta as Dt,tc as R,tj as we,tk as Me,ua as a,uj as Ai,uk as Nn,vc as kt,w as Ee,wb as ze,wf as Oe,wj as at,xb as We,xf as et,xj as H,yb as ce,yf as ke,yj as z,zb as Ft,zc as Bt,zd as De,zj as ki}from"./chunk-XOLTEKM3.js";import"./chunk-ZOBGFIAP.js";import"./chunk-7LF7TUYR.js";import"./chunk-QSPXPEUM.js";import"./chunk-MHF6VH7J.js";import"./chunk-OC2CZ3QN.js";import"./chunk-S75KSQCC.js";import"./chunk-F3WKVTVT.js";import"./chunk-TX6COQKF.js";import"./chunk-B3JIB7CB.js";import"./chunk-AV2XMJZK.js";import"./chunk-TLNUV6LJ.js";import"./chunk-X3MDAFQV.js";import"./chunk-LE344D6P.js";import"./chunk-BSSTUKEO.js";import"./chunk-SLCVE5JY.js";import"./chunk-NWYS2Y26.js";import"./chunk-5ORQKHAE.js";import"./chunk-NNIW76YM.js";import"./chunk-GN4LVN6F.js";import"./chunk-Q3TZ5E3J.js";import"./chunk-THUL57GX.js";import"./chunk-7FN55G7Q.js";import"./chunk-JA4SO6QN.js";import"./chunk-DJJWZ6ME.js";import"./chunk-BME7YW2F.js";import"./chunk-ZHEQ3EZZ.js";import"./chunk-LIP7LW4Z.js";import"./chunk-OCJB2TQU.js";import"./chunk-UFSYSDPG.js";import"./chunk-NVYUSY5M.js";import"./chunk-DP4VB7EI.js";import"./chunk-FBLIPTM4.js";import"./chunk-3JRA4PLP.js";import"./chunk-RQKBBL3R.js";import"./chunk-ZTKCIUS4.js";import"./chunk-FEFKMD5S.js";import"./chunk-5ORJAWGA.js";import"./chunk-YTZYL6W2.js";import"./chunk-JBS3UN52.js";import{a as w,b as ye,f as le}from"./chunk-3ONYU5UZ.js";function Wn(i,r){i&1&&(D(0,"mat-progress-spinner",4),m(1,"translate"),m(2,"translate")),i&2&&(u("matTooltip",_(1,2,"VS_COMPACT_BUSINESS_RULES_LOADING")),E("aria-label",_(2,4,"VS_COMPACT_BUSINESS_RULES_LOADING")))}function jn(i,r){if(i&1){let e=b();l(0,"mat-chip-listbox",9),m(1,"translate"),T("change",function(n){g(e);let o=s();return v(o.setFilterValue(n))}),l(2,"mat-chip-option",10),f(3),m(4,"translate"),d(),l(5,"mat-chip-option",11),f(6),m(7,"translate"),d()()}if(i&2){let e=s();E("aria-label",_(1,5,"VS_COMPACT_BUSINESS_RULES_CHIPS_GROUP_ARIA_LABEL")),a(2),u("value",e.AlertType.Error),a(),V(" ",X(4,7,"VS_COMPACT_BUSINESS_RULES_ERRORS",pe(13,mn,e.nrOfErrors()))," "),a(2),u("value",e.AlertType.Warning),a(),V(" ",X(7,10,"VS_COMPACT_BUSINESS_RULES_WARNINGS",pe(15,mn,e.nrOfWarnings()))," ")}}function Xn(i,r){if(i&1){let e=b();l(0,"ui-alert-bar",12),T("clicked",function(){let n=g(e).$implicit,o=s();return v(o.onRuleClick(n))}),f(1),m(2,"translate"),d()}if(i&2){let e=r.$implicit;u("focusable",!0)("status",e.level)("showCloseButton",!1),E("data-testid","business-rule-item_"+e.id),a(),V(" ",X(2,5,e.messageKey,e.messageParams)," ")}}function Yn(i,r){if(i&1&&(l(0,"ui-alert-bar",8),f(1),m(2,"translate"),d()),i&2){let e=s();u("status",e.AlertType.Info)("showCloseButton",!1),a(),V(" ",_(2,3,"VS_COMPACT_BUSINESS_RULES_ALL_HONOURED")," ")}}var mn,zn,_n,gn=le(()=>{"use strict";R();oe();nt();Ri();ee();li();$();L();de();fe();He();R();Ri();nt();ee();$();oe();li();L();mn=i=>({nr:i}),zn=(i,r)=>r.id;_n=(()=>{class i{_rulesManagerService=x(st);_extractionValidationService=x(ve);toggle=ft();ruleClick=ft();AlertType=Pe;filteredRules=c(()=>this._allInvalidRules().filter(e=>!this._selectedAlertTypeFilter()||e.level===this._selectedAlertTypeFilter()));nrOfErrors=c(()=>this._allInvalidRules().filter(e=>e.level===Pe.Error).length);nrOfWarnings=c(()=>this._allInvalidRules().filter(e=>e.level===Pe.Warning).length);rulesLoaded=c(()=>this._rulesManagerService.status().loaded);_allRuleSets=c(()=>Bi(this._extractionValidationService.validationResultsAsEvaluatedRuleSets(),this._rulesManagerService.entities()));_allInvalidRules=c(()=>this._allRuleSets()?.filter(e=>!e.isValid)?.flatMap(e=>e.rules.filter(t=>!t.isValid).map(t=>({id:`${e.fieldId}-${e.valueIndex}-${t.name}`,fieldId:e.fieldId,fieldValueIndex:e.valueIndex,level:this._getAlertLevelForRuleSet(e),messageKey:t.message?.key??"",messageParams:t.message?.params??{}})))??[]);_selectedAlertTypeFilter=G(null);_expansionPanelElement=je.required(Ke);onExpansionPanelToggle(e){this.toggle.emit(e)}setFilterValue(e){this._selectedAlertTypeFilter.set(e.value??null),this._expansionPanelElement().open()}onRuleClick(e){this.ruleClick.emit(e)}_getAlertLevelForRuleSet(e){switch(e.criticality){case"Must":return Pe.Error;default:return Pe.Warning}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-business-rules"]],viewQuery:function(t,n){t&1&&ze(n._expansionPanelElement,Ke,5),t&2&&We()},outputs:{toggle:"toggle",ruleClick:"ruleClick"},decls:22,vars:14,consts:[["businessRulesPanel",""],["hideToggle","","togglePosition","before",1,"compact-business-rules-panel",3,"opened","afterCollapse"],["role","group"],["mat-icon-button","","data-testid","business-rules-expand-toggle",3,"matTooltip"],["mode","indeterminate","diameter","19","strokeWidth","2","data-testid","business-rules-loading-spinner","tabIndex","0",3,"matTooltip"],["hideSingleSelectionIndicator",""],["data-testid","business-rules-list",1,"rules-list"],[3,"focusable","status","showCloseButton"],[3,"status","showCloseButton"],["hideSingleSelectionIndicator","",3,"change"],["data-testid","business-rules-filter-errors","uiKeydownStopEventPropagation","",3,"value"],["data-testid","business-rules-filter-warnings","uiKeydownStopEventPropagation","",3,"value"],[3,"clicked","focusable","status","showCloseButton"]],template:function(t,n){if(t&1){let o=b();P(0),m(1,"translate"),l(2,"mat-expansion-panel",1,0),T("opened",function(){return g(o),v(n.onExpansionPanelToggle(!0))})("afterCollapse",function(){return g(o),v(n.onExpansionPanelToggle(!1))}),l(4,"mat-expansion-panel-header",2)(5,"mat-panel-title"),P(6),m(7,"translate"),P(8),m(9,"translate"),l(10,"button",3)(11,"mat-icon"),f(12),d()(),l(13,"span"),f(14),d()(),l(15,"mat-panel-description"),S(16,Wn,3,6,"mat-progress-spinner",4)(17,jn,8,17,"mat-chip-listbox",5),d()(),l(18,"div",6),J(19,Xn,3,8,"ui-alert-bar",7,zn,!1,Yn,3,5,"ui-alert-bar",8),d()()}if(t&2){let o=ce(3),p=_(1,8,"VS_COMPACT_BUSINESS_RULES_TITLE");a(4),E("aria-label",p);let h=_(7,10,"VS_COMPACT_BUSINESS_RULES_COLLAPSE_TOOLTIP"),I=_(9,12,"VS_COMPACT_BUSINESS_RULES_EXPAND_TOOLTIP");a(6),u("matTooltip",o.expanded?h:I),E("aria-label",o.expanded?h:I)("aria-expanded",o.expanded),a(2),j(o.expanded?"expand_less":"expand_more"),a(2),j(p),a(2),y(n.rulesLoaded()?17:16),a(3),Z(n.filteredRules())}},dependencies:[Ui,Ke,Pi,Fi,wi,it,tt,di,Y,ae,q,K,ne,De,ri,ai,A,Mi,yi,N],styles:[`:host{display:flex;flex-direction:column;overflow:hidden;font-size:14px;height:100%}.compact-business-rules-panel.mat-expansion-panel{display:flex;flex-direction:column;height:100%}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header{background-color:var(--mat-expansion-header-hover-state-layer-color);min-height:38px;flex-shrink:0;padding-left:0}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-content-hide-toggle{margin-left:0}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-expansion-panel-header-title{background-color:unset}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{flex-grow:1;flex-shrink:0;justify-content:end}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header .mat-expansion-panel-header-description .mat-mdc-chip-selected{background-color:var(--color-selection-indicator)}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-collapsed-state-height)}.compact-business-rules-panel.mat-expansion-panel .mat-expansion-panel-content-wrapper{height:100%;overflow:auto}.compact-business-rules-panel.mat-expansion-panel mat-chip-option{padding-left:8px;padding-right:8px;font-weight:400}.compact-business-rules-panel.mat-expansion-panel .rules-list{display:flex;flex-direction:column;gap:4px;margin-top:4px;overflow:auto}.compact-business-rules-panel.mat-expansion-panel .rules-list ui-alert-bar{cursor:pointer}
2
2
  `],encapsulation:2,changeDetection:0})}return i})()});function to(i,r){if(i&1){let e=b();l(0,"button",9),T("click",function(){g(e);let n=s();return v(n.deleteRow())}),l(1,"mat-icon"),f(2,"delete"),d(),l(3,"span"),f(4),m(5,"translate"),d()()}i&2&&(a(4),j(_(5,1,"VS_TABLE_DELETE_ROW")))}function io(i,r){i&1&&D(0,"mat-divider")}function no(i,r){if(i&1&&(l(0,"div"),wt(1,10),S(2,io,1,0,"mat-divider"),d()),i&2){let e=r.$implicit,t=r.$index,n=r.$count,o=s();E("data-testid","child-value_"+t+"_"+o.valueId()),a(),u("ngTemplateOutlet",o.fieldTemplate())("ngTemplateOutletContext",Lt(4,Zn,e,t,o.valueIndex(),o.level()+1)),a(),y(t!==n-1?2:-1)}}var Jn,Zn,eo,vn,fn=le(()=>{"use strict";Xe();R();pi();oe();oi();ke();ee();vi();$();L();de();fe();R();Xe();oe();ee();$();oi();ke();vi();Jn=(i,r,e)=>({currentNr:i,totalNr:r,valuesSummary:e}),Zn=(i,r,e,t)=>({$implicit:i,indexInParent:r,parentValueIndex:e,level:t}),eo=(i,r)=>r.id;vn=(()=>{class i{_translateService=x(Je);_extractionManagerService=x(W);_derivedPartsService=x(dt);fieldTemplate=M.required();field=M.required();taxonomy=M.required();valueId=M.required();valueIndex=M.required();level=M.required();isReadonly=M.required();value=c(()=>this._extractionManagerService.getById(this.valueId()));childValues=c(()=>this.value().valueIds.map(e=>this._extractionManagerService.getById(e)));color=c(()=>this.taxonomy().color);ConfirmationStatus=z;isAnyChildSelected=c(()=>!!this._extractionManagerService.selectedParentValueIdMap()[this.valueId()]||this.valueId()===this._extractionManagerService.selectedValueId());currentNr=c(()=>this.valueIndex()+1);totalNr=c(()=>this.field().valueIds.length);_translatedIsMissingMessage=Be(this._translateService.stream("VS_SIMPLE_FIELD_NO_DATA_MESSAGE"));_translatedNotExtractedMessage=Be(this._translateService.stream("VS_SIMPLE_FIELD_REMOVED_MESSAGE"));valuesSummary=c(()=>{let e=this._translatedIsMissingMessage(),t=this._translatedNotExtractedMessage();return this._collectLeafValues(this.childValues(),5).map(o=>this._formatValue(o,e,t)).join(", ")});deleteRow(){this._extractionManagerService.removeExtractedValues(this.field().id,[this.valueId()])}highlightRow(){this._extractionManagerService.setSelectedValue(this.valueId())}setRowConfirmedStatus(e){this._extractionManagerService.changeValueConfirmation(this.valueId(),e.checked)}_collectLeafValues(e,t){let n=[],o=p=>{if(!(n.length>=t))for(let h of p){if(n.length>=t)break;if(h.type===H.Primary||!h.valueIds.length)n.push(h);else{let I=h.valueIds.map(re=>this._extractionManagerService.getById(re));o(I)}}};return o(e),n.slice(0,t)}_formatValue(e,t,n){return e.type===H.Primary?this._derivedPartsService.format(e):ki(e.confirmationStatus)?n:t}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-field-group-row"]],hostVars:4,hostBindings:function(t,n){t&2&&(Ft("border-color",n.color()),ie("selected",n.isAnyChildSelected()))},inputs:{fieldTemplate:[1,"fieldTemplate"],field:[1,"field"],taxonomy:[1,"taxonomy"],valueId:[1,"valueId"],valueIndex:[1,"valueIndex"],level:[1,"level"],isReadonly:[1,"isReadonly"]},decls:25,vars:24,consts:[["bodyMenu",""],[1,"row-info"],[1,"summary",3,"matTooltip"],[1,"actions"],["data-testid","field-group-row-confirmed-checkbox","tabindex","-1",1,"row-confirm-checkbox",3,"change","click","matTooltip","aria-label","checked","indeterminate","disabled"],["mat-icon-button","","data-testid","fg-actions-menu-trigger",3,"matMenuTriggerFor"],["mat-menu-item","","data-testid","highlight-row",3,"click"],["mat-menu-item","","data-testid","delete-row"],[1,"values"],["mat-menu-item","","data-testid","delete-row",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,n){if(t&1){let o=b();l(0,"section",1),P(1),m(2,"translate"),l(3,"div",2),f(4),d(),l(5,"div",3),P(6),m(7,"translate"),l(8,"mat-checkbox",4),T("change",function(h){return g(o),v(n.setRowConfirmedStatus(h))})("click",function(h){return g(o),v(h.stopPropagation())}),d(),l(9,"button",5),m(10,"translate"),l(11,"mat-icon"),f(12,"more_vert"),d()(),l(13,"mat-menu",null,0)(15,"button",6),T("click",function(){return g(o),v(n.highlightRow())}),l(16,"mat-icon"),f(17,"select_all"),d(),l(18,"span"),f(19),m(20,"translate"),d()(),S(21,to,6,3,"button",7),d()()(),l(22,"section",8),J(23,no,3,9,"div",null,eo),d()}if(t&2){let o=ce(14),p=n.value(),h=X(2,11,"VS_FIELD_GROUP_ROW_INFO",Nt(20,Jn,n.currentNr(),n.totalNr(),n.valuesSummary()));a(3),u("matTooltip",h),a(),V(" ",h," ");let I=_(7,14,"VS_ROW_CONFIRM_TOOLTIP");a(4),u("matTooltip",I),Ot("aria-label",I),u("checked",p.confirmationStatus===n.ConfirmationStatus.Confirmed)("indeterminate",p.confirmationStatus===n.ConfirmationStatus.PartiallyConfirmed)("disabled",n.isReadonly()),a(),u("matMenuTriggerFor",o),E("aria-label",_(10,16,"VS_TABLE_FIELD_CONFIRM_IS_MISSING_TOOLTIP")),a(10),j(_(20,18,"VS_TABLE_HIGHLIGHT_ROW")),a(2),y(n.isReadonly()?-1:21),a(2),Z(n.childValues())}},dependencies:[Gt,Bt,ne,De,Y,ae,q,K,ni,ii,et,Oe,gi,mi,ui,_i,N],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:start;padding-left:8px;border-left:4px solid transparent}.row-info[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;align-items:center}.row-info[_ngcontent-%COMP%] .summary[_ngcontent-%COMP%]{flex-grow:1;align-items:center;padding:2px 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-style:italic;font-weight:700}.row-info[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;align-self:flex-end;gap:8px;padding-right:2px}.values[_ngcontent-%COMP%]{flex-grow:1;width:100%;align-self:flex-end}"],changeDetection:0})}return i})()});function oo(i,r){i&1&&(l(0,"span",3),m(1,"translate"),f(2),m(3,"translate"),d()),i&2&&(u("matTooltip",_(1,2,"VS_SIMPLE_FIELD_REMOVED_MESSAGE_TOOLTIP")),a(2),V(" ",_(3,4,"VS_SIMPLE_FIELD_REMOVED_MESSAGE")," "))}function ao(i,r){i&1&&(l(0,"span",3),m(1,"translate"),f(2),m(3,"translate"),d()),i&2&&(u("matTooltip",_(1,2,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE_TOOLTIP")),a(2),V(" ",_(3,4,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE")," "))}var Cn,xn,hn=le(()=>{"use strict";R();oe();ee();$();L();Ge();de();fe();He();Ue();ut();R();ee();oe();$();L();Cn=(i,r)=>[i,r];xn=(()=>{class i{_configurationsManagerService=x(ge);_extractionManagerService=x(W);_valuesFactoryService=x(ct);_vsKeyboardShortcutsService=x(Q);_bridgeService=x(Ce);field=M.required();taxonomy=M.required();changeValueShortcut=c(()=>this._vsKeyboardShortcutsService.fields()?.changeValue);revertShortcut=c(()=>this._vsKeyboardShortcutsService.fields()?.revert);hasHistory=c(()=>!!this._extractionManagerService.historyMap()[this.field().id]?.history?.length);ConfirmationStatus=z;_fieldConfiguration=c(()=>this._configurationsManagerService.getFieldCustomization(this.taxonomy().id));_pdfSelectionAsPrimaryValue=this._bridgeService.pdfSelectionAsPrimaryValue;canCreateValueWithReference=c(()=>{let e=this._pdfSelectionAsPrimaryValue();return Fe(e,this._fieldConfiguration().referenceEditModes)});createValueTooltip=c(()=>this.canCreateValueWithReference()?"VS_SIMPLE_FIELD_CHANGE_VALUE_TOOLTIP":this.taxonomy().requiresReference?"":"VS_SIMPLE_FIELD_CHANGE_EMPTY_REFERENCE_VALUE_TOOLTIP");selectField(){this._extractionManagerService.setSelectedValue(this.field().id)}addNewValueToField(){if(this.taxonomy().type===F.FieldGroup){let t=this._valuesFactoryService.generateRowOfFields(this.field().fieldId,this.field().id);this._extractionManagerService.addMultipleExtractedValues(this.field().id,[t.value,...t.childValues]);return}let e=w(w({},this._valuesFactoryService.generatePrimaryValue(this.field().fieldId,this.field().id)),this._pdfSelectionAsPrimaryValue());this._extractionManagerService.addExtractedPrimaryValue(this.field().id,e)}revertToPreviousValue(){this._extractionManagerService.restorePreviousValue(this.field().id)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-missing-value"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"]},decls:19,vars:29,consts:[[1,"compact-missing-value",3,"field","taxonomy","value","valueIndex"],["ngProjectAs","content",5,["content"]],["data-testid","missing-value-message",1,"text"],[3,"matTooltip"],["ngProjectAs","pre-suffix-content",5,["pre-suffix-content"]],["mat-icon-button","","data-testid","missing-value-create-value","type","button","color","primary",3,"click","disabled","matTooltip"],["ngProjectAs","post-suffix-content",5,["post-suffix-content"]],["mat-icon-button","","data-testid","missing-value-revert-to-previous-value-button","type","button",3,"click","disabled","matTooltip"]],template:function(t,n){if(t&1&&(l(0,"ui-du-compact-value-shell",0),k(1,1),l(2,"i",2),S(3,oo,4,6,"span",3)(4,ao,4,6,"span",3),d(),B(),k(5,4),l(6,"button",5),m(7,"translate"),m(8,"uiHotkeysComboDisplay"),m(9,"translate"),T("click",function(){return n.addNewValueToField()}),l(10,"mat-icon"),f(11,"add_circle_outline"),d()(),B(),k(12,6),l(13,"button",7),m(14,"translate"),m(15,"uiHotkeysComboDisplay"),m(16,"translate"),T("click",function(){return n.revertToPreviousValue()}),l(17,"mat-icon"),f(18,"undo"),d()(),B(),d()),t&2){let o,p;u("field",n.field())("taxonomy",n.taxonomy())("value",null)("valueIndex",-1),a(3),y(n.field().confirmationStatus===n.ConfirmationStatus.Confirmed?3:4),a(3),u("disabled",n.taxonomy().requiresReference&&!n.canCreateValueWithReference())("matTooltip",Le(23,Cn,_(7,11,n.createValueTooltip()),_(8,13,(o=n.changeValueShortcut())==null?null:o.combos)).join(" ")),E("aria-label",_(9,15,n.createValueTooltip())),a(7),u("disabled",!n.hasHistory())("matTooltip",Le(26,Cn,_(14,17,"VS_SIMPLE_FIELD_REVERT_TOOLTIP"),_(15,19,(p=n.revertShortcut())==null?null:p.combos)).join(" ")),E("aria-label",_(16,21,"VS_SIMPLE_FIELD_REVERT_TOOLTIP"))}},dependencies:[Y,ae,ne,De,q,K,A,he,N,me],styles:[".compact-missing-value[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{font-size:14px;font-weight:400;line-height:20px}"],changeDetection:0})}return i})()});function ro(i,r){if(i&1&&(l(0,"div",2)(1,"div",5)(2,"span"),f(3),m(4,"translate"),d()()()),i&2){let e=s();a(3),j(_(4,1,e.stringValue()))}}function lo(i,r){i&1&&(l(0,"span",6),m(1,"translate"),f(2),m(3,"translate"),d()),i&2&&(u("matTooltip",_(1,2,"VS_SIMPLE_FIELD_REMOVED_MESSAGE_TOOLTIP")),a(2),V(" ",_(3,4,"VS_SIMPLE_FIELD_REMOVED_MESSAGE")," "))}function so(i,r){i&1&&(l(0,"span",6),m(1,"translate"),f(2),m(3,"translate"),d()),i&2&&(u("matTooltip",_(1,2,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE_TOOLTIP")),a(2),V(" ",_(3,4,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE")," "))}function co(i,r){if(i&1&&(l(0,"i",3),S(1,lo,4,6,"span",6)(2,so,4,6,"span",6),d()),i&2){let e=s();a(),y(e.field().confirmationStatus===e.ConfirmationStatus.Confirmed?1:2)}}function po(i,r){if(i&1&&(k(0,4),D(1,"ui-du-compact-validator-notes",7),B()),i&2){let e=s(),t=C(4),n=C(5),o=C(6);a(),u("valueId",t.id)("fieldId",e.field().id)("taxonomy",n)("notes",o)("appInReadonlyMode",!0)}}var Sn,yn=le(()=>{"use strict";R();$();L();Ge();de();ut();en();R();$();L();Sn=(()=>{class i{field=M.required();taxonomy=M.required();value=M.required();valueIndex=M.required();TaxonomyDefinitionType=F;ConfirmationStatus=z;validatorNotesTaxonomy=c(()=>{let e=this.taxonomy();if(e.type===F.Field)return e.validatorNotes});validatorNotes=c(()=>this.validatorNotesTaxonomy()?.enabled?this.value()?.validatorNotes:void 0);validatorNotesLevel=_e;stringValue=c(()=>{let e=this.taxonomy();if(e.type===F.DocumentType)return e.name;if(e.type===F.Table)return"VS_TABLE_FIELD_TITLE";let t=this.value()?.value??"";return t?e.type===F.Field&&e.contentType===ot.Set?e.values.find(n=>n===t)??"":t:""});isMissing=c(()=>!this.value());static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-readonly-value"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],valueIndex:[1,"valueIndex"]},decls:8,vars:10,consts:[[3,"field","taxonomy","value","valueIndex","readonly"],["ngProjectAs","content",5,["content"]],["tabindex","0"],["data-testid","missing-value",1,"text"],["ngProjectAs","validator-notes-value-level",5,["validator-notes-value-level"]],[1,"text"],[3,"matTooltip"],["data-testid","validator-notes",3,"valueId","fieldId","taxonomy","notes","appInReadonlyMode"]],template:function(t,n){if(t&1&&(l(0,"ui-du-compact-value-shell",0),k(1,1),S(2,ro,5,3,"div",2)(3,co,3,1,"i",3),B(),P(4)(5)(6),S(7,po,2,5,"ng-container",4),d()),t&2){u("field",n.field())("taxonomy",n.taxonomy())("value",n.value())("valueIndex",n.valueIndex())("readonly",!0),a(2),y(n.isMissing()?3:2),a(2);let o=O(n.value());a();let p=O(n.validatorNotesTaxonomy());a(),O(n.validatorNotes()),a(),y(p&&p.enabled&&p.level===n.validatorNotesLevel.Value&&o?7:-1)}},dependencies:[q,K,A,he,xe,N],encapsulation:2,changeDetection:0})}return i})()});function mo(i,r){if(i&1){let e=b();l(0,"ui-du-compact-document-type-input",6),m(1,"translate"),T("panelOpenChange",function(n){g(e);let o=s();return v(o.panelOpen.set(n))}),d()}i&2&&E("aria-label",_(1,1,"A11Y_CS_DOCUMENT_TYPE_SELECT"))}function _o(i,r){if(i&1){let e=b();l(0,"ui-du-compact-boolean-input",15),T("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n))}),d()}if(i&2){let e=s(2);u("value",e.value().value??"")("validationError",e.validationError())}}function go(i,r){if(i&1){let e=b();l(0,"ui-du-compact-set-input",16),T("panelOpenChange",function(n){g(e);let o=s(2);return v(o.panelOpen.set(n))})("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n))}),d()}if(i&2){let e=s(2),t=C(1);u("value",e.value().value??"")("validationError",e.validationError())("options",t.values||Rt(3,uo))}}function vo(i,r){if(i&1){let e=b();l(0,"ui-du-compact-number-input",17),T("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n))}),d()}if(i&2){let e=s(2);u("value",e.value().value??"")("validationError",e.validationError())("valueUniqueId",e.value().id)("derivedParts",e.value().derivedParts)("textDirection",e.textDirection())("decimalSeparator",e.docTypeMetadata().decimalSeparator)("thousandsSeparator",e.docTypeMetadata().thousandsSeparator)}}function fo(i,r){if(i&1){let e=b();l(0,"ui-du-compact-monetary-input",18),T("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n))})("derivedPartsChange",function(n){g(e);let o=s(2);return v(o.onDerivedPartsChange(n,!0))}),d()}if(i&2){let e=s(2);u("value",e.value().value??"")("validationError",e.validationError())("valueUniqueId",e.value().id)("derivedParts",e.value().derivedParts)("textDirection",e.textDirection())("decimalSeparator",e.docTypeMetadata().decimalSeparator)("thousandsSeparator",e.docTypeMetadata().thousandsSeparator)}}function Co(i,r){if(i&1){let e=b();l(0,"ui-du-compact-date-input",19),T("panelOpenChange",function(n){g(e);let o=s(2);return v(o.panelOpen.set(n))})("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n))})("derivedPartsChange",function(n){g(e);let o=s(2);return v(o.onDerivedPartsChange(n))}),d()}if(i&2){let e=s(2),t=C(0);u("fieldId",t.id)("value",e.value().value??"")("valueUniqueId",e.value().id)("derivedParts",e.value().derivedParts)("validationError",e.validationError())("textDirection",e.textDirection())("displayFormat",e.docTypeMetadata().dateDisplayFormat)}}function xo(i,r){if(i&1){let e=b();l(0,"ui-du-compact-address-input",20),T("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n,!0))})("derivedPartsChange",function(n){g(e);let o=s(2);return v(o.onDerivedPartsChange(n))})("panelOpenChange",function(n){g(e);let o=s(2);return v(o.panelOpen.set(n))}),d()}if(i&2){let e=s(2);u("value",e.value().value??"")("valueUniqueId",e.value().id)("derivedParts",e.value().derivedParts)("validationError",e.validationError())("maxRows",4)("textDirection",e.textDirection())}}function ho(i,r){if(i&1){let e=b();l(0,"ui-du-compact-name-input",21),T("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n,!0))})("derivedPartsChange",function(n){g(e);let o=s(2);return v(o.onDerivedPartsChange(n))})("panelOpenChange",function(n){g(e);let o=s(2);return v(o.panelOpen.set(n))}),d()}if(i&2){let e=s(2);u("value",e.value().value??"")("valueUniqueId",e.value().id)("derivedParts",e.value().derivedParts)("validationError",e.validationError())("maxRows",4)("textDirection",e.textDirection())}}function So(i,r){if(i&1){let e=b();l(0,"ui-du-compact-text-input",22),T("valueChange",function(n){g(e);let o=s(2);return v(o.onInputValueChanges(n))}),d()}if(i&2){let e=s(2);u("value",e.value().value??"")("validationError",e.validationError())("maxRows",4)("textDirection",e.textDirection())}}function yo(i,r){if(i&1&&S(0,_o,1,2,"ui-du-compact-boolean-input",7)(1,go,1,4,"ui-du-compact-set-input",8)(2,vo,1,7,"ui-du-compact-number-input",9)(3,fo,1,7,"ui-du-compact-monetary-input",10)(4,Co,1,7,"ui-du-compact-date-input",11)(5,xo,1,6,"ui-du-compact-address-input",12)(6,ho,1,6,"ui-du-compact-name-input",13)(7,So,1,4,"ui-du-compact-text-input",14),i&2){let e,t=s(),n=C(1);y((e=n.contentType)===t.FieldType.Boolean?0:e===t.FieldType.Set?1:e===t.FieldType.Number?2:e===t.FieldType.MonetaryQuantity?3:e===t.FieldType.Date?4:e===t.FieldType.Address?5:e===t.FieldType.Name?6:7)}}function To(i,r){if(i&1&&(k(0,5),D(1,"ui-du-compact-validator-notes",23),B()),i&2){let e=s(),t=C(0),n=C(8),o=C(9);a(),u("fieldId",t.id)("valueId",e.value().id)("taxonomy",n)("notes",o)("appInReadonlyMode",!1)}}var uo,Tn,Mn=le(()=>{"use strict";Ct();R();L();Ge();de();fe();Ue();Bn();Mt();qn();ut();R();L();uo=()=>[];Tn=(()=>{class i{_configurationsManagerService=x(ge);_extractionManagerService=x(W);_derivedPartsService=x(dt);_bridgeService=x(Ce);_vsKeyboardShortcutsService=x(Q);_extractionValidationService=x(ve);field=M.required();taxonomy=M.required();value=M.required();valueIndex=M.required();TaxonomyDefinitionType=F;FieldType=ot;panelOpen=G(!1);menuOpen=G(!1);textDirection=G("auto");validationError=c(()=>this._extractionValidationService.invalidPrimaryValuesMap()[this.value().id]?.validationError??null);docTypeMetadata=this._extractionManagerService.documentTypeTaxonomy;hasHistory=c(()=>!!this._extractionManagerService.historyMap()[this.value().id]?.history?.length);displayRTLFeatures=c(()=>this._configurationsManagerService.isRTLFeaturesEnabled()&&Qi(this.taxonomy()));hotkeys=this._vsKeyboardShortcutsService.fields;validatorNotesTaxonomy=c(()=>{let e=this.taxonomy();if(e.type===F.Field)return e.validatorNotes});validatorNotes=c(()=>this.validatorNotesTaxonomy()?.enabled?this.value()?.validatorNotes:void 0);validatorNotesLevel=_e;_fieldConfiguration=c(()=>this._configurationsManagerService.getFieldCustomization(this.taxonomy().id));_pdfSelectionAsPrimaryValue=this._bridgeService.pdfSelectionAsPrimaryValue;pdfHasValidSelectionForValue=c(()=>{let e=this._pdfSelectionAsPrimaryValue();return Fe(e,this._fieldConfiguration().referenceEditModes)&&!at(e?.reference,this.value()?.reference)});changeExtractedValue(){if(!this.pdfHasValidSelectionForValue())return;let e=w(w({},this.value()),this._pdfSelectionAsPrimaryValue());this._extractionManagerService.updateExtractedPrimaryValue(e)}revertToPreviousValue(){this._extractionManagerService.restorePreviousValue(this.value().id)}removeExtractedValue(){this._extractionManagerService.removeExtractedValues(this.field().id,[this.value().id])}onTextDirectionChange(e){this.textDirection.set(e)}reverseWords(){if(!this.value().reference)return;let t=this._bridgeService.reverseWordsInPrimaryValue(this.value());this._extractionManagerService.updateExtractedPrimaryValue(t)}confirmValue(){this._extractionManagerService.changeValueConfirmation(this.value().id,!0)}unconfirmValue(){this._extractionManagerService.changeValueConfirmation(this.value().id,!1)}onInputValueChanges(e,t=!1){let n=this.taxonomy();if(n.type!==F.Field)return;let o=t,p=this.value(),h=w({},p);!e&&p.value!==p.unformattedValue?(h.value=p.unformattedValue,h.derivedParts=p.derivedParts.map(I=>ye(w({},I),{value:""})),o=!1):(h.value=this._derivedPartsService.convertFormattedValueToValue(n.contentType,e)??e,h.derivedParts=this._derivedPartsService.convertFormattedValueToDerivedParts(n.contentType,e),h.reference||(h.unformattedValue=e)),this._extractionManagerService.updateExtractedPrimaryValue(h,o,!0)}onDerivedPartsChange(e,t=!1){let n=w(w({},this.value()),this._derivedPartsService.derivedPartsToValueUpdate(this.value(),e));this._extractionManagerService.updateExtractedPrimaryValue(n,!1,t)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-simple-value"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],valueIndex:[1,"valueIndex"]},decls:11,vars:20,consts:[[3,"field","taxonomy","value","valueIndex","positionCropHorizontally","textDirection"],["ngProjectAs","content",5,["content"]],["data-testid","doc-type-select"],["ngProjectAs","post-suffix-content",5,["post-suffix-content"]],[3,"change","revert","remove","textDirectionChange","reverseWords","stateChange","disableChange","disableRevert","displayRemove","displayTextDirection","displayReverseWords","shouldMarkAsMissingInsteadOfRemove","shouldAddInsteadOfChange","hotkeys"],["ngProjectAs","validator-notes-value-level",5,["validator-notes-value-level"]],["data-testid","doc-type-select",3,"panelOpenChange"],["data-testid","boolean-input",3,"value","validationError"],["data-testid","set-input",3,"value","validationError","options"],["data-testid","number-input",3,"value","validationError","valueUniqueId","derivedParts","textDirection","decimalSeparator","thousandsSeparator"],["data-testid","monetary-quantity-input",3,"value","validationError","valueUniqueId","derivedParts","textDirection","decimalSeparator","thousandsSeparator"],["data-testid","date-input",3,"fieldId","value","valueUniqueId","derivedParts","validationError","textDirection","displayFormat"],["data-testid","address-input",3,"value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],["data-testid","name-input",3,"value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],["data-testid","text-input",3,"value","validationError","maxRows","textDirection"],["data-testid","boolean-input",3,"valueChange","value","validationError"],["data-testid","set-input",3,"panelOpenChange","valueChange","value","validationError","options"],["data-testid","number-input",3,"valueChange","value","validationError","valueUniqueId","derivedParts","textDirection","decimalSeparator","thousandsSeparator"],["data-testid","monetary-quantity-input",3,"valueChange","derivedPartsChange","value","validationError","valueUniqueId","derivedParts","textDirection","decimalSeparator","thousandsSeparator"],["data-testid","date-input",3,"panelOpenChange","valueChange","derivedPartsChange","fieldId","value","valueUniqueId","derivedParts","validationError","textDirection","displayFormat"],["data-testid","address-input",3,"valueChange","derivedPartsChange","panelOpenChange","value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],["data-testid","name-input",3,"valueChange","derivedPartsChange","panelOpenChange","value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],["data-testid","text-input",3,"valueChange","value","validationError","maxRows","textDirection"],["data-testid","validator-notes",1,"validator-notes",3,"fieldId","valueId","taxonomy","notes","appInReadonlyMode"]],template:function(t,n){if(t&1){let o=b();P(0)(1),l(2,"ui-du-compact-value-shell",0),k(3,1),S(4,mo,2,3,"ui-du-compact-document-type-input",2)(5,yo,8,1),B(),k(6,3),l(7,"ui-compact-actions-menu",4),T("change",function(){return g(o),v(n.changeExtractedValue())})("revert",function(){return g(o),v(n.revertToPreviousValue())})("remove",function(){return g(o),v(n.removeExtractedValue())})("textDirectionChange",function(h){return g(o),v(n.onTextDirectionChange(h))})("reverseWords",function(){return g(o),v(n.reverseWords())})("stateChange",function(h){return g(o),v(n.menuOpen.set(h==="open"))}),d(),B(),P(8)(9),S(10,To,2,5,"ng-container",5),d()}if(t&2){let o=O(n.field());a();let p=O(n.taxonomy());a(),u("field",o)("taxonomy",p)("value",n.value())("valueIndex",n.valueIndex())("positionCropHorizontally",n.panelOpen()||n.menuOpen())("textDirection",n.textDirection()),a(2),y(p.type===n.TaxonomyDefinitionType.DocumentType?4:5),a(3),u("disableChange",!n.pdfHasValidSelectionForValue())("disableRevert",!n.hasHistory())("displayRemove",p.type!==n.TaxonomyDefinitionType.DocumentType)("displayTextDirection",n.displayRTLFeatures())("displayReverseWords",n.displayRTLFeatures())("shouldMarkAsMissingInsteadOfRemove",o.valueIds.length===1)("shouldAddInsteadOfChange",o.valueIds.length===0)("hotkeys",n.hotkeys()),a();let h=O(n.validatorNotesTaxonomy());a(),O(n.validatorNotes()),a(),y(h&&h.enabled&&h.level===n.validatorNotesLevel.Value?10:-1)}},dependencies:[Qe,A,rn,on,an,ln,sn,dn,pn,cn,un,he,xe,pt,N],encapsulation:2,changeDetection:0})}return i})()});function bo(i,r){if(i&1){let e=b();l(0,"div",7)(1,"mat-radio-button",8),T("click",function(){let n=g(e).$index,o=s(2);return v(o.onCheckboxClick(n))}),d(),l(2,"div",9),T("click",function(){let n=g(e).$index,o=s(2);return v(o.highlightedSuggestionIndex.set(n))}),l(3,"ui-attention-pill",10),f(4),m(5,"percent"),d(),l(6,"span",11),f(7),d()()()}if(i&2){let e=r.$implicit,t=r.$index,n=s(2);ie("highlighted",n.highlightedSuggestionIndex()===t),E("data-testid","suggestion-item_"+t+"_"+e.id),a(),u("checked",n.selectedSuggestionIndex()===t)("disabled",n.readonly()),E("aria-hidden",!0),a(),u("id","suggestion-option-id-"+e.id),E("aria-labelledby","suggestion-option-id-"+e.id)("aria-selected",n.selectedSuggestionIndex()===t),a(),u("level",n.confidenceLevelToAttentionLevelMap[e.confidenceLevel]),E("data-testid","suggestion-confidence-level-"+e.confidenceLevel),a(),V(" ",_(5,13,e.confidence)," "),a(3),j(e.value)}}function Vo(i,r){if(i&1){let e=b();l(0,"div",3)(1,"div",4),f(2," VS_COMPACT_FIELD_VALUE_SUGGESTIONS_TITLE "),l(3,"span"),f(4),d()(),l(5,"div",5),m(6,"translate"),T("keyup.arrowup",function(){g(e);let n=s();return v(n.navigateThroughOptions("up"))})("keyup.arrowleft",function(){g(e);let n=s();return v(n.navigateThroughOptions("up"))})("keyup.arrowdown",function(){g(e);let n=s();return v(n.navigateThroughOptions("down"))})("keyup.arrowright",function(){g(e);let n=s();return v(n.navigateThroughOptions("down"))})("keydown.enter",function(n){g(e);let o=s();return v(o.replaceSuggestionViaKeyboard(n))})("keydown.space",function(n){g(e);let o=s();return v(o.replaceSuggestionViaKeyboard(n))})("keydown.tab",function(){g(e);let n=s();return v(n.onClose())})("keydown.shift.tab",function(){g(e);let n=s();return v(n.onClose())}),J(7,bo,8,15,"div",6,Mo),d()()}if(i&2){let e=s(),t=C(0),n=C(2);u("cdkTrapFocusAutoCapture",!0),a(4),j(t),a(),E("aria-label",_(6,4,"VS_COMPACT_FIELD_VALUE_SUGGESTIONS_TITLE"))("aria-activedescendant","suggestion-option-id-"+e.highlightedSuggestion().id),a(2),Z(n)}}var Mo,bn,Vn=le(()=>{"use strict";zt();Ct();Xe();R();xi();L();de();fe();He();St();vt();Ue();kn();Mt();R();zt();Ct();xi();L();Mo=(i,r)=>r.id;bn=(()=>{class i{_overlay=x(Yt);_focusMonitor=x(Kt);_extractionManagerService=x(W);_vsKeyboardShortcutsService=x(Q);_bridgeService=x(Ce);field=M.required();taxonomy=M.required();readonly=M(!1);_triggerButton=je.required(Ae,{read:Ne});_suggestionsAsPrimaryValues=c(()=>this._extractionManagerService.suggestionsByParentId()[this.field().id]??[]);suggestionModels=c(()=>this._suggestionsAsPrimaryValues().map(e=>ye(w({},e),{confidenceLevel:nn(e.confidence,this.taxonomy().extractionConfidenceThreshold)})));isOpen=G(!1);highlightedSuggestionIndex=G(0);highlightedSuggestion=c(()=>this.suggestionModels()[this.highlightedSuggestionIndex()]);selectedValue=c(()=>{let e=this.field().valueIds[0];return this._extractionManagerService.getById(e)});isFieldSelected=c(()=>!!this._extractionManagerService.selectedParentValueIdMap()[this.field().id]);selectedSuggestionIndex=c(()=>this.suggestionModels().findIndex(e=>this.selectedValue().value===e.value));confidenceLevelToAttentionLevelMap={[Tt.High]:yt.Success,[Tt.Low]:yt.Error};toggleSuggestionsShortcut=c(()=>this._vsKeyboardShortcutsService.fields()?.toggleSuggestions);scrollStrategy=this._overlay.scrollStrategies.reposition();constructor(){ue(()=>{if(this.isOpen()){let e=this.highlightedSuggestion();this._bridgeService.activeHighlight([e.id])}}),ue(e=>{let t=this._registerHotKeys();e(()=>t?.unsubscribe())})}onKeyDown(e){this.isOpen()&&e.stopPropagation()}onToggle(){return this.isOpen()?this.onClose():this.onOpen()}onOpen(){this.isOpen.set(!0);let e=this.suggestionModels().map(t=>t.id);this._bridgeService.passiveHighlight(e)}onClose(e=!0){this.isOpen()&&(this.isOpen.set(!1),this._bridgeService.activeHighlight([]),this._bridgeService.passiveHighlight([]),e&&(this.isFieldSelected()?this._extractionManagerService.setSelectedValue(this.selectedValue().id):this._focusMonitor.focusVia(this._triggerButton().nativeElement,"keyboard",{preventScroll:!0})))}navigateThroughOptions(e){this.highlightedSuggestionIndex.update(t=>{let n=e==="up"?t-1:t+1;return hi(n,0,this._suggestionsAsPrimaryValues().length-1)})}onCheckboxClick(e){this._replaceSuggestion(e)}replaceSuggestionViaKeyboard(e){e.preventDefault(),this._replaceSuggestion(this.highlightedSuggestionIndex())}_replaceSuggestion(e){let t=this._suggestionsAsPrimaryValues()[e],n=this.selectedValue();!this.readonly()&&n.value!==t.value&&(this._extractionManagerService.updateExtractedPrimaryValue(ye(w({},t),{id:n.id,confirmationStatus:z.Confirmed,isSuggestion:!1})),this.highlightedSuggestionIndex.set(e)),this.onClose(!1)}_registerHotKeys(){let t=[this.toggleSuggestionsShortcut()].filter(Te);return this._vsKeyboardShortcutsService.listen$(t).pipe(Ee(()=>this.isFieldSelected())).subscribe(()=>this.onToggle())}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-suggestions"]],viewQuery:function(t,n){t&1&&ze(n._triggerButton,Ae,5,Ne),t&2&&We()},hostBindings:function(t,n){t&1&&T("keydown",function(p){return n.onKeyDown(p)},Dt)},inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],readonly:[1,"readonly"]},decls:7,vars:15,consts:[["trigger","cdkOverlayOrigin"],["cdkOverlayOrigin","","data-testid","suggestions-trigger-button","tabindex","-1",3,"click","tooltip","value","active"],["cdkConnectedOverlay","","cdkConnectedOverlayBackdropClass","overlay-backdrop",3,"overlayOutsideClick","detach","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayScrollStrategy"],["data-testid","popover-root","cdkFocusInitial","","cdkTrapFocus","",1,"popover",3,"cdkTrapFocusAutoCapture"],["translate","",1,"title"],["data-testid","suggestions-list","tabindex","0","role","listbox",1,"suggestions",3,"keyup.arrowup","keyup.arrowleft","keyup.arrowdown","keyup.arrowright","keydown.enter","keydown.space","keydown.tab","keydown.shift.tab"],[1,"suggestion",3,"highlighted"],[1,"suggestion"],["tabindex","-1",1,"radio-button",3,"click","checked","disabled"],["role","option","data-testid","suggestion-option",1,"option-item",3,"click","id"],[3,"level"],[1,"value"]],template:function(t,n){if(t&1){let o=b();P(0),m(1,"uiHotkeysComboDisplay"),P(2),l(3,"ui-counter",1,0),m(5,"translate"),T("click",function(){return g(o),v(n.onToggle())}),d(),$e(6,Vo,9,6,"ng-template",2),T("overlayOutsideClick",function(){return g(o),v(n.onClose())})("detach",function(){return g(o),v(n.onClose())})}if(t&2){let o,p=ce(4),h=O(_(1,9,(o=n.toggleSuggestionsShortcut())==null?null:o.combos)??"");a(2);let I=O(n.suggestionModels());a(),u("tooltip",se("",_(5,13,"VS_FIELD_VALUE_SUGGESTION_COUNTER_TOOLTIP")," ",h))("value",I.length)("active",n.isOpen()),a(3),u("cdkConnectedOverlayHasBackdrop",!0)("cdkConnectedOverlayOrigin",p)("cdkConnectedOverlayOpen",n.isOpen())("cdkConnectedOverlayScrollStrategy",n.scrollStrategy)}},dependencies:[$t,qt,Qe,Qt,Ae,Ci,fi,A,Ze,bi,Yi,Ht,N,me],styles:[".popover[_ngcontent-%COMP%]{min-width:300px;background:var(--color-background-secondary);border-radius:4px;box-shadow:0 11px 15px -7px #0003,0 24px 38px 3px #00000024,0 9px 46px 8px #0000001f;display:flex;flex-direction:column;gap:2px}.popover[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin:8px;padding:0 12px;font-size:14px;font-weight:600;line-height:20px;color:var(--color-foreground)}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%]{max-height:300px;overflow-y:auto;padding:4px 0;display:flex;flex-direction:column}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%]:focus-visible{outline:none}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion[_ngcontent-%COMP%]{flex:1;display:flex;padding:2px 0;gap:8px}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion[_ngcontent-%COMP%]:hover{background-color:var(--color-background-hover)}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion[_ngcontent-%COMP%]:active{background-color:var(--color-background-pressed)}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion.highlighted[_ngcontent-%COMP%]{background-color:var(--color-background-selected)}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion[_ngcontent-%COMP%]:not(:first-child){border-top:1px solid var(--color-border-de-emp)}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion[_ngcontent-%COMP%] .radio-button[_ngcontent-%COMP%]{padding-left:12px}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion[_ngcontent-%COMP%] .option-item[_ngcontent-%COMP%]{cursor:pointer;flex:1;display:flex;gap:8px;align-items:center}.popover[_ngcontent-%COMP%] .suggestions[_ngcontent-%COMP%] .suggestion[_ngcontent-%COMP%] .option-item[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{font-size:14px;font-weight:400;line-height:20px;color:var(--color-foreground-de-emp)}"],changeDetection:0})}return i})()});function Eo(i,r){i&1&&(l(0,"mat-icon",9),f(1,"table_chart"),d(),l(2,"span"),f(3),m(4,"translate"),d()),i&2&&(a(3),j(_(4,1,"VS_TABLE_FIELD_TITLE")))}function Io(i,r){i&1&&(l(0,"ui-du-compact-input-error",10),f(1),m(2,"translate"),d()),i&2&&(a(),V(" ",_(2,1,"VS_TABLE_FIELD_BODY_IS_REQUIRED_ERROR_MSG")," "))}function Do(i,r){i&1&&(l(0,"ui-du-compact-input-error",10),f(1),m(2,"translate"),d()),i&2&&(a(),V(" ",_(2,1,"VS_TABLE_FIELD_INVALID_CELL_VALUE_ERROR_MSG")," "))}function Oo(i,r){if(i&1&&(S(0,Io,3,3,"ui-du-compact-input-error",10),S(1,Do,3,3,"ui-du-compact-input-error",10)),i&2){let e=s(),t=e.validationError();y(t===e.ValidationCode.TableBodyRequired?0:-1),a(),y(t===e.ValidationCode.InvalidCells?1:-1)}}function Po(i,r){i&1&&(l(0,"span",11),m(1,"translate"),f(2),m(3,"translate"),d()),i&2&&(u("matTooltip",_(1,2,"VS_SIMPLE_FIELD_REMOVED_MESSAGE_TOOLTIP")),a(2),V(" ",_(3,4,"VS_SIMPLE_FIELD_REMOVED_MESSAGE")," "))}function wo(i,r){i&1&&(l(0,"span",11),m(1,"translate"),f(2),m(3,"translate"),d()),i&2&&(u("matTooltip",_(1,2,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE_TOOLTIP")),a(2),V(" ",_(3,4,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE")," "))}function Fo(i,r){if(i&1&&(l(0,"i",5),S(1,Po,4,6,"span",11)(2,wo,4,6,"span",11),d()),i&2){let e=s(),t=C(0);a(),y(t.confirmationStatus===e.ConfirmationStatus.Confirmed?1:2)}}function Uo(i,r){if(i&1&&(k(0,6),D(1,"ui-du-compact-validator-notes",12),B()),i&2){s();let e=C(0),t=C(9),n=C(10);a(),u("fieldId",e.id)("taxonomy",t)("notes",n)("appInReadonlyMode",!1)}}var En,In=le(()=>{"use strict";R();ee();$();L();Ge();de();fe();Ln();Kn();Ue();Mt();Gn();ut();R();ee();$();L();En=(()=>{class i{_extractionManagerService=x(W);_extractionValidationService=x(ve);_tableService=x(tn);_vsKeyboardShortcutsService=x(Q);field=M.required();taxonomy=M.required();readonly=M.required();dummyPrimaryValue=c(()=>{let e=this.field();return e.valueIds.length?ye(w({},e),{type:H.Primary,parentId:e.id,value:null,unformattedValue:null,isAnchorBased:!1,reference:null,derivedParts:[]}):null});validationError=c(()=>this._extractionValidationService.invalidTableFieldValuesMap()[this.field().id]?.validationError);hasHistory=c(()=>!!this._extractionManagerService.historyMap()[this.field().id]?.history?.length);hotkeys=this._vsKeyboardShortcutsService.fields;validatorNotesTaxonomy=c(()=>this.taxonomy().validatorNotes);validatorNotes=c(()=>this.validatorNotesTaxonomy()?.enabled?this.field().validatorNotes:void 0);isSelected=c(()=>this._tableService.selectedTableId()===this.field().id);validatorNotesLevel=_e;ValidationCode=ji;ConfirmationStatus=z;openTableEditor(){this._tableService.selectedTableId()===this.field().id&&this._tableService.isTableEditorVisible.set(!0)}revertToPreviousValue(){this._extractionManagerService.restorePreviousValue(this.field().id)}removeExtractedValue(){let e=this.field().id;this._extractionManagerService.setSelectedValue(e),this._extractionManagerService.removeExtractedValues(e,this.field().valueIds),this._tableService.isTableEditorVisible.set(!1)}onHotkeyPress(e){switch(e){case"revert":this.revertToPreviousValue();break;case"remove":this.removeExtractedValue();break;default:break}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-table-value"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],readonly:[1,"readonly"]},decls:14,vars:20,consts:[[3,"click","field","taxonomy","value","valueIndex","readonly"],["ngProjectAs","content",5,["content"]],[1,"content-wrapper"],[1,"top-side"],[1,"bottom-side"],["data-testid","missing-value-message",1,"text"],["ngProjectAs","validator-notes-value-level",5,["validator-notes-value-level"]],["ngProjectAs","post-suffix-content",5,["post-suffix-content"]],[3,"revert","remove","disableRevert","disableRemove","displayChange","displayTextDirection","displayReverseWords","shouldAddInsteadOfChange","hotkeys"],["fontSet","material-icons-outlined"],["data-testid","error"],[3,"matTooltip"],["data-testid","validator-notes",1,"validator-notes",3,"fieldId","taxonomy","notes","appInReadonlyMode"]],template:function(t,n){if(t&1){let o=b();P(0),l(1,"ui-du-compact-value-shell",0),T("click",function(){return g(o),v(n.openTableEditor())}),k(2,1),l(3,"div",2)(4,"div",3),S(5,Eo,5,3),d(),l(6,"div",4),S(7,Oo,2,2)(8,Fo,3,1,"i",5),d()(),B(),P(9)(10),S(11,Uo,2,4,"ng-container",6),k(12,7),l(13,"ui-compact-actions-menu",8),T("revert",function(){return g(o),v(n.revertToPreviousValue())})("remove",function(){return g(o),v(n.removeExtractedValue())}),d(),B(),d()}if(t&2){let o=O(n.field()),p=!o.valueIds.length;a(),u("field",o)("taxonomy",n.taxonomy())("value",n.dummyPrimaryValue())("valueIndex",0)("readonly",n.readonly()),a(2),ie("no-values",p),a(2),y(p?-1:5),a(2),y(p?8:7),a(2);let h=O(n.validatorNotesTaxonomy());a(),O(n.validatorNotes()),a(),y(h&&h.enabled&&h.level===n.validatorNotesLevel.Value&&!p?11:-1),a(2),u("disableRevert",!n.hasHistory())("disableRemove",p)("displayChange",!1)("displayTextDirection",!1)("displayReverseWords",!1)("shouldAddInsteadOfChange",!0)("hotkeys",n.hotkeys())}},dependencies:[Y,ae,q,K,A,he,Zi,pt,xe,N],styles:[".content-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding-left:8px}.content-wrapper[_ngcontent-%COMP%] .top-side[_ngcontent-%COMP%]{height:48px;display:flex;justify-content:flex-start;align-items:center;gap:12px;padding-left:4px}.content-wrapper[_ngcontent-%COMP%] .bottom-side[_ngcontent-%COMP%]{font-size:14px;font-weight:400;line-height:42px}.content-wrapper.no-values[_ngcontent-%COMP%]{flex-direction:row;padding-left:0}"],changeDetection:0})}return i})()});function Lo(i,r){i&1&&(l(0,"mat-icon",12),m(1,"translate"),f(2," anchor "),d()),i&2&&u("matTooltip",Ie(_(1,2,"VS_FIELD_EDIT_CAPABILITIES_ANCHORS_TOOLTIP")))}function Ao(i,r){i&1&&(l(0,"mat-icon",13),m(1,"translate"),f(2,"crop_free"),d()),i&2&&u("matTooltip",Ie(_(1,2,"VS_FIELD_EDIT_CAPABILITIES_AREA_ONLY_TOOLTIP")))}function ko(i,r){i&1&&(l(0,"mat-icon",14),m(1,"translate"),f(2,"short_text"),d()),i&2&&u("matTooltip",Ie(_(1,2,"VS_FIELD_EDIT_CAPABILITIES_TOKENS_ONLY_TOOLTIP")))}function Bo(i,r){if(i&1&&(l(0,"span",6),S(1,Lo,3,4,"mat-icon",12),S(2,Ao,3,4,"mat-icon",13),S(3,ko,3,4,"mat-icon",14),d()),i&2){let e=s(2);a(),y(e.showAnchorIcon()?1:-1),a(),y(e.showAreaIcon()?2:-1),a(),y(e.showTokensIcon()?3:-1)}}function Ho(i,r){i&1&&(l(0,"mat-chip-listbox")(1,"mat-chip",15),f(2),m(3,"translate"),d()()),i&2&&(a(2),V(" ",_(3,1,"TAXO_FIELD_DEFAULT_VALUE")," "))}function Go(i,r){if(i&1&&D(0,"ui-du-compact-suggestions",8),i&2){let e=s(2),t=C(2),n=C(3);u("field",t)("taxonomy",n)("readonly",e.readonly())}}function Ko(i,r){if(i&1&&D(0,"ui-du-compact-validator-notes",16),i&2){s();let e=C(0),t=C(1),n=s(2),o=C(2);u("fieldId",o.id)("taxonomy",e)("notes",t)("appInReadonlyMode",n.readonly())}}function qo(i,r){if(i&1&&(P(0)(1),S(2,Ko,1,4,"ui-du-compact-validator-notes",16)),i&2){let e=s(2),t=C(2),n=C(3),o=O(n.validatorNotes);a(),O(t.validatorNotes),a(),y(o&&o.enabled&&o.level===e.ValidatorNotesLevel.Field?2:-1)}}function $o(i,r){if(i&1&&D(0,"ui-du-compact-table-value",10),i&2){let e=s(2),t=C(2),n=C(3),o=t.valueIds.length?(e.readonly()?"readonly-":"")+"field-value_0_0":"missing-field-value";u("field",t)("taxonomy",n)("readonly",e.readonly()),E("data-testid",o)}}function zo(i,r){if(i&1&&D(0,"ui-du-compact-field-group-row",17),i&2){let e=r.$implicit,t=r.$index,n=s(3),o=ce(7),p=C(2),h=C(3),I="field-value_"+t+"_"+e;u("field",p)("taxonomy",h)("valueId",e)("valueIndex",t)("level",n.level())("fieldTemplate",o)("isReadonly",n.readonly()),E("data-testid",I)}}function Wo(i,r){if(i&1&&D(0,"ui-du-compact-readonly-value",18),i&2){s(4);let e=C(2),t=C(3);u("field",e)("taxonomy",t)("value",null)("valueIndex",-1)}}function jo(i,r){if(i&1&&D(0,"ui-du-compact-missing-value",19),i&2){s(4);let e=C(2),t=C(3);u("field",e)("taxonomy",t)}}function Xo(i,r){if(i&1&&S(0,Wo,1,4,"ui-du-compact-readonly-value",18)(1,jo,1,2,"ui-du-compact-missing-value",19),i&2){let e=s(3);y(e.readonly()?0:1)}}function Yo(i,r){if(i&1&&J(0,zo,1,8,"ui-du-compact-field-group-row",17,Pt,!1,Xo,2,1),i&2){s(2);let e=C(2);Z(e.valueIds)}}function Qo(i,r){if(i&1&&D(0,"ui-du-compact-readonly-value",20),i&2){let e=s(),t=e.$implicit,n=e.$index,o=C(0),p=s(3),h=C(2),I=C(3);u("field",h)("taxonomy",I)("value",t)("valueIndex",p.parentValueIndex()??n),E("data-testid","readonly-"+o)}}function Jo(i,r){if(i&1&&D(0,"ui-du-compact-simple-value",20),i&2){let e=s(),t=e.$implicit,n=e.$index,o=C(0),p=s(3),h=C(2),I=C(3);u("field",h)("taxonomy",I)("value",t)("valueIndex",p.parentValueIndex()??n),E("data-testid",o)}}function Zo(i,r){i&1&&D(0,"mat-divider")}function ea(i,r){if(i&1&&(P(0),S(1,Qo,1,5,"ui-du-compact-readonly-value",20)(2,Jo,1,5,"ui-du-compact-simple-value",20),S(3,Zo,1,0,"mat-divider")),i&2){let e=r.$implicit,t=r.$index,n=r.$count,o=s(3),p=C(3);O("field-value_"+t+"_"+e.id),a(),y(o.readonly()?1:p.type!==o.TaxonomyDefinitionType.FieldGroup&&p.type!==o.TaxonomyDefinitionType.Table?2:-1),a(2),y(t!==n-1?3:-1)}}function ta(i,r){if(i&1&&D(0,"ui-du-compact-readonly-value",18),i&2){s(4);let e=C(2),t=C(3);u("field",e)("taxonomy",t)("value",null)("valueIndex",-1)}}function ia(i,r){if(i&1&&D(0,"ui-du-compact-missing-value",19),i&2){s(4);let e=C(2),t=C(3);u("field",e)("taxonomy",t)}}function na(i,r){if(i&1&&S(0,ta,1,4,"ui-du-compact-readonly-value",18)(1,ia,1,2,"ui-du-compact-missing-value",19),i&2){let e=s(3),t=C(4);y(e.readonly()?0:t?-1:1)}}function oa(i,r){if(i&1&&J(0,ea,4,3,null,null,No,!1,na,2,1),i&2){let e=s(2);Z(e.fieldValues())}}function aa(i,r){if(i&1){let e=b();l(0,"div",11)(1,"button",21),m(2,"translate"),m(3,"uiHotkeysComboDisplay"),m(4,"translate"),T("click",function(){g(e);let n=s(2);return v(n.addNewValueToField())}),l(5,"mat-icon"),f(6,"add"),d(),f(7),m(8,"translate"),d()()}if(i&2){let e,t=s(2);a(),u("matTooltip",se("",_(2,6,t.multiValueButtonTooltip())," ",_(3,8,(e=t.addValueShortcut())==null?null:e.combos)))("disabled",!t.canAddNewValue()),E("aria-label",_(4,10,t.multiValueButtonTooltip())),a(6),V(" ",_(8,12,"VS_COMPACT_FIELD_ADD_TO_MULTI_VALUE_BUTTON")," ")}}function ra(i,r){if(i&1&&(l(0,"div",2)(1,"div",3)(2,"div",4),D(3,"ui-du-shared-field-hotkey-button",5),m(4,"translate"),S(5,Bo,4,3,"span",6),l(6,"span",7),f(7),m(8,"translate"),d(),S(9,Ho,4,3,"mat-chip-listbox"),S(10,Go,1,3,"ui-du-compact-suggestions",8),d(),S(11,qo,3,3),l(12,"div",9),S(13,$o,1,4,"ui-du-compact-table-value",10)(14,Yo,3,1)(15,oa,3,1),d(),S(16,aa,9,14,"div",11),d()()),i&2){let e=s(),t=C(0),n=C(2),o=C(3),p=C(4);ie("is-document-type",p),a(),ie("has-multiple-values",e.hasMultipleValues())("inline-values",e.inlineValues())("offset-children",o.type===e.TaxonomyDefinitionType.FieldGroup&&!!n.valueIds.length),a(),u("ngClass","level-"+e.level()),a(),u("fieldId",n.fieldId)("disableInteraction",!0)("color",o.color)("hotkey",t)("hotkeyTooltipKey",X(4,24,e.assignHotkeyTooltip(),pe(29,Ro,t)))("disabled",e.readonly()),a(2),y(e.showCapabilitiesIcons()?5:-1),a(2),V(" ",p?_(8,27,"VS_DOCTYPE_LABEL"):o.name," "),a(2),y(n.dataSource===e.ExtractionSource.Defaulted?9:-1),a(),y(e.hasSuggestions()&&n.type===e.ValueType.Field&&o.type===e.TaxonomyDefinitionType.Field?10:-1),a(),y(o.type!==e.TaxonomyDefinitionType.DocumentType?11:-1),a(),ie("full-height",n.valueIds.length===1),a(),y(o.type===e.TaxonomyDefinitionType.Table&&n.type===e.ValueType.Table?13:o.type===e.TaxonomyDefinitionType.FieldGroup&&n.type===e.ValueType.FieldGroup?14:15),a(3),y(!e.readonly()&&o.type!==e.TaxonomyDefinitionType.DocumentType&&o.type!==e.TaxonomyDefinitionType.Table&&o.multiValued&&n.valueIds.length?16:-1)}}function la(i,r){if(i&1&&D(0,"ui-du-compact-field",22),i&2){let e=r.$implicit,t=r.parentValueIndex,n=r.level,o=s(),p="inner-field_"+t+"_"+e.fieldId;u("field",e)("readonly",o.readonly())("inlineValues",o.inlineValues())("assignHotkeyDisabled",!0)("parentValueIndex",t)("level",n),E("data-testid",p)}}var Ro,No,Dn,On=le(()=>{"use strict";Xe();R();oe();nt();ke();ee();$();L();Ge();Un();de();fe();He();St();vt();Ue();Hn();en();fn();hn();yn();Mn();Vn();In();R();ee();oe();$();nt();L();Ro=i=>({key:i}),No=(i,r)=>r.id;Dn=(()=>{class i{_configurationsManagerService=x(ge);_taxonomyManagerService=x(lt);_extractionManagerService=x(W);_valuesFactoryService=x(ct);_bridgeService=x(Ce);_vsKeyboardShortcutsService=x(Q);field=M.required();parentValueIndex=M();level=M(0);inlineValues=M(!1);readonly=M(!1);assignHotkeyDisabled=M(!1);documentTypeId=c(()=>this._extractionManagerService.selectedDocumentTypeId());taxonomy=c(()=>this._taxonomyManagerService.getById(this.field().fieldId));TaxonomyDefinitionType=F;ValidatorNotesLevel=_e;ValueType=H;ExtractionSource=Ai;fieldValues=c(()=>this.field().valueIds.map(e=>this._extractionManagerService.getById(e)).filter(Te).filter(e=>e.type===H.Primary));isSelected=c(()=>{let e=this._extractionManagerService.selectedValueId(),t=this.field().id;return t===e||!!this._extractionManagerService.selectedParentValueIdMap()[t]});hasSuggestions=c(()=>{let e=this.field();return!!this._extractionManagerService.suggestionsByParentId()[e.id]?.length});changeValueShortcut=c(()=>this.readonly()?void 0:this._vsKeyboardShortcutsService.fields()?.changeValue);addValueShortcut=c(()=>this.readonly()?void 0:this._vsKeyboardShortcutsService.fields()?.addValue);assignHotkey=c(()=>this._vsKeyboardShortcutsService.areShortcutsEnabled()&&!this.assignHotkeyDisabled()?Ki(this.taxonomy()):void 0);assignHotkeyTooltip=c(()=>this.assignHotkey()!=null?"VS_FIELD_COLOR_CODED_HOTKEY_TOOLTIP":"VS_FIELD_COLOR_CODED_HOTKEY_MISSING_TOOLTIP");showCapabilitiesIcons=c(()=>!this._allowsOnlyAnchorsAndFeatureIsDisabled()&&!this._editReferenceCapabilities().includes(we.all));showAnchorIcon=c(()=>this._configurationsManagerService.globalCustomizations().isAnchorSelectionAllowed&&this._editReferenceCapabilities().includes(we.anchor));showAreaIcon=c(()=>this._editReferenceCapabilities().includes(we.area));showTokensIcon=c(()=>this._editReferenceCapabilities().includes(we.tokens));_fieldConfiguration=c(()=>this._configurationsManagerService.getFieldCustomization(this.taxonomy().id));_pdfSelectionAsPrimaryValue=this._bridgeService.pdfSelectionAsPrimaryValue;_pdfHasValidSelectionForField=c(()=>{let e=this._pdfSelectionAsPrimaryValue();return Fe(e,this._fieldConfiguration().referenceEditModes)&&this.field().valueIds.every(t=>{let n=this._extractionManagerService.getById(t);return!at(e?.reference,n?.reference)})});_canChangeExistingValueOnFieldHotkey=c(()=>{let e=this.taxonomy();if(this.readonly()||e.type===F.Table||e.type===F.FieldGroup||e.type!==F.DocumentType&&e.multiValued||this.field().valueIds.length!==1)return!1;let t=this._pdfSelectionAsPrimaryValue();return!e.requiresReference&&!t||this._pdfHasValidSelectionForField()});canAddNewValue=c(()=>{let e=this.taxonomy();if(this.readonly()||e.type===F.Table)return!1;let t=this.field(),n=this._pdfSelectionAsPrimaryValue(),o=!e.requiresReference&&!n||this._pdfHasValidSelectionForField();return t.valueIds.length?o&&this.isMultiValued():o});multiValueButtonTooltip=c(()=>this.canAddNewValue()?"":this._pdfSelectionAsPrimaryValue()?"VS_FIELD_ADD_TO_MULTI_VALUE_TOOLTIP":"VS_SIMPLE_FIELD_CHANGE_EMPTY_REFERENCE_VALUE_TOOLTIP");isMultiValued=c(()=>{let e=this.taxonomy();return e.type!==F.DocumentType&&e.multiValued});hasMultipleValues=c(()=>{let e=this.field();return e.type===H.Field&&e.valueIds.length>1});_editReferenceCapabilities=c(()=>this._configurationsManagerService.getFieldCustomization(this.field().fieldId).referenceEditModes);_allowsOnlyAnchors=c(()=>this._editReferenceCapabilities().length===1&&this._editReferenceCapabilities()[0]===we.anchor);_allowsOnlyAnchorsAndFeatureIsDisabled=c(()=>this._allowsOnlyAnchors()&&!this._configurationsManagerService.globalCustomizations().isAnchorSelectionAllowed);_valueToSelect=c(()=>{let e=this.field();return e.type===H.Table||e.type===H.FieldGroup?e.id:e.valueIds[0]??e.id});constructor(){ue(e=>{let t=this._registerHotKeys();e(()=>t?.unsubscribe())})}addNewValueToField(){if(!this.canAddNewValue())return;if(this.taxonomy().type===F.FieldGroup){let t=this._valuesFactoryService.generateRowOfFields(this.field().fieldId,this.field().id);this._extractionManagerService.addMultipleExtractedValues(this.field().id,[t.value,...t.childValues]);return}let e=w(w({},this._valuesFactoryService.generatePrimaryValue(this.field().fieldId,this.field().id)),this._pdfSelectionAsPrimaryValue());this._extractionManagerService.addExtractedPrimaryValue(this.field().id,e)}_handleAssignHotkeyPress(){let e=this._valueToSelect();e&&this._extractionManagerService.setFocusedValue(e);let t=this._pdfSelectionAsPrimaryValue();if(!t){this.isSelected()||this._selectCurrentValue();return}if(this._canChangeExistingValueOnFieldHotkey()){let n=this._extractionManagerService.getById(this.field().valueIds[0]),o=w(w({},n),t);this._extractionManagerService.updateExtractedPrimaryValue(o);return}if(this.canAddNewValue()&&this.taxonomy().type!==F.FieldGroup){let n=w(w({},this._valuesFactoryService.generatePrimaryValue(this.field().fieldId,this.field().id)),t);this._extractionManagerService.addExtractedPrimaryValue(this.field().id,n);return}this.isSelected()||this._selectCurrentValue()}_selectCurrentValue(){this._extractionManagerService.setSelectedValue(this._valueToSelect())}_registerHotKeys(){let e=new bt,t=this.addValueShortcut(),n=this.assignHotkey(),o=[t,n].filter(Te);return e.add(this._vsKeyboardShortcutsService.listen$(o).subscribe(p=>{switch(p.shortcut){case t:this.isSelected()&&this.addNewValueToField();break;case n:this._handleAssignHotkeyPress();break}})),e}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-field"]],inputs:{field:[1,"field"],parentValueIndex:[1,"parentValueIndex"],level:[1,"level"],inlineValues:[1,"inlineValues"],readonly:[1,"readonly"],assignHotkeyDisabled:[1,"assignHotkeyDisabled"]},features:[Ut([...Ji])],decls:8,vars:8,consts:[["fieldTemplate",""],[1,"ui-compact-field",3,"is-document-type"],[1,"ui-compact-field"],[1,"data-point"],[1,"name-container",3,"ngClass"],["data-testid","assign-hotkey-button",3,"fieldId","disableInteraction","color","hotkey","hotkeyTooltipKey","disabled"],[1,"edit-reference-capabilities-icon"],["uiDuSharedSetTitleWhenEllipsesActive","","data-testid","field-name",1,"field-name"],["data-testid","value-suggestions",3,"field","taxonomy","readonly"],["data-testid","field-values",1,"values"],[3,"field","taxonomy","readonly"],[1,"add-value"],["data-testid","capabilities-icon-anchor",3,"matTooltip"],["data-testid","capabilities-icon-area","color","warn",3,"matTooltip"],["data-testid","capabilities-icon-tokens","color","primary",3,"matTooltip"],["data-testid","defaulted-chip","disableRipple","true",1,"chip-mini","validated-chip"],["data-testid","validator-notes",1,"validator-notes",3,"fieldId","taxonomy","notes","appInReadonlyMode"],[3,"field","taxonomy","valueId","valueIndex","level","fieldTemplate","isReadonly"],["data-testid","readonly-missing-field-value",3,"field","taxonomy","value","valueIndex"],["data-testid","missing-field-value",3,"field","taxonomy"],[3,"field","taxonomy","value","valueIndex"],["mat-button","","data-testid","create-value","color","primary",3,"click","matTooltip","disabled"],[3,"field","readonly","inlineValues","assignHotkeyDisabled","parentValueIndex","level"]],template:function(t,n){if(t&1&&(P(0),m(1,"uiHotkeysComboDisplay"),P(2)(3)(4),S(5,ra,17,31,"div",1),$e(6,la,1,7,"ng-template",null,0,At)),t&2){let o;O(X(1,1,(o=n.assignHotkey())==null?null:o.combos,!1)??""),a(2);let p=O(n.field());a();let h=O(n.taxonomy()),I=n.documentTypeId();a(),O(h.type===n.TaxonomyDefinitionType.DocumentType),a(),y(I&&p?5:-1)}},dependencies:[i,kt,Y,ae,ne,Ye,q,K,it,si,tt,A,Ni,Vi,bn,xe,En,Sn,Tn,xn,vn,Oe,N,me],styles:['.ui-compact-field[_ngcontent-%COMP%]{padding:0 2px}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%]{position:relative;padding:2px 0;display:grid;grid-template-areas:"field-name" "validator-notes" "values" "add-value";grid-template-columns:minmax(200px,1fr)}.ui-compact-field[_ngcontent-%COMP%] .data-point.inline-values[_ngcontent-%COMP%]:not(.offset-children){grid-template-areas:"field-name values" ". add-value" "validator-notes validator-notes";grid-template-columns:minmax(200px,2fr) 3fr}.ui-compact-field[_ngcontent-%COMP%] .data-point.offset-children[_ngcontent-%COMP%] > .name-container.level-0[_ngcontent-%COMP%], .ui-compact-field[_ngcontent-%COMP%] .data-point.has-multiple-values[_ngcontent-%COMP%] > .name-container.level-0[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10}.ui-compact-field[_ngcontent-%COMP%] .data-point.offset-children[_ngcontent-%COMP%] > .name-container.level-1[_ngcontent-%COMP%], .ui-compact-field[_ngcontent-%COMP%] .data-point.has-multiple-values[_ngcontent-%COMP%] > .name-container.level-1[_ngcontent-%COMP%]{position:sticky;top:40px;z-index:9}.ui-compact-field[_ngcontent-%COMP%] .data-point.offset-children[_ngcontent-%COMP%] > .name-container.level-2[_ngcontent-%COMP%], .ui-compact-field[_ngcontent-%COMP%] .data-point.has-multiple-values[_ngcontent-%COMP%] > .name-container.level-2[_ngcontent-%COMP%]{position:sticky;top:80px;z-index:8}.ui-compact-field[_ngcontent-%COMP%] .data-point.offset-children[_ngcontent-%COMP%] > .name-container.level-3[_ngcontent-%COMP%], .ui-compact-field[_ngcontent-%COMP%] .data-point.has-multiple-values[_ngcontent-%COMP%] > .name-container.level-3[_ngcontent-%COMP%]{position:sticky;top:120px;z-index:7}.ui-compact-field[_ngcontent-%COMP%] .data-point.offset-children[_ngcontent-%COMP%] > .name-container.level-4[_ngcontent-%COMP%], .ui-compact-field[_ngcontent-%COMP%] .data-point.has-multiple-values[_ngcontent-%COMP%] > .name-container.level-4[_ngcontent-%COMP%]{position:sticky;top:160px;z-index:6}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%] .name-container[_ngcontent-%COMP%]{background-color:var(--color-background);grid-area:field-name;align-self:start;min-height:40px;display:flex;gap:8px;align-items:center;white-space:nowrap;overflow-x:hidden}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%] .name-container[_ngcontent-%COMP%] .field-name[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;line-height:20px;font-weight:400;color:var(--color-foreground)}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%] .name-container[_ngcontent-%COMP%] .edit-reference-capabilities-icon[_ngcontent-%COMP%]{display:inline-flex}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%] .validator-notes[_ngcontent-%COMP%]{grid-area:validator-notes}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%] .values[_ngcontent-%COMP%]{grid-area:values;grid-column-end:none;position:relative;display:flex;flex-direction:column;overflow:visible;gap:8px}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%] .values.full-height[_ngcontent-%COMP%]{max-height:none}.ui-compact-field[_ngcontent-%COMP%] .data-point[_ngcontent-%COMP%] .add-value[_ngcontent-%COMP%]{grid-area:add-value}'],changeDetection:0})}return i})()});function ua(i,r){i&1&&D(0,"mat-divider")}function ma(i,r){if(i&1&&(D(0,"ui-du-compact-field",9),S(1,ua,1,0,"mat-divider")),i&2){let e,t=r.$implicit,n=r.$index,o=r.$count,p=s(2),h=C(0),I=t.fieldId===((e=p.documentTypeTaxonomy())==null?null:e.id),re=p.shouldHideDocumentTypeField()?n:n-1,te=I?"doc-type-field":"field_"+re+"_"+t.fieldId;u("field",t)("readonly",p.readonly())("inlineValues",h),E("data-testid",te),a(),y(n!==o-1?1:-1)}}function _a(i,r){i&1&&(l(0,"span",18),f(1,"VS_EXTRACTION_RESULTS_MAIN_SAVEDRAFT_LOADING_STATE_BUTTON"),d())}function ga(i,r){i&1&&(l(0,"span",18),f(1,"VS_EXTRACTION_RESULTS_MAIN_SAVEDRAFT_BUTTON"),d())}function va(i,r){if(i&1){let e=b();l(0,"button",17),m(1,"translate"),m(2,"uiHotkeysComboDisplay"),T("click",function(){g(e);let n=s(4);return v(n.onSave())}),S(3,_a,2,0,"span",18)(4,ga,2,0,"span",18),d()}if(i&2){let e,t=s(4),n=t.saveMode()===t.SavingState.ASDRAFT&&t.isSaving();u("matTooltip",se("",_(1,6,"VS_EXTRACTION_RESULTS_MAIN_SAVEDRAFT_BUTTON_TOOLTIP")," ",_(2,8,(e=t.saveAsDraftExtractionResultsShortcut())==null?null:e.combos)))("disabled",!t.canSave())("progressButtonLoading",n),a(3),y(n?3:4)}}function fa(i,r){i&1&&(l(0,"span",18),f(1,"VS_EXTRACTION_RESULTS_MAIN_SAVE_LOADING_STATE_BUTTON"),d())}function Ca(i,r){i&1&&(l(0,"span",18),f(1,"VS_EXTRACTION_RESULTS_MAIN_SAVE_BUTTON"),d())}function xa(i,r){if(i&1){let e=b();l(0,"div",15),m(1,"translate"),l(2,"button",19),m(3,"translate"),m(4,"uiHotkeysComboDisplay"),T("click",function(){g(e);let n=s(4);return v(n.onSubmit())}),S(5,fa,2,0,"span",18)(6,Ca,2,0,"span",18),d()()}if(i&2){let e,t=s(4);u("matTooltip",Ie(t.hasInvalidRules()?_(1,8,"VS_SAVE_BUSINESS_RULES_VALIDATION_ERROR"):""));let n=t.saveMode()===t.SavingState.SUBMIT&&t.isSaving();a(2),u("matTooltip",se("",_(3,10,"VS_EXTRACTION_RESULTS_MAIN_SAVE_BUTTON_TOOLTIP")," ",_(4,12,(e=t.saveExtractionResultsShortcut())==null?null:e.combos)))("disabled",!t.canSave()||t.hasInvalidRules())("progressButtonLoading",n),a(3),y(n?5:6)}}function ha(i,r){if(i&1){let e=b();l(0,"button",20),m(1,"translate"),m(2,"uiHotkeysComboDisplay"),T("click",function(){g(e);let n=s(4);return v(n.onReportException())}),f(3," ! "),d()}if(i&2){let e,t=s(4);u("matTooltip",se("",_(1,4,"VS_EXTRACTION_RESULTS_REPORT_DOCUMENT_AS_EXCEPTION_TOOLTIP")," ",_(2,6,(e=t.reportDocumentAsExceptionShortcut())==null?null:e.combos)))("disabled",t.isSaving()||t.isFormattingDerivedParts())}}function Sa(i,r){if(i&1){let e=b();l(0,"div",10)(1,"button",12),m(2,"translate"),m(3,"uiHotkeysComboDisplay"),T("click",function(){g(e);let n=s(3);return v(n.onDiscardChanges())}),f(4),m(5,"translate"),d(),l(6,"div",13),S(7,va,5,10,"button",14),S(8,xa,7,14,"div",15),d(),S(9,ha,4,8,"button",16),d()}if(i&2){let e,t=s(3);a(),u("matTooltip",se("",_(2,8,"VS_EXTRACTION_RESULTS_DISCARD_CHANGES_TOOLTIP")," ",_(3,10,(e=t.discardChangesShortcut())==null?null:e.combos)))("disabled",!t.canDiscardChanges()),a(3),V(" ",_(5,12,"VS_EXTRACTION_RESULT_DISCARD_CHANGES_BUTTON")," "),a(3),y(t.enableSaveAsDraft()?7:-1),a(),y(t.options().hideSubmitButton?-1:8),a(),y(!t.options().hideReportAsExceptionButton&&t.isReportExceptionAllowed()?9:-1)}}function ya(i,r){if(i&1&&(f(0),m(1,"translate")),i&2){let e=s(4);V(" ",X(1,1,"VS_EXTRACTION_RESULTS_UNCONFIRMED_REGULAR_AND_TABLE_FIELDS_DECIDE_MESSAGE",Le(4,sa,e.numberOfUnconfirmedRegularValues(),e.numberOfUnconfirmedTableValues()))," ")}}function Ta(i,r){if(i&1&&(f(0),m(1,"translate")),i&2){let e=s(4);V(" ",X(1,1,"VS_EXTRACTION_RESULTS_UNCONFIRMED_REGULAR_FIELDS_DECIDE_MESSAGE",pe(4,da,e.numberOfUnconfirmedRegularValues()))," ")}}function Ma(i,r){if(i&1&&(f(0),m(1,"translate")),i&2){let e=s(4);V(" ",X(1,1,"VS_EXTRACTION_RESULTS_UNCONFIRMED_TABLE_FIELDS_DECIDE_MESSAGE",pe(4,ca,e.numberOfUnconfirmedTableValues()))," ")}}function ba(i,r){if(i&1){let e=b();l(0,"div",11)(1,"div",21)(2,"span"),S(3,ya,2,7)(4,Ta,2,6)(5,Ma,2,6),d(),l(6,"span",18),f(7," VS_EXTRACTION_RESULTS_UNCONFIRMED_FIELDS_CONTINUE_QUESTION "),d()(),l(8,"div",22)(9,"button",23),T("click",function(){g(e);let n=s(3);return v(n.onContinueAndSave())}),f(10),m(11,"translate"),d(),l(12,"button",24),T("click",function(){g(e);let n=s(3);return v(n.onCancelDecisionMode())}),f(13),m(14,"translate"),d()()()}if(i&2){let e=s(3);a(3),y(e.numberOfUnconfirmedRegularValues()>0&&e.numberOfUnconfirmedTableValues()>0?3:e.numberOfUnconfirmedRegularValues()>0?4:e.numberOfUnconfirmedTableValues()>0?5:-1),a(7),V(" ",_(11,3,"VS_EXTRACTION_RESULTS_CONTINUE_AND_SAVE_BUTTON")," "),a(3),V(" ",_(14,5,"VS_EXTRACTION_RESULTS_NO_CONTINUE_BUTTON")," ")}}function Va(i,r){if(i&1&&(l(0,"div",7),S(1,Sa,10,14,"div",10)(2,ba,15,7,"div",11),d()),i&2){let e=s(2);a(),y(e.isInDecidingMode()?2:1)}}function Ea(i,r){i&1&&(l(0,"div",8)(1,"span",25),f(2,"VS_EXTRACTION_RESULTS_READONLY_LABEL"),d()())}function Ia(i,r){if(i&1){let e=b();l(0,"form",1),T("submit",function(n){return g(e),v(n.preventDefault())}),l(1,"as-split",2)(2,"as-split-area",3)(3,"div",4),J(4,ma,2,5,null,null,pa),d()(),l(6,"as-split-area",5)(7,"ui-du-compact-business-rules",6),T("toggle",function(n){g(e);let o=s();return v(o.onBusinessRulesToggle(n))})("ruleClick",function(n){g(e);let o=s();return v(o.onBusinessRuleClick(n))}),d()()(),S(8,Va,3,1,"div",7)(9,Ea,3,0,"div",8),d()}if(i&2){let e=s(),t=C(0);E("data-testid","compact-fields-container_"+(t?"inline":"stacked")),a(),u("unit",e.businessRulesExpanded()?"percent":"pixel")("disabled",!e.businessRulesExpanded()),a(),u("size",e.businessRulesExpanded()?70:"*"),a(2),Z(e.fieldValuesToRender()),a(2),u("size",e.businessRulesExpanded()?30:38)("maxSize",70),a(2),y(e.readonly()?9:8)}}var sa,da,ca,pa,Da,Hs,Oa=le(()=>{Xt();R();pi();ti();oe();ke();ee();$();L();Fn();Oi();Rn();de();fe();He();St();Wi();vt();wn();Nn();An();Ue();gn();On();R();ti();Xt();oe();$();ke();L();Wi();Oi();sa=(i,r)=>({notConfirmedFields:i,notConfirmedTables:r}),da=i=>({notConfirmedFields:i}),ca=i=>({notConfirmedTables:i}),pa=(i,r)=>r.id;Da=550,Hs=(()=>{class i{_destroyRef=x(It);_configurationManagerService=x(ge);_taxonomyManagerService=x(lt);_extractionManagerService=x(W);_rulesManagerService=x(st);_vsKeyboardShortcutsService=x(Q);_businessTelemetryService=x(Xi);_errorService=x(Hi);_snackBarService=x(Ei);_translateService=x(Je);_extractionValidationService=x(ve);_externalInteractions=x(Gi);_dialogService=x(Li);readonly=M(!1);enableSaveAsDraft=M(!1);options=M({});businessRulesExpanded=G(!1);SavingState=Me;isReportExceptionAllowed=c(()=>this._configurationManagerService.globalCustomizations().isReportExceptionAllowed);isSaving=c(()=>this._extractionManagerService.status().saving);saveMode=G(Me.ASDRAFT);shouldInlineFieldsForm=G(null);isInDecidingMode=G(!1);isFormattingDerivedParts=c(()=>Object.values(this._extractionManagerService.formattingDerivedPartsPerValueMap()).some(ht));hasInvalidRules=this._rulesManagerService.hasInvalidRules;canSave=c(()=>![this.isFormattingDerivedParts(),this.isInDecidingMode(),this.isSaving(),this.readonly()].some(ht));canDiscardChanges=c(()=>!this.isSaving()&&!this.readonly()&&this._extractionManagerService.hasHistory());hasUnconfirmedValues=c(()=>this._extractionManagerService.entities().some(e=>e.confirmationStatus!==z.Confirmed));numberOfUnconfirmedRegularValues=c(()=>this._extractionManagerService.navigableFieldValueIds().map(e=>this._extractionManagerService.getById(e)).filter(e=>e.type!==H.Table&&e.confirmationStatus!==z.Confirmed).length);numberOfUnconfirmedTableValues=c(()=>this._extractionManagerService.navigableFieldValueIds().map(e=>this._extractionManagerService.getById(e)).filter(e=>e.type===H.Table&&e.confirmationStatus!==z.Confirmed).length);moveToNextShortcut=c(()=>this._vsKeyboardShortcutsService.fields()?.moveToNext);moveToPreviousShortcut=c(()=>this._vsKeyboardShortcutsService.fields()?.moveToPrevious);saveExtractionResultsShortcut=c(()=>this.readonly()?void 0:this._vsKeyboardShortcutsService.general()?.saveExtractionResults);discardChangesShortcut=c(()=>this.readonly()?void 0:this._vsKeyboardShortcutsService.general()?.discardChanges);reportDocumentAsExceptionShortcut=c(()=>this.readonly()?void 0:this._vsKeyboardShortcutsService.general()?.reportDocumentAsException);saveUnconfirmedDataShortcut=c(()=>!this.readonly()&&this.isInDecidingMode()?this._vsKeyboardShortcutsService.general()?.saveUnconfirmedData:void 0);cancelSaveUnconfirmedDataShortcut=c(()=>!this.readonly()&&this.isInDecidingMode()?this._vsKeyboardShortcutsService.general()?.cancelSaveUnconfirmedData:void 0);saveAsDraftExtractionResultsShortcut=c(()=>!this.readonly()&&this.enableSaveAsDraft()?this._vsKeyboardShortcutsService.general()?.saveAsDraftExtractionResults:void 0);documentTypeTaxonomy=c(()=>{let e=this._extractionManagerService.selectedDocumentTypeId();return e?this._taxonomyManagerService.getById(e):null});shouldHideDocumentTypeField=c(()=>!!this.options().hideDocumentTypeField);fieldValuesToRender=c(()=>{let e=this._extractionManagerService.selectedDocumentTypeId();if(!e)return[];let t=this.shouldHideDocumentTypeField(),n=this._extractionManagerService.getById(e),o=this._extractionManagerService.entities().filter(p=>p.parentId===e).filter(rt);return[...t?[]:[n],...o]});_resizeObserver=new ResizeObserver(Ti(([e])=>this._handleResize(e),10));_hostElement=x(Ne).nativeElement;_saveResult$=ci(this._extractionManagerService.status).pipe(Vt(),Ee(([e,t])=>e.saving&&(t.saved||!!t.saveError)),gt(([,e])=>e.saveError??Si(!0)));_saveResult=Be(this._saveResult$);constructor(){ue(e=>{let t=this._registerHotKeys();e(()=>t?.unsubscribe())}),ue(()=>{let e=this._saveResult();if(e?.isSuccess)this._showSaveSuccessMessage();else if(e?.hasErrors){let t=e.errorMessageKey?this._translateService.instant(e.errorMessageKey,e.errorMessageParams):e.errorMessage;this._businessTelemetryService.submitErrorEvent(0,t)}})}ngOnInit(){this._externalInteractions.save$.pipe(Et(e=>this._onExternalSave(!e)),xt(this._destroyRef)).subscribe(e=>this._externalInteractions.saveResult$.next(e)),this._attachResizeObserver()}ngOnDestroy(){this._resizeObserver.disconnect()}onBusinessRulesToggle(e){this.businessRulesExpanded.set(e)}onBusinessRuleClick(e){let t=this._taxonomyManagerService.fieldIdToParentFieldIdDictionary()[e.fieldId];if(t){let p=this._extractionManagerService.entities().filter(rt).find(te=>te.fieldId===t&&te.type!==H.Field);if(!p)return;if(e.fieldValueIndex<0){this._extractionManagerService.setSelectedValue(p.id);return}let h=p.valueIds[e.fieldValueIndex],I=this._extractionManagerService.getById(h).valueIds.map(te=>this._extractionManagerService.getById(te)).find(te=>te.fieldId===e.fieldId),re=I?.valueIds[0]??I?.id;re&&this._extractionManagerService.setSelectedValue(re);return}let n=this._extractionManagerService.entities().filter(rt).find(p=>p.fieldId===e.fieldId),o=e.fieldValueIndex>=0?n?.valueIds[e.fieldValueIndex]:n?.id;o&&this._extractionManagerService.setSelectedValue(o)}onSave(){this.saveMode.set(Me.ASDRAFT),this.canSave()&&this._extractionManagerService.save(!0)}onSubmit(){if(this.saveMode.set(Me.SUBMIT),!!this.canSave()&&this._validateFieldsForm()){if(this.hasUnconfirmedValues()){this.isInDecidingMode.set(!0);return}if(this.hasInvalidRules()){this._showInvalidBusinessRuleErrorMessage(!0);return}this._extractionManagerService.save(!1)}}onCancelDecisionMode(){this.isInDecidingMode.set(!1)}onContinueAndSave(){this.isInDecidingMode.set(!1),this.canSave()&&(this._extractionManagerService.confirmAll(),this.onSubmit())}onReportException(){if(this.readonly())return;let e=this._taxonomyManagerService.reportAsExceptionReasons(),t=this._dialogService.openReportAsExceptionDialog(e);t&&t.afterClosed().pipe(qe(1),Ee(n=>!!n&&n.result)).subscribe(n=>this._extractionManagerService.reportAsException(n?.message))}onDiscardChanges(){if(!this.canDiscardChanges())return;let e=this._dialogService.openDiscardChangesDialog();e&&e.afterClosed().pipe(qe(1),Ee(t=>!!t&&t.result)).subscribe(()=>{this._extractionManagerService.discardAllChanges()})}_onExternalSave(e){return this.saveMode.set(e?Me.ASDRAFT:Me.SUBMIT),this.isSaving()?Ve({success:!1,error:"Saving is already in progress."}):this.readonly()?Ve({success:!1,error:"Saving is disabled in readonly mode."}):this.isFormattingDerivedParts()?Ve({success:!1,error:"Values are formatting. Try saving again."}):!e&&this.hasInvalidRules()?Ve({success:!1,error:"There are invalid business rules."}):!e&&!this._validateFieldsForm()?Ve({success:!1,error:"There are invalid values in the form."}):(e||this._extractionManagerService.confirmAll(),this._extractionManagerService.save(e),this._saveResult$.pipe(gt(t=>({success:t.isSuccess,error:t.errorMessageKey??t.errorMessage})),xt(this._destroyRef),qe(1)))}_showSaveSuccessMessage=()=>{let e=this._translateService.instant("VS_EXTRACTION_RESULTS_SAVE_SUCCESS_MESSAGE");this._snackBarService.success(e)};_showSaveErrorMessage=e=>{let n=e.details??e.message;this._snackBarService.error(n,{duration:0})};_showInvalidBusinessRuleErrorMessage(e){if(!e)return;let t=this._translateService.instant("VS_SAVE_BUSINESS_RULES_VALIDATION_ERROR");this._showSaveErrorMessage({message:t})}_validateFieldsForm(){let e=this._extractionValidationService.invalidPrimaryValues()[0];return e?(this._extractionManagerService.setSelectedValue(e.value.id),!1):!0}_registerHotKeys(){let e=this.moveToNextShortcut(),t=this.moveToPreviousShortcut(),n=this.saveExtractionResultsShortcut(),o=this.discardChangesShortcut(),p=this.reportDocumentAsExceptionShortcut(),h=this.saveUnconfirmedDataShortcut(),I=this.cancelSaveUnconfirmedDataShortcut(),re=this.saveAsDraftExtractionResultsShortcut(),te=[e,t,n,o,p,h,I,re].filter(Te);return this._vsKeyboardShortcutsService.listen$(te).subscribe(Pn=>{switch(Pn.shortcut){case e:this._extractionManagerService.navigateToNextValue(!this.readonly());break;case t:this._extractionManagerService.navigateToPreviousValue(!this.readonly());break;case n:this.onSubmit();break;case o:this.onDiscardChanges();break;case p:this.onReportException();break;case h:this.onContinueAndSave();break;case I:this.onCancelDecisionMode();break;case re:this.onSave();break;default:break}})}_attachResizeObserver(){this._resizeObserver.observe(this._hostElement)}_handleResize(e){let t=e.contentRect.width,n=this.shouldInlineFieldsForm(),o=t>=Da;n!==o&&this.shouldInlineFieldsForm.set(o)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=U({type:i,selectors:[["ui-du-compact-fields-form"]],inputs:{readonly:[1,"readonly"],enableSaveAsDraft:[1,"enableSaveAsDraft"],options:[1,"options"]},decls:2,vars:2,consts:[["tabindex","0",1,"compact-fields-form"],["tabindex","0",1,"compact-fields-form",3,"submit"],["direction","vertical",1,"form-content",3,"unit","disabled"],[1,"fields-split-area",3,"size"],["cdkScrollable","","data-testid","compact-fields",1,"compact-fields"],[3,"size","maxSize"],[1,"compact-business-rules",3,"toggle","ruleClick"],[1,"footer"],[1,"footer","readonly"],[3,"field","readonly","inlineValues"],[1,"buttons"],["data-testid","decide-unconfirmed-fields",1,"decide-unconfirmed-fields"],["mat-button","","data-testid","btn-discard-changes",1,"discard","btn-small",3,"click","matTooltip","disabled"],[1,"save-buttons"],["ui-progress-button","","mat-stroked-button","","color","secondary","data-testid","save-as-draft-button",1,"save-as-draft","btn-small",3,"matTooltip","disabled","progressButtonLoading"],[3,"matTooltip"],["mat-flat-button","","data-testid","report-exception-button","color","warn",1,"report","btn-small",3,"matTooltip","disabled"],["ui-progress-button","","mat-stroked-button","","color","secondary","data-testid","save-as-draft-button",1,"save-as-draft","btn-small",3,"click","matTooltip","disabled","progressButtonLoading"],["translate",""],["ui-progress-button","","mat-flat-button","","color","primary","data-testid","save-button","type","button",1,"save","btn-small",3,"click","matTooltip","disabled","progressButtonLoading"],["mat-flat-button","","data-testid","report-exception-button","color","warn",1,"report","btn-small",3,"click","matTooltip","disabled"],["data-testid","decide-message",1,"decide-message"],[1,"decide-buttons"],["mat-flat-button","","color","primary","data-testid","continue-and-save",1,"btn-small",3,"click"],["mat-flat-button","","color","warn","data-testid","cancel-save",1,"btn-small",3,"click"],["data-testid","readonly-label","translate","",1,"readonly-label"]],template:function(t,n){if(t&1&&(P(0),S(1,Ia,10,7,"form",0)),t&2){let o=O(n.shouldInlineFieldsForm());a(),y(o!==null?1:-1)}},dependencies:[ei,Zt,Jt,jt,Wt,Y,ne,Ye,q,K,et,Oe,A,Ze,zi,qi,$i,Di,Ii,Dn,_n,N,me],styles:[".compact-fields-form[_ngcontent-%COMP%]{height:100%;position:relative;display:flex;flex-direction:column}.compact-fields-form[_ngcontent-%COMP%] .form-content[_ngcontent-%COMP%]{flex-grow:1}.compact-fields-form[_ngcontent-%COMP%] .form-content[_ngcontent-%COMP%] .fields-split-area[_ngcontent-%COMP%]{overflow:hidden}.compact-fields-form[_ngcontent-%COMP%] .form-content[_ngcontent-%COMP%] .fields-split-area[_ngcontent-%COMP%] .compact-fields[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-direction:column;height:100%;overflow:auto}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;flex-wrap:wrap;border-top-width:1.2px;border-top-style:solid;padding:10px 20px}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .ui-select[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{font-size:14px;max-width:85px}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .buttons[_ngcontent-%COMP%]{display:flex;flex-grow:1;justify-content:flex-end;gap:10px;align-items:center}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .buttons[_ngcontent-%COMP%] .report[_ngcontent-%COMP%]{min-width:37px}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .buttons[_ngcontent-%COMP%] .save-buttons[_ngcontent-%COMP%]{display:flex;gap:10px}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .buttons[_ngcontent-%COMP%] .save-buttons[_ngcontent-%COMP%] .save[_ngcontent-%COMP%], .compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .buttons[_ngcontent-%COMP%] .save-buttons[_ngcontent-%COMP%] .save-as-draft[_ngcontent-%COMP%]{min-width:95px}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .decide-unconfirmed-fields[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;width:100%}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .decide-unconfirmed-fields[_ngcontent-%COMP%] .decide-message[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-grow:1;align-items:flex-end;margin-right:20px;text-align:right}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .decide-unconfirmed-fields[_ngcontent-%COMP%] .decide-message[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:first-child{font-size:10px}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .decide-unconfirmed-fields[_ngcontent-%COMP%] .decide-message[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-child(2){font-size:12px}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .decide-unconfirmed-fields[_ngcontent-%COMP%] .decide-buttons[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center}.compact-fields-form[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .decide-unconfirmed-fields[_ngcontent-%COMP%] .decide-buttons[_ngcontent-%COMP%] .mat-mdc-unelevated-button[_ngcontent-%COMP%]:nth-child(2){margin-left:10px}.compact-fields-form[_ngcontent-%COMP%] .footer.readonly[_ngcontent-%COMP%] .readonly-label[_ngcontent-%COMP%]{height:24px;flex-grow:1;text-align:center}"],changeDetection:0})}return i})()});Oa();export{Hs as UiCompactFieldsFormComponent};
@@ -1,4 +1,4 @@
1
- import{$ as g,$a as r,$e as ri,A as st,Ab as s,Af as Je,Ak as Rn,Bb as y,Bf as Ze,Cb as v,Cf as fi,Ci as ki,D as At,De as Qe,Df as _i,Eb as $t,Ee as ae,Ef as hi,Fa as M,Fb as Ht,Ff as Ci,Gb as Ne,Ha as Lt,Hb as $e,He as ye,Hf as gi,Ib as qt,Ie as re,Ja as X,Jc as jt,Je as le,Jk as Qi,Kk as Vn,Mf as xi,Mk as it,Nd as Se,Ni as Sn,Nk as ji,O as dt,Od as Te,Oe as ei,Pc as Xt,Pd as Ee,Pe as je,Qi as he,R as Fe,Ra as k,Re as se,Ri as ht,Sb as _,Se as de,Ta as u,Tb as h,Te as ce,U as un,Ue as ti,Va as f,Vc as fn,Vf as vi,We as hn,Wi as me,Wj as zi,X as Ce,Xa as De,Xe as ii,Xi as Ct,Ya as L,Ye as ni,Za as z,Zb as E,Ze as oi,_a as C,_b as Gt,_e as ai,_i as gt,_j as En,ab as l,af as li,al as nt,ba as R,bb as Ue,bi as Vi,bk as $i,bl as Xi,c as Ft,ca as V,cc as He,ci as Cn,cl as Me,d as Dt,dc as mt,dl as bt,ee as Yt,ei as Oi,ej as Li,el as we,fd as qe,fi as Fi,fl as St,ga as Pt,ge as N,gi as gn,gk as yn,gl as Wi,hc as Qt,hd as Wt,hk as Hi,hl as On,ia as ge,ib as U,id as _n,ik as In,jk as xt,ka as Bt,ke as Kt,kg as bi,l as rt,la as xe,lb as b,lc as S,le as G,lf as si,lh as Mi,li as Di,lk as H,ma as ve,mb as x,mc as $,mf as di,mg as Si,mk as Pe,na as kt,nd as Ge,nf as ci,ni as Ui,o as lt,of as pi,oi as Ni,pc as J,pd as ee,pf as Ie,qb as W,qd as te,qe as Jt,qg as Ti,qh as et,rb as Y,re as ie,rf as ut,rg as Ei,rh as wi,sa as a,sb as K,sf as ft,sg as yi,sh as Ri,si as xn,tc as Z,te as Zt,tf as pe,tg as Ii,ti as vn,tk as vt,ua as D,ub as ct,uc as q,uf as Xe,ui as Ai,vb as zt,ve as ne,vf as We,vi as bn,w as Ut,wb as pt,wf as Ye,wh as Ae,wi as Pi,wk as Mn,xf as mi,xh as _t,xi as Bi,xk as qi,yb as T,ye as oe,yf as ui,yh as tt,yj as Tn,yk as wn,z as Nt,zb as be,ze as Q,zf as Ke,zk as Gi}from"./chunk-5LGMGLPM.js";import{a as Vt,b as Ot,f as F}from"./chunk-3ONYU5UZ.js";var zo,Fn=F(()=>{"use strict";gt();S();zo=(()=>{class n{unconfirmedRegularValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType!=="Table"));return Math.max(0,i-t)}unconfirmedTableValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType==="Table"));return Math.max(0,i-t)}hasAllValuesConfirmed(e){return e?e.fields.find(t=>t.isMissing?!Ct(t.confirmationStatus):t.values.find(o=>!Ct(o.confirmationStatus)))===void 0:!0}_countConfirmedValuesForFields(e){return e.reduce(({total:i,confirmed:t},o)=>(o.isMissing&&(i+=1,t+=o.confirmationStatus===me.Confirmed?1:0),i+=o.values.length,o.values.forEach(d=>t+=d.confirmationStatus===me.Confirmed?1:0),{total:i,confirmed:t}),{total:0,confirmed:0})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Re,Be,Yi,Ki=F(()=>{"use strict";S();ft();Cn();G();Sn();Bi();tt();gt();vi();un();En();wn();Mn();Rn();In();Vn();bt();Pe();ji();S();Re=(function(n){return n.None="None",n.Partial="Partial",n.All="All",n})(Re||{}),Be=(function(n){return n.NextUnconfirmedCell="next-unconfirmed-cell",n.ConfirmAllCells="confirm-all-valid-cells",n})(Be||{}),Yi=(()=>{class n{_documentInfoService=g(Hi);_apoFactory=g(qi);_bridgeService=g(it);_extractionService=g(Me);_extractionValidationService=g(H);_externalInteractionsService=g(Qi);_errorService=g(ki);_pdfMapper=g(Gi);_translateService=g(Yt);_sharedSettings=g(Oi);tableFieldId=ge(null);_isReadonly=ge(!1);_selectedExtraction=ut(this._extractionService.selectedExtraction$);cellToScrollTo$=new Dt(null);tableInitialized$=new Ft;tableInitialized=ut(this.tableInitialized$);rowsPerPage=ge(this._sharedSettings.getPersistedTableRowsPerPage()??10);pageIndex=ge(0);tableSelectionAppendFromRowIndex=ge(void 0);tableField=E(()=>this._selectedExtraction()?.fields.find(e=>e.id===this.tableFieldId()));tableValue=E(()=>this.tableField()?.values[0]);numberOfRows=E(()=>this.tableValue()?.body.rows.length??0);hasRows=E(()=>this.numberOfRows()>0);numberOfInvalidCells=E(()=>this._getNumberOfInvalidCells());numberOfUnconfirmedCells=E(()=>this._getNumberOfUnconfirmedCells());totalPages=E(()=>{let e=this.tableValue();return e?.body.rows?Math.ceil(e.body.rows.length/this.rowsPerPage()):0});confirmationButtonGroupOptions=E(()=>{let e=this.numberOfUnconfirmedCells(),i=this.numberOfInvalidCells();return[{id:Be.NextUnconfirmedCell,text:this._translateService.instant(e===1?"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.singular":"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.plural",{numberOfUnconfirmedCells:e}),description:this._translateService.instant("VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON_TOOLTIP",{numberOfUnconfirmedCells:e})},{id:Be.ConfirmAllCells,text:this._translateService.instant("VS_TABLE_CONFIRM_ALL_CELLS_BUTTON"),disabled:i>0}]});paginatedDataSource=E(()=>{let e=this.tableValue(),i=this.pageIndex(),t=this.rowsPerPage(),o=e?e.body.rows.slice(i*t,(i+1)*t):[];return new Vi(o)});header=E(()=>{let e=this.tableValue();if(e?.header)return e.header;let i=this.tableField(),t=this._selectedExtraction();return i&&t?this._apoFactory.createEmptyTableHeader(i.id,t.docTypeId):null});headerRow=E(()=>this.header()?.cells??[]);headerRowIds=E(()=>this.headerRow().map(e=>e.id).concat(["actions"]),{equal:gi});constructor(){this._externalInteractionsService.selectTableCellInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e.table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this.selectCell(e)),this._externalInteractionsService.selectTableRowInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e[0].table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this._selectTableRow(e))}init({tableFieldId:e,isReadonly:i}){this._resetState(),this.tableFieldId.set(e),this._isReadonly.set(i),this.tableInitialized$.next()}cleanup(){this._resetState()}setRowsPerPage(e){this._updatePagination(0,e)}changePage(e){this._updatePagination(e,this.rowsPerPage())}selectCell(e,i=!1){let t=this.rowsPerPage(),o=this.pageIndex(),d=Math.floor(e.cell.rowIndex/t);d!==o&&e.cell.rowIndex!==-1&&(this._updatePagination(d,t),this.cellToScrollTo$.next(e.cell.uniqueId));let p=this._bridgeService.selectedTableCell$.value,O=(p?.cell.values?.length??0)>0;!this._isReadonly()&&(i||O)&&p?.cell&&p.cell.uniqueId!==e.cell.uniqueId&&this._extractionService.changeTableCellConfirmation({tableFieldId:p.table.id,rowUniqueId:p.cell.rowUniqueId,cellUniqueId:p.cell.uniqueId},!0),this._bridgeService.selectedTableCell$.next(e)}addNewRow(e){let i=this.getPaginatedRow(e),t=this._getSafeTableField(),o=this.tableValue(),d=this._extractionService.addEmptyTableRow(t.id,o?.uniqueId,i);if(d){let p=d[0];this.selectCell({cell:p,table:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(p.uniqueId)}}setRowConfirmedStatus(e,i){let t=i===Re.All,o=this._getSafeTableField();e.filter(d=>this._isCellConfirmed(d)!==t).forEach(d=>this._extractionService.changeTableCellConfirmation({tableFieldId:o.id,rowUniqueId:d.rowUniqueId,cellUniqueId:d.uniqueId},t)),this._bridgeService.highlightTableCells$.next({table:o,cells:e})}getRowConfirmedStatus(e){let i=e.filter(t=>this._isCellConfirmed(t)).length;return i===e.length?Re.All:i===0?Re.None:Re.Partial}getPaginatedRow(e){let i=this.rowsPerPage(),t=this.pageIndex();return e+t*i}updateTableFromSelection(e){let i=this.tableSelectionAppendFromRowIndex(),t=i===void 0,[o,d]=this._createHeaderAndBodyFromSelection(e,i,t),p=this._getSafeTableFieldId();if(t)this._extractionService.replaceTableRows(p,o,d);else{if(!i&&i!==0)throw Error("The fromRow should be set!");let P=this._getSafeTableValue();this._extractionService.addTableRowsAtIndex(p,P.uniqueId,i+1,d)}let O=this.rowsPerPage(),I=Math.floor((t?0:i+1)/O);this._updatePagination(I,O)}goToFirstInvalidCell(){let e=this._getSafeTableField(),i=this._getFirstInvalidCell();i&&(this.selectCell({table:e,cell:i,origin:he.CrudOperation}),this.cellToScrollTo$.next(i.uniqueId))}handleConfirmationButtonClick(e){e===Be.NextUnconfirmedCell?this.goToFirstUnconfirmedCell():e===Be.ConfirmAllCells&&this._confirmUnconfirmedCells()}goToFirstUnconfirmedCell(){let e=this._getSafeTableField(),t=this._getFirstUnconfirmedRow()?.find(o=>!this._isCellConfirmed(o));t&&(this.selectCell({table:e,cell:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(t.uniqueId))}removeEmptyRowsForActiveTable(){let e=this.tableFieldId();e&&this._extractionService.removeEmptyTableRows(e)}_selectTableRow(e){let i=this.rowsPerPage(),t=this.pageIndex(),o=Math.floor(e[0].cell.rowIndex/i);o!==t&&this._updatePagination(o,i);let d={table:e[0].table,cells:e.map(p=>p.cell)};this.cellToScrollTo$.next(e[0].cell.uniqueId),this._bridgeService.selectedTableCell$.next(null),this._bridgeService.selectedTableRow$.next(d),this._bridgeService.highlightTableCells$.next(d)}_confirmUnconfirmedCells(){let e=this._getSafeTableFieldId(),i=this._getSafeTableValue();this._extractionService.confirmTableValue(e,i.uniqueId),this._bridgeService.tableEditorVisibility$.next(!1)}_getAllRows(){return this._getSafeTableValue().body.rows}_getFirstInvalidCell(){let e=this._getSafeTableValue();for(let i of e.body.rows)for(let t of i)if(!t.isMissing&&this._extractionValidationService.validateFieldValue(t,t.values[0]))return t;return null}_getFirstUnconfirmedRow(){for(let e of this._getAllRows())if(this.getRowConfirmedStatus(e)!==Re.All)return e;return null}_getNumberOfInvalidCells(){let e=this._getSafeTableValue(),i=0;for(let t of e.body.rows)for(let o of t)!o.isMissing&&this._extractionValidationService.validateFieldValue(o,o.values[0])&&i++;return i}_getNumberOfUnconfirmedCells(){let e=0;for(let i of this._getAllRows())for(let t of i)this._isCellConfirmed(t)||e++;return e}_updatePagination(e,i){let t=Math.ceil(this.numberOfRows()/i),o=Math.max(Math.min(e,t-1),0);this._sharedSettings.persistTableRowsPerPage(i),this.rowsPerPage.set(i),this.pageIndex.set(o)}_isCellConfirmed(e){return e.isMissing?e.confirmationStatus===me.Confirmed:e.values[0].confirmationStatus===me.Confirmed}_resetState(){this.tableFieldId.set(null),this.pageIndex.set(0)}_createHeaderAndBodyFromSelection(e,i,t){let o=this._getSafeTableField(),d=this.header();if(!d)throw this._errorService.createError("Table editor must be initialized before creating a header!");let O=o.editReferenceCapabilities.includes(ht.area)?e.rows:e.rows.filter(j=>j.some(B=>B.tokens.length>0)),I=t&&e.hasHeader?O.shift():[],P=O,w=Ot(Vt({},d),{cells:[]}),Ve=[];if(t&&I){let j=vt();d.cells.forEach((B,Oe)=>{let at=I.find(ze=>ze.columnName===B.name);w.cells[Oe]=this._createTableCellFromSelection(at,o.id,B,0,j,!0)})}return P.forEach((j,B)=>{Ve[B]=[];let Oe=(i||0)+B,at=vt();d.cells.forEach((ze,dn)=>{let cn=j.find(mn=>mn.columnName===ze.name),pn=this._createTableCellFromSelection(cn,o.id,ze,Oe,at);Ve[B][dn]=pn})}),[w,Ve]}_createTableCellFromSelection(e,i,t,o,d,p=!1){let O=this._extractionService.selectedDocTypeId??"",I=p?this._apoFactory.createEmptyTableHeaderCell(i,t.id,t.columnIndex,d,O):this._apoFactory.createEmptyTableBodyCell(i,t.id,t.columnIndex,o,d,O,"AUTOMATIC_EXTRACTION"),P=I.editReferenceCapabilities.includes(ht.area),w=this._apoFactory.createEmptyValueForField(I),Ve=t.type===Ri.Set?t.taxonomy.values:[],j=e?P?[e.region]:e.tokens:[],[B,Oe]=P?[I.defaultValue,this._createCustomSelectionReference(e)]:this._pdfMapper.mapPDFTokensToValueAndReference(j,I.type,Ve);return w.reference=Oe,w.confirmationStatus=me.Confirmed,w.confidence=1,w.ocrConfidence=zi(j),w.value=p?t.name:B,w.unformattedValue=B,w.derivedParts=p?[]:w.derivedParts,I.isMissing=!w.reference?.words.length,I.isMissing||I.values.push(w),I.isHeaderCell=p,I.confirmationStatus=me.Confirmed,I.hasDerivedParts=w.derivedParts.length>0,I.boxesChanged=!0,I}_createCustomSelectionReference(e){let i=this._apoFactory.createDefaultReference();if(e==null)return i;let{top:t,left:o,width:d,height:p}=e.region.box;return i.words=[{length:0,startIndex:0,processingSource:this._documentInfoService.documentInfoModel().pages[e.pageIndex].processingSource,boxes:[[t,o,d,p]],pageIndex:e.pageIndex,pageHeight:0,pageWidth:0}],i}_getSafeTableFieldId(){let e=this.tableFieldId();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableField(){let e=this.tableField();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableValue(){let e=this.tableValue();if(!e)throw this._errorService.createError("Cannot perform operation on table value that does not exist!");return e}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var va,Dn=F(()=>{"use strict";S();xn();tt();gt();bt();Xi();ji();Ki();S();va=(()=>{class n{_extractionService=g(Me);_groupFieldsService=g(nt);_bridgeService=g(it);_tableEditorService=g(Yi);_matrixIterator=new Ni;moveFieldValuePosition(e,{shouldConfirmPrevious:i=!0}={}){let t=this._flattenFieldValues();if(t.length===0)return;let o=new Ui(t),d=o.findIndex(O=>O.isSelected),p=o.move(e,d);this._extractionService.selectFieldValue(p.fieldId,p.valueId,he.KeyboardShortcuts,-1,i)}moveCellPosition(e,i){let o=i.values[0],d=[...o?[o?.header.cells]:[],...o?.body.rows??[]],p=this._bridgeService.selectedField$.value,O=this._bridgeService.selectedTableCell$.value;if(p?.taxonomyType!==et.Table)return;let I=this._getCurrentCellPosition(O,d),P=this._matrixIterator.movePosition(I,e,d);if(!P)return;let w=d[P.rowIndex][P.colIndex];return this._tableEditorService.selectCell({table:i,cell:w,origin:he.KeyboardShortcuts},!0),P}_getFieldValues(e){let i=[];return e.forEach(t=>{if(t.values.length===0){i.push({fieldId:t.id,isSelected:t.isSelected});return}t.values.forEach(o=>{i.push({fieldId:t.id,valueId:o.uniqueId,isSelected:o.isSelected})})}),i}_flattenFieldValues=()=>{let e=this._extractionService.selectedExtraction;if(!e)return[];let i=e.docTypeField,t=[{fieldId:i.id,valueId:i.values[0].uniqueId,isSelected:i.isSelected}],o=this._getFieldValues(this._groupFieldsService.fieldsToValidate),d=this._getFieldValues(this._groupFieldsService.validFields),p=[...o,...d];return t.push(...p),t};_getCurrentCellPosition(e,i){if(!e||!i||i.length===0)return;let t=i.length,o=i[0].length;for(let d=0;d<t;d++)for(let p=0;p<o;p++)if(i[d][p].uniqueId===e.cell.uniqueId)return{rowIndex:d,colIndex:p}}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Nn,Ji=F(()=>{"use strict";q();te();ce();Ze();S();te();ce();Ze();Nn=(()=>{class n{uiChipButton=!0;text;status="info";matMenuTriggerPanel;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-chip-button"]],hostVars:2,hostBindings:function(i,t){i&2&&T("ui-chip-button",t.uiChipButton)},inputs:{text:"text",status:"status",matMenuTriggerPanel:"matMenuTriggerPanel"},decls:5,vars:3,consts:[["mat-flat-button","",1,"btn-small","chip-btn",2,"height","20px","padding","2px 6px",3,"matMenuTriggerFor","ngClass"],[1,"apollo-button-text-left"]],template:function(i,t){i&1&&(r(0,"button",0)(1,"span",1),s(2),l(),r(3,"mat-icon"),s(4,"expand_more"),l()()),i&2&&(C("matMenuTriggerFor",t.matMenuTriggerPanel)("ngClass",t.status),a(2),y(t.text))},dependencies:[$,ee,Ge,de,se,Je,Ke],styles:[`.ui-chip-button button.mat-mdc-unelevated-button.chip-btn{height:20px;padding:2px 6px;box-sizing:border-box!important}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn:focus-visible{outline:solid 2px var(--color-primary)}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn .apollo-button-text-left{font-size:11px;line-height:16px}
1
+ import{$a as z,$c as jt,$e as Qe,$f as _i,$h as _t,$i as Bi,$k as qi,A as st,Ab as T,Ae as Yt,Bb as be,Cb as s,Cc as Z,Cd as Wt,Ce as N,Cj as gt,Ck as En,D as At,Db as y,Dc as q,Dd as _n,Eb as v,El as nt,Fi as Vi,Fk as $i,Fl as Xi,Ge as Kt,Gi as Cn,Gl as Me,Ha as M,He as G,Hl as bt,Id as Ge,Ii as Oi,Ij as Li,Il as we,Ja as Lt,Jb as $t,Jf as si,Jg as bi,Ji as Fi,Jl as St,Kb as Ht,Kd as ee,Kf as di,Ki as gn,Kk as yn,Kl as Wi,La as X,Lb as Ne,Ld as te,Lf as ci,Lg as Si,Lk as Hi,Ll as On,Mb as $e,Me as Jt,Mf as pi,Mk as In,Nb as qt,Ne as ie,Nf as Ie,Nk as xt,P as dt,Pe as Zt,Pf as ut,Pg as Ti,Ph as Mi,Pi as Di,Pk as H,Qf as ft,Qg as Ei,Qk as Pe,Rf as pe,Rg as yi,Ri as Ui,S as Fe,Se as ne,Sf as Xe,Sg as Ii,Si as Ni,Ta as k,Tf as We,Uf as Ye,Uh as et,V as un,Va as u,Vf as mi,Vh as wi,We as oe,Wf as ui,Wh as Ri,Wi as xn,Xa as f,Xb as _,Xe as Q,Xf as Ke,Xi as vn,Xk as vt,Y as Ce,Yb as h,Yf as Je,Yi as Ai,Za as De,Zf as Ze,Zi as bn,_a as L,_f as fi,_h as Ae,_i as Pi,_k as Mn,aa as g,ab as C,af as ae,ag as hi,ai as tt,ak as Tn,al as wn,bb as r,bg as Ci,bl as Gi,c as Ft,cb as l,cl as Rn,d as Dt,da as R,db as Ue,dc as E,df as ye,dg as gi,ea as V,ec as Gt,ef as re,ej as ki,ff as le,gd as Xt,he as Se,ia as Pt,ic as He,ie as Te,ig as xi,jc as mt,je as Ee,ka as ge,kb as U,kf as ei,l as rt,lf as je,ll as Qi,ma as Bt,md as fn,ml as Vn,na as xe,nb as b,nf as se,o as lt,oa as ve,ob as x,oc as Qt,of as de,ol as it,pa as kt,pf as ce,pj as Sn,pl as ji,qf as ti,sb as W,sf as hn,sg as vi,sj as he,tb as Y,tc as S,tf as ii,tj as ht,ua as a,ub as K,uf as ni,vc as $,vf as oi,w as Ut,wa as D,wb as ct,wf as ai,xb as zt,xf as ri,yb as pt,yc as J,yf as li,yj as me,yk as zi,z as Nt,zd as qe,zj as Ct}from"./chunk-XOLTEKM3.js";import{a as Vt,b as Ot,f as F}from"./chunk-3ONYU5UZ.js";var zo,Fn=F(()=>{"use strict";gt();S();zo=(()=>{class n{unconfirmedRegularValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType!=="Table"));return Math.max(0,i-t)}unconfirmedTableValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType==="Table"));return Math.max(0,i-t)}hasAllValuesConfirmed(e){return e?e.fields.find(t=>t.isMissing?!Ct(t.confirmationStatus):t.values.find(o=>!Ct(o.confirmationStatus)))===void 0:!0}_countConfirmedValuesForFields(e){return e.reduce(({total:i,confirmed:t},o)=>(o.isMissing&&(i+=1,t+=o.confirmationStatus===me.Confirmed?1:0),i+=o.values.length,o.values.forEach(d=>t+=d.confirmationStatus===me.Confirmed?1:0),{total:i,confirmed:t}),{total:0,confirmed:0})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Re,Be,Yi,Ki=F(()=>{"use strict";S();ft();Cn();G();Sn();Bi();tt();gt();vi();un();En();wn();Mn();Rn();In();Vn();bt();Pe();ji();S();Re=(function(n){return n.None="None",n.Partial="Partial",n.All="All",n})(Re||{}),Be=(function(n){return n.NextUnconfirmedCell="next-unconfirmed-cell",n.ConfirmAllCells="confirm-all-valid-cells",n})(Be||{}),Yi=(()=>{class n{_documentInfoService=g(Hi);_apoFactory=g(qi);_bridgeService=g(it);_extractionService=g(Me);_extractionValidationService=g(H);_externalInteractionsService=g(Qi);_errorService=g(ki);_pdfMapper=g(Gi);_translateService=g(Yt);_sharedSettings=g(Oi);tableFieldId=ge(null);_isReadonly=ge(!1);_selectedExtraction=ut(this._extractionService.selectedExtraction$);cellToScrollTo$=new Dt(null);tableInitialized$=new Ft;tableInitialized=ut(this.tableInitialized$);rowsPerPage=ge(this._sharedSettings.getPersistedTableRowsPerPage()??10);pageIndex=ge(0);tableSelectionAppendFromRowIndex=ge(void 0);tableField=E(()=>this._selectedExtraction()?.fields.find(e=>e.id===this.tableFieldId()));tableValue=E(()=>this.tableField()?.values[0]);numberOfRows=E(()=>this.tableValue()?.body.rows.length??0);hasRows=E(()=>this.numberOfRows()>0);numberOfInvalidCells=E(()=>this._getNumberOfInvalidCells());numberOfUnconfirmedCells=E(()=>this._getNumberOfUnconfirmedCells());totalPages=E(()=>{let e=this.tableValue();return e?.body.rows?Math.ceil(e.body.rows.length/this.rowsPerPage()):0});confirmationButtonGroupOptions=E(()=>{let e=this.numberOfUnconfirmedCells(),i=this.numberOfInvalidCells();return[{id:Be.NextUnconfirmedCell,text:this._translateService.instant(e===1?"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.singular":"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.plural",{numberOfUnconfirmedCells:e}),description:this._translateService.instant("VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON_TOOLTIP",{numberOfUnconfirmedCells:e})},{id:Be.ConfirmAllCells,text:this._translateService.instant("VS_TABLE_CONFIRM_ALL_CELLS_BUTTON"),disabled:i>0}]});paginatedDataSource=E(()=>{let e=this.tableValue(),i=this.pageIndex(),t=this.rowsPerPage(),o=e?e.body.rows.slice(i*t,(i+1)*t):[];return new Vi(o)});header=E(()=>{let e=this.tableValue();if(e?.header)return e.header;let i=this.tableField(),t=this._selectedExtraction();return i&&t?this._apoFactory.createEmptyTableHeader(i.id,t.docTypeId):null});headerRow=E(()=>this.header()?.cells??[]);headerRowIds=E(()=>this.headerRow().map(e=>e.id).concat(["actions"]),{equal:gi});constructor(){this._externalInteractionsService.selectTableCellInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e.table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this.selectCell(e)),this._externalInteractionsService.selectTableRowInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e[0].table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this._selectTableRow(e))}init({tableFieldId:e,isReadonly:i}){this._resetState(),this.tableFieldId.set(e),this._isReadonly.set(i),this.tableInitialized$.next()}cleanup(){this._resetState()}setRowsPerPage(e){this._updatePagination(0,e)}changePage(e){this._updatePagination(e,this.rowsPerPage())}selectCell(e,i=!1){let t=this.rowsPerPage(),o=this.pageIndex(),d=Math.floor(e.cell.rowIndex/t);d!==o&&e.cell.rowIndex!==-1&&(this._updatePagination(d,t),this.cellToScrollTo$.next(e.cell.uniqueId));let p=this._bridgeService.selectedTableCell$.value,O=(p?.cell.values?.length??0)>0;!this._isReadonly()&&(i||O)&&p?.cell&&p.cell.uniqueId!==e.cell.uniqueId&&this._extractionService.changeTableCellConfirmation({tableFieldId:p.table.id,rowUniqueId:p.cell.rowUniqueId,cellUniqueId:p.cell.uniqueId},!0),this._bridgeService.selectedTableCell$.next(e)}addNewRow(e){let i=this.getPaginatedRow(e),t=this._getSafeTableField(),o=this.tableValue(),d=this._extractionService.addEmptyTableRow(t.id,o?.uniqueId,i);if(d){let p=d[0];this.selectCell({cell:p,table:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(p.uniqueId)}}setRowConfirmedStatus(e,i){let t=i===Re.All,o=this._getSafeTableField();e.filter(d=>this._isCellConfirmed(d)!==t).forEach(d=>this._extractionService.changeTableCellConfirmation({tableFieldId:o.id,rowUniqueId:d.rowUniqueId,cellUniqueId:d.uniqueId},t)),this._bridgeService.highlightTableCells$.next({table:o,cells:e})}getRowConfirmedStatus(e){let i=e.filter(t=>this._isCellConfirmed(t)).length;return i===e.length?Re.All:i===0?Re.None:Re.Partial}getPaginatedRow(e){let i=this.rowsPerPage(),t=this.pageIndex();return e+t*i}updateTableFromSelection(e){let i=this.tableSelectionAppendFromRowIndex(),t=i===void 0,[o,d]=this._createHeaderAndBodyFromSelection(e,i,t),p=this._getSafeTableFieldId();if(t)this._extractionService.replaceTableRows(p,o,d);else{if(!i&&i!==0)throw Error("The fromRow should be set!");let P=this._getSafeTableValue();this._extractionService.addTableRowsAtIndex(p,P.uniqueId,i+1,d)}let O=this.rowsPerPage(),I=Math.floor((t?0:i+1)/O);this._updatePagination(I,O)}goToFirstInvalidCell(){let e=this._getSafeTableField(),i=this._getFirstInvalidCell();i&&(this.selectCell({table:e,cell:i,origin:he.CrudOperation}),this.cellToScrollTo$.next(i.uniqueId))}handleConfirmationButtonClick(e){e===Be.NextUnconfirmedCell?this.goToFirstUnconfirmedCell():e===Be.ConfirmAllCells&&this._confirmUnconfirmedCells()}goToFirstUnconfirmedCell(){let e=this._getSafeTableField(),t=this._getFirstUnconfirmedRow()?.find(o=>!this._isCellConfirmed(o));t&&(this.selectCell({table:e,cell:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(t.uniqueId))}removeEmptyRowsForActiveTable(){let e=this.tableFieldId();e&&this._extractionService.removeEmptyTableRows(e)}_selectTableRow(e){let i=this.rowsPerPage(),t=this.pageIndex(),o=Math.floor(e[0].cell.rowIndex/i);o!==t&&this._updatePagination(o,i);let d={table:e[0].table,cells:e.map(p=>p.cell)};this.cellToScrollTo$.next(e[0].cell.uniqueId),this._bridgeService.selectedTableCell$.next(null),this._bridgeService.selectedTableRow$.next(d),this._bridgeService.highlightTableCells$.next(d)}_confirmUnconfirmedCells(){let e=this._getSafeTableFieldId(),i=this._getSafeTableValue();this._extractionService.confirmTableValue(e,i.uniqueId),this._bridgeService.tableEditorVisibility$.next(!1)}_getAllRows(){return this._getSafeTableValue().body.rows}_getFirstInvalidCell(){let e=this._getSafeTableValue();for(let i of e.body.rows)for(let t of i)if(!t.isMissing&&this._extractionValidationService.validateFieldValue(t,t.values[0]))return t;return null}_getFirstUnconfirmedRow(){for(let e of this._getAllRows())if(this.getRowConfirmedStatus(e)!==Re.All)return e;return null}_getNumberOfInvalidCells(){let e=this._getSafeTableValue(),i=0;for(let t of e.body.rows)for(let o of t)!o.isMissing&&this._extractionValidationService.validateFieldValue(o,o.values[0])&&i++;return i}_getNumberOfUnconfirmedCells(){let e=0;for(let i of this._getAllRows())for(let t of i)this._isCellConfirmed(t)||e++;return e}_updatePagination(e,i){let t=Math.ceil(this.numberOfRows()/i),o=Math.max(Math.min(e,t-1),0);this._sharedSettings.persistTableRowsPerPage(i),this.rowsPerPage.set(i),this.pageIndex.set(o)}_isCellConfirmed(e){return e.isMissing?e.confirmationStatus===me.Confirmed:e.values[0].confirmationStatus===me.Confirmed}_resetState(){this.tableFieldId.set(null),this.pageIndex.set(0)}_createHeaderAndBodyFromSelection(e,i,t){let o=this._getSafeTableField(),d=this.header();if(!d)throw this._errorService.createError("Table editor must be initialized before creating a header!");let O=o.editReferenceCapabilities.includes(ht.area)?e.rows:e.rows.filter(j=>j.some(B=>B.tokens.length>0)),I=t&&e.hasHeader?O.shift():[],P=O,w=Ot(Vt({},d),{cells:[]}),Ve=[];if(t&&I){let j=vt();d.cells.forEach((B,Oe)=>{let at=I.find(ze=>ze.columnName===B.name);w.cells[Oe]=this._createTableCellFromSelection(at,o.id,B,0,j,!0)})}return P.forEach((j,B)=>{Ve[B]=[];let Oe=(i||0)+B,at=vt();d.cells.forEach((ze,dn)=>{let cn=j.find(mn=>mn.columnName===ze.name),pn=this._createTableCellFromSelection(cn,o.id,ze,Oe,at);Ve[B][dn]=pn})}),[w,Ve]}_createTableCellFromSelection(e,i,t,o,d,p=!1){let O=this._extractionService.selectedDocTypeId??"",I=p?this._apoFactory.createEmptyTableHeaderCell(i,t.id,t.columnIndex,d,O):this._apoFactory.createEmptyTableBodyCell(i,t.id,t.columnIndex,o,d,O,"AUTOMATIC_EXTRACTION"),P=I.editReferenceCapabilities.includes(ht.area),w=this._apoFactory.createEmptyValueForField(I),Ve=t.type===Ri.Set?t.taxonomy.values:[],j=e?P?[e.region]:e.tokens:[],[B,Oe]=P?[I.defaultValue,this._createCustomSelectionReference(e)]:this._pdfMapper.mapPDFTokensToValueAndReference(j,I.type,Ve);return w.reference=Oe,w.confirmationStatus=me.Confirmed,w.confidence=1,w.ocrConfidence=zi(j),w.value=p?t.name:B,w.unformattedValue=B,w.derivedParts=p?[]:w.derivedParts,I.isMissing=!w.reference?.words.length,I.isMissing||I.values.push(w),I.isHeaderCell=p,I.confirmationStatus=me.Confirmed,I.hasDerivedParts=w.derivedParts.length>0,I.boxesChanged=!0,I}_createCustomSelectionReference(e){let i=this._apoFactory.createDefaultReference();if(e==null)return i;let{top:t,left:o,width:d,height:p}=e.region.box;return i.words=[{length:0,startIndex:0,processingSource:this._documentInfoService.documentInfoModel().pages[e.pageIndex].processingSource,boxes:[[t,o,d,p]],pageIndex:e.pageIndex,pageHeight:0,pageWidth:0}],i}_getSafeTableFieldId(){let e=this.tableFieldId();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableField(){let e=this.tableField();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableValue(){let e=this.tableValue();if(!e)throw this._errorService.createError("Cannot perform operation on table value that does not exist!");return e}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var va,Dn=F(()=>{"use strict";S();xn();tt();gt();bt();Xi();ji();Ki();S();va=(()=>{class n{_extractionService=g(Me);_groupFieldsService=g(nt);_bridgeService=g(it);_tableEditorService=g(Yi);_matrixIterator=new Ni;moveFieldValuePosition(e,{shouldConfirmPrevious:i=!0}={}){let t=this._flattenFieldValues();if(t.length===0)return;let o=new Ui(t),d=o.findIndex(O=>O.isSelected),p=o.move(e,d);this._extractionService.selectFieldValue(p.fieldId,p.valueId,he.KeyboardShortcuts,-1,i)}moveCellPosition(e,i){let o=i.values[0],d=[...o?[o?.header.cells]:[],...o?.body.rows??[]],p=this._bridgeService.selectedField$.value,O=this._bridgeService.selectedTableCell$.value;if(p?.taxonomyType!==et.Table)return;let I=this._getCurrentCellPosition(O,d),P=this._matrixIterator.movePosition(I,e,d);if(!P)return;let w=d[P.rowIndex][P.colIndex];return this._tableEditorService.selectCell({table:i,cell:w,origin:he.KeyboardShortcuts},!0),P}_getFieldValues(e){let i=[];return e.forEach(t=>{if(t.values.length===0){i.push({fieldId:t.id,isSelected:t.isSelected});return}t.values.forEach(o=>{i.push({fieldId:t.id,valueId:o.uniqueId,isSelected:o.isSelected})})}),i}_flattenFieldValues=()=>{let e=this._extractionService.selectedExtraction;if(!e)return[];let i=e.docTypeField,t=[{fieldId:i.id,valueId:i.values[0].uniqueId,isSelected:i.isSelected}],o=this._getFieldValues(this._groupFieldsService.fieldsToValidate),d=this._getFieldValues(this._groupFieldsService.validFields),p=[...o,...d];return t.push(...p),t};_getCurrentCellPosition(e,i){if(!e||!i||i.length===0)return;let t=i.length,o=i[0].length;for(let d=0;d<t;d++)for(let p=0;p<o;p++)if(i[d][p].uniqueId===e.cell.uniqueId)return{rowIndex:d,colIndex:p}}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Nn,Ji=F(()=>{"use strict";q();te();ce();Ze();S();te();ce();Ze();Nn=(()=>{class n{uiChipButton=!0;text;status="info";matMenuTriggerPanel;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-chip-button"]],hostVars:2,hostBindings:function(i,t){i&2&&T("ui-chip-button",t.uiChipButton)},inputs:{text:"text",status:"status",matMenuTriggerPanel:"matMenuTriggerPanel"},decls:5,vars:3,consts:[["mat-flat-button","",1,"btn-small","chip-btn",2,"height","20px","padding","2px 6px",3,"matMenuTriggerFor","ngClass"],[1,"apollo-button-text-left"]],template:function(i,t){i&1&&(r(0,"button",0)(1,"span",1),s(2),l(),r(3,"mat-icon"),s(4,"expand_more"),l()()),i&2&&(C("matMenuTriggerFor",t.matMenuTriggerPanel)("ngClass",t.status),a(2),y(t.text))},dependencies:[$,ee,Ge,de,se,Je,Ke],styles:[`.ui-chip-button button.mat-mdc-unelevated-button.chip-btn{height:20px;padding:2px 6px;box-sizing:border-box!important}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn:focus-visible{outline:solid 2px var(--color-primary)}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn .apollo-button-text-left{font-size:11px;line-height:16px}
2
2
  `],encapsulation:2,changeDetection:0})}return n})()});var An=F(()=>{"use strict";Ji()});var Zi,en=F(()=>{"use strict";S();Zi=(()=>{class n{uiStatusIndicator=!0;text;status="info";static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-status-indicator"]],hostVars:4,hostBindings:function(i,t){i&2&&(be(t.status),T("ui-status-indicator",t.uiStatusIndicator))},inputs:{text:"text",status:"status"},decls:1,vars:1,template:function(i,t){i&1&&s(0),i&2&&v("",t.text,`
3
3
  `)},styles:[`.ui-status-indicator{display:flex;align-items:center;padding:0 6px;height:20px;font-size:11px;font-weight:400}
4
4
  `],encapsulation:2,changeDetection:0})}return n})()});var Pa,Pn=F(()=>{"use strict";S();ce();S();ce();Pa=(()=>{class n{expanded=!1;loading=!1;expand=new D;collapse=new D;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-expand-icon"]],inputs:{expanded:"expanded",loading:"loading"},outputs:{expand:"expand",collapse:"collapse"},decls:5,vars:4,consts:[["automation-id","expand-icon","data-testid","expand-icon",1,"ui-expand-icon"],[1,"arrow",3,"click"],[1,"line",3,"click"]],template:function(i,t){i&1&&(r(0,"div",0)(1,"mat-icon",1),b("click",function(){return t.expand.emit()}),s(2,"expand_more"),l(),r(3,"mat-icon",2),b("click",function(){return t.collapse.emit()}),s(4,"remove"),l()()),i&2&&T("is-expanded",t.expanded)("is-loading",t.loading)},dependencies:[de,se],styles:[`.ui-expand-icon{position:relative;display:flex;height:24px;width:24px;-webkit-user-select:none;user-select:none;margin:5px}.ui-expand-icon mat-icon{position:absolute!important;transition-duration:.25s;transition-timing-function:linear;transition-property:transform,opacity}.ui-expand-icon mat-icon.line{opacity:0;z-index:-1}.ui-expand-icon.is-expanded .mat-icon,.ui-expand-icon.is-loading .mat-icon{transform:rotate(180deg)}.ui-expand-icon.is-expanded .mat-icon.arrow,.ui-expand-icon.is-loading .mat-icon.arrow{opacity:0;z-index:-1}.ui-expand-icon.is-expanded .mat-icon.line,.ui-expand-icon.is-loading .mat-icon.line{opacity:1;z-index:1}.ui-expand-icon.is-loading .mat-icon.line{animation:rotate-center .6s infinite}@keyframes rotate-center{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
@@ -0,0 +1,2 @@
1
+ import{Ab as f,Cb as l,Ce as y,Eb as h,Ha as m,He as D,Kd as g,Ld as _,Ta as u,Va as r,Xa as c,Xb as v,Yb as C,ab as s,bb as n,cb as a,he as M,ie as T,je as b,nf as w,ob as d,of as U,pf as E,tc as B,ua as e,zd as x}from"./chunk-XOLTEKM3.js";import{f as S}from"./chunk-3ONYU5UZ.js";function N(t,I){if(t&1&&(n(0,"mat-icon"),l(1),a()),t&2){let p=d();e(),h("filter_",p.value)}}function O(t,I){t&1&&(n(0,"mat-icon"),l(1,"filter_9_plus"),a())}var q,P=S(()=>{"use strict";_();E();b();D();B();E();_();b();q=(()=>{class t{value;tooltip;active;static \u0275fac=function(i){return new(i||t)};static \u0275cmp=m({type:t,selectors:[["ui-counter"]],inputs:{value:"value",tooltip:"tooltip",active:"active"},decls:4,vars:8,consts:[["mat-icon-button","",1,"counter-icon-button",3,"matTooltip"]],template:function(i,o){i&1&&(n(0,"button",0),v(1,"translate"),r(2,N,2,1,"mat-icon"),r(3,O,2,0,"mat-icon"),a()),i&2&&(f("counter-icon-active",o.active),s("matTooltip",o.tooltip),u("aria-label",C(1,6,"A11Y_VS_COUNTER_BUTTON")),e(2),c(o.value<=9?2:-1),e(),c(o.value>9?3:-1))},dependencies:[U,w,g,x,T,M,y],styles:[`:host .counter-icon-button{width:40px!important;height:40px!important;padding:0!important;display:inline-flex;align-items:center;justify-content:center}:host .counter-icon-button>*[role=img]{height:18px;width:18px;font-size:18px}:host .counter-icon-button>*[role=img] svg{width:18px;height:18px}:host .counter-icon-button .mat-mdc-button-touch-target{width:40px!important;height:40px!important}
2
+ `],encapsulation:2,changeDetection:0})}return t})()});export{q as a,P as b};