UNPKG

@pepperi/lib

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.1.

16 lines (14 loc) 55.8 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/common/http"),require("@angular/platform-browser"),require("@angular/platform-browser/animations"),require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("@ngx-translate/core")):"function"==typeof define&&define.amd?define("@pepperi/lib",["exports","@angular/core","@angular/common","@angular/common/http","@angular/platform-browser","@angular/platform-browser/animations","@angular/forms","rxjs","rxjs/operators","@ngx-translate/core"],t):t(((e=e||self).pepperi=e.pepperi||{},e.pepperi.lib={}),e.ng.core,e.ng.common,e.ng.common.http,e.ng.platformBrowser,e.ng.platformBrowser.animations,e.ng.forms,e.rxjs,e.rxjs.operators,e.translate)}(this,(function(e,t,r,n,i,o,a,s,p,l){"use strict";var u=function(){function e(){}return e.prototype.urlBase64Decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)},e.prototype.b64decode=function(e){var t="";if((e=String(e).replace(/=+$/,"")).length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r=0,n=void 0,i=void 0,o=0;i=e.charAt(o++);~i&&(n=r%4?64*n+i:i,r++%4)?t+=String.fromCharCode(255&n>>(-2*r&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return t},e.prototype.b64DecodeUnicode=function(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))},e.prototype.decodeToken=function(e){if(!e||""===e)return null;var t=e.split(".");if(3!==t.length)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");var r=this.urlBase64Decode(t[1]);if(!r)throw new Error("Cannot decode the token.");return JSON.parse(r)},e.prototype.getTokenExpirationDate=function(e){var t;if(!(t=this.decodeToken(e))||!t.hasOwnProperty("exp"))return null;var r=new Date(0);return r.setUTCSeconds(t.exp),r},e.prototype.isTokenExpired=function(e,t){if(!e||""===e)return!0;var r=this.getTokenExpirationDate(e);return t=t||0,null!==r&&!(r.valueOf()>(new Date).valueOf()+1e3*t)},e.prototype.getAuthScheme=function(e,t){return"function"==typeof e?e(t):e},e}();u.ɵfac=function(e){return new(e||u)},u.ɵprov=t.ɵɵdefineInjectable({token:u,factory:u.ɵfac,providedIn:"root"});var c=function(){function e(e){this.jwtHelper=e,this.IDP_TOKEN_KEY="idp_token",this.PAPI_BASE_URL_KEY="pepperi.baseurl",this.WAPI_TOKEN_KEY="auth_token",this.WAPI_BASE_URL_KEY="serverHostURL"}return e.prototype.getParseToken=function(){var e=this.getIdpToken();return this.jwtHelper.decodeToken(e)},e.prototype.setObject=function(e,t){var r="string"==typeof t||t instanceof String?t:JSON.stringify(t);sessionStorage.setItem(e,r.toString())},e.prototype.getObject=function(e){var t=null,r=sessionStorage.getItem(e);try{t=r?JSON.parse(r):r}catch(e){t=r}return t},e.prototype.getPepperiConsumerToken=function(){return this.PEPPERI_CONSUMER_TOKEN},e.prototype.gettWapiToken=function(){return this.getObject(this.WAPI_TOKEN_KEY)},e.prototype.getWapiBaseUrl=function(){return this.getObject(this.WAPI_BASE_URL_KEY)},e.prototype.getIdpToken=function(){return this.getObject(this.IDP_TOKEN_KEY)},e.prototype.getPapiBaseUrl=function(){var e=this.getParseToken();return e?e[this.PAPI_BASE_URL_KEY]:null},e}();c.ɵfac=function(e){return new(e||c)(t.ɵɵinject(u))},c.ɵprov=t.ɵɵdefineInjectable({token:c,factory:c.ɵfac,providedIn:"root"});var d=function(){function e(e){this.sessionService=e,this.AUTH_HEADER="Authorization",this.PEPPERI_TOKEN_HEADER="PepperiSessionToken",this.PEPPERI_CONSUMER_KEY_HEADER="X-Pepperi-ConsumerKey"}return e.prototype.addAuthorizationToken=function(e){if(!e.headers.has(this.AUTH_HEADER)){var t=this.sessionService.getIdpToken();t&&(e=e.clone({headers:e.headers.set(this.AUTH_HEADER,"Bearer "+t)}))}return e},e.prototype.addPepperiConsumerToken=function(e){if(!e.headers.has(this.PEPPERI_CONSUMER_KEY_HEADER)){var t=this.sessionService.getPapiBaseUrl();if(t&&e.url.match(new RegExp(t,"g"))){var r=this.sessionService.getPepperiConsumerToken();r&&(e=e.clone({headers:e.headers.set(this.PEPPERI_CONSUMER_KEY_HEADER,r)}))}}return e},e.prototype.addWebApiToken=function(e){if(!e.headers.has(this.PEPPERI_TOKEN_HEADER)){var t=this.sessionService.getWapiBaseUrl();if(t&&e.url.match(new RegExp(t,"g"))){var r=this.sessionService.gettWapiToken();r&&(e=e.clone({headers:e.headers.set(this.PEPPERI_TOKEN_HEADER,r)}))}}return e},e.prototype.intercept=function(e,t){return console.warn("AuthInterceptor"),e.headers.has("Content-Type")||(e=e.clone({headers:e.headers.set("Content-Type","application/json")})),e=this.addAuthorizationToken(e),e=this.addPepperiConsumerToken(e),e=this.addWebApiToken(e),t.handle(e)},e}();d.ɵfac=function(e){return new(e||d)(t.ɵɵinject(c))},d.ɵprov=t.ɵɵdefineInjectable({token:d,factory:d.ɵfac});var h=function(){function e(){}return e.prototype.intercept=function(e,t){return console.warn("ErrorInterceptor"),t.handle(e).pipe(p.catchError((function(e){return e.status,s.throwError(e)})))},e}();h.ɵfac=function(e){return new(e||h)},h.ɵprov=t.ɵɵdefineInjectable({token:h,factory:h.ɵfac});var E=function(){function e(){this.counter=0,this.showLoaderSubject=new s.BehaviorSubject(!1)}return Object.defineProperty(e.prototype,"onChanged$",{get:function(){return this.showLoaderSubject.asObservable().pipe(p.distinctUntilChanged())},enumerable:!1,configurable:!0}),e.prototype.show=function(){this.counter++,this.showLoaderSubject.next(!0)},e.prototype.hide=function(){this.counter--,0===this.counter&&this.showLoaderSubject.next(!1)},e}();E.ɵfac=function(e){return new(e||E)},E.ɵprov=t.ɵɵdefineInjectable({token:E,factory:E.ɵfac,providedIn:"root"});var _=function(){function e(e){this.injector=e}return e.prototype.intercept=function(e,t){console.warn("LoaderInterceptor");var r=this.injector.get(E);return r.show(),t.handle(e).pipe(p.delay(3e3),p.finalize((function(){return r.hide()})))},e}();_.ɵfac=function(e){return new(e||_)(t.ɵɵinject(t.Injector))},_.ɵprov=t.ɵɵdefineInjectable({token:_,factory:_.ɵfac});var f=function(){function e(){}return e.prototype.intercept=function(e,t){console.warn("ProfilerInterceptor");var r,i=Date.now();return t.handle(e).pipe(p.tap((function(e){e instanceof n.HttpResponse&&(r="succeeded")}),(function(e){return r="failed"})),p.finalize((function(){var t=Date.now()-i,n=e.method+' "'+e.urlWithParams+'" '+r+" in "+t+" ms.";console.log(n)})))},e}();f.ɵfac=function(e){return new(e||f)},f.ɵprov=t.ɵɵdefineInjectable({token:f,factory:f.ɵfac});var S,T,m=[{provide:n.HTTP_INTERCEPTORS,useClass:d,multi:!0},{provide:n.HTTP_INTERCEPTORS,useClass:h,multi:!0},{provide:n.HTTP_INTERCEPTORS,useClass:_,multi:!0},{provide:n.HTTP_INTERCEPTORS,useClass:f,multi:!0}],R=["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"];(S=e.ORIENTATION||(e.ORIENTATION={}))[S.Landscape=0]="Landscape",S[S.Portrait=1]="Portrait",(T=e.SCREEN_SIZE||(e.SCREEN_SIZE={}))[T.XL=0]="XL",T[T.LG=1]="LG",T[T.MD=2]="MD",T[T.SM=3]="SM",T[T.XS=4]="XS";var g=function(){function t(t){this.translate=t,this.resizeSubject=new s.BehaviorSubject(e.SCREEN_SIZE.LG)}return Object.defineProperty(t.prototype,"onResize$",{get:function(){return this.resizeSubject.asObservable().pipe(p.distinctUntilChanged())},enumerable:!1,configurable:!0}),t.prototype.onResize=function(e){this.resizeSubject.next(e)},t.prototype.getOrintation=function(){return window.innerHeight>window.innerWidth?e.ORIENTATION.Portrait:e.ORIENTATION.Landscape},t.prototype.getScreenWidth=function(){var t=250;switch(this.resizeSubject.getValue()){case e.SCREEN_SIZE.XS:t=this.getOrintation()===e.ORIENTATION.Landscape?130:65;break;case e.SCREEN_SIZE.SM:case e.SCREEN_SIZE.MD:t=this.getOrintation()===e.ORIENTATION.Landscape?220:140;break;case e.SCREEN_SIZE.LG:t=this.getOrintation()===e.ORIENTATION.Landscape?400:250}return t},t.prototype.getScreenHeight=function(){var t=250;switch(this.resizeSubject.getValue()){case e.SCREEN_SIZE.XS:t=this.getOrintation()===e.ORIENTATION.Landscape?65:130;break;case e.SCREEN_SIZE.SM:case e.SCREEN_SIZE.MD:t=this.getOrintation()===e.ORIENTATION.Landscape?140:220;break;case e.SCREEN_SIZE.LG:t=this.getOrintation()===e.ORIENTATION.Landscape?250:400}return t},t.prototype.getScreenHeightPx=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},t.prototype.getScreenWidthPx=function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},t.prototype.getCurrentLanguage=function(){return this.translate&&this.translate.currentLang||navigator.language},t.prototype.isRtl=function(){var e=this.getCurrentLanguage();return R.indexOf(e)>=0},t}();g.ɵfac=function(e){return new(e||g)(t.ɵɵinject(l.TranslateService))},g.ɵprov=t.ɵɵdefineInjectable({token:g,factory:g.ɵfac,providedIn:"root"});var I=function(){function e(e,t,r){this.layoutService=e,this.renderer=t,this.element=r}return e.prototype.ngOnInit=function(){this.layoutService.isRtl()&&this.renderer.addClass(this.element.nativeElement,"rtl")},e}();I.ɵfac=function(e){return new(e||I)(t.ɵɵdirectiveInject(g),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ElementRef))},I.ɵdir=t.ɵɵdefineDirective({type:I,selectors:[["","pepRtlClass",""]]});var y=function(){function e(e,t,r){this.layoutService=e,this.renderer=t,this.element=r}return e.prototype.ngOnInit=function(){var e=this.layoutService.isRtl();this.renderer.setAttribute(this.element.nativeElement,"dir",e?"rtl":"ltr")},e}();y.ɵfac=function(e){return new(e||y)(t.ɵɵdirectiveInject(g),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(t.ElementRef))},y.ɵdir=t.ɵɵdefineDirective({type:y,selectors:[["","pepRtlDirection",""]]});var v=function(){function e(){}return e.prototype.transform=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e},e}();v.ɵfac=function(e){return new(e||v)},v.ɵpipe=t.ɵɵdefinePipe({name:"capitalize",type:v,pure:!0});var O=function(){function e(){}return e.prototype.transform=function(e){return e?btoa(e):e},e}();O.ɵfac=function(e){return new(e||O)},O.ɵpipe=t.ɵɵdefinePipe({name:"encodePipe",type:O,pure:!0});var C=function(){function e(){}return e.prototype.transform=function(e){return e?escape(e):e},e}();C.ɵfac=function(e){return new(e||C)},C.ɵpipe=t.ɵɵdefinePipe({name:"escapePipe",type:C,pure:!0});var b=function(){function e(){}return e.prototype.transform=function(e){return e.replace(/(<br\ ?\/?>)/g," ")},e}();b.ɵfac=function(e){return new(e||b)},b.ɵpipe=t.ɵɵdefinePipe({name:"replaceLineBreaks",type:b,pure:!0});var A=function(){function e(){}return e.prototype.transform=function(e,t,r){void 0===r&&(r=!1);var n="";return(e=new Date(e))&&(n=e.toLocaleDateString(t||"en-US"),r&&(n+=" "+e.toLocaleTimeString(t||"en-US",{hour:"2-digit",minute:"2-digit"}))),n},e}();A.ɵfac=function(e){return new(e||A)},A.ɵpipe=t.ɵɵdefinePipe({name:"dateFormatter",type:A,pure:!0});var N=function(){function e(){}return e.prototype.transform=function(e,t,r){void 0===r&&(r=!1);var n="",i=new Date(e);return e&&(n=i.toLocaleDateString(t||"en-US"),r&&(n+=" "+i.toLocaleTimeString(t||"en-US"))),n},e}();N.ɵfac=function(e){return new(e||N)},N.ɵpipe=t.ɵɵdefinePipe({name:"dateStringFormatter",type:N,pure:!0});var Y=function(){function e(e){this.sanitizer=e}return e.prototype.transform=function(e){return this.sanitizer.bypassSecurityTrustHtml(e)},e}();Y.ɵfac=function(e){return new(e||Y)(t.ɵɵdirectiveInject(i.DomSanitizer))},Y.ɵpipe=t.ɵɵdefinePipe({name:"safeHtml",type:Y,pure:!0});var D=function(){function e(e){this.sanitizer=e}return e.prototype.transform=function(e,t){switch(t){case"html":return this.sanitizer.bypassSecurityTrustHtml(e);case"style":return this.sanitizer.bypassSecurityTrustStyle(e);case"script":return this.sanitizer.bypassSecurityTrustScript(e);case"url":return this.sanitizer.bypassSecurityTrustUrl(e);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(e);default:throw new Error("Invalid safe type specified: "+t)}},e}();D.ɵfac=function(e){return new(e||D)(t.ɵɵdirectiveInject(i.DomSanitizer))},D.ɵpipe=t.ɵɵdefinePipe({name:"safe",type:D,pure:!0});var F=function(){function e(){}return e.prototype.transform=function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2")},e}();F.ɵfac=function(e){return new(e||F)},F.ɵpipe=t.ɵɵdefinePipe({name:"splitUppercase",type:F,pure:!0});var L=function(){function e(){}return e.prototype.transform=function(e){return parseInt(e)},e}();L.ɵfac=function(e){return new(e||L)},L.ɵpipe=t.ɵɵdefinePipe({name:"toNumber",type:L,pure:!0});var P=function(){function e(e){this.element=e}return e.prototype.onClick=function(){var e=this;setTimeout((function(){e.element.nativeElement.blur()}),0)},e}();P.ɵfac=function(e){return new(e||P)(t.ɵɵdirectiveInject(t.ElementRef))},P.ɵdir=t.ɵɵdefineDirective({type:P,selectors:[["","pepButtonBlur",""]],hostBindings:function(e,r){1&e&&t.ɵɵlistener("click",(function(){return r.onClick()}))}});var M=function(){function e(e){this.element=e}return e.prototype.menuClosedEvent=function(){var e=this;setTimeout((function(){e.element.nativeElement.blur()}),0)},e.prototype.menuOpenedEvent=function(){var e=this;setTimeout((function(){e.element.nativeElement.blur()}),0)},e}();M.ɵfac=function(e){return new(e||M)(t.ɵɵdirectiveInject(t.ElementRef))},M.ɵdir=t.ɵɵdefineDirective({type:M,selectors:[["","pepMenuBlur",""]],hostBindings:function(e,r){1&e&&t.ɵɵlistener("menuClosed",(function(){return r.menuClosedEvent()}))("menuOpened",(function(){return r.menuOpenedEvent()}))}});var K=function(){function e(){this.targets=new Map}return e.prototype.addTarget=function(e,t){this.targets.set(e,t)},e.prototype.attach=function(e,t){var r=this.getTarget(e);r&&r.createEmbeddedView(t)},e.prototype.clear=function(e){var t=this.getTarget(e);t&&t.clear()},e.prototype.getTarget=function(e){return this.targets.has(e)?this.targets.get(e):null},e}();K.ɵfac=function(e){return new(e||K)},K.ɵprov=t.ɵɵdefineInjectable({token:K,factory:K.ɵfac,providedIn:"root"});var H=function(){function e(e,t){this.portalService=e,this.templateRef=t}return e.prototype.ngOnInit=function(){this.portalService.attach(this.targetName,this.templateRef)},e.prototype.ngOnDestroy=function(){this.portalService.clear(this.targetName)},e}();H.ɵfac=function(e){return new(e||H)(t.ɵɵdirectiveInject(K),t.ɵɵdirectiveInject(t.TemplateRef))},H.ɵdir=t.ɵɵdefineDirective({type:H,selectors:[["","pepAttach",""]],inputs:{targetName:["pepAttach","targetName"]}});var w=function(){function e(e,t){this.portalService=e,this.viewContainer=t}return e.prototype.ngOnInit=function(){this.portalService.addTarget(this.targetName,this.viewContainer)},e}();w.ɵfac=function(e){return new(e||w)(t.ɵɵdirectiveInject(K),t.ɵɵdirectiveInject(t.ViewContainerRef))},w.ɵdir=t.ɵɵdefineDirective({type:w,selectors:[["","pepTarget",""]],inputs:{targetName:["pepTarget","targetName"]}});var G,x=function(){};x.ɵmod=t.ɵɵdefineNgModule({type:x}),x.ɵinj=t.ɵɵdefineInjector({factory:function(e){return new(e||x)},providers:[m],imports:[[r.CommonModule,n.HttpClientModule,i.BrowserModule,o.BrowserAnimationsModule,a.ReactiveFormsModule,a.FormsModule],l.TranslateModule]}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(x,{declarations:[v,O,C,b,A,N,Y,D,F,L,P,M,I,y,H,w],imports:[r.CommonModule,n.HttpClientModule,i.BrowserModule,o.BrowserAnimationsModule,a.ReactiveFormsModule,a.FormsModule],exports:[v,O,C,b,A,N,Y,D,F,L,P,M,I,y,H,w,l.TranslateModule]}),(G=e.FIELD_TYPE||(e.FIELD_TYPE={}))[G.Default=0]="Default",G[G.TextBox=1]="TextBox",G[G.LimitedLengthTextBox=2]="LimitedLengthTextBox",G[G.TextArea=3]="TextArea",G[G.TextHeader=4]="TextHeader",G[G.Date=5]="Date",G[G.DateAndTime=6]="DateAndTime",G[G.NumberInteger=7]="NumberInteger",G[G.NumberReal=8]="NumberReal",G[G.Currency=9]="Currency",G[G.Boolean=10]="Boolean",G[G.ComboBox=11]="ComboBox",G[G.MultiTickBox=12]="MultiTickBox",G[G.Separator=13]="Separator",G[G.Address=14]="Address",G[G.Percentage=15]="Percentage",G[G.EmptyComboBox=16]="EmptyComboBox",G[G.InternalLink=17]="InternalLink",G[G.Email=18]="Email",G[G.LimitedDate=19]="LimitedDate",G[G.Image=20]="Image",G[G.MultiTickBoxToComboBox=21]="MultiTickBoxToComboBox",G[G.EmptyMultiTickBox=22]="EmptyMultiTickBox",G[G.Totals=23]="Totals",G[G.Attachment=24]="Attachment",G[G.Signature=25]="Signature",G[G.Link=26]="Link",G[G.ImageURL=27]="ImageURL",G[G.NumberIntegerQuantitySelector=28]="NumberIntegerQuantitySelector",G[G.NumberRealQuantitySelector=29]="NumberRealQuantitySelector",G[G.NumberIntegerForMatrix=30]="NumberIntegerForMatrix",G[G.NumberRealForMatrix=31]="NumberRealForMatrix",G[G.Images=32]="Images",G[G.Indicators=33]="Indicators",G[G.CalculatedReal=34]="CalculatedReal",G[G.CalculatedInt=35]="CalculatedInt",G[G.CalculatedString=36]="CalculatedString",G[G.CalculatedDate=37]="CalculatedDate",G[G.CalculatedBool=38]="CalculatedBool",G[G.MapDataDropDown=39]="MapDataDropDown",G[G.MapDataReal=40]="MapDataReal",G[G.MapDataString=41]="MapDataString",G[G.MapDataInt=42]="MapDataInt",G[G.Sum=43]="Sum",G[G.Phone=44]="Phone",G[G.UrlForApi=45]="UrlForApi",G[G.ManyToManyUrlForApi=46]="ManyToManyUrlForApi",G[G.ReferenceType=47]="ReferenceType",G[G.GuidReferenceType=48]="GuidReferenceType",G[G.Button=49]="Button",G[G.InternalPage=50]="InternalPage",G[G.Duration=51]="Duration",G[G.ListOfObjects=52]="ListOfObjects",G[G.Package=53]="Package",G[G.BooleanText=55]="BooleanText",G[G.RichTextHTML=56]="RichTextHTML";var B=function(e,t,r,n,i,o,a){void 0===e&&(e=0),void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=0),void 0===i&&(i=1),void 0===o&&(o=1),void 0===a&&(a=1),this.X=e,this.Width=t,this.XAlignment=r,this.Y=n,this.Height=i,this.YAlignment=o,this.LineNumber=a},V=function(){this.MandatoryField=!1,this.Mandatory=!1,this.minFieldWidth=45,this.calcColumnWidth=10,this.calcTitleColumnWidthString="100%",this.calcColumnWidthString="100%"},U=function(){},j=function(){},k=function(){this.IsSelectableForActions=!0,this.IsEditable=!0},z=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.Success=!0,this.ErrorMessage="",this.Type="",this.UIControl=e,this.Data=t},W=function(){this.ErrorMessage="",this.Success=!0,this.TotalAmount="0",this.CurrencySymbol="$"},X=function(){},Z=function(){},q=function(e){void 0===e&&(e={}),this.ApiName=e.ApiName,this.Value=e.Value,this.FormattedValue=e.FormattedValue||"",this.FieldType=e.FieldType,this.ColumnWidth=e.ColumnWidth,this.ColumnWidthType=e.ColumnWidthType,this.XAlignment=e.XAlignment,this.Title=e.Title||""},J=function(){},Q=function(){function e(){}return e.pad4=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t},e.random4=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},e.newGuid=function(){if("undefined"!=typeof window&&void 0!==window.crypto&&void 0!==window.crypto.getRandomValues){var e=new Uint16Array(8);return window.crypto.getRandomValues(e),this.pad4(e[0])+this.pad4(e[1])+"-"+this.pad4(e[2])+"-"+this.pad4(e[3])+"-"+this.pad4(e[4])+"-"+this.pad4(e[5])+this.pad4(e[6])+this.pad4(e[7])}return this.random4()+this.random4()+"-"+this.random4()+"-"+this.random4()+"-"+this.random4()+"-"+this.random4()+this.random4()+this.random4()},e}(),$=function(){function e(e,t){this.sessionService=e,this.http=t}return e.prototype.getTextFile=function(e){},e.prototype.getHttpCall=function(e,t){return void 0===t&&(t={}),this.http.get(e,t).pipe(p.catchError(this.handleError.bind(this)))},e.prototype.postHttpCall=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),this.http.post(e,t,r).pipe(p.catchError(this.handleError.bind(this)))},e.prototype.getWapiApiCall=function(e,t){void 0===t&&(t={});var r=this.sessionService.getWapiBaseUrl();return this.getHttpCall(""+r+e,t)},e.prototype.postWapiApiCall=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r={});var n=this.sessionService.getWapiBaseUrl();return this.postHttpCall(""+n+e,t,r)},e.prototype.getPapiApiCall=function(e,t){void 0===t&&(t={});var r=this.sessionService.getPapiBaseUrl();return this.getHttpCall(""+r+e,t)},e.prototype.postPapiApiCall=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r={});var n=this.sessionService.getPapiBaseUrl();return this.postHttpCall(""+n+e,t,r)},e.prototype.handleError=function(e){var t="Unknown error!";return t=e.error instanceof ErrorEvent?"Error: "+e.error.message:this.getServerErrorMessage(e),s.throwError(t)},e.prototype.getServerErrorMessage=function(e){switch(e.status){case 404:return"Not Found: "+e.message;case 403:return"Access Denied: "+e.message;case 500:return"Internal Server Error: "+e.message;default:return"Unknown Server Error\nError Code: "+e.status+"\nMessage: "+e.message}},e}();$.ɵfac=function(e){return new(e||$)(t.ɵɵinject(c),t.ɵɵinject(n.HttpClient))},$.ɵprov=t.ɵɵdefineInjectable({token:$,factory:$.ɵfac,providedIn:"root"});var ee=function(){function e(e,t){this.sessionService=e,this.httpService=t,this.ADDON_ASSETS_PATH_KEY="AddonAssetsPath"}return e.prototype.getAddonStaticFolder=function(){return this.sessionService.getObject(this.ADDON_ASSETS_PATH_KEY)||""},e.prototype.setAddonStaticFolder=function(e){return this.sessionService.setObject(this.ADDON_ASSETS_PATH_KEY,e)},e.prototype.getAddonApiCall=function(e,t,r,n){return void 0===n&&(n={}),this.httpService.getPapiApiCall("/addons/api/"+e+"/"+t+"/"+r,n)},e.prototype.postAddonApiCall=function(e,t,r,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),this.httpService.postPapiApiCall("/addons/api/"+e+"/"+t+"/"+r,n,i)},e}();ee.ɵfac=function(e){return new(e||ee)(t.ɵɵinject(c),t.ɵɵinject($))},ee.ɵprov=t.ɵɵdefineInjectable({token:ee,factory:ee.ɵfac,providedIn:"root"}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var te=function(e,t){return(te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function re(e,t){function r(){this.constructor=e}te(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}Object.create;function ne(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}Object.create;var ie=function(){function e(e,t){this.document=e,this.platformId=t,this.documentIsAccessible=r.isPlatformBrowser(this.platformId)}return e.prototype.check=function(e){return!!this.documentIsAccessible&&(e=encodeURIComponent(e),this.getCookieRegExp(e).test(this.document.cookie))},e.prototype.get=function(e){if(this.documentIsAccessible&&this.check(e)){e=encodeURIComponent(e);var t=this.getCookieRegExp(e).exec(this.document.cookie);return this.safeDecodeURIComponent(t[1])}return""},e.prototype.getAll=function(){var e=this;if(!this.documentIsAccessible)return{};var t={},r=this.document;return r.cookie&&""!==r.cookie&&r.cookie.split(";").forEach((function(r){var n=ne(r.split("="),2),i=n[0],o=n[1];t[e.safeDecodeURIComponent(i.replace(/^ /,""))]=e.safeDecodeURIComponent(o)})),t},e.prototype.set=function(e,t,r,n,i,o,a){if(void 0===a&&(a="Lax"),this.documentIsAccessible){var s=encodeURIComponent(e)+"="+encodeURIComponent(t)+";";if(r)if("number"==typeof r)s+="expires="+new Date((new Date).getTime()+1e3*r*60*60*24).toUTCString()+";";else s+="expires="+r.toUTCString()+";";n&&(s+="path="+n+";"),i&&(s+="domain="+i+";"),!1===o&&"None"===a&&(o=!0),o&&(s+="secure;"),s+="sameSite="+a+";",this.document.cookie=s}},e.prototype.delete=function(e,t,r,n,i){void 0===i&&(i="Lax"),this.documentIsAccessible&&this.set(e,"",new Date("Thu, 01 Jan 1970 00:00:01 GMT"),t,r,n,i)},e.prototype.deleteAll=function(e,t,r,n){if(void 0===n&&(n="Lax"),this.documentIsAccessible){var i=this.getAll();for(var o in i)i.hasOwnProperty(o)&&this.delete(o,e,t,r,n)}},e.prototype.getCookieRegExp=function(e){var t=e.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/gi,"\\$1");return new RegExp("(?:^"+t+"|;\\s*"+t+")=(.*?)(?:;|$)","g")},e.prototype.safeDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(t){return e}},e}();ie.ɵfac=function(e){return new(e||ie)(t.ɵɵinject(r.DOCUMENT,8),t.ɵɵinject(t.PLATFORM_ID))},ie.ɵprov=t.ɵɵdefineInjectable({token:ie,factory:ie.ɵfac,providedIn:"root"});var oe,ae=function(){function e(){}return e.prototype.convertFormData=function(e){var t=this,r=new z,n=new k,i=e.Fields,o=new U;return o.ControlFields=[],i.forEach((function(e){return o.ControlFields.push(t.setUIControlField(e))})),n.Fields=[],n.Type=0,n.UID=Q.newGuid(),e.Fields.forEach((function(e){return n.Fields.push(t.setDataField(e))})),r.Data=n,r.UIControl=o,r},e.prototype.convertListData=function(e){var t=this,r=new W,n=new Array,i=e[0].Fields,o=new U;return o.ControlFields=[],i.forEach((function(e){return o.ControlFields.push(t.setUIControlField(e))})),e.forEach((function(e){var r=new k;r.Fields=[],r.Type=0,r.UID=Q.newGuid(),e.Fields.forEach((function(e){return r.Fields.push(t.setDataField(e))})),n.push(r)})),r.Rows=n,r.UIControl=o,r},e.prototype.setUIControlField=function(e){var t=new V;return t.ApiName=e.ApiName,t.FieldType=e.FieldType,t.Layout=new B(1,1,e.XAlignment,1,1,1),t.Title=e.Title,t.ReadOnly=!1,t.ColumnWidth=e.ColumnWidth,t.ColumnWidthType=e.ColumnWidthType||1,t},e.prototype.setDataField=function(e){var t=new j;return t.AdditionalValue=e.AdditionalValue,t.ApiName=e.ApiName,t.Enabled=!0,t.FieldType=e.FieldType,t.FormattedValue=e.FormattedValue||e.Value.toString(),t.GroupFields=null,t.NotificationInfo="",t.OptionalValues=e.OptionalValues,t.ReferenceObjectSubType="",t.TextColor="",t.Value=e.Value.toString(),t.Visible=!0,t.Type="0",t},e.prototype.setFieldLayout=function(e,t,r,n,i,o,a){return new B(e,t,r,n,i,o,a)},e}();ae.ɵfac=function(e){return new(e||ae)},ae.ɵprov=t.ɵɵdefineInjectable({token:ae,factory:ae.ɵfac,providedIn:"root"}),(oe=e.FileTypeEnum||(e.FileTypeEnum={}))[oe.Script=1]="Script",oe[oe.Style=2]="Style";var se=function(){function t(){this.scripts=new Map,this.styles=new Map}return t.prototype.loadFiles=function(t){var r=this,n=[];return t.forEach((function(t){t.type===e.FileTypeEnum.Style?n.push(r.loadStyle(t.path)):t.type===e.FileTypeEnum.Script&&n.push(r.loadScript(t.path))})),Promise.all(n)},t.prototype.removeFiles=function(t){for(var r=0;r<t.length&&t[r].path&&""!==t[r].path.trim();r++){var n=this.getFileName(t[r].path,!0),i=document.getElementById(n);i.parentNode.removeChild(i),t[r].type===e.FileTypeEnum.Script&&this.scripts.has(n)?this.scripts.delete(n):t[r].type===e.FileTypeEnum.Style&&this.styles.has(n)&&this.styles.delete(n)}},t.prototype.loadScript=function(t){var r=this;return new Promise((function(n,i){var o=r.getFileName(t,!0);r.scripts.has(o)||r.scripts.set(o,{loaded:!1,src:t});var a=r.scripts.get(o);if(a.loaded)n({script:o,loaded:!0,status:"Already Loaded"});else{var s=document.createElement("script");s.type="text/javascript",s.src=a.src,s.setAttribute("id",o),s.async=!1,s.readyState?s.onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,a.loaded=!0,n({path:t,type:e.FileTypeEnum.Script,loaded:!0,status:"Loaded"}))}:s.onload=function(){a.loaded=!0,n({path:t,type:e.FileTypeEnum.Script,loaded:!0,status:"Loaded"})},s.onerror=function(r){return n({path:t,type:e.FileTypeEnum.Script,loaded:!1,status:"Loaded"})},document.getElementsByTagName("head")[0].appendChild(s)}}))},t.prototype.loadStyle=function(t){var r=this;return new Promise((function(n,i){var o=r.getFileName(t,!0);r.styles.has(o)||r.styles.set(o,{loaded:!1,src:t});var a=r.styles.get(o);if(a.loaded)n({path:t,type:e.FileTypeEnum.Style,loaded:!0,status:"Already Loaded"});else{var s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=a.src,s.media="all",s.setAttribute("id",o),a.loaded=!0,n({path:t,type:e.FileTypeEnum.Style,loaded:!0,status:"Loaded"}),document.getElementsByTagName("head")[0].appendChild(s)}}))},t.prototype.getFileName=function(e,t){void 0===t&&(t=!1);var r=t?e.length-1:e.lastIndexOf(".");return e.substr(e.lastIndexOf("/")+1,r)},t.prototype.getFileExtension=function(e){var t=e.split("."),r="";return t.length>1&&(r=t[t.length-2]),r},t.prototype.isValidUrl=function(e){try{new URL(e);return!0}catch(e){return!1}},t.prototype.convertFromb64toBlob=function(e,t,r){void 0===t&&(t=""),void 0===r&&(r=512);for(var n=atob(e),i=[],o=0;o<n.length;o+=r){for(var a=n.slice(o,o+r),s=new Array(a.length),p=0;p<a.length;p++)s[p]=a.charCodeAt(p);var l=new Uint8Array(s);i.push(l)}return new Blob(i,{type:t})},t.prototype.getAssetsPath=function(){return"/assets/pepperi-lib/"},t.prototype.getAssetsTranslationsPath=function(){return this.getAssetsPath()+"i18n/"},t.prototype.getAssetsImagesPath=function(e){return void 0===e&&(e=""),this.getAssetsPath()+"images/"+e},t.prototype.getNoImagePath=function(){return this.getAssetsImagesPath("no-image.svg")},t}();se.ɵfac=function(e){return new(e||se)},se.ɵprov=t.ɵɵdefineInjectable({token:se,factory:se.ɵfac,providedIn:"root"});var pe,le,ue=function(){function e(){}return e.prototype.parseDate=function(e,t){void 0===t&&(t=!1);var r=null;if(""!==e){r=new Date(e);var n=e.split("-");if(3===n.length&&!t){var i=Number(n[0]),o=Number(n[1])-1,a=Number(n[2]);r=new Date(i,o,a)}}return r&&isNaN(r.getTime())&&(r=null),r},e.prototype.stringifyDate=function(e,t){if(void 0===t&&(t=!1),e){var r=[];return r.push(e.getFullYear(),"-",e.getMonth()+1,"-",e.getDate()),t&&r.push("T",(e.getHours()<10?"0":"")+e.getHours(),":",(e.getMinutes()<10?"0":"")+e.getMinutes(),":",(e.getSeconds()<10?"0":"")+e.getSeconds(),"Z"),r.join("")}return""},e.prototype.stringifyDateWithOffset=function(e,t){if(void 0===t&&(t=!1),t){var r=-1*(new Date).getTimezoneOffset();e.setMinutes(e.getMinutes()-r)}return this.stringifyDate(e,t)},e.prototype.isValueHtml=function(e){return/<\/?[a-z][\s\S]*>/i.test(e)},e.prototype.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},e}();ue.ɵfac=function(e){return new(e||ue)},ue.ɵprov=t.ɵɵdefineInjectable({token:ue,factory:ue.ɵfac,providedIn:"root"}),(pe=e.LAYOUT_TYPE||(e.LAYOUT_TYPE={}))[pe.PepperiForm=0]="PepperiForm",pe[pe.PepperiCard=1]="PepperiCard",pe[pe.PepperiTable=2]="PepperiTable",pe[pe.Editmodal=3]="Editmodal",(le=e.STYLE_TYPE||(e.STYLE_TYPE={})).Weak="weak",le.Regular="regular",le.Strong="strong";var ce=function(){},de=function(){function e(e){void 0===e&&(e={}),this.notificationInfo={},this.value=e.value,this.formattedValue=e.formattedValue,this.additionalValue=e.additionalValue,this.notificationInfo=e.notificationInfo,this.key=e.key||"",this.label=e.label||"",this.accessory=e.accessory||"",this.required=!!e.required,this.readonly=!!e.readonly,this.disabled=!!e.disabled,this.order=void 0===e.order?1:e.order,this.controlType=e.controlType||"",this.type=e.type||"",this.placeholder=e.placeholder||"",this.hidden=!!e.hidden,this.row=void 0===e.row?1:e.row,this.rowSpan=void 0===e.rowSpan?1:e.rowSpan,this.col=void 0===e.col?1:e.col,this.colSpan=void 0===e.colSpan?1:e.colSpan,this.xAlignment=void 0===e.xAlignment?1:e.xAlignment,this.yAlignment=void 0===e.yAlignment?1:e.yAlignment,this.maxFieldCharacters=void 0===e.maxFieldCharacters?0:e.maxFieldCharacters,this.minValue=void 0===e.minValue?0:e.minValue,this.maxValue=void 0===e.maxValue?0:e.maxValue,this.textColor=e.textColor||"",this.lastFocusField=e.lastFocusField||null,this.updatedDataCount=0}return e.prototype.updateField=function(e,t,r){void 0===r&&(r=null),this.disabled=!e.Enabled||!t,this.readonly=!e.Enabled||!t,this.value=e.Value,this.additionalValue=e.AdditionalValue,this.formattedValue=e.FormattedValue,this.notificationInfo=e.NotificationInfo,this.textColor=e.TextColor,this.lastFocusField=r,"qs"===this.controlType&&(this.updatedDataCount+=1),"link"===this.type&&(this.formattedValue=this.disabled&&null!==this.formattedValue&&null!==this.value?this.formattedValue:this.value)},e}(),he=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="placeholder",r}return re(t,e),t}(de),Ee=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="separator",r}return re(t,e),t}(de),_e=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="button",r.referenceObjectSubType="",r.referenceObjectInternalType="",r.referenceObjectType=t.referenceObjectType||null,r.referenceObjectSubType=t.referenceObjectSubType||null,r.referenceObjectInternalType=t.referenceObjectInternalType||null,r}return re(t,e),t}(de),fe=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="attachment",r}return re(t,e),t}(de),Se=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="indicators",r}return re(t,e),t}(de),Te=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="textbox",r}return re(t,e),t}(de),me=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="textarea",r.type="textarea",r}return re(t,e),t}(de),Re=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="richhtmltextarea",r.type="richhtmltextarea",r}return re(t,e),t}(de),ge=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="signature",r.options=[],r.options=t.options||[],r}return re(t,e),t}(de),Ie=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="image",r.hasCampaignField=null,r.indicatorsField=null,r.menuField=null,r.options=[],r.sizeLimitMB=5,r.hasCampaignField=t.hasCampaignField||null,r.indicatorsField=t.indicatorsField||null,r.menuField=t.menuField||null,r.options=t.options||[],r.sizeLimitMB=t.sizeLimitMB||5,r}return re(t,e),t}(de),ye=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="images",r.options=[],r.options=t.options||[],r}return re(t,e),t}(de),ve=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="qs",r.alowDecimal=t.alowDecimal||!1,r}return re(t,e),t}(de),Oe=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="date",r}return re(t,e),t}(de),Ce=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="checkbox",r}return re(t,e),t}(de),be=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="select",r.options=[],r.options=t.options||[],r}return re(t,e),t.prototype.updateField=function(t,r){e.prototype.updateField.call(this,t,r),this.options=t.OptionalValues},t}(de),Ae=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="address",r.groupFields=null,r.groupFields=t.groupFields||null,r}return re(t,e),t}(de),Ne=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="internalPage",r.objectId="",r.parentId="",r.searchCode="",r.objectId=t.objectId||"",r.parentId=t.parentId||"",r.searchCode=t.searchCode||"",r}return re(t,e),t}(de),Ye=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.controlType="menu",r.options=[],r.options=t.options||[],r}return re(t,e),t}(de),De=function(){function t(e,r){this.sessionService=e,this.fb=r,this.hasCustomHomepage=null,this.hasCustomHeader=null,this.customHeaderHeight=t.DEFAULT_HEADER_HEIGHT,this.mainContHeight=0,this.footerHeight=new s.BehaviorSubject(0)}return t.prototype.getValidatorsForField=function(e,t,r,n,i,o,s,p){void 0===o&&(o=!1),void 0===s&&(s=NaN),void 0===p&&(p=NaN);var l=[];return!e||t||r?l.push(a.Validators.nullValidator):o?l.push(a.Validators.requiredTrue):l.push(a.Validators.required),n>0&&l.push(a.Validators.maxLength(n)),"email"===i?l.push(a.Validators.pattern(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)):"phone"===i?l.push(a.Validators.pattern(/^[\d\.\-\+\(\)\*\#]+$/)):"int"!==i&&"real"!==i||(l.push(a.Validators.pattern(/^[\.,\-\+\d]+$/)),isNaN(s)||l.push(a.Validators.min(s)),isNaN(p)||l.push(a.Validators.max(p))),l},t.prototype.getDefaultFromGroup=function(e,t,r,n,i,o,a,s,p,l,u){void 0===o&&(o=0),void 0===a&&(a=""),void 0===s&&(s=!1),void 0===p&&(p=!0),void 0===l&&(l=NaN),void 0===u&&(u=NaN);var c=p?this.getValidatorsForField(r,n,i,o,a,s,l,u):[],d={};return d[e]=[{value:t,disabled:i},c],this.fb.group(d)},t.prototype.getFormControl=function(e,t,r){void 0===r&&(r=null);var n=null;return e&&e.controls&&(n=null===r?e.controls[t]:e.controls[r].get(t)),n},t.prototype.updateFormFieldValue=function(e,t,r,n){void 0===r&&(r=""),void 0===n&&(n=null);var i=this.getFormControl(e,t,n);i&&i.setValue(r)},t.prototype.updateFormField=function(e,t,r,n){void 0===r&&(r=""),void 0===n&&(n=null);var i=this.getFormControl(e,t.key,n);if(i&&(i.setValue(r),i.disabled!==t.disabled)){t.disabled?i.disable():i.enable();var o=this.getValidatorsForField(t.required,t.readonly,t.disabled,t.maxFieldCharacters,t.type,"checkbox"===t.controlType);i.setValidators(o)}},t.prototype.calculateFormFieldHeight=function(e,r,n){void 0===e&&(e=!0),void 0===r&&(r=1),void 0===n&&(n=!1);var i=this.getThemeVariables(),o=this.getNumberThemeVariable(i,t.FORM_FIELD_HEIGHT_KEY),a=this.getNumberThemeVariable(i,t.FORM_FIELD_TITLE_HEIGHT_KEY),s=this.getNumberThemeVariable(i,t.FORM_SPACEING_KEY),p=0;if(1===r)p=(e?a:0)+o;else{var l=e?r:r-1;p=r*o+l*a+(n?0:l*s)}return p},t.prototype.calculateCardRowsHeight=function(e,r){void 0===e&&(e=1),void 0===r&&(r=!0);var n=this.getThemeVariables(),i=this.getNumberThemeVariable(n,t.CARD_FIELD_HEIGHT_KEY),o=this.getNumberThemeVariable(n,t.CARD_SPACEING_KEY);return e*i+(e-1)*(r?o:0)},t.prototype.calculateTableRowsHeight=function(e,r){void 0===e&&(e=1),void 0===r&&(r=!0);var n=this.getThemeVariables(),i=this.getNumberThemeVariable(n,t.TABLE_FIELD_HEIGHT_KEY),o=this.getNumberThemeVariable(n,t.TABLE_SPACEING_KEY);return e*(i+(r?2*o:0))},t.prototype.calculateFieldHeight=function(r,n,i){void 0===r&&(r=e.LAYOUT_TYPE.PepperiForm);return r===e.LAYOUT_TYPE.PepperiTable?this.getThemeVariable(t.TABLE_FIELD_HEIGHT_KEY):r===e.LAYOUT_TYPE.PepperiCard?this.calculateCardRowsHeight(n,!i)+t.REM_STRING:this.calculateFormFieldHeight(!1,n,i)+t.REM_STRING},t.prototype.getBrandingTheme=function(){var e=this.sessionService.getObject(t.USER_THEME);return e&&e.Theme||"default-theme"},t.prototype.getDefaultThemeLayoutVariables=function(e){e["--pep-screen-max-size-2xs"]="460"+t.PX_STRING,e["--pep-screen-max-size-xs"]="767"+t.PX_STRING,e["--pep-screen-max-size-sm"]="991"+t.PX_STRING,e["--pep-screen-max-size-md"]="1199"+t.PX_STRING,e["--pep-screen-max-size-lg"]="1366"+t.PX_STRING,e["--pep-screen-max-size-xl"]="1920"+t.PX_STRING,e[t.SIDE_BAR_WIDTH_KEY]="16"+t.REM_STRING,e[t.TOP_BAR_SPACING_TOP_KEY]="1.5"+t.REM_STRING,e[t.TOP_BAR_SPACING_BOTTOM_KEY]="0.5"+t.REM_STRING,e[t.TOP_BAR_FIELD_HEIGHT_KEY]="2.5"+t.REM_STRING,e[t.FOOTER_BAR_SPACING_TOP_KEY]="0.75"+t.REM_STRING,e[t.FOOTER_BAR_SPACING_BOTTOM_KEY]="1.25"+t.REM_STRING},t.prototype.getDefaultThemeBorderRadiusVariables=function(e){e[t.BORDER_RADIUS_SM_KEY]="0.125"+t.REM_STRING,e[t.BORDER_RADIUS_MD_KEY]="0.25"+t.REM_STRING,e[t.BORDER_RADIUS_LG_KEY]="0.5"+t.REM_STRING},t.prototype.getDefaultThemeSpacingVariables=function(e){e[t.SPACING_SIZE_2XS_KEY]="0.125"+t.REM_STRING,e[t.SPACING_SIZE_XS_KEY]="0.25"+t.REM_STRING,e[t.SPACING_SIZE_SM_KEY]="0.5"+t.REM_STRING,e[t.SPACING_SIZE_MD_KEY]="0.75"+t.REM_STRING,e[t.SPACING_SIZE_LG_KEY]="1"+t.REM_STRING,e[t.SPACING_SIZE_XL_KEY]="1.5"+t.REM_STRING,e[t.SPACING_SIZE_2XL_KEY]="2"+t.REM_STRING},t.prototype.getDefaultThemeFontsVariables=function(e){e[t.FONT_FAMILY_TITLE_KEY]="Nexa",e[t.FONT_FAMILY_BODY_KEY]="Inter",e[t.FONT_SIZE_2XS_KEY]="0.625"+t.REM_STRING,e[t.FONT_SIZE_XS_KEY]="0.75"+t.REM_STRING,e[t.FONT_SIZE_SM_KEY]="0.875"+t.REM_STRING,e[t.FONT_SIZE_MD_KEY]="1"+t.REM_STRING,e[t.FONT_SIZE_LG_KEY]="1.125"+t.REM_STRING,e[t.FONT_SIZE_XL_KEY]="1.25"+t.REM_STRING,e[t.FONT_SIZE_2XL_KEY]="1.5"+t.REM_STRING,e[t.LINE_HEIGHT_2XS_KEY]="0.75"+t.REM_STRING,e[t.LINE_HEIGHT_XS_KEY]="1"+t.REM_STRING,e[t.LINE_HEIGHT_SM_KEY]="1.25"+t.REM_STRING,e[t.LINE_HEIGHT_MD_KEY]="1.5"+t.REM_STRING,e[t.LINE_HEIGHT_LG_KEY]="1.75"+t.REM_STRING,e[t.LINE_HEIGHT_XL_KEY]="2"+t.REM_STRING,e[t.LINE_HEIGHT_2XL_KEY]="2.25"+t.REM_STRING,e["--pep-font-weight-normal"]=400,e["--pep-font-weight-bold"]=600,e["--pep-font-weight-bolder"]=800},t.prototype.getDefaultThemeButtonsVariables=function(e){e["--pep-button-2xs-horizontal-spacing"]="0.25"+t.REM_STRING,e["--pep-button-2xs-min-width"]="1"+t.REM_STRING,e["--pep-button-2xs-height"]="1"+t.REM_STRING,e["--pep-button-2xs-font-size"]="var("+t.FONT_SIZE_2XS_KEY+")",e["--pep-button-xs-horizontal-spacing"]="0.5"+t.REM_STRING,e["--pep-button-xs-min-width"]="2"+t.REM_STRING,e["--pep-button-xs-height"]="1.5"+t.REM_STRING,e["--pep-button-xs-font-size"]="var("+t.FONT_SIZE_XS_KEY+")",e["--pep-button-sm-horizontal-spacing"]="0.75"+t.REM_STRING,e["--pep-button-sm-min-width"]="2"+t.REM_STRING,e["--pep-button-sm-height"]="2"+t.REM_STRING,e["--pep-button-sm-font-size"]="var("+t.FONT_SIZE_SM_KEY+")",e["--pep-button-md-horizontal-spacing"]="1"+t.REM_STRING,e["--pep-button-md-min-width"]="2.5"+t.REM_STRING,e["--pep-button-md-height"]="2.5"+t.REM_STRING,e["--pep-button-md-font-size"]="var("+t.FONT_SIZE_MD_KEY+")",e["--pep-button-lg-horizontal-spacing"]="1"+t.REM_STRING,e["--pep-button-lg-min-width"]="3"+t.REM_STRING,e["--pep-button-lg-height"]="3"+t.REM_STRING,e["--pep-button-lg-font-size"]="var("+t.FONT_SIZE_LG_KEY+")",e["--pep-button-xl-horizontal-spacing"]="1.5"+t.REM_STRING,e["--pep-button-xl-min-width"]="5"+t.REM_STRING,e["--pep-button-xl-height"]="4"+t.REM_STRING,e["--pep-button-xl-font-size"]="var("+t.FONT_SIZE_XL_KEY+")"},t.prototype.getSystemPrimaryInvertColorsVariables=function(e){e[t.COLOR_SYSTEM_PRIMARY_INVERT_KEY+"-h"]="255",e[t.COLOR_SYSTEM_PRIMARY_INVERT_KEY+"-s"]="100%",e[t.COLOR_SYSTEM_PRIMARY_INVERT_KEY+"-l"]="100%"},t.prototype.getSystemPrimaryColorsVariables=function(e){e[t.COLOR_SYSTEM_PRIMARY_KEY+"-h"]="0",e[t.COLOR_SYSTEM_PRIMARY_KEY+"-s"]="0%",e[t.COLOR_SYSTEM_PRIMARY_KEY+"-l"]="10%"},t.prototype.getSystemSuccessColorsVariables=function(e){e[t.COLOR_SYSTEM_SUCCESS_KEY+"-h"]="100",e[t.COLOR_SYSTEM_SUCCESS_KEY+"-s"]="100%",e[t.COLOR_SYSTEM_SUCCESS_KEY+"-l"]="25%"},t.prototype.getSystemCautionColorsVariables=function(e){e[t.COLOR_SYSTEM_CAUTION_KEY+"-h"]="360",e[t.COLOR_SYSTEM_CAUTION_KEY+"-s"]="100%",e[t.COLOR_SYSTEM_CAUTION_KEY+"-l"]="40%"},t.prototype.getUserPrimaryColorsVariables=function(e){e[t.COLOR_USER_PRIMARY_KEY+"-h"]="78",e[t.COLOR_USER_PRIMARY_KEY+"-s"]="87%",e[t.COLOR_USER_PRIMARY_KEY+"-l"]="27%"},t.prototype.getUserSecondaryColorsVariables=function(e){e[t.COLOR_USER_SECONDARY_KEY+"-h"]="77",e[t.COLOR_USER_SECONDARY_KEY+"-s"]="87%",e[t.COLOR_USER_SECONDARY_KEY+"-l"]="42%"},t.prototype.getWeakColorsVariables=function(e){e[t.COLOR_WEAK_KEY+"-h"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-h)",e[t.COLOR_WEAK_KEY+"-s"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-s)",e[t.COLOR_WEAK_KEY+"-l"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-l)"},t.prototype.getRegularColorsVariables=function(e){e[t.COLOR_REGULAR_KEY+"-h"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-h)",e[t.COLOR_REGULAR_KEY+"-s"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-s)",e[t.COLOR_REGULAR_KEY+"-l"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-l)"},t.prototype.getStrongColorsVariables=function(e){e[t.COLOR_STRONG_KEY+"-h"]="var("+t.COLOR_USER_PRIMARY_KEY+"-h)",e[t.COLOR_STRONG_KEY+"-s"]="var("+t.COLOR_USER_PRIMARY_KEY+"-s)",e[t.COLOR_STRONG_KEY+"-l"]="var("+t.COLOR_USER_PRIMARY_KEY+"-l)"},t.prototype.getTextColorsVariables=function(e){e[t.COLOR_TEXT_LINK_KEY+"-h"]="207",e[t.COLOR_TEXT_LINK_KEY+"-s"]="76%",e[t.COLOR_TEXT_LINK_KEY+"-l"]="37%"},t.prototype.getDefaultThemeColorsVariables=function(e){this.getSystemPrimaryInvertColorsVariables(e),this.getSystemPrimaryColorsVariables(e),this.getSystemSuccessColorsVariables(e),this.getSystemCautionColorsVariables(e),this.getUserPrimaryColorsVariables(e),this.getUserSecondaryColorsVariables(e),this.getWeakColorsVariables(e),this.getRegularColorsVariables(e),this.getStrongColorsVariables(e),this.getTextColorsVariables(e)},t.prototype.getDefaultThemeShadowsVariables=function(e){e[t.SHADOW_NONE_OFFSET_KEY]="0";e[t.SHADOW_XS_OFFSET_KEY]="0 0.125rem 0.25rem 0";e[t.SHADOW_SM_OFFSET_KEY]="0 0.25rem 0.5rem 0";e[t.SHADOW_MD_OFFSET_KEY]="0 0.5rem 1rem 0";e[t.SHADOW_LG_OFFSET_KEY]="0 1rem 2rem 0";e[t.SHADOW_XL_OFFSET_KEY]="0 2rem 4rem 0"},t.prototype.getDefaultThemeFormCustomizationVariables=function(e){e[t.FORM_FIELD_HEIGHT_KEY]="2.5"+t.REM_STRING,e[t.FORM_FIELD_TITLE_HEIGHT_KEY]="1.5"+t.REM_STRING,e[t.FORM_SPACEING_KEY]=1+t.REM_STRING,e[t.FORM_FIELD_SPACEING_KEY]=1+t.REM_STRING},t.prototype.getDefaultThemeCardCustomizationVariables=function(e){e[t.CARD_FIELD_HEIGHT_KEY]="1.5"+t.REM_STRING,e[t.CARD_SPACEING_KEY]="var("+t.SPACING_SIZE_XS_KEY+")",e[t.CARD_BORDER_RADIUS_KEY]="var("+t.BORDER_RADIUS_MD_KEY+")",e[t.CARD_SHADOW_OFFSET_KEY]="var("+t.SHADOW_MD_OFFSET_KEY+")"},t.prototype.getDefaultThemeTableCustomizationVariables=function(e){e[t.TABLE_FIELD_HEIGHT_KEY]="2"+t.REM_STRING,e[t.TABLE_SPACEING_KEY]="0.5"+t.REM_STRING,e[t.TABLE_BORDER_RADIUS_KEY]="var("+t.BORDER_RADIUS_MD_KEY+")"},t.prototype.getDefaultThemeQSCustomizationVariables=function(r){var n=e.STYLE_TYPE.Regular;r[t.STYLE_QS_KEY]=n,r[t.COLOR_QS_KEY+"-h"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-h)",r[t.COLOR_QS_KEY+"-s"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-s)",r[t.COLOR_QS_KEY+"-l"]="var("+t.COLOR_SYSTEM_PRIMARY_KEY+"-l)"},t.prototype.getDefaultThemeTopHeaderCustomizationVariables=function(r){var n=e.STYLE_TYPE.Strong;r[t.STYLE_TOP_HEADER_KEY]=n,r[t.COLOR_TOP_HEADER_KEY+"-h"]="",r[t.COLOR_TOP_HEADER_KEY+"-s"]="",r[t.COLOR_TOP_HEADER_KEY+"-l"]=""},t.prototype.getDefaultThemeVariables=function(){var e={};return this.getDefaultThemeLayoutVariables(e),this.getDefaultThemeBorderRadiusVariables(e),this.getDefaultThemeSpacingVariables(e),this.getDefaultThemeFontsVariables(e),this.getDefaultThemeButtonsVariables(e),this.getDefaultThemeColorsVariables(e),this.getDefaultThemeShadowsVariables(e),this.getDefaultThemeFormCustomizationVariables(e),this.getDefaultThemeCardCustomizationVariables(e),this.getDefaultThemeTableCustomizationVariables(e),this.getDefaultThemeQSCustomizationVariables(e),this.getDefaultThemeTopHeaderCustomizationVariables(e),e},t.prototype.getThemeVariables=function(){var e=this.getDefaultThemeVariables(),r=this.sessionService.getObject(t.USER_THEME_VARIABLES);if(r)for(var n in r)e[n]=r[n];return e},t.prototype.setThemeVariables=function(e){void 0===e&&(e=null);var r=this.getThemeVariables();if(e)for(var n in e)r[n]=e[n];for(var n in this.sessionService.setObject(t.USER_THEME_VARIABLES,JSON.stringify(r)),r)document.documentElement.style.setProperty(n,r[n])},t.prototype.getThemeVariable=function(e){var t=this.getThemeVariables();return t.hasOwnProperty(e)?t[e]:""},t.prototype.getNumberThemeVariable=function(e,r){return e&&e.hasOwnProperty(r)?(0===e[r].indexOf("var(")&&(r=e[r].substr(4).split(")")[0]),Number(e[r].replace(t.REM_STRING,""))):0},t.prototype.setFooterHeight=function(e){var r=this;this.footerHeight.getValue()!==e&&setTimeout((function(){return r.footerHeight.next(e)}),0),document.documentElement.style.setProperty(t.FOOTER_HEIGHT_KEY,e+t.REM_STRING)},t.prototype.setDefaultFooterHeight=function(){var e=this.getThemeVariables(),r=this.getNumberThemeVariable(e,t.FOOTER_BAR_SPACING_TOP_KEY)+this.getNumberThemeVariable(e,t.FOOTER_BAR_SPACING_BOTTOM_KEY)+this.getNumberThemeVariable(e,t.TOP_BAR_FIELD_HEIGHT_KEY);this.setFooterHeight(r)},t.prototype.getTopBarHeight=function(){var e=this.getThemeVariables();return this.getNumberThemeVariable(e,t.TOP_BAR_SPACING_TOP_KEY)+this.getNumberThemeVariable(e,t.TOP_BAR_SPACING_BOTTOM_KEY)+this.getNumberThemeVariable(e,t.TOP_BAR_FIELD_HEIGHT_KEY)},t.prototype.setOldUserTheme=function(e){var r,n,i={Theme:e.Theme||"default-theme"};this.sessionService.setObject(t.USER_THEME,JSON.stringify(i)),this.isLightColor(e.BrandingMainColor)?(r=t.DEFAULT_SPINNER_COLOR,n="#222"):(r=e.BrandingMainColor,n=t.DEFAULT_BRANDING_COLOR);var o={BrandingSecondaryColor:e.BrandingSecondaryColor,BrandingMainColor:e.BrandingMainColor,BrandingFontColor:n,SpinnerColor:r};this.sessionService.setObject(t.USER_COLOR,JSON.stringify(o)),this.hasCustomHeader=!!(e.TopHeaderFiles&&e.TopHeaderFiles.length>0&&""!==e.TopHeaderFiles[0]),this.hasCustomHomepage="Buyer"===e.UserRole&&e.TopHeaderFiles&&e.TopHeaderFiles.length>1&&""!==e.TopHeaderFiles[1]},t.prototype.isLegacyColor=function(){var e=document.documentElement.style.getPropertyValue(t.COLOR_TOP_HEADER_KEY+"-h"),r=document.documentElement.style.getPropertyValue(t.COLOR_TOP_HEADER_KEY+"-s"),n=document.documentElement.style.getPropertyValue(t.COLOR_TOP_HEADER_KEY+"-l");return!(e&&r&&n)},t.prototype.getLoadingSpinnerColor=function(){var e="";if(this.isLegacyColor()){var r=this.sessionService.getObj