-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-es2015.ed819aeb10799b4e2d44.js
1 lines (1 loc) · 14.6 KB
/
main-es2015.ed819aeb10799b4e2d44.js
1
(self.webpackChunk_angular_ru_sdk=self.webpackChunk_angular_ru_sdk||[]).push([[179],{8255:function(e){function t(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}t.keys=function(){return[]},t.resolve=t,t.id=8255,e.exports=t},433:function(e,t,n){"use strict";function i(e){const t=Array.isArray(e)?e:[e];return function(e){return!t.includes(e)}}function r(e){return 0===(null!=e?e:[]).length}n.d(t,{De:function(){return i},NL:function(){return r}}),n(7247),n(416),n(9868)},1321:function(e,t,n){"use strict";n.d(t,{n:function(){return g}});var i=n(4788);function r(e,t=0){const n=Math.pow(10,t),i=+(t?e*n:e).toFixed(8),r=Math.floor(i),o=i-r;return o>.5-1e-8&&o<.5+1e-8?(r%2==0?r:r+1)/n:Math.round(i)/n}var o=n(9868);function s(e,t="ru-RU"){var n,i;let r=null==e?void 0:e.toString().replace(/\s/g,"");const s=new Intl.NumberFormat(t).formatToParts(12345.6),u=Array.from(new Intl.NumberFormat(t,{useGrouping:!1}).format(9876543210)).reverse(),a=new RegExp(`[${null===(n=s.find(e=>"group"===e.type))||void 0===n?void 0:n.value}]`,"g"),l=new RegExp(`[${null===(i=s.find(e=>"decimal"===e.type))||void 0===i?void 0:i.value}]`),c=new RegExp(`[${u.join("")}]`,"g");return r=null==r?void 0:r.trim().replace(a,"").replace(l,".").replace(c,e=>{var t,n;return null!==(n=null===(t=new Map(u.map((e,t)=>[e,t])).get(e))||void 0===t?void 0:t.toString())&&void 0!==n?n:""}),(0,o.ZM)(r)?+r:NaN}var u=n(416),a=n(5850),l=n(5319),c=n(2759),h=n(4e3),d=n(4751);let g=(()=>{class e{constructor(e,t,n,i,r){this.el=e,this.ngControl=n,this.ngZone=i,this.cd=r,this.subscriptions=new l.w,this.previousLang=null,this.maximumFractionDigits=3,this.isInsideAngularZone=!0,this.options={},this.markedAsDirty=!0,this.cursorPointer=0,this.setFirstLocalOptionsByGlobal(t)}get isInAngularZone(){return this.isInsideAngularZone}get amountFormatOptions(){return this.options}set amountFormatOptions(e){this.options=Object.assign(Object.assign({},this.options),null!=e?e:{}),this.recalculateWhenChangesOptions()}get dirty(){return this.markedAsDirty}get element(){return this.el.nativeElement}setLang(e){this.options.lang=e,this.recalculateWhenChangesOptions()}getCursorPosition(){return this.cursorPointer}ngOnInit(){this.setupElementType(),this.subscribeToElementEvents()}ngAfterViewInit(){this.format()}ngOnDestroy(){this.unsubscribeFromElementEvents()}subscribeToElementEvents(){var e;null===(e=this.ngZone)||void 0===e||e.runOutsideAngular(()=>{this.subscriptions.add((0,c.R)(this.element,"input").subscribe(()=>{this.isInsideAngularZone=i.R0b.isInAngularZone(),this.format()})),this.subscriptions.add((0,c.R)(this.element,"blur").subscribe(()=>{this.isInsideAngularZone=i.R0b.isInAngularZone(),this.formatOnBlur()}))})}unsubscribeFromElementEvents(){this.subscriptions.unsubscribe()}formatOnBlur(){var e;this.isIncorrectPreviewAfterBlur()&&(this.element.value=null!==(e=(0,a.QH)(this.element.value))&&void 0!==e?e:"")}format(){var e,t;const n=this.getFractionSeparator();this.cursorPointer=null!==(e=this.element.selectionStart)&&void 0!==e?e:0;const i=this.cursorPointer!==this.element.value.length;if(this.replaceAllInvalidSymbolsBeforeTranslation(),this.viewModelIsOnlyMinus())return this.resetModelValue(),void(this.element.value="-");const r=this.element.value,o=this.getNumberValueWithGaussRounded();this.setModelValueBy(o),this.element.value=r;const s=this.prepareConvertedToLocaleValue(o,n);this.element.value=isNaN(null===(t=this.ngControl)||void 0===t?void 0:t.value)?"":s,this.setSelectionRangeBy(i,s),this.preventExpressionChangedAfter()}isIncorrectPreviewAfterBlur(){return this.lastSymbolIsFraction()||this.viewModelIsOnlyMinus()}resetModelValue(e=null){var t;null===(t=this.ngControl)||void 0===t||t.reset(e)}replaceAllInvalidSymbolsBeforeTranslation(){const e=this.getFractionSeparator();this.element.value=this.removeNonNumericSymbols(),this.element.value=this.replaceInvalidFractionPosition(e),this.element.value=this.removeDuplicateMinusOrFractionSymbol(e)}getMaximumFractionDigits(){var e,t;return null!==(t=null===(e=this.options.formatOptions)||void 0===e?void 0:e.maximumFractionDigits)&&void 0!==t?t:this.maximumFractionDigits}getLastSymbolsAsZeroDot(e){var t,n,i;const o=this.getMaximumFractionDigits();let u=0===o?"":null!==(i=null===(n=null===(t=this.element.value.match(new RegExp(`(\\${e})(.+)?`)))||void 0===t?void 0:t[0])||void 0===n?void 0:n.replace(/,|./,""))&&void 0!==i?i:"";if(u.length>this.maximumFractionDigits){const t=r(s(`0${e}${u}`,this.options.lang),o);u=isNaN(t)?"":t.toString().replace(/0\./,"")}return u}prepareConvertedToLocaleValue(e,t){const n=this.lastSymbolIsFraction();let i=this.getConvertedToLocaleString(e);if(n)i=`${i}${t}`;else{const e=this.getLastSymbolsAsZeroDot(t);if((0,o.ZM)(e)){const n=i.split(t),r=null==n?void 0:n[0];i=(0,o.ZM)(r)?`${r}${t}${e}`:`0${t}${e}`}}return i.replace(/\s/g," ")}setModelValueBy(e){isNaN(e)?this.resetModelValue():this.resetModelValue(e)}getConvertedToLocaleString(e){return(isNaN(e)?"":e).toLocaleString(this.options.lang,this.options.formatOptions)}getNumberValueWithGaussRounded(){const e=this.getMaximumFractionDigits();return r(s(this.element.value,this.options.lang),e)}lastSymbolIsFraction(){return(0,a.B3)(this.element.value)===this.getFractionSeparator()}replaceInvalidFractionPosition(e){return this.element.value.replace(new RegExp(`\\${e}+$`,"g"),e)}removeDuplicateMinusOrFractionSymbol(e){let t=this.element.value,n=0;return t=t.replace(new RegExp(`\\${e}`,"g"),()=>(n++,n>1?"":e)),0!==t.indexOf("-")&&(t=t.replace(/-/g,"")),t}viewModelIsOnlyMinus(){return"-"===this.element.value}getFractionSeparator(){var e;return function(e){const t={expectedValue:1000000.65,lastValuePositionBeforeFraction:-3};return t.expectedValue.toLocaleString(e).slice(t.lastValuePositionBeforeFraction).slice(0,1)}(null!==(e=this.options.lang)&&void 0!==e?e:h.J.lang)}removeNonNumericSymbols(){return this.viewModelIsOnlyMinus()?this.element.value:(0,a.a9)(this.element.value)}setSelectionRangeBy(e,t){try{e||(this.cursorPointer=t.length),this.element.setSelectionRange(this.cursorPointer,this.cursorPointer)}catch(n){}}setFirstLocalOptionsByGlobal(e){this.options=(0,u.I8)(e),this.previousLang=this.options.lang}recalculateWhenChangesOptions(){var e;const t=s(this.element.value,null!==(e=this.previousLang)&&void 0!==e?e:this.options.lang);this.element.value=t.toLocaleString(this.options.lang,this.options.formatOptions),this.previousLang=this.options.lang,this.format()}preventExpressionChangedAfter(){this.markedAsDirty&&((0,o.ZK)(this.cd),this.markedAsDirty=!1)}setupElementType(){this.el.nativeElement.setAttribute("type","text")}}return e.\u0275fac=function(t){return new(t||e)(i.Y36(i.SBq),i.Y36(h.L),i.Y36(d.a5,8),i.Y36(i.R0b,8),i.Y36(i.sBO,8))},e.\u0275dir=i.lG2({type:e,selectors:[["","amountFormat",""]],inputs:{amountFormatOptions:"amountFormatOptions"}}),e})()},802:function(e,t,n){"use strict";n.d(t,{V:function(){return s}});var i=n(2057),r=n(4e3),o=n(4788);let s=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[{provide:r.L,useValue:Object.assign(Object.assign({},r.J),t)}]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[i.ez]]}),e})()},4e3:function(e,t,n){"use strict";n.d(t,{L:function(){return i},J:function(){return r}});const i=new(n(4788).OlP)("AMOUNT_FORMAT_OPTIONS"),r={lang:"ru-RU"}},9794:function(e,t,n){"use strict";n.d(t,{B:function(){return s}});var i=n(1453),r=n(5850),o=n(4788);let s=(()=>{class e{constructor(e){this.elementRef=e,this.filter=[],this.manualEvent=null}onInput(e){var t,n;if(this.manualEvent===e)return;const i=this.elementRef.nativeElement.value,o=(0,r.hX)(i,this.filter);o!==i&&(this.manualEvent=new InputEvent("input",Object.assign(Object.assign({},e),{data:o})),this.elementRef.nativeElement.value=null!==(n=null===(t=this.manualEvent)||void 0===t?void 0:t.data)&&void 0!==n?n:"",this.elementRef.nativeElement.dispatchEvent(this.manualEvent))}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(o.SBq))},e.\u0275dir=o.lG2({type:e,selectors:[["","filter",""]],hostBindings:function(e,t){1&e&&o.NdJ("input",function(e){return t.onInput(e)})},inputs:{filter:"filter"},features:[o._Bn([i.N])]}),e})()},2118:function(e,t,n){"use strict";n.d(t,{V6:function(){return i.V},iL:function(){return s}}),n(1321);var i=n(802);n(4e3),n(5850),n(9794);var r=n(2057),o=n(4788);let s=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e}),e.\u0275inj=o.cJS({imports:[[r.ez]]}),e})();n(1453),n(9868)},1453:function(e,t,n){"use strict";n.d(t,{N:function(){return h}});var i=n(4751),r=n(433),o=n(7247),s=n(9765),u=n(8002),a=n(6782);class l{constructor(e){this.accessor=e,this.onViewValueChangedSubject=new s.xQ,this.onModelValueChangedSubject=new s.xQ,this.onViewValueChanged=this.onViewValueChangedSubject.asObservable(),this.onModelValueChanged=this.onModelValueChangedSubject.asObservable(),this.saveOriginalAccessorFunctions(),this.patchAccessorFunctions()}pushModelValue(e){var t;null===(t=this.onModelValueChangeFunction)||void 0===t||t.call(this,e)}pushViewValue(e){this.writeViewValueFunction(e)}detach(){this.accessor.registerOnChange=this.registerOnViewValueChangeFunction,this.accessor.registerOnChange(this.onModelValueChangeFunction),this.accessor.writeValue=this.writeViewValueFunction}patchAccessorFunctions(){this.accessor.registerOnChange=e=>{this.onModelValueChangeFunction=e,this.registerOnViewValueChangeFunction(e=>{this.onViewValueChangedSubject.next(e)})},this.accessor.writeValue=e=>{this.onModelValueChangedSubject.next(e)}}saveOriginalAccessorFunctions(){this.writeViewValueFunction=this.accessor.writeValue.bind(this.accessor),this.registerOnViewValueChangeFunction=this.accessor.registerOnChange.bind(this.accessor)}}var c=n(4788);let h=(()=>{class e{constructor(e){this.onDestroy=new s.xQ,this.controlValueOperators=[];const[t]=e;t&&(this.interceptor=new l(t)),this.makeSequencesAndPassValues()}ngOnDestroy(){var e;null===(e=this.interceptor)||void 0===e||e.detach(),this.onDestroy.next(),this.onDestroy.complete()}attach(e){this.controlValueOperators=this.controlValueOperators.concat(e)}detach(e){this.controlValueOperators=this.controlValueOperators.filter((0,r.De)(e))}toModelValue(e){let t=e;for(const n of this.controlValueOperators)t=(0,o.qK)(n.toModelValue)?n.toModelValue(t):t;return t}toViewValue(e){let t=e;for(const n of this.controlValueOperators)t=(0,o.qK)(n.toViewValue)?n.toViewValue(t):t;return t}makeSequencesAndPassValues(){this.listenViewConvertToModelValue(),this.listenModelConvertToViewValue()}listenModelConvertToViewValue(){var e;null===(e=this.interceptor)||void 0===e||e.onModelValueChanged.pipe((0,u.U)(e=>this.toViewValue(e)),(0,a.R)(this.onDestroy)).subscribe(e=>{var t;return null===(t=this.interceptor)||void 0===t?void 0:t.pushViewValue(e)})}listenViewConvertToModelValue(){var e;null===(e=this.interceptor)||void 0===e||e.onViewValueChanged.pipe((0,u.U)(e=>this.toModelValue(e)),(0,a.R)(this.onDestroy)).subscribe(e=>{var t;return null===(t=this.interceptor)||void 0===t?void 0:t.pushModelValue(e)})}}return e.\u0275fac=function(t){return new(t||e)(c.LFG(i.JU,2))},e.\u0275prov=c.Yz7({token:e,factory:e.\u0275fac}),e})()},7247:function(e,t,n){"use strict";function i(e){return"function"==typeof e}n.d(t,{qK:function(){return i}}),n(9868)},4889:function(e,t,n){"use strict";var i=n(1211),r=n(4788),o=n(9868),s=n(8497),u=n(5363),a=n(3050),l=n(3121),c=n(4141),h=n(2118),d=n(4525),g=n(591);let v=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Xpm({type:e,selectors:[["app-root"]],decls:32,vars:0,consts:[[1,"dashboard"],["mode","side","opened","",1,"dashboard__menu"],[1,"title"],["src","assets/img/angular.svg","alt","angular",1,"logo"],["routerLink","/",1,"logo-title"],[1,"menu"],[1,"menu__item"],["routerLink","samples/guide"],[1,"dashboard__content"]],template:function(e,t){1&e&&(r.TgZ(0,"mat-drawer-container",0),r._uU(1,"\n "),r.TgZ(2,"mat-drawer",1),r._uU(3,"\n "),r.TgZ(4,"mat-toolbar",2),r._uU(5,"\n "),r._UZ(6,"img",3),r._uU(7,"\n "),r.TgZ(8,"a",4),r._uU(9,"@angular-ru/common"),r.qZA(),r._uU(10,"\n "),r.qZA(),r._uU(11,"\n\n "),r.TgZ(12,"mat-list",5),r._uU(13,"\n "),r.TgZ(14,"mat-list-item",6),r._uU(15,"\n "),r.TgZ(16,"a",7),r._uU(17,"- "),r.TgZ(18,"strong"),r._uU(19,"Guide overview"),r.qZA(),r.qZA(),r._uU(20,"\n "),r.qZA(),r._uU(21,"\n "),r._UZ(22,"mat-divider"),r._uU(23,"\n "),r.qZA(),r._uU(24,"\n "),r.qZA(),r._uU(25,"\n\n "),r.TgZ(26,"mat-drawer-content",8),r._uU(27,"\n "),r._UZ(28,"router-outlet"),r._uU(29,"\n "),r.qZA(),r._uU(30,"\n"),r.qZA(),r._uU(31,"\n"))},directives:[a.kh,a.jA,l.Ye,d.yS,u.i$,u.Tg,g.d,a.LW,d.lC],encapsulation:2,changeDetection:0}),e})(),p=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.oAB({type:e}),e.\u0275inj=r.cJS({imports:[[d.Bz.forRoot([{path:"",pathMatch:"full",redirectTo:"samples"},{path:"samples",children:[{path:"",pathMatch:"full",redirectTo:"guide"},{path:"guide",loadChildren:()=>n.e(551).then(n.bind(n,6551)).then(e=>e.GuideModule)}]}],{useHash:!0,scrollPositionRestoration:"enabled"})],d.Bz]}),e})();n(802);let m=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.oAB({type:e,bootstrap:[v]}),e.\u0275inj=r.cJS({imports:[[i.b2,s.JF,p,c.PW,a.SJ,l.g0,u.ie,h.V6.forRoot()]]}),e})();(0,o.oA)(!0)&&(0,r.G48)(),i.q6().bootstrapModule(m,{ngZoneEventCoalescing:!0}).catch(e=>console.error(e))},416:function(e,t,n){"use strict";n.d(t,{I8:function(){return r}});var i=n(9868);function r(e){return(0,i.kK)(e)?e:JSON.parse(JSON.stringify(e))}},5850:function(e,t,n){"use strict";n.d(t,{hX:function(){return o},B3:function(){return s},QH:function(){return u},a9:function(){return a}});var i=n(433),r=n(7247);function o(e,t=[]){return Array.isArray(t)?function(e,t=[]){return(0,i.NL)(t)?e:Array.from(e).filter(e=>t.includes(e)).join("")}(e,t):(0,r.qK)(t)?function(e,t){return Array.from(e).filter(t).join("")}(e,t):t instanceof RegExp?function(e,t){var n;return(null!==(n=e.match(t))&&void 0!==n?n:[]).join("")}(e,t):e}function s(e){return null==e?void 0:e.slice(-1)}function u(e){return null==e?void 0:e.slice(0,-1)}function a(e){var t;return null!==(t=null==e?void 0:e.replace(/[^\d,.-]/g,"").replace(/^\.|^,/,""))&&void 0!==t?t:""}},9868:function(e,t,n){"use strict";function i(e){return!function(e){const t="string"==typeof e?e.trim():e;return[void 0,null,NaN,"",1/0].includes(t)}(e)}function r(e){return null==e}function o(e){return!r(e)}function s(e){r(e)||(Array.isArray(e)?e.forEach(e=>u(e)):o(e)&&u(e))}function u(e){o(e)&&!e.destroyed&&e.detectChanges()}function a(e){return!0===e}n.d(t,{ZM:function(){return i},ZK:function(){return s},kK:function(){return r},DX:function(){return o},oA:function(){return a}})}},function(e){"use strict";e.O(0,[736],function(){return e(e.s=4889)}),e.O()}]);