@openmrs/ngx-formentry 3.0.1-pre.8 → 3.0.1-pre.83

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.
Files changed (213) hide show
  1. package/bundles/openmrs-ngx-formentry.umd.js +9382 -8307
  2. package/bundles/openmrs-ngx-formentry.umd.js.map +1 -1
  3. package/components/afe-ng-select.component.d.ts +5 -3
  4. package/components/appointments-overview/appointments-overview.component.d.ts +5 -3
  5. package/components/check-box/checkbox.component.d.ts +6 -3
  6. package/components/check-box/checkbox.module.d.ts +7 -0
  7. package/components/custom-component-wrapper/custom-component-wrapper..module.d.ts +7 -0
  8. package/components/custom-component-wrapper/custom-component-wrapper.component.d.ts +4 -3
  9. package/components/custom-control-wrapper/custom-control-wrapper..module.d.ts +8 -0
  10. package/components/custom-control-wrapper/custom-control-wrapper.component.d.ts +3 -0
  11. package/components/date-time-picker/date-picker/date-picker.component.d.ts +5 -2
  12. package/components/date-time-picker/date-time-picker.component.d.ts +6 -4
  13. package/components/date-time-picker/date-time-picker.module.d.ts +11 -3
  14. package/components/date-time-picker/index.d.ts +8 -0
  15. package/components/date-time-picker/picker-modal/modal.component.d.ts +6 -4
  16. package/components/date-time-picker/pipes/moment.pipe.d.ts +3 -0
  17. package/components/date-time-picker/time-picker/time-picker.component.d.ts +5 -2
  18. package/components/file-upload/file-upload.component.d.ts +4 -1
  19. package/components/file-upload/file-upload.module.d.ts +10 -0
  20. package/components/file-upload/secure.pipe.d.ts +3 -0
  21. package/components/input/input.directive.d.ts +5 -2
  22. package/components/input/input.module.d.ts +9 -0
  23. package/components/input/label.component.d.ts +13 -10
  24. package/components/input/text-area.directive.d.ts +5 -2
  25. package/components/ngx-datetime-picker/ngx-datetime-picker.component.d.ts +4 -0
  26. package/components/ngx-datetime-picker/ngx-datetime-picker.module.d.ts +9 -3
  27. package/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time-adapter.class.d.ts +3 -3
  28. package/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time.module.d.ts +8 -3
  29. package/components/ngx-pick-datetime/lib/date-time/calendar-body.component.d.ts +7 -8
  30. package/components/ngx-pick-datetime/lib/date-time/calendar-month-view.component.d.ts +4 -4
  31. package/components/ngx-pick-datetime/lib/date-time/calendar-multi-year-view.component.d.ts +8 -9
  32. package/components/ngx-pick-datetime/lib/date-time/calendar-year-view.component.d.ts +5 -5
  33. package/components/ngx-pick-datetime/lib/date-time/calendar.component.d.ts +6 -10
  34. package/components/ngx-pick-datetime/lib/date-time/date-time-inline.component.d.ts +7 -5
  35. package/components/ngx-pick-datetime/lib/date-time/date-time-picker-container.component.d.ts +17 -18
  36. package/components/ngx-pick-datetime/lib/date-time/date-time-picker-input.directive.d.ts +12 -15
  37. package/components/ngx-pick-datetime/lib/date-time/date-time-picker-intl.service.d.ts +3 -3
  38. package/components/ngx-pick-datetime/lib/date-time/date-time-picker-trigger.directive.d.ts +7 -8
  39. package/components/ngx-pick-datetime/lib/date-time/date-time-picker.component.d.ts +5 -6
  40. package/components/ngx-pick-datetime/lib/date-time/date-time.class.d.ts +3 -0
  41. package/components/ngx-pick-datetime/lib/date-time/date-time.module.d.ts +21 -3
  42. package/components/ngx-pick-datetime/lib/date-time/numberedFixLen.pipe.d.ts +3 -0
  43. package/components/ngx-pick-datetime/lib/date-time/timer-box.component.d.ts +4 -4
  44. package/components/ngx-pick-datetime/lib/date-time/timer.component.d.ts +7 -8
  45. package/components/ngx-pick-datetime/lib/dialog/dialog-container.component.d.ts +17 -15
  46. package/components/ngx-pick-datetime/lib/dialog/dialog.module.d.ts +9 -3
  47. package/components/ngx-pick-datetime/lib/dialog/dialog.service.d.ts +3 -0
  48. package/components/ngx-remote-select/ngx-remote-select.component.d.ts +7 -4
  49. package/components/ngx-remote-select/ngx-remote-select.module.d.ts +8 -0
  50. package/components/ngx-tabset/components/{tab-set.d.ts → ngx-tab-set.component.d.ts} +6 -3
  51. package/components/ngx-tabset/components/tab.component.d.ts +13 -0
  52. package/components/ngx-tabset/directives/hover-class.directive.d.ts +4 -1
  53. package/components/ngx-tabset/modules/ngx-tabset.module.d.ts +8 -0
  54. package/components/number-input/number-input.component.d.ts +4 -1
  55. package/components/number-input/number-input.module.d.ts +7 -0
  56. package/components/radio-button/radio.component.d.ts +22 -0
  57. package/components/radio-button/radio.module.d.ts +9 -0
  58. package/components/select/optgroup.directive.d.ts +4 -1
  59. package/components/select/option.directive.d.ts +4 -1
  60. package/components/select/select.component.d.ts +7 -4
  61. package/components/select/select.module.d.ts +9 -0
  62. package/esm2015/components/afe-ng-select.component.js +37 -23
  63. package/esm2015/components/appointments-overview/appointments-overview.component.js +15 -13
  64. package/esm2015/components/check-box/checkbox.component.js +37 -24
  65. package/esm2015/components/check-box/checkbox.module.js +13 -8
  66. package/esm2015/components/custom-component-wrapper/custom-component-wrapper..module.js +15 -10
  67. package/esm2015/components/custom-component-wrapper/custom-component-wrapper.component.js +17 -12
  68. package/esm2015/components/custom-control-wrapper/custom-control-wrapper..module.js +15 -10
  69. package/esm2015/components/custom-control-wrapper/custom-control-wrapper.component.js +27 -17
  70. package/esm2015/components/date-time-picker/date-picker/date-picker.component.js +33 -23
  71. package/esm2015/components/date-time-picker/date-time-picker.component.js +42 -27
  72. package/esm2015/components/date-time-picker/date-time-picker.module.js +34 -21
  73. package/esm2015/components/date-time-picker/index.js +9 -0
  74. package/esm2015/components/date-time-picker/picker-modal/modal.component.js +18 -17
  75. package/esm2015/components/date-time-picker/pipes/moment.pipe.js +8 -4
  76. package/esm2015/components/date-time-picker/time-picker/time-picker.component.js +35 -24
  77. package/esm2015/components/file-upload/file-upload.component.js +34 -22
  78. package/esm2015/components/file-upload/file-upload.module.js +31 -16
  79. package/esm2015/components/file-upload/secure.pipe.js +12 -13
  80. package/esm2015/components/input/input.directive.js +43 -20
  81. package/esm2015/components/input/input.module.js +16 -11
  82. package/esm2015/components/input/label.component.js +130 -44
  83. package/esm2015/components/input/text-area.directive.js +30 -16
  84. package/esm2015/components/ngx-datetime-picker/ngx-datetime-picker.component.js +41 -21
  85. package/esm2015/components/ngx-datetime-picker/ngx-datetime-picker.module.js +28 -16
  86. package/esm2015/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time-adapter.class.js +14 -11
  87. package/esm2015/components/ngx-pick-datetime/lib/date-time/adapter/native-date-time.module.js +26 -17
  88. package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-body.component.js +39 -39
  89. package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-month-view.component.js +58 -42
  90. package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-multi-year-view.component.js +58 -47
  91. package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar-year-view.component.js +57 -43
  92. package/esm2015/components/ngx-pick-datetime/lib/date-time/calendar.component.js +67 -53
  93. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-inline.component.js +56 -42
  94. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-container.component.js +92 -73
  95. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-input.directive.js +121 -97
  96. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-intl.service.js +7 -5
  97. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-trigger.directive.js +31 -32
  98. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker.component.js +58 -42
  99. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time.class.js +31 -18
  100. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time.module.js +59 -34
  101. package/esm2015/components/ngx-pick-datetime/lib/date-time/numberedFixLen.pipe.js +10 -6
  102. package/esm2015/components/ngx-pick-datetime/lib/date-time/timer-box.component.js +49 -38
  103. package/esm2015/components/ngx-pick-datetime/lib/date-time/timer.component.js +52 -46
  104. package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog-container.component.js +114 -75
  105. package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog.module.js +15 -10
  106. package/esm2015/components/ngx-pick-datetime/lib/dialog/dialog.service.js +24 -13
  107. package/esm2015/components/ngx-remote-select/ngx-remote-select.component.js +42 -28
  108. package/esm2015/components/ngx-remote-select/ngx-remote-select.module.js +14 -9
  109. package/esm2015/components/ngx-tabset/components/ngx-tab-set.component.js +76 -0
  110. package/esm2015/components/ngx-tabset/components/tab.component.js +37 -0
  111. package/esm2015/components/ngx-tabset/directives/hover-class.directive.js +18 -14
  112. package/esm2015/components/ngx-tabset/modules/ngx-tabset.module.js +15 -10
  113. package/esm2015/components/number-input/number-input.component.js +70 -40
  114. package/esm2015/components/number-input/number-input.module.js +14 -9
  115. package/esm2015/components/radio-button/radio.component.js +89 -0
  116. package/esm2015/components/radio-button/radio.module.js +19 -0
  117. package/esm2015/components/select/optgroup.directive.js +15 -13
  118. package/esm2015/components/select/option.directive.js +15 -13
  119. package/esm2015/components/select/select.component.js +68 -174
  120. package/esm2015/components/select/select.module.js +16 -11
  121. package/esm2015/form-entry/control-hiders-disablers/disabler-helper.js +1 -2
  122. package/esm2015/form-entry/data-sources/data-sources.js +7 -7
  123. package/esm2015/form-entry/directives/collapse.directive.js +45 -30
  124. package/esm2015/form-entry/directives/historical-value.directive.js +71 -0
  125. package/esm2015/form-entry/error-renderer/error-renderer.component.js +17 -16
  126. package/esm2015/form-entry/expression-runner/expression-runner.js +7 -5
  127. package/esm2015/form-entry/form-entry.module.js +143 -63
  128. package/esm2015/form-entry/form-factory/control-relations.factory.js +7 -5
  129. package/esm2015/form-entry/form-factory/form-control.service.js +10 -9
  130. package/esm2015/form-entry/form-factory/form-node.js +19 -4
  131. package/esm2015/form-entry/form-factory/form.factory.js +20 -11
  132. package/esm2015/form-entry/form-factory/form.js +1 -5
  133. package/esm2015/form-entry/form-factory/hiders-disablers.factory.js +10 -9
  134. package/esm2015/form-entry/form-factory/question.factory.js +90 -6
  135. package/esm2015/form-entry/form-factory/show-messages.factory.js +9 -8
  136. package/esm2015/form-entry/form-factory/validation.factory.js +7 -5
  137. package/esm2015/form-entry/form-renderer/form-renderer.component.js +93 -56
  138. package/esm2015/form-entry/helpers/historical-expression-helper-service.js +7 -5
  139. package/esm2015/form-entry/helpers/historical-field-helper-service.js +7 -4
  140. package/esm2015/form-entry/helpers/js-expression-helper.js +22 -4
  141. package/esm2015/form-entry/helpers/risk-dataset-table.js +247 -0
  142. package/esm2015/form-entry/pipes/time-ago.pipe.js +11 -11
  143. package/esm2015/form-entry/question-models/checkbox.model.js +2 -2
  144. package/esm2015/form-entry/question-models/interfaces/base-options.js +1 -1
  145. package/esm2015/form-entry/question-models/interfaces/date-question-options.js +1 -1
  146. package/esm2015/form-entry/question-models/interfaces/radio-button-options.js +2 -0
  147. package/esm2015/form-entry/question-models/interfaces/repeating-question-options.js +1 -1
  148. package/esm2015/form-entry/question-models/models.js +2 -1
  149. package/esm2015/form-entry/question-models/question-base.js +2 -1
  150. package/esm2015/form-entry/question-models/radio-button.model.js +12 -0
  151. package/esm2015/form-entry/services/debug-mode.service.js +7 -5
  152. package/esm2015/form-entry/services/form-errors.service.js +7 -4
  153. package/esm2015/form-entry/services/form-schema-compiler.service.js +9 -7
  154. package/esm2015/form-entry/services/historical-encounter-data.service.js +8 -6
  155. package/esm2015/form-entry/value-adapters/encounter.adapter.js +9 -10
  156. package/esm2015/form-entry/value-adapters/obs-adapter-helper.js +31 -15
  157. package/esm2015/form-entry/value-adapters/obs.adapter.js +8 -11
  158. package/esm2015/form-entry/value-adapters/order.adapter.js +7 -7
  159. package/esm2015/form-entry/value-adapters/person-attribute.adapter.js +7 -6
  160. package/esm2015/lib/index.js +10 -1
  161. package/esm2015/openmrs-ngx-formentry.js +1 -72
  162. package/esm2015/shared.module.js +15 -9
  163. package/fesm2015/openmrs-ngx-formentry.js +10909 -10053
  164. package/fesm2015/openmrs-ngx-formentry.js.map +1 -1
  165. package/form-entry/data-sources/data-sources.d.ts +3 -0
  166. package/form-entry/directives/collapse.directive.d.ts +3 -0
  167. package/form-entry/directives/{historical-value-directive.d.ts → historical-value.directive.d.ts} +3 -0
  168. package/form-entry/error-renderer/error-renderer.component.d.ts +4 -3
  169. package/form-entry/expression-runner/expression-runner.d.ts +3 -0
  170. package/form-entry/form-entry.module.d.ts +28 -0
  171. package/form-entry/form-factory/control-relations.factory.d.ts +3 -0
  172. package/form-entry/form-factory/form-control.service.d.ts +3 -0
  173. package/form-entry/form-factory/form-node.d.ts +3 -2
  174. package/form-entry/form-factory/form.factory.d.ts +5 -1
  175. package/form-entry/form-factory/hiders-disablers.factory.d.ts +3 -0
  176. package/form-entry/form-factory/question.factory.d.ts +6 -0
  177. package/form-entry/form-factory/show-messages.factory.d.ts +3 -0
  178. package/form-entry/form-factory/validation.factory.d.ts +3 -0
  179. package/form-entry/form-renderer/form-renderer.component.d.ts +13 -2
  180. package/form-entry/helpers/historical-expression-helper-service.d.ts +3 -0
  181. package/form-entry/helpers/historical-field-helper-service.d.ts +3 -0
  182. package/form-entry/helpers/js-expression-helper.d.ts +5 -0
  183. package/form-entry/helpers/risk-dataset-table.d.ts +1 -0
  184. package/form-entry/pipes/time-ago.pipe.d.ts +3 -0
  185. package/form-entry/question-models/interfaces/base-options.d.ts +2 -0
  186. package/form-entry/question-models/interfaces/radio-button-options.d.ts +8 -0
  187. package/form-entry/question-models/interfaces/repeating-question-options.d.ts +2 -0
  188. package/form-entry/question-models/models.d.ts +1 -0
  189. package/form-entry/question-models/question-base.d.ts +5 -0
  190. package/form-entry/question-models/radio-button.model.d.ts +7 -0
  191. package/form-entry/services/debug-mode.service.d.ts +3 -0
  192. package/form-entry/services/form-errors.service.d.ts +3 -0
  193. package/form-entry/services/form-schema-compiler.service.d.ts +3 -0
  194. package/form-entry/services/historical-encounter-data.service.d.ts +3 -0
  195. package/form-entry/value-adapters/encounter.adapter.d.ts +3 -0
  196. package/form-entry/value-adapters/obs-adapter-helper.d.ts +7 -0
  197. package/form-entry/value-adapters/obs.adapter.d.ts +3 -0
  198. package/form-entry/value-adapters/order.adapter.d.ts +3 -0
  199. package/form-entry/value-adapters/person-attribute.adapter.d.ts +3 -0
  200. package/lib/index.d.ts +9 -0
  201. package/openmrs-ngx-formentry.d.ts +1 -81
  202. package/package.json +3 -4
  203. package/shared.module.d.ts +7 -0
  204. package/styles/ngx-formentry.css +1 -1
  205. package/bundles/openmrs-ngx-formentry.umd.min.js +0 -2
  206. package/bundles/openmrs-ngx-formentry.umd.min.js.map +0 -1
  207. package/components/ngx-tabset/components/tab.d.ts +0 -10
  208. package/esm2015/components/ngx-tabset/components/tab-set.js +0 -67
  209. package/esm2015/components/ngx-tabset/components/tab.js +0 -35
  210. package/esm2015/form-entry/directives/historical-value-directive.js +0 -66
  211. package/esm2015/form-entry/form-renderer/form-renderer.component.css.js +0 -179
  212. package/form-entry/form-renderer/form-renderer.component.css.d.ts +0 -1
  213. package/openmrs-ngx-formentry.metadata.json +0 -1
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("rxjs"),require("moment"),require("lodash"),require("@angular/animations"),require("@ng-select/ng-select"),require("@angular/platform-browser"),require("ngx-webcam"),require("ngx-file-uploader"),require("@angular/cdk/a11y"),require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/cdk/keycodes"),require("@angular/cdk/coercion"),require("rxjs/operators"),require("@angular/cdk/platform"),require("@angular-extensions/elements")):"function"==typeof define&&define.amd?define("@openmrs/ngx-formentry",["exports","@angular/core","@angular/common","@angular/forms","rxjs","moment","lodash","@angular/animations","@ng-select/ng-select","@angular/platform-browser","ngx-webcam","ngx-file-uploader","@angular/cdk/a11y","@angular/cdk/overlay","@angular/cdk/portal","@angular/cdk/keycodes","@angular/cdk/coercion","rxjs/operators","@angular/cdk/platform","@angular-extensions/elements"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).openmrs=e.openmrs||{},e.openmrs["ngx-formentry"]={}),e.ng.core,e.ng.common,e.ng.forms,e.rxjs,e.moment,e._,e.ng.animations,e.ngSelect,e.ng.platformBrowser,e.ngxWebcam,e.ngxFileUploader,e.ng.cdk.a11y,e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.cdk.keycodes,e.ng.cdk.coercion,e.rxjs.operators,e.ng.cdk.platform,e.elements)}(this,(function(e,t,n,i,r,o,a,s,l,c,u,d,p,h,f,m,y,g,b,v){"use strict";function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function x(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var k=x(t),C=w(o),T=x(a),O=w(a),D=function(){function e(){this.cookieKey="formDebug"}return e.prototype.debugEnabled=function(){return!1},e}();D.decorators=[{type:t.Injectable}],D.ctorParameters=function(){return[]};var M=function(){function e(e,t){this.changeDetectorRef=e,this.ngZone=t}return e.prototype.transform=function(e){var t=this;this.removeTimer();var n=new Date(e),i=new Date,r=Math.round(Math.abs((i.getTime()-n.getTime())/1e3)),o=Number.isNaN(r)?1e3:1e3*this.getSecondsUntilUpdate(r);this.timer=this.ngZone.runOutsideAngular((function(){return"undefined"!=typeof window?window.setTimeout((function(){t.ngZone.run((function(){return t.changeDetectorRef.markForCheck()}))}),o):null}));var a=Math.round(Math.abs(r/60)),s=Math.round(Math.abs(a/60)),l=Math.round(Math.abs(s/24)),c=Math.round(Math.abs(l/30.416)),u=Math.round(Math.abs(l/365));return Number.isNaN(r)?"":r<=45?"a few seconds ago":r<=90?"a minute ago":a<=45?a+" minutes ago":a<=90?"an hour ago":s<=22?s+" hours ago":s<=36?"a day ago":l<=25?l+" days ago":l<=45?"a month ago":l<=345?c+" months ago":l<=545?"a year ago":u+" years ago"},e.prototype.ngOnDestroy=function(){this.removeTimer()},e.prototype.removeTimer=function(){this.timer&&(window.clearTimeout(this.timer),this.timer=null)},e.prototype.getSecondsUntilUpdate=function(e){return e<60?2:e<3600?30:e<86400?300:3600},e}();M.decorators=[{type:t.Pipe,args:[{name:"timeAgo",pure:!1}]}],M.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.NgZone}]};var A=function(){function e(){this.announceErrorFieldSource=new r.Subject,this.announceErrorField$=this.announceErrorFieldSource.asObservable()}return e.prototype.announceErrorField=function(e){this.announceErrorFieldSource.next(e)},e}();A.control=null,A.tab=null,A.decorators=[{type:t.Injectable}];var S=function(e,t){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},S(e,t)};function _(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function I(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function P(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function E(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function V(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(E(arguments[t]));return e}Object.create;var q=function(){function e(e,t){this._control=e,this._relatedTo=t,this._registerForChangesFromRelatedControl()}return Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relatedTo",{get:function(){return this._relatedTo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastUpdateValue",{get:function(){return this._lastUpdateValue},enumerable:!1,configurable:!0}),e.prototype.updateControlBasedOnRelation=function(e){return e!==this._lastUpdateValue&&(this._lastUpdateValue=e,this._control.updateCalculatedValue&&this._control.updateCalculatedValue(),this._control.updateValueAndValidity(),this._control.updateHiddenState&&this._control.updateHiddenState(),this._control.updateDisabledState&&this._control.updateDisabledState(),this._control.updateAlert&&this._control.updateAlert(),!0)},e.prototype._registerForChangesFromRelatedControl=function(){var e=this;this._relatedTo.valueChanges.subscribe((function(t){e.updateControlBasedOnRelation(t)}))},e}(),F=function(){function e(e,t){this._otherRelations=[],this._relationFor=e,this._relations=[],t&&this.addRelatedControls(t)}return Object.defineProperty(e.prototype,"relationsFor",{get:function(){return this._relationFor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relations",{get:function(){return this._relations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"otherRelations",{get:function(){return this._otherRelations},enumerable:!1,configurable:!0}),e.prototype.addRelatedControls=function(e){if(e instanceof i.AbstractControl&&this.relations.push(new q(this._relationFor,e)),e instanceof Array)for(var t=0;t<e.length;t++)this.relations.push(new q(this._relationFor,e[t]))},e}(),j=function(){function e(){}return e.prototype.hideControl=function(e){e.hidden=!0,e.disable&&e.disable()},e.prototype.showControl=function(e){e.hidden=!1},e.prototype.setHiderForControl=function(e,t){e.hiders.push(t)},e.prototype.clearHidersForControl=function(e){e.hiders.splice(0),e.hidden=!1},e.prototype.evaluateControlHiders=function(e){var t=!1;e.hiders.forEach((function(e){e.reEvaluateHidingExpression(),!0===e.toHide&&(t=!0)})),e.hidden=t,e.hidden&&e.disable&&e.disable()},e.prototype.setUpReEvaluationWhenValueChanges=function(e){e.updateHiddenState&&e.valueChanges.subscribe((function(t){e.updateHiddenState()}))},e}(),R=function(){function e(){}return e.prototype.hideAlert=function(e){e.shown=!1},e.prototype.showAlert=function(e){e.shown=!0},e.prototype.setAlertsForControl=function(e,t){e.alerts.push(t)},e.prototype.clearAlertsForControl=function(e){e.alerts.splice(0),e.alert=""},e.prototype.evaluateControlAlerts=function(e){var t="";e.alerts.forEach((function(e){e.reEvaluateAlertExpression(),t=!0===e.shown?e.alertMessage:""})),e.alert=t},e.prototype.setUpReEvaluationWhenValueChanges=function(e){e.updateAlert&&e.valueChanges.subscribe((function(t){e.updateAlert()}))},e}(),N=function(){function e(){}return e.prototype.setDisablerForControl=function(e,t){e.disablers.push(t)},e.prototype.clearDisablersForControl=function(e){e.disablers.splice(0),e.disable()},e.prototype.evaluateControlDisablers=function(e){var t=!1;e.disablers.forEach((function(e){e.reEvaluateDisablingExpression(),!0===e.toDisable&&(t=!0)})),t?e.disable():e.enable()},e.prototype.setUpReEvaluationWhenValueChanges=function(e){e.updateDisabledState&&e.valueChanges.subscribe((function(t){e.updateDisabledState()}))},e}(),L=function(){function e(e,t,n,i){this._control=t,this._questionModel=e,this._form=n,this._path=i?i+"."+e.key:e.key}return Object.defineProperty(e.prototype,"question",{get:function(){return this._questionModel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"form",{get:function(){return this._form},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},enumerable:!1,configurable:!0}),e.prototype.removeAt=function(e){},e.prototype.createChildNode=function(){},e.prototype.removeChildNode=function(){},e}(),H=function(e){function t(t,n,i,r,o){return e.call(this,t,n,r,o)||this}return _(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return null},enumerable:!1,configurable:!0}),t}(L),Y=function(e){function t(t,n,i,r,o){var a=e.call(this,t,n,r,o)||this;return a._children={},a}return _(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),t.prototype.setChild=function(e,t){this.children[e]=t},t}(L),B=function(e){function t(t,n,i,r,o,a){var s=e.call(this,t,n,o,a)||this;return s.formFactory=r,s.childNodeCreatedEvents=[],s._children=[],s.childNodeCreatedEvents=[],s}return _(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this._children},enumerable:!1,configurable:!0}),t.prototype.createChildNode=function(){if(this.createChildFunc){var e=this.createChildFunc(this.question,this,this.formFactory);return this.fireChildNodeCreatedListener(e),e}return null},t.prototype.removeAt=function(e){confirm("Are you sure you want to remove?")&&this.removeChildFunc&&this.removeChildFunc(e,this)},t.prototype.addChildNodeCreatedListener=function(e){this.childNodeCreatedEvents.push(e)},t.prototype.fireChildNodeCreatedListener=function(e){for(var t=0;t<this.childNodeCreatedEvents.length;t++){(0,this.childNodeCreatedEvents[t])(e)}},t}(L),Q=function(e){this.type=e.type,this.message=e.message||null},z=function(e){function t(t){var n=e.call(this,t)||this;return n.failsWhenExpression=t.failsWhenExpression,n}return _(t,e),t}(Q),W=function(e){function t(t){var n=e.call(this,t)||this;return n.referenceQuestionId=t.referenceQuestionId,n.referenceQuestionAnswers=t.referenceQuestionAnswers,n}return _(t,e),t}(Q),G=function(){function e(){}return e.prototype.buildRelations=function(e){var t=this.mapControlIds(e,{});for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];this.setRelations(t,i)}},e.prototype.buildArrayNodeRelations=function(e){var t=e.form;if(t){var n=t.rootNode;this.buildRelations(e);var i=this.mapControlIds(n,{}),r=this.mapControlIds(e,{});for(var o in i){if(i.hasOwnProperty(o))if((l=i[o])instanceof H){var a=l.question;a.key&&a.key.length>0&&this.setRelations(r,l)}}for(var s in this.createRelationsToArrayControls(e),r)if(r.hasOwnProperty(s)){var l,c=(l=r[s]).control;c.updateHiddenState(),c.updateAlert()}}},e.prototype.createRelationsToArrayControls=function(e){var t=e.form.rootNode,n=this.mapControlIds(t,{}),i=this.mapControlIds(e,{});for(var r in n)if(n.hasOwnProperty(r)){var o=n[r],a=e.path.substring(0,e.path.lastIndexOf("."));if(-1===o.path.indexOf(a+".")){var s=function(n){if(i.hasOwnProperty(n)){var r=i[n],s=r.question.key;if(l.hasRelation(s,o.question)){var c=e.form.searchNodeByPath(t,a,[]);if(c.length>0){var u=c[0],d=o.control;-1===d.controlRelations.otherRelations.indexOf(u)&&d.controlRelations.otherRelations.push(u),r.control.addValueChangeListener((function(e){d.updateCalculatedValue&&d.updateCalculatedValue(),d.updateValueAndValidity(),d.updateHiddenState&&d.updateHiddenState(),d.updateAlert&&d.updateAlert(),d.updateDisabledState&&d.updateDisabledState()}))}}}},l=this;for(var c in i)s(c)}}},e.prototype.getRelationsForControl=function(e,t){var n=new Array,i=t.form.searchNodeByQuestionId(e);if(i.length>0){var r=i[0],o=this.mapControlIds(t,{});for(var a in o)o.hasOwnProperty(a)&&this.hasRelation(o[a].question.key,r.question)&&n.push(o[a].control)}return n},e.prototype.mapControlIds=function(e,t){var n=e.children;for(var i in n)if(n.hasOwnProperty(i)){var r=n[i];if(r instanceof Y)this.mapControlIds(r,t);else if(r instanceof H){(o=r.question).key&&o.key.length>0&&(t[o.key]=r)}else if(r instanceof B){var o;(o=r.question).key&&o.key.length>0&&(t[o.key]=r)}}return t},e.prototype.setRelations=function(e,t){var n=t.question.key;for(var i in e)if(e.hasOwnProperty(i)&&i!==n){var r=e[i],o=r.question;if(this.hasRelation(n,o,t)&&this.addRelationToControl(r.control,t.control),"object"==typeof o.required){var a=o.required;"conditionalRequired"===a.type&&a.referenceQuestionId===n&&this.addRelationToControl(r.control,t.control)}}},e.prototype.hasRelation=function(e,t,n){var i=!1;if(t.validators&&t.validators.length>0&&t.validators.forEach((function(t){if(t instanceof z){var n=t.failsWhenExpression;n&&-1!==n.indexOf(e)&&(i=!0)}else t instanceof W&&"conditionalAnswered"===t.type&&t.referenceQuestionId===e&&(i=!0)})),!i){if("string"==typeof t.hide){var r=t.hide;r.length>0&&-1!==r.indexOf(e)&&(i=!0)}else if("object"==typeof t.hide){t.hide.field===e&&(i=!0)}if(t.alert&&"object"==typeof t.alert&&(i=!0),"string"==typeof t.disable){var o=t.disable;o.length>0&&-1!==o.indexOf(e)&&(i=!0)}}return!i&&t.calculateExpression&&t.calculateExpression.length>0&&-1!==t.calculateExpression.indexOf(e)&&(i=!0),i},e.prototype.addRelationToControl=function(e,t){e.controlRelations.addRelatedControls(t)},e}();G.decorators=[{type:t.Injectable}],G.ctorParameters=function(){return[]};var U=function(){function e(){}return e.prototype.getRunnable=function(e,t,n,i,r){var o=this,a=this;return{run:function(){var s={};t.uuid&&(s[t.uuid]=t.value),window.moment=C.default,s.myValue=t.value,s.FORM={},a.setControlQuestion(t,r,s),a.getControlRelationValueString(t,s),a.getHelperMethods(n,s),a.getDataDependencies(i,s),r&&a.getDataDependencies(r.dataSourcesContainer.dataSources,s);var l="",c="";for(var u in s)l=""===l?l+u:l+","+u,c=""===c?c+"scope['"+u+"']":c+",scope['"+u+"']";-1===e.indexOf("return")&&(e="return "+e);try{var d=new Function(l,e);return s[Symbol.iterator]=function(){var e,t,n;return I(this,(function(i){switch(i.label){case 0:for(t in e=[],this)e.push(t);n=0,i.label=1;case 1:return n<e.length?[4,this[e[n]]]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))},Object.keys(s).indexOf("undefined")>=0?(console.warn("Missing reference found",e,s),!1):d.call.apply(d,V([o],s))}catch(e){return!1}}}},e.prototype.getControlRelationValueString=function(e,t){var n=this;e&&e.controlRelations&&e.controlRelations.relations&&e.controlRelations.relations.forEach((function(e){if(e.relatedTo){var n=e.relatedTo,i=e.relatedTo;i&&Array.isArray(i.value)?t[n.uuid]=e.relatedTo.value:t[n.uuid]=e.relatedTo.value&&e.relatedTo.value.value?e.relatedTo.value.value:e.relatedTo.value}})),e&&e.controlRelations&&e.controlRelations.otherRelations&&e.controlRelations.otherRelations.length>0&&e.controlRelations.otherRelations.forEach((function(i){if(i instanceof B){var r=i,o=e.uuid,a=new G,s=[];r.children.forEach((function(e){s=s.concat(a.getRelationsForControl(o,e))})),n.setControlArrayValues(e,s,t)}}))},e.prototype.setControlQuestion=function(e,t,n){t&&e&&e.controlRelations&&e.controlRelations.relations&&e.controlRelations.relations.forEach((function(e){var i,r,o=e.relatedTo,a=null===(r=null===(i=t.searchNodeByQuestionId(o.uuid)[0])||void 0===i?void 0:i.question)||void 0===r?void 0:r.extras;n.FORM[o.uuid]=a}))},e.prototype.setControlArrayValues=function(e,t,n){var i=this;this._getFormControlKeys(t).forEach((function(e){var r=i._getValuesForKey(e,t);n[e]=r}))},e.prototype._getFormControlKeys=function(e){var t=[];return e.forEach((function(e){-1===t.indexOf(e.uuid)&&t.push(e.uuid)})),t},e.prototype._getValuesForKey=function(e,t){var n=[];return t.forEach((function(t){t.uuid===e&&n.push(t.value)})),n},e.prototype.getHelperMethods=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},e.prototype.getDataDependencies=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},e}();U.decorators=[{type:t.Injectable}];var $,J=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.hidden=!1,r.hiderHelper=new j,r.disablerHelper=new N,r.AlertHelper=new R,r._controlRelations=new F(r),r.hiders=[],r.disablers=[],r.alerts=[],r.valueChanges.subscribe((function(e){r._previousValue!==e&&(r.fireValueChangeListener(e),r._previousValue=e)})),r}return _(t,e),Object.defineProperty(t.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!1,configurable:!0}),t.prototype.disable=function(t){e.prototype.disable.call(this,t),e.prototype.setValue.call(this,"")},t.prototype.hide=function(){this.hiderHelper.hideControl(this)},t.prototype.show=function(){this.hiderHelper.showControl(this)},t.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},t.prototype.setCalculatorFn=function(e){this.calculator=e},t.prototype.updateCalculatedValue=function(){if(this.calculator){var e=this.calculator.call(U,{});this.setValue(e)}},t.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},t.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},t.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},t.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},t.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},t.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},t.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},t.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},t.prototype.addValueChangeListener=function(e){this._valueChangeListener=e},t.prototype.fireValueChangeListener=function(e){this._valueChangeListener&&"function"==typeof this._valueChangeListener&&this._valueChangeListener(e)},t.prototype.setValue=function(t){e.prototype.setValue.call(this,t)},t}(i.FormControl),Z=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.hiderHelper=new j,r.disablerHelper=new N,r.AlertHelper=new R,r._controlRelations=new F(r),r.hiders=[],r.disablers=[],r.alerts=[],r}return _(t,e),Object.defineProperty(t.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!1,configurable:!0}),t.prototype.hide=function(){this.hiderHelper.hideControl(this)},t.prototype.show=function(){this.hiderHelper.showControl(this)},t.prototype.disable=function(t){e.prototype.disable.call(this,t),e.prototype.setValue.call(this,{})},t.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},t.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},t.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},t.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},t.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},t.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},t.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},t.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},t.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},t.prototype.setValue=function(t){e.prototype.setValue.call(this,t)},t}(i.FormGroup),X=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.hiderHelper=new j,r.AlertHelper=new R,r.disablerHelper=new N,r._controlRelations=new F(r),r.hiders=[],r.alerts=[],r.disablers=[],r.valueChanges.subscribe((function(e){r._previousValue!==e&&(r.fireValueChangeListener(e),r._previousValue=e)})),r}return _(t,e),Object.defineProperty(t.prototype,"uuid",{get:function(){return this._uuid},set:function(e){this._uuid=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controlRelations",{get:function(){return this._controlRelations},enumerable:!1,configurable:!0}),t.prototype.hide=function(){this.hiderHelper.hideControl(this)},t.prototype.show=function(){this.hiderHelper.showControl(this)},t.prototype.disable=function(t){e.prototype.disable.call(this,t),e.prototype.setValue.call(this,[])},t.prototype.setHidingFn=function(e){this.hiderHelper.setHiderForControl(this,e)},t.prototype.clearHidingFns=function(){this.hiderHelper.clearHidersForControl(this)},t.prototype.updateHiddenState=function(){this.hiderHelper.evaluateControlHiders(this)},t.prototype.setDisablingFn=function(e){this.disablerHelper.setDisablerForControl(this,e)},t.prototype.clearDisablingFns=function(){this.disablerHelper.clearDisablersForControl(this)},t.prototype.updateDisabledState=function(){this.disablerHelper.evaluateControlDisablers(this)},t.prototype.setAlertFn=function(e){this.AlertHelper.setAlertsForControl(this,e)},t.prototype.clearMessageFns=function(){this.AlertHelper.clearAlertsForControl(this)},t.prototype.updateAlert=function(){this.AlertHelper.evaluateControlAlerts(this)},t.prototype.addValueChangeListener=function(e){this._valueChangeListener=e},t.prototype.fireValueChangeListener=function(e){this.alerts.length>0&&this.updateAlert(),this._valueChangeListener&&"function"==typeof this._valueChangeListener&&this._valueChangeListener(e)},t.prototype.setValue=function(t){e.prototype.setValue.call(this,t)},t}(i.FormArray);e.AfeControlType=void 0,($=e.AfeControlType||(e.AfeControlType={}))[$.AfeFormControl=0]="AfeFormControl",$[$.AfeFormArray=1]="AfeFormArray",$[$.AfeFormGroup=2]="AfeFormGroup",$[$.None=3]="None";var K=function(){function e(e){this.defaultValue=e.defaultValue,this.originalValue=e.originalValue,this.extras=e.extras,this.renderingType=e.type,this.key=e.key||"",this.label=e.label||"",this.validators=e.validators||[],this.required=e.required,this.hide=e.hide,this.disable=e.disable,this.readOnly=e.readOnly,this.alert=e.alert,this.historicalDataValue=e.historicalDataValue,this.calculateExpression=e.calculateExpression}return e.prototype.setHistoricalValue=function(e){this.enableHistoricalValue=e},e.prototype.showHistoricalEncounterDate=function(e){this.showHistoricalValueDate=void 0===e||e},e}(),ee=function(){function e(){}return e.prototype.validate=function(e){return function(t){var n,i=t.value,r=null,o=e.referenceQuestionId,a=e.referenceQuestionAnswers;return t&&t.controlRelations&&t.controlRelations.relations&&t.controlRelations.relations.forEach((function(e){var t=e.relatedTo;t.uuid===o&&(r=t&&Array.isArray(t.value)?e.relatedTo.value:e.relatedTo.value&&e.relatedTo.value.value?e.relatedTo.value.value:e.relatedTo.value)})),"object"==typeof a&&-1!==a.indexOf(r)&&(n=!0),n&&!i?{conditional_required:{message:e.message}}:null}},e}(),te=function(){function e(){}return e.prototype.validate=function(e){return function(t){var n=t.value,i=null,r=e.referenceQuestionId,o=e.referenceQuestionAnswers,a=!0;return n&&t&&t.controlRelations&&t.controlRelations.relations&&t.controlRelations.relations.forEach((function(e){var t=e.relatedTo;t.uuid===r&&(i=Array.isArray(t.value)?t.value:t.value&&"object"==typeof t.value&&t.value.value?t.value.value:t.value),i?"object"==typeof o&&-1===o.indexOf(i)&&(a=!1):a=!1})),a?null:{conditional_answered:{message:e.message}}}},e}(),ne=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value;return null==t||"string"==typeof t&&0===t.length?{required:!0}:null},e}(),ie=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value;return t&&0!==t.length?!/Invalid|NaN/.test(new Date(t).toString())?null:{date:!0}:null},e}(),re=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){var n=t.value;return n>=e?null:{min:{requiredValue:e,actualValue:n}}}return null}},e}(),oe=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){var n=t.value;return n<=e?null:{max:{requiredValue:e,actualValue:n}}}return null}},e}(),ae=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){if((new ie).validate(t.value))return{mindate:{requiredDate:e}};var n=new Date(t.value);return n.getTime()<e.getTime()?{mindate:{requiredDate:e,actualDate:n}}:null}return null}},e}(),se=function(){function e(){}return e.prototype.validate=function(e){return function(t){if(t.hidden)return null;if(t.value&&0!==t.value.length){if((new ie).validate(t.value))return{maxdate:{requiredDate:e}};var n=new Date(t.value);return n.getTime()>e.getTime()?{maxdate:{requiredDate:e,actualDate:n}}:null}return null}},e}(),le=function(){function e(){}return e.prototype.validate=function(e){if(e.hidden)return null;var t=e.value,n=new Date;if(t&&0!==t.length&&!(new ie).validate(t))return new Date(t).getTime()>n.getTime()?{futureDateRestriction:!0}:null;return null},e}(),ce=function(){function e(){}return e.prototype.calcBMI=function(e,t){var n;return e&&t&&(n=(t/(e/100*e/100)).toFixed(1)),e&&t?parseFloat(n):null},e.prototype.calcBSA=function(e,t){var n;return e&&t&&(n=Math.sqrt(e*t/3600).toFixed(2)),e&&t?parseFloat(n):null},e.prototype.calcBMIForAgeZscore=function(e,t,n){var i;t&&n&&(i=(n/(t/100*t/100)).toFixed(1));var r,o=T.first(e);if(o){var a=Object.keys(o).map((function(e){return o[e]})).map((function(e){return e})),s=Object.keys(o),l=a[1],c=[];i<l?c.push(l):T.forEach(a,(function(e){e<=i&&c.push(e)}));var u=T.last(c);(r=s[T.findIndex(a,(function(e){return e===u}))].replace("SD","")).includes("neg")&&(r="-"+(r=r.substring(1,0))),"S"!==r&&"L"!==r&&"M"!==r&&"-5"!==r||(r="-4")}return i&&o?r:null},e.prototype.calcWeightForHeightZscore=function(e,t,n){var i,r;t&&n&&(t=parseFloat(t).toFixed(1));t<45||t>110?r=-4:i=T.filter(e,(function(e){return parseFloat(e.Length).toFixed(1)===t}));var o=T.first(i);if(o){var a=Object.keys(o).map((function(e){return o[e]})).map((function(e){return e})),s=Object.keys(o),l=a[1],c=[];n<l?c.push(l):T.forEach(a,(function(e){e<=n&&c.push(e)}));var u=T.last(c);(r=s[T.findIndex(a,(function(e){return e===u}))].replace("SD","")).includes("neg")&&(r="-"+(r=r.substring(1,0))),"S"!==r&&"L"!==r&&"M"!==r&&"-5"!==r||(r="-4")}return t&&n?r:null},e.prototype.calcHeightForAgeZscore=function(e,t,n){var i,r=T.first(e);if(r){var o=Object.keys(r).map((function(e){return r[e]})).map((function(e){return e})),a=Object.keys(r),s=o[1],l=[];t<s?l.push(s):T.forEach(o,(function(e){e<=t&&l.push(e)}));var c=T.last(l);(i=a[T.findIndex(o,(function(e){return e===c}))].replace("SD","")).includes("neg")&&(i="-"+(i=i.substring(1,0))),"S"!==i&&"L"!==i&&"M"!==i&&"-5"!==i||(i="-4")}return t&&n&&r?i:null},e.prototype.isEmpty=function(e){return null==e||""===e||"null"===e||"undefined"===e||!(!Array.isArray(e)||0!==e.length)},e.prototype.arrayContains=function(e,t){if(Array.isArray(t)){if(0===t.length)return!0;for(var n=!0,i=0;i<t.length;i++){var r=t[i];-1===e.indexOf(r)&&(n=!1)}return n}return-1!==e.indexOf(t)},e.prototype.extractRepeatingGroupValues=function(e,t){return t.map((function(t){return t[e]}))},e.prototype.formatDate=function(e,t,n){if(t=t||"yyyy-MM-dd",n=n||"+0300",!(e instanceof Date)&&null==(e=new Date(e)))throw new Error("DateFormatException: value passed is not a valid date");return e},e.prototype.arrayContainsAny=function(e,t){if(Array.isArray(t)){if(0===t.length)return!0;for(var n=!1,i=0;i<t.length;i++){var r=t[i];-1!==e.indexOf(r)&&(n=!0)}return n}return-1!==e.indexOf(t)},Object.defineProperty(e.prototype,"helperFunctions",{get:function(){var e=this;return{arrayContainsAny:e.arrayContainsAny,calcBMI:e.calcBMI,calcBMIForAgeZscore:e.calcBMIForAgeZscore,calcWeightForHeightZscore:e.calcWeightForHeightZscore,calcHeightForAgeZscore:e.calcHeightForAgeZscore,isEmpty:e.isEmpty,arrayContains:e.arrayContains,extractRepeatingGroupValues:e.extractRepeatingGroupValues}},enumerable:!1,configurable:!0}),e}();ce.decorators=[{type:t.Injectable}];var ue=function(){};ue.JSExpressionValidatorsEnabled=!1;var de=function(){function e(){}return e.prototype.validate=function(e,t){return function(n){if(!ue.JSExpressionValidatorsEnabled)return null;var i=e.failsWhenExpression,r=(new ce).helperFunctions;return(new U).getRunnable(i,n,r,{},t).run()?{js_expression:{expression:i,message:e.message}}:null}},e}(),pe=function(){};pe.REQUIRED_FIELD_MSG="This field is required!",pe.INVALID_DATE_MSG="Provided date is invalid!",pe.FUTURE_DATE_RESTRICTION_MSG="Future date is not allowed!",pe.MIN_LENGTH_MSG="Min Length should be {minLength}",pe.MAX_LENGTH_MSG="Max Length should be {maxLength}",pe.MAX_DATE_MSG="Max Date should be {maxDate}",pe.MIN_DATE_MSG="Min Date should be {minDate}",pe.MAX_MSG="Max value should be {max}",pe.MIN_MSG="Min value should be {min}";var he=function(){function e(){}return e.prototype.getValidators=function(e,t){var n=this,i=[];return e.validators&&T.forEach(e.validators,(function(e){switch(e.type){case"date":i.push(n.dateValidator),e.allowFutureDates||i.push(n.futureDateRestrictionValidator);break;case"js_expression":i.push(n.jsExpressionValidator.validate(e,t));break;case"max":i.push(n.getMaxValueValidator(e.max));break;case"min":i.push(n.getMinValueValidator(e.min));break;case"conditionalRequired":i.push(n.conditionalRequiredValidator.validate(e));break;case"conditionalAnswered":i.push(n.conditionalAnsweredValidator.validate(e))}})),e.required&&"string"==typeof e.required&&"true"===e.required&&i.push(this.requiredValidator),i},Object.defineProperty(e.prototype,"conditionalRequiredValidator",{get:function(){return new ee},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"conditionalAnsweredValidator",{get:function(){return new te},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requiredValidator",{get:function(){return(new ne).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateValidator",{get:function(){return(new ie).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"futureDateRestrictionValidator",{get:function(){return(new le).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDateValidator",{get:function(){return(new se).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDateValidator",{get:function(){return(new ae).validate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minLengthValidator",{get:function(){return i.Validators.minLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLengthValidator",{get:function(){return i.Validators.maxLength},enumerable:!1,configurable:!0}),e.prototype.getMinValueValidator=function(e){return(new re).validate(e)},e.prototype.getMaxValueValidator=function(e){return(new oe).validate(e)},Object.defineProperty(e.prototype,"jsExpressionValidator",{get:function(){return new de},enumerable:!1,configurable:!0}),e.prototype.errors=function(e,t){var n=[];for(var i in e)if(e.hasOwnProperty(i))switch(i){case"required":n.push(pe.REQUIRED_FIELD_MSG);break;case"date":n.push(pe.INVALID_DATE_MSG);break;case"futureDateRestriction":n.push(pe.FUTURE_DATE_RESTRICTION_MSG);break;case"minlength":n.push(pe.MIN_LENGTH_MSG.replace("{minLength}",e.minlength.requiredLength));break;case"maxlength":n.push(pe.MIN_LENGTH_MSG.replace("{maxLength}",e.maxlength.requiredLength));break;case"maxdate":n.push(pe.MAX_DATE_MSG.replace("{maxDate}",e.maxdate.requiredDate));break;case"mindate":n.push(pe.MIN_DATE_MSG.replace("{minDate}",e.mindate.requiredDate));break;case"max":n.push(pe.MAX_MSG.replace("{max}",e.max.requiredValue));break;case"min":n.push(pe.MIN_MSG.replace("{min}",e.min.requiredValue));break;case"js_expression":n.push(e.js_expression.message);break;case"conditional_required":n.push(e.conditional_required.message);break;case"conditional_answered":n.push(e.conditional_answered.message)}return n},e}();he.decorators=[{type:t.Injectable}],he.ctorParameters=function(){return[]};var fe=function(){function e(e,t,n){this.expressionRunner=e,this.expressionHelper=t,this._debugModeService=n}return e.prototype.getJsExpressionDisabler=function(e,t,n){var i=this.expressionRunner.getRunnable(e.disable,t,this.expressionHelper.helperFunctions,{},n),r={toDisable:!1,disableWhenExpression:e.disable,reEvaluateDisablingExpression:function(){var e=i.run();r.toDisable=e}};return r},e.prototype.getJsExpressionHider=function(e,t,n){var i=e.hide,r="object"==typeof i?this.convertHideObjectToString(i):e.hide,o=this._debugModeService.debugEnabled(),a=this.expressionRunner.getRunnable(r,t,this.expressionHelper.helperFunctions,{},n),s={toHide:!1,hideWhenExpression:r,reEvaluateHidingExpression:function(){s.toHide=!0!==o&&a.run()}};return s},e.prototype.convertHideObjectToString=function(e){return e.value instanceof Array?"!arrayContains(["+("'"+e.value.join("','")+"'")+"],"+e.field+")":""},e}();fe.decorators=[{type:t.Injectable}],fe.ctorParameters=function(){return[{type:U},{type:ce},{type:D}]};var me=function(){function e(e,t){this.expressionRunner=e,this.expressionHelper=t}return e.prototype.getJsExpressionshowAlert=function(e,t,n){var i=this.expressionRunner.getRunnable(e.alert.alertWhenExpression,t,this.expressionHelper.helperFunctions,{},n),r={shown:!1,alertWhenExpression:e.alert.alertWhenExpression,alertMessage:e.alert.message,reEvaluateAlertExpression:function(){var e=i.run();r.shown=e}};return r},e}();me.decorators=[{type:t.Injectable}],me.ctorParameters=function(){return[{type:U},{type:ce}]};var ye=function(){function t(e,t,n){this.alertsFactory=n,this.controls=[],this.validationFactory=e,this.hidersDisablersFactory=t}return t.prototype.generateControlModel=function(t,n,i,r){if(t instanceof K){if(t.controlType===e.AfeControlType.AfeFormArray)return this.generateFormArray(t,n,r);if(t.controlType===e.AfeControlType.AfeFormGroup)return this.generateFormGroupModel(t,i,n,r);if(t.controlType===e.AfeControlType.AfeFormControl)return this.generateFormControl(t,n,r)}return null},t.prototype.generateFormGroupModel=function(e,t,n,i){var r=new Z({});this.wireHidersDisablers(e,r,i),this.wireAlerts(e,r,i),n instanceof Z&&n.setControl(e.key,r);var o=e;return t&&o&&o.questions.length>0&&this._generateFormGroupChildrenModel(o.questions,r,i),r},t.prototype._generateFormGroupChildrenModel=function(e,t,n){var i=this;e.length>0&&e.forEach((function(e){var r=i.generateControlModel(e,t,!0,n);null!==r&&t.addControl(e.key,r)}))},t.prototype.generateFormArray=function(e,t,n){var i,r=this.validationFactory.getValidators(e,n);return(i=r&&r.length>0?new X([],r[0]):new X([])).uuid=e.key,this.wireHidersDisablers(e,i,n),this.wireAlerts(e,i,n),t instanceof Z&&t.setControl(e.key,i),i},t.prototype.generateFormControl=function(e,t,n){var i,r=e.defaultValue||"",o=this.validationFactory.getValidators(e,n),a=new J(r,o);return a.uuid=e.key,this.wireHidersDisablers(e,a,n),this.wireAlerts(e,a,n),this.wireCalculator(e,a,n,null===(i=null==n?void 0:n.dataSourcesContainer)||void 0===i?void 0:i.dataSources),t instanceof Z&&t.setControl(e.key,a),a},t.prototype.wireAlerts=function(e,t,n){if(e.alert&&""!==e.alert){var i=this.alertsFactory.getJsExpressionshowAlert(e,t,n);t.setAlertFn(i)}},t.prototype.wireHidersDisablers=function(e,t,n){if(e.hide&&""!==e.hide){var i=this.hidersDisablersFactory.getJsExpressionHider(e,t,n);t.setHidingFn(i)}if(e.disable&&""!==e.disable){var r=this.hidersDisablersFactory.getJsExpressionDisabler(e,t,n);t.setDisablingFn(r)}},t.prototype.wireCalculator=function(e,t,n,i){if(e.calculateExpression&&""!==e.calculateExpression){var r=new ce,o=(new U).getRunnable(e.calculateExpression,t,r.helperFunctions,i,n);t.setCalculatorFn(o.run)}},t}();ye.decorators=[{type:t.Injectable}],ye.ctorParameters=function(){return[{type:he},{type:fe},{type:me}]};var ge='a {\n color: white;\n text-decoration: none;\n font-size: 12px;\n text-transform: uppercase;\n }\n\n ul {\n list-style-type: none;\n margin: 2px auto;\n position: relative;\n }\n\n li {\n display: block;\n padding: 10px 20px;\n white-space: nowrap;\n transition: all 0.3s ease-in;\n border-bottom: 4px solid transparent;\n }\n\n li:hover {\n border-bottom: 4px solid white;\n opacity: 0.7;\n cursor: pointer;\n }\n\n .owl-theme .owl-controls .owl-nav {\n position: absolute;\n width: 100%;\n top: 0;\n }\n\n .owl-theme .owl-controls .owl-nav [class*="owl-"] {\n position: absolute;\n background: none;\n color: black;\n }\n\n .owl-theme .owl-controls .owl-nav [class*="owl-"]:hover {\n background: none;\n color: black;\n }\n\n .owl-theme .owl-controls .owl-nav .owl-next {\n right: 0;\n transform: translate(120%);\n }\n\n .owl-theme .owl-controls .owl-nav .owl-prev {\n left: 0;\n transform: translate(-120%);\n }\n\n .slick-initialized .swipe-tab-content {\n position: relative;\n min-height: 365px;\n }\n @media screen and (min-width: 767px) {\n .slick-initialized .swipe-tab-content {\n min-height: 500px;\n }\n }\n .slick-initialized .swipe-tab {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 50px;\n background: none;\n border: 0;\n color: #757575;\n cursor: pointer;\n text-align: center;\n border-bottom: 2px solid rgba(51, 122, 183, 0);\n transition: all 0.5s;\n }\n .slick-initialized .swipe-tab:hover {\n color: #337AB7;\n }\n .slick-initialized .swipe-tab.active-tab {\n border-bottom-color: #337AB7;\n color: #337AB7;\n font-weight: bold;\n }\n\n .disabled {\n opacity: .5;\n pointer-events: none;\n }\n\n .select2-container {\n margin-top: -5px;\n }\n\n .btn {\n padding: 0px 12px !important;\n }\n\n .form-tooltip{\n color:rgb(51, 122, 183);\n display: inline-block;\n }\n .question-info{\n opacity:0;\n height:0px;\n display: none;\n transition-duration: opacity 1s ease-out;\n transtion-delay: 0.5s;\n padding-top: 2px;\n padding-bottom: 2px;\n color: #696969;\n border-style: ridge;\n border-width: 1px;\n border-color: #337ab7;\n margin-top: 2px;\n }\n .hide-info{\n display:none;\n height:0px;\n }\n .form-tooltip:hover ~ .question-info {\n display:block;\n opacity:1;\n height:auto;\n }\n .form-tooltip .tooltipcontent::after {\n content: " ";\n position: absolute;\n bottom: 100%; /* At the top of the tooltip */\n right: 0%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n border-top-color: transparent;\n border-right-color: transparent;\n border-bottom-color: #337ab7;\n border-left-color: transparent;\n }\n\n ng-select.form-control {\n padding-top: 0;\n height: auto;\n padding-bottom: 0;\n }\n\n .forms-dropdown-menu {\n max-height: 450px;\n overflow-y: scroll;\n }\n .no-border {\n border: 0;\n box-shadow: none;\n}\n.text-danger{\n color: var(--cds-support-01, #da1e28);\n}\n.error{\n margin-bottom: 3rem;\n}\n.afe-control{\n margin-bottom: 1.5rem;\n}\n[hidden] {\n display: none !important;\n}\n.accordion-content-dark {\n background-color: #f4f4f4;\n padding-right: 1rem;\n}\n.accordion-content-override{\n\n box-sizing: content-box;\n}\n\n.question-area {\n width: 100%\n}\n ',be=function(){function e(){this._dataSources={}}return Object.defineProperty(e.prototype,"dataSources",{get:function(){return this._dataSources},enumerable:!1,configurable:!0}),e.prototype.registerDataSource=function(e,t,n){if(void 0===n&&(n=!1),n)for(var i in t)this.registerDataSource(i,t[i],!1);this.dataSources[e]&&console.warn("Overriding registered data source",e),this._dataSources[e]=t},e.prototype.clearDataSource=function(e){delete this._dataSources[e]},e}();be.decorators=[{type:t.Injectable}],be.ctorParameters=function(){return[]};var ve=function(){function e(e,t,n,i){this.validationFactory=e,this.dataSources=t,this.formErrorsService=n,this.document=i,this.theme="light",this.childComponents=[],this.isCollapsed=!1,this.followFocus=!0,this.cacheActive=!1,this.isNavigation=!0,this.type="default",this.inlineDatePicker=new Date,this.activeTab=0}return e.prototype.ngOnInit=function(){var e=this;if(this.setUpRemoteSelect(),this.setUpFileUpload(),this.loadLabels(),this.node&&this.node.form){var t=this.node.form.valueProcessingInfo.lastFormTab;t&&t!==this.activeTab&&(this.activeTab=t)}this.node&&"form"===this.node.question.renderingType&&this.formErrorsService.announceErrorField$.subscribe((function(t){e.scrollToControl(t)})),this.node&&"section"===this.node.question.renderingType&&(this.isCollapsed=!this.node.question.isExpanded),this.parentComponent&&this.parentComponent.addChildComponent(this)},e.prototype.ngOnChanges=function(e){e.labelMap&&this.loadLabels()},e.prototype.addChildComponent=function(e){this.childComponents.push(e)},e.prototype.setUpRemoteSelect=function(){this.node&&this.node.question.extras&&"remote-select"===this.node.question.renderingType&&(this.dataSource=this.dataSources.dataSources[this.node.question.dataSource],this.dataSource&&this.node.question.dataSourceOptions&&(this.dataSource.dataSourceOptions=this.node.question.dataSourceOptions))},e.prototype.setUpFileUpload=function(){this.node&&this.node.question.extras&&"file"===this.node.question.renderingType&&(this.dataSource=this.dataSources.dataSources[this.node.question.dataSource])},e.prototype.loadLabels=function(){var e,t,n=this;!this.node.question.label&&this.labelMap[null===(t=null===(e=this.node.question.extras)||void 0===e?void 0:e.questionOptions)||void 0===t?void 0:t.concept]&&(this.node.question.label=this.labelMap[this.node.question.extras.questionOptions.concept]),this.node.question.options&&this.node.question.options.forEach((function(e){!e.label&&n.labelMap[e.value]&&(e.label=n.labelMap[e.value])}))},e.prototype.checkSection=function(e){if("section"===e.question.renderingType){var t=!1;return!Object.keys(e.children).every((function(n){var i=e.children[n];return i instanceof Y&&(t=Object.keys(i.children).every((function(e){return i.children[e].control.hidden}))),e.children[n].control.hidden||t}))}return!0},e.prototype.clickTab=function(e){this.activeTab=e},e.prototype.loadPreviousTab=function(){this.isCurrentTabFirst()||(this.clickTab(this.activeTab-1),document.body.scrollTop=0)},e.prototype.isCurrentTabFirst=function(){return 0===this.activeTab},e.prototype.isCurrentTabLast=function(){return this.activeTab===this.node.question.questions.length-1},e.prototype.loadNextTab=function(){this.isCurrentTabLast()||(this.clickTab(this.activeTab+1),document.body.scrollTop=0)},e.prototype.tabSelected=function(e){this.activeTab=e,this.setPreviousTab()},e.prototype.setPreviousTab=function(){this.node&&this.node.form&&(this.node.form.valueProcessingInfo.lastFormTab=this.activeTab)},e.prototype.hasErrors=function(){return this.node.control.touched&&!this.node.control.valid},e.prototype.errors=function(){return this.getErrors(this.node)},e.prototype.scrollToControl=function(e){var t=this,n=+e.split(",")[0],i=e.split(",")[1]+"id",r=this.childComponents[n];this.clickTab(n),setTimeout((function(){r.childComponents.forEach((function(e){e.isCollapsed=!1,setTimeout((function(){var e=t.document.getElementById(i);null!==e&&e.focus&&(e.focus(),e.scrollIntoView({behavior:"smooth",block:"center"}))}),100)}))}),200)},e.prototype.onDateChanged=function(e){this.node=e},e.prototype.upload=function(e){},e.prototype.toggleInformation=function(e){var t=document.getElementById(e);"block"===t.style.display?t.style.display="none":t.style.display="block"},e.prototype.getErrors=function(e){var t=e.control.errors;return t?this.validationFactory.errors(t,e.question):[]},e}();ve.decorators=[{type:t.Component,args:[{selector:"form-renderer",template:'\x3c!--CONTAINERS--\x3e\n<div *ngIf="node.question.renderingType === \'form\'">\n <ngx-tabset (onSelect)="tabSelected($event)" [selectedIndex]="activeTab">\n <ngx-tab [tabTitle]="question.label" *ngFor="let question of node.question.questions; let i = index">\n <form-renderer [node]="node.children[question.key]" [parentComponent]="this" [parentGroup]="node.control" [labelMap]="labelMap">\n </form-renderer>\n </ngx-tab>\n <error-renderer [form]="node.form"></error-renderer>\n </ngx-tabset>\n\n</div>\n<div *ngIf="node.question.renderingType === \'page\'">\n \x3c!--Page Components--\x3e\n <app-custom-component-wrapper [dark]="theme === \'light\'" [componentConfigs]="node.question.componentConfigs">\n </app-custom-component-wrapper>\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="parentGroup" [labelMap]="labelMap"></form-renderer>\n</div>\n<div *ngIf="node.question.renderingType === \'section\' && checkSection(node)">\n <div class="bx--accordion__item" [ngClass]="{ \'bx--accordion__item--active\': !isCollapsed }">\n <button class="bx--accordion__heading" type="button" [attr.aria-expanded]="isCollapsed ? \'false\' : \'true\'"\n aria-controls="accordion-item-0" (click)="isCollapsed = !isCollapsed">\n <svg class="bx--accordion__arrow" ibmIcon="chevron--right" size="16" xmlns="http://www.w3.org/2000/svg"\n focusable="false" preserveAspectRatio="xMidYMid meet" aria-hidden="true" width="16" height="16"\n viewBox="0 0 16 16">\n <path d="M11 8L6 13 5.3 12.3 9.6 8 5.3 3.7 6 3z"></path>\n </svg>\n <p class="bx--accordion__title">\n {{ node.question.label }}\n </p>\n </button>\n <div [collapse]="isCollapsed">\n \x3c!--Section Components--\x3e\n <app-custom-component-wrapper [dark]="(theme === \'light\')" [componentConfigs]="node.question.componentConfigs">\n </app-custom-component-wrapper>\n <div class="bx--accordion__content accordion-content-override" [ngClass]="{\n \'accordion-content-dark\': theme === \'light\'}">\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="parentGroup" [labelMap]="labelMap"></form-renderer>\n </div>\n </div>\n </div>\n</div>\n\n\x3c!-- MESSAGES --\x3e\n<div *ngIf="node.control && node.control.alert && node.control.alert !== \'\'" class="alert alert-warning">\n <a class="close" data-dismiss="alert">&times;</a> {{ node.control.alert }}\n</div>\n\n\x3c!--CONTROLS--\x3e\n\n\n<div *ngIf="node.question.controlType === 0" [formGroup]="parentGroup" [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }">\n <app-custom-component-wrapper [dark]="!(theme === \'light\')" [componentConfigs]="node.question.componentConfigs">\n </app-custom-component-wrapper>\n <div class="bx--form-item">\n \x3c!--LEAF CONTROL--\x3e\n <div class="question-area">\n <a class="form-tooltip pull-right" (click)="toggleInformation(node.question.extras.id)" data-placement="right"\n *ngIf="\n node.question &&\n node.question.extras.questionInfo &&\n node.question.extras.questionInfo !== \'\' &&\n node.question.extras.questionInfo !== \' \'\n ">\n <i class="glyphicon glyphicon-question-sign" aria-hidden="true"></i>\n </a>\n\n <label *ngIf="node.question.label" [style.color]="hasErrors() ? \'red\' : \'\'" class="bx--label"\n [attr.for]="node.question.key">\n {{ node.question.required ? \'*\' : \'\' }} {{ node.question.label }}\n </label>\n\n <div *ngIf="node.question.extras.questionOptions.customControl; else nativeControls">\n <app-custom-control-wrapper [formControlName]="node.question.key" [id]="node.question.key + \'id\'"\n [question]="node.question">\n </app-custom-control-wrapper>\n </div>\n\n <ng-template #nativeControls>\n <div class="afe-control" [ngSwitch]="node.question.renderingType">\n <ibm-select [theme]="theme" *ngSwitchCase="\'select\'" [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'">\n <option *ngFor="let o of node.question.options" [value]="o.value">\n {{ o.label }}\n </option>\n </ibm-select>\n\n \x3c!-- <app-file-upload *ngSwitchCase="\'file\'" [dataSource]="dataSource" [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'" (fileChanged)="upload($event)">\n </app-file-upload> --\x3e\n <div *ngSwitchCase="\'file\'">\n <app-file-upload [dataSource]="dataSource" [formControlName]="node.question.key"\n [id]="node.question.key + \'id\'" (fileChanged)="upload($event)">\n </app-file-upload>\n </div>\n\n <textarea [theme]="theme" ibmTextArea [ngClass]="{\n \'bx--text-area--light\': theme === \'light\',\n \'bx--text-area--invalid\': !node.control.valid\n }" [placeholder]="node.question.placeholder" [rows]="node.question.rows" class="bx--text-area"\n *ngSwitchCase="\'textarea\'" [formControlName]="node.question.key" [id]="node.question.key + \'id\'"\n [readOnly]="node.question.extras.readOnly">\n </textarea>\n\n <ngx-remote-select [theme]="theme" *ngSwitchCase="\'remote-select\'" [placeholder]="node.question.placeholder"\n tabindex="0" [dataSource]="dataSource" [componentID]="node.question.key + \'id\'"\n [formControlName]="node.question.key" [id]="node.question.key + \'id\'"></ngx-remote-select>\n\n <ngx-datetimepicker [weeks]="node.question.extras.questionOptions.weeksList"\n [showWeeks]="node.question.showWeeksAdder" [theme]="theme" [id]="node.question.key + \'id\'"\n [formControlName]="node.question.key" *ngSwitchCase="\'date\'">\n </ngx-datetimepicker>\n <ng-select [ngClass]="{\'afe-custom\': theme === \'light\'}" [id]="node.question.key + \'id\'"\n *ngSwitchCase="\'multi-select\'" [items]="node.question.options" bindLabel="label" bindValue="value"\n [multiple]="true" placeholder="" clearAllText="Clear" [formControlName]="node.question.key">\n </ng-select>\n\n <ng-select [ngClass]="{\'afe-custom\': theme === \'light\'}" [id]="node.question.key + \'id\'"\n *ngSwitchCase="\'single-select\'" [items]="node.question.options" bindLabel="label" bindValue="value"\n placeholder="" clearAllText="Clear" [formControlName]="node.question.key">\n </ng-select>\n\n <number-input [theme]="theme" *ngSwitchCase="\'number\'" [id]="node.question.key + \'id\'"\n [min]="node.question.extras.questionOptions.min" [max]="node.question.extras.questionOptions.max"\n [formControlName]="node.question.key" [attr.placeholder]="node.question.placeholder">\n </number-input>\n\n <input [theme]="theme" class="bx--text-input" ibmText *ngSwitchDefault [formControlName]="node.question.key"\n [attr.placeholder]="node.question.placeholder" [type]="node.question.renderingType"\n [id]="node.question.key + \'id\'" [readOnly]="node.question.extras.readOnly"/>\n\n <div *ngSwitchCase="\'radio\'">\n <div *ngFor="let o of node.question.options">\n <label class="form-control no-border">\n <input type="radio" [formControlName]="node.question.key" [id]="node.question.key + \'id\'"\n [value]="o.value" />\n {{ o.label }}\n </label>\n </div>\n </div>\n\n <div *ngSwitchCase="\'checkbox\'">\n <checkbox [id]="node.question.key + \'id\'" [formControlName]="node.question.key"\n [options]="node.question.options" [selected]="node.control.value"></checkbox>\n </div>\n\n <div *ngIf="\n node.question.enableHistoricalValue && node.question.historicalDisplay\n " style="margin-top: 2px">\n <div class="container-fluid">\n <div class="row">\n <div class="col-xs-9">\n <span class="text-warning">Previous Value: </span>\n <strong>{{ node.question.historicalDisplay?.text }}</strong>\n <span *ngIf="node.question.showHistoricalValueDate">\n <span> | </span>\n <strong class="text-primary">{{ node.question.historicalDisplay?._date }}\n </strong>\n <span class="text-primary" *ngIf="\n node.question.historicalDisplay &&\n node.question.historicalDisplay._date\n ">\n ({{ node.question.historicalDisplay._date | timeAgo }})</span>\n </span>\n </div>\n <button type="button" [node]="node" [name]="\'historyValue\'"\n class="bx--btn bx--btn--primary bx--btn--sm col-xs-3">\n Use Value\n </button>\n </div>\n </div>\n </div>\n <appointments-overview [node]="node"></appointments-overview>\n <div *ngIf="hasErrors()">\n <div *ngFor="let e of errors()">\n <span class="text-danger">{{ e }}</span>\n </div>\n </div>\n </div>\n </ng-template>\n\n\n\n <div class="question-info col-md-12 col-lg-12 col-sm-12" id="{{ node.question.extras.id }}" *ngIf="\n node.question &&\n node.question.extras.questionInfo &&\n node.question.extras.questionInfo !== \'\' &&\n node.question.extras.questionInfo !== \' \'\n ">\n {{ node.question.extras.questionInfo }}\n </div>\n </div>\n </div>\n</div>\n<div *ngIf="node.question.controlType === 1" [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }">\n \x3c!--ARRAY CONTROL--\x3e\n <div [ngSwitch]="node.question.renderingType">\n <div class="well" style="padding: 2px" *ngSwitchCase="\'repeating\'">\n <h4 style="margin: 2px; font-weight: bold">{{ node.question.label }}</h4>\n <hr style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 2px;\n " />\n <div [ngSwitch]="node.question.extras.type">\n <div *ngSwitchCase="\'testOrder\'">\n <div *ngFor="let child of node.children; let i = index">\n <form-renderer *ngFor="let question of child.question.questions" [parentComponent]="this"\n [node]="child.children[question.key]" [parentGroup]="child.control" [labelMap]="labelMap"></form-renderer>\n <div>{{ child.orderNumber }}</div>\n <button type="button " class="bx--btn bx--btn--danger bx--btn--sm" (click)="node.removeAt(i)">\n Remove\n </button>\n <br />\n <hr style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 1px;\n " />\n </div>\n </div>\n\n <div *ngSwitchCase="\'obsGroup\'" style="margin-bottom: 20px">\n <div *ngFor="let child of node.children; let i = index">\n <form-renderer *ngFor="let question of child.question.questions" [parentComponent]="this"\n [node]="child.children[question.key]" [parentGroup]="child.control" [labelMap]="labelMap"></form-renderer>\n <button type="button " class="bx--btn bx--btn--danger bx--btn--sm" (click)="node.removeAt(i)">\n Remove\n </button>\n <br />\n <hr style="\n margin-left: -2px;\n margin-right: -2px;\n margin-bottom: 4px;\n margin-top: 8px;\n border-width: 1px;\n " />\n </div>\n </div>\n </div>\n <button type="button" class="bx--btn bx--btn--primary" (click)="node.createChildNode()">\n Add\n </button>\n </div>\n </div>\n</div>\n<div *ngIf="node.question.controlType === 2" [hidden]="node.control.hidden"\n [ngClass]="{ disabled: node.control.disabled }">\n \x3c!--GROUP--\x3e\n <div [ngSwitch]="node.question.renderingType">\n <div *ngSwitchCase="\'group\'">\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="node.control" [labelMap]="labelMap"></form-renderer>\n </div>\n <div *ngSwitchCase="\'field-set\'" style="border: 1px solid #eeeeee; padding: 2px; margin: 2px">\n <form-renderer *ngFor="let question of node.question.questions" [parentComponent]="this"\n [node]="node.children[question.key]" [parentGroup]="node.control" [labelMap]="labelMap"></form-renderer>\n </div>\n </div>\n</div>\n',styles:["../../style/app.css",ge]}]}],ve.ctorParameters=function(){return[{type:he},{type:be},{type:A},{type:void 0,decorators:[{type:t.Inject,args:[n.DOCUMENT]}]}]},ve.propDecorators={parentComponent:[{type:t.Input}],node:[{type:t.Input}],parentGroup:[{type:t.Input}],theme:[{type:t.Input}],labelMap:[{type:t.Input}]};var we=function(){function e(e,t){this.validationFactory=e,this.formErrorsService=t}return e.prototype.ngOnInit=function(){},e.prototype.showErrors=function(){return!this.form.valid&&this.form.showErrors},Object.defineProperty(e.prototype,"errorNodes",{get:function(){return this.form.markInvalidControls(this.form.rootNode,[])},enumerable:!1,configurable:!0}),e.prototype.getControlError=function(e){var t=e.control.errors;return t?this.validationFactory.errors(t,e.question):[]},e.prototype.announceErrorField=function(e){var t=this,n=this.form.searchNodeByQuestionId(e.path.substring(0,e.path.indexOf(".")));T.forEach(n,(function(n){if("page"===n.question.renderingType){var i=t.getPageIndex(n);t.formErrorsService.announceErrorField(i+","+e.question.key)}}))},e.prototype.getPageIndex=function(e){return this.form.rootNode.question.questions.indexOf(e.question)},e}();we.decorators=[{type:t.Component,args:[{selector:"error-renderer",template:'<div *ngIf="showErrors()" class="container">\n <div data-notification *ngFor="let errorNode of errorNodes"\n class="bx--inline-notification bx--inline-notification--error bx--inline-notification--low-contrast pointer" role="alert"\n (click)="announceErrorField(errorNode)">\n <div class="bx--inline-notification__details">\n <div class="bx--inline-notification__text-wrapper">\n <p class="bx--inline-notification__title">{{ errorNode.question.label }}</p>\n <p class="bx--inline-notification__subtitle">{{ getControlError(errorNode) }}</p>\n </div>\n </div>\n <button tabindex="0" class="bx--inline-notification__action-button bx--btn bx--btn--sm bx--btn--ghost"\n type="button">Fix</button>\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg" class="bx--inline-notification__icon" width="20" height="20"\n viewBox="0 0 20 20" aria-hidden="true">\n <path d="M10,1c-5,0-9,4-9,9s4,9,9,9s9-4,9-9S15,1,10,1z M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z"></path>\n <path d="M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z" data-icon-path="inner-path" opacity="0"></path>\n </svg>\n </div>\n</div>',styles:["ul{list-style:none}.list-group-item{padding:2px 15px;cursor:pointer}ul li:hover{background-color:#fff}h4{margin-top:7px;margin-bottom:7px}.pointer{cursor:pointer}"]}]}],we.ctorParameters=function(){return[{type:he},{type:A}]},we.propDecorators={form:[{type:t.Input}]};var xe=function(){function e(){}return e.prototype.getDisplayTextFromOptions=function(e,t,n){var i="",r=e.historicalDataValue;if(T.isArray(r.value)){var o=0;T.each(r.value,(function(r){T.each(e.options,(function(e){e[t]===r&&(0===o?i+=e[n]:i=i+", "+e[n],o++)}))}))}else T.each(e.options,(function(e){e[t]===r.value&&(i=e[n])}));return i},e}();xe.decorators=[{type:t.Injectable}];var ke=function(){function e(e){this.historicalFieldHelper=e,this._nodeChange=new t.EventEmitter}return e.prototype.setValue=function(e){"historyValue"===e.target.name&&(!this._node||this.compareString(this._node.question.renderingType,"page")&&this.compareString(this._node.question.renderingType,"section")||(this._node.control.setValue(this._node.question.historicalDataValue.value),this._node.question.historicalValue=this._node.question.historicalDataValue,e.stopPropagation(),this._nodeChange.emit(this._node)))},e.prototype.compareString=function(e,t){return e===t},Object.defineProperty(e.prototype,"node",{set:function(e){if(e&&(this._node=e,this._node.question.enableHistoricalValue&&!T.isUndefined(this._node.question.historicalDataValue))){var t={text:"",_date:""};"select"===this._node.question.renderingType||"multi-select"===this._node.question.renderingType||"single-select"===this._node.question.renderingType?(t.text=this.historicalFieldHelper.getDisplayTextFromOptions(this._node.question,"value","label"),t._date=this._node.question.historicalDataValue.valueDate,this._node.question.historicalDisplay=t):T.isUndefined(this._node.question.historicalDataValue)||(t.text=this._node.question.historicalDataValue.value,t._date=this._node.question.historicalDataValue.valueDate,this._node.question.historicalDisplay=t)}},enumerable:!1,configurable:!0}),e}();ke.decorators=[{type:t.Directive,args:[{selector:"[node]"}]}],ke.ctorParameters=function(){return[{type:xe}]},ke.propDecorators={_node:[{type:t.Input}],_nodeChange:[{type:t.Output}],setValue:[{type:t.HostListener,args:["click",["$event"]]}],node:[{type:t.Input}]};var Ce="400ms cubic-bezier(0.4,0.0,0.2,1)",Te=[s.style({height:0,visibility:"hidden"}),s.animate(Ce,s.style({height:"*",visibility:"visible"}))],Oe=[s.style({height:"*",visibility:"visible"}),s.animate(Ce,s.style({height:0,visibility:"hidden"}))],De=function(){function e(e,n,i){this._el=e,this._renderer=n,this.collapsed=new t.EventEmitter,this.collapses=new t.EventEmitter,this.expanded=new t.EventEmitter,this.expands=new t.EventEmitter,this.isExpanded=!0,this.collapseNewValue=!0,this.isCollapsed=!1,this.isCollapse=!0,this.isCollapsing=!1,this.isAnimated=!1,this._display="block",this._stylesLoaded=!1,this._COLLAPSE_ACTION_NAME="collapse",this._EXPAND_ACTION_NAME="expand",this._factoryCollapseAnimation=i.build(Oe),this._factoryExpandAnimation=i.build(Te)}return Object.defineProperty(e.prototype,"display",{set:function(e){this.isAnimated?(this._display=e,"none"!==e?this.show():this.hide()):this._renderer.setStyle(this._el.nativeElement,"display",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collapse",{get:function(){return this.isExpanded},set:function(e){this.collapseNewValue=e,this._player&&!this._isAnimationDone||(this.isExpanded=e,this.toggle())},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewChecked=function(){this._stylesLoaded=!0,this._player&&this._isAnimationDone&&(this._player.reset(),this._renderer.setStyle(this._el.nativeElement,"height","*"))},e.prototype.toggle=function(){this.isExpanded?this.hide():this.show()},e.prototype.hide=function(){var e=this;this.isCollapsing=!0,this.isExpanded=!1,this.isCollapsed=!0,this.isCollapsing=!1,this.collapses.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._COLLAPSE_ACTION_NAME)((function(){e._isAnimationDone=!0,e.collapseNewValue!==e.isCollapsed&&e.isAnimated?e.show():(e.collapsed.emit(e),e._renderer.setStyle(e._el.nativeElement,"display","none"))}))},e.prototype.show=function(){var e=this;this._renderer.setStyle(this._el.nativeElement,"display",this._display),this.isCollapsing=!0,this.isExpanded=!0,this.isCollapsed=!1,this.isCollapsing=!1,this.expands.emit(this),this._isAnimationDone=!1,this.animationRun(this.isAnimated,this._EXPAND_ACTION_NAME)((function(){e._isAnimationDone=!0,e.collapseNewValue!==e.isCollapsed&&e.isAnimated?e.hide():(e.expanded.emit(e),e._renderer.removeStyle(e._el.nativeElement,"overflow"))}))},e.prototype.animationRun=function(e,t){var n=this;if(!e||!this._stylesLoaded)return function(e){return e()};this._renderer.setStyle(this._el.nativeElement,"overflow","hidden"),this._renderer.addClass(this._el.nativeElement,"collapse");var i=t===this._EXPAND_ACTION_NAME?this._factoryExpandAnimation:this._factoryCollapseAnimation;return this._player&&this._player.destroy(),this._player=i.create(this._el.nativeElement),this._player.play(),function(e){var t;return null===(t=n._player)||void 0===t?void 0:t.onDone(e)}},e}();De.decorators=[{type:t.Directive,args:[{selector:"[collapse]",exportAs:"bs-collapse",host:{"[class.collapse]":"true"}}]}],De.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:s.AnimationBuilder}]},De.propDecorators={collapsed:[{type:t.Output}],collapses:[{type:t.Output}],expanded:[{type:t.Output}],expands:[{type:t.Output}],isExpanded:[{type:t.HostBinding,args:["class.in"]},{type:t.HostBinding,args:["class.show"]},{type:t.HostBinding,args:["attr.aria-expanded"]}],isCollapsed:[{type:t.HostBinding,args:["attr.aria-hidden"]}],isCollapse:[{type:t.HostBinding,args:["class.collapse"]}],isCollapsing:[{type:t.HostBinding,args:["class.collapsing"]}],display:[{type:t.Input}],isAnimated:[{type:t.Input}],collapse:[{type:t.Input}]};var Me=function(){},Ae=function(){function e(){this.theme="dark",this.disabled=!1,this.skeleton=!1,this.invalid=!1,this.id="number-"+e.numberCount,this.size="md",this.min=null,this.max=null,this.step=1,this.warn=!1,this.change=new t.EventEmitter,this.decrementLabel="Decrease",this.incrementLabel="Increase",this._value=0,this.onTouched=function(){},this.propagateChange=function(e){},e.numberCount++}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=""!==e&&null!==e?Number(e):null},enumerable:!1,configurable:!0}),e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.focusOut=function(){this.onTouched()},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.onIncrement=function(){var e=this._value||0;null===this.max||e+this.step<=this.max?this.value=parseFloat((e+this.step).toPrecision(this.precision)):this.value=this.max,this.emitChangeEvent()},e.prototype.onDecrement=function(){var e=this._value||0;null===this.min||e-this.step>=this.min?this.value=parseFloat((e-this.step).toPrecision(this.precision)):this.value=this.min,this.emitChangeEvent()},e.prototype.emitChangeEvent=function(){var e=new Me;e.source=this,e.value=this.value,this.change.emit(e),this.propagateChange(this.value)},e.prototype.onNumberInputChange=function(e){this.value=e.target.value,this.emitChangeEvent()},e.prototype.isTemplate=function(e){return e instanceof t.TemplateRef},e}();Ae.numberCount=0,Ae.decorators=[{type:t.Component,args:[{selector:"number-input",template:'<div data-numberinput [attr.data-invalid]="invalid ? true : null" class="bx--number" [ngClass]="{\n \'bx--number--light\': theme === \'light\',\n \'bx--number--nolabel\': !label,\n \'bx--number--helpertext\': helperText,\n \'bx--skeleton\': skeleton,\n \'bx--number--sm\': size === \'sm\',\n \'bx--number--xl\': size === \'xl\'\n }">\n <div class="bx--number__input-wrapper" [ngClass]="{\n \'bx--number__input-wrapper--warning\': warn\n }">\n <input type="number" [id]="id" [value]="value" [attr.min]="min" [attr.max]="max" [attr.step]="step"\n [disabled]="disabled" [required]="required" (input)="onNumberInputChange($event)" />\n <div class="bx--number__controls">\n <button type="button" class="bx--number__control-btn down-icon" (click)="onDecrement()" title="Decrement number"\n [attr.aria-label]="decrementLabel" tabindex="-1">\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"\n fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true" class="down-icon">\n <path d="M8 15H24V17H8z"></path>\n </svg>\n </button>\n <div class="bx--number__rule-divider"></div>\n <button type="button" class="bx--number__control-btn up-icon" (click)="onIncrement()" title="Increment number"\n [attr.aria-label]="incrementLabel" tabindex="-1">\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"\n fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true" class="up-icon">\n <path d="M17 15L17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z"></path>\n </svg>\n </button>\n <div class="bx--number__rule-divider"></div>\n </div>\n </div>\n <div *ngIf="helperText && !invalid && !warn" class="bx--form__helper-text">\n <ng-container *ngIf="!isTemplate(helperText)">{{\n helperText\n }}</ng-container>\n <ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>\n </div>\n <div *ngIf="!warn && invalid" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(invalidText)">{{\n invalidText\n }}</ng-container>\n <ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>\n </div>\n <div *ngIf="!invalid && warn" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(warnText)">{{ warnText }}</ng-container>\n <ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>\n </div>\n</div>',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Ae})),multi:!0}]}]}],Ae.ctorParameters=function(){return[]},Ae.propDecorators={theme:[{type:t.Input}],disabled:[{type:t.Input}],skeleton:[{type:t.Input}],invalid:[{type:t.Input}],id:[{type:t.Input}],size:[{type:t.Input}],required:[{type:t.Input}],value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],label:[{type:t.Input}],helperText:[{type:t.Input}],invalidText:[{type:t.Input}],step:[{type:t.Input}],precision:[{type:t.Input}],warn:[{type:t.Input}],warnText:[{type:t.Input}],change:[{type:t.Output}],decrementLabel:[{type:t.Input}],incrementLabel:[{type:t.Input}],focusOut:[{type:t.HostListener,args:["focusout"]}]};var Se=function(){};Se.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],exports:[Ae],declarations:[Ae],providers:[]}]}];var _e=function(){function e(e,t){this._ref=e,this.sanitizer=t,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._result=new r.BehaviorSubject(null),this.result=this._result.asObservable(),this._internalSubscription=null}return e.prototype.ngOnDestroy=function(){this._subscription&&this._dispose()},e.prototype.transform=function(e,t){this.getfile=t;var n=this.internalTransform(e);return this.asyncTrasnform(n)},e.prototype.internalTransform=function(e){var t=this;return e?(this.previousUrl!==e&&(this.previousUrl=e,this._internalSubscription=this.getfile(e).subscribe((function(e){var n=t.sanitizer.bypassSecurityTrustUrl(e);t._result.next(n)}))),this.result):this.result},e.prototype.asyncTrasnform=function(e){return this._obj?e!==this._obj?(this._dispose(),this.asyncTrasnform(e)):this._latestValue===this._latestReturnedValue?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,t.WrappedValue.wrap(this._latestValue)):(e&&this._subscribe(e),this._latestReturnedValue=this._latestValue,this._latestValue)},e.prototype._subscribe=function(e){var t=this;this._obj=e,this._subscription=e.subscribe({next:function(n){return t._updateLatestValue(e,n)},error:function(e){throw e}})},e.prototype._dispose=function(){this._subscription&&this._subscription.unsubscribe(),this._internalSubscription&&this._internalSubscription.unsubscribe(),this._internalSubscription=null,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null},e.prototype._updateLatestValue=function(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())},e}();_e.decorators=[{type:t.Pipe,args:[{name:"secure",pure:!1}]}],_e.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:c.DomSanitizer}]};var Ie=function(){};Ie.decorators=[{type:t.NgModule,args:[{declarations:[_e],imports:[n.CommonModule],exports:[_e],providers:[be]}]}];var Pe=function(){function e(e){this.renderer=e,this.uploading=!1,this.fileUuid=null,this.pdfUploaded=!1,this.formEntryMode=!0,this.propagateChange=function(e){}}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.fileUuid&&this.checkFileType()},e.prototype.onFileChange=function(e){var t,n;try{for(var i=P(e),r=i.next();!r.done;r=i.next()){var o=r.value;this.upload(o)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.upload=function(e){var t=this;this.dataSource&&(this.uploading=!0,this.dataSource.fileUpload(e).subscribe((function(e){t.fileUuid=e.image,t.checkFileType(),t.propagateChange(t.fileUuid),t.uploading=!1}),(function(e){t.uploading=!1})))},e.prototype.writeValue=function(e){e!==this.fileUuid&&(this.fileUuid=e,this.checkFileType())},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(){},e.prototype.onChange=function(e){this.propagateChange(e.id)},e.prototype.clearValue=function(){this.fileUuid=null,this.pdfUploaded=!1,this.pdfUrl=null,this.propagateChange(this.fileUuid)},e.prototype.getPdfUrl=function(e){var t=this;this.dataSource.fetchFile(e,"pdf").subscribe((function(e){t.pdfUploaded=!0,t.pdfUrl=e.changingThisBreaksApplicationSecurity}))},e.prototype.checkFileType=function(){-1!==this.fileUuid.search(/pdf/gi)&&this.getPdfUrl(this.fileUuid)},e}();Pe.decorators=[{type:t.Component,args:[{selector:"app-file-upload",template:'<lib-file-uploader\n [srcUrl]="pdfUrl"\n [formEntry]="formEntryMode"\n [(ngModel)]="fileUuid"\n (_onClear)="clearValue()"\n (uploadData)="onFileChange($event)"\n>\n</lib-file-uploader>\n<div *ngIf="fileUuid">\n <img\n *ngIf="!pdfUploaded"\n class="img-responsive"\n [src]="fileUuid | secure: this.dataSource.fetchFile"\n alt=""\n />\n</div>\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Pe})),multi:!0}],styles:["\n img {\n margin-left: auto;\n margin-right: auto;\n display: block;\n }\n "]}]}],Pe.ctorParameters=function(){return[{type:t.Renderer2}]},Pe.propDecorators={dataSource:[{type:t.Input}]};var Ee=function(){};Ee.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,Ie,u.WebcamModule,d.NgxFileUploaderModule],exports:[Pe],declarations:[Pe],providers:[]}]}];var Ve=function(){function e(){this.locale="en",this.viewFormat="ll",this.returnObject="js",this.onDatePickerCancel=new t.EventEmitter,this.onSelectDate=new t.EventEmitter,this.onDisplayMonths=!1,this.onDisplayYears=!1,this.displayYearsIndex=0,this.monthsShort=C.default.monthsShort()}return e.prototype.ngOnInit=function(){var e=this;this.initValue(),O.default.each(this.fullYearRange,(function(t,n){e.currentYear=e.calendarDate.clone().startOf("year").year(),-1!==t.indexOf(e.currentYear)&&(e.displayYearsIndex=n)})),this.displayYearRange=this.fullYearRange[this.displayYearsIndex],this.generateCalendar()},e.prototype.prev=function(){this.onDisplayYears?(this.displayYearsIndex--,this.displayYearsIndex<0&&(this.displayYearsIndex=0),this.displayYearRange=this.fullYearRange[this.displayYearsIndex]):this.calendarDate=this.calendarDate.clone().subtract(1,"M"),this.generateCalendar()},e.prototype.showMonthSelection=function(){this.onDisplayMonths=!0,this.onDisplayYears=!1},e.prototype.showYearSelection=function(){this.onDisplayYears=!0,this.onDisplayMonths=!1},e.prototype.next=function(){this.onDisplayYears?(this.displayYearsIndex++,this.displayYearsIndex>=this.fullYearRange.length&&(this.displayYearsIndex=this.fullYearRange.length-1),this.displayYearRange=this.fullYearRange[this.displayYearsIndex++]):this.calendarDate=this.calendarDate.clone().add(1,"M"),this.generateCalendar()},e.prototype.selectDay=function(e){var t=e.diff(this.calendarDate.clone().startOf("date"),"days");e=this.calendarDate.clone().add(t,"d");var n=this.parseToReturnObjectType(e);this.onSelectDate.emit(n),this.cancelDatePicker()},e.prototype.selectMonth=function(e){this.calendarDate=this.calendarDate.clone().month(e),this.onDisplayMonths=!1,this.generateCalendar()},e.prototype.selectYear=function(e){this.calendarDate=this.calendarDate.clone().year(e),this.onDisplayYears=!1,this.generateCalendar()},e.prototype.selectToday=function(){var e=this.parseToReturnObjectType(C.default());this.onSelectDate.emit(e),this.cancelDatePicker()},e.prototype.clearPickDate=function(){this.onSelectDate.emit(null),this.cancelDatePicker()},e.prototype.cancelDatePicker=function(){this.onDatePickerCancel.emit(!1)},e.prototype.generateYears=function(){for(var e=C.default().year(),t=[],n=this.calendarDate.clone().subtract(100,"y").year();n<=e;n++)t.push(n);this.fullYearRange=O.default.chunk(t,14)},e.prototype.initValue=function(){C.default.locale(this.locale),this.today=C.default().startOf("date"),this.currentMonth=this.monthsShort[C.default().month()],this.currentYear=C.default().year(),this.dayNames=C.default.weekdaysShort(!0),this.initDate?(this.calendarDate="string"===this.returnObject?C.default(this.initDate,this.viewFormat):C.default(this.initDate),this.selectedDate=this.calendarDate.clone().startOf("date")):this.calendarDate=C.default(),this.generateYears()},e.prototype.generateCalendar=function(){this.calendarDays=[];for(var e=0-(this.calendarDate.clone().startOf("month").day()+(7-C.default.localeData().firstDayOfWeek()))%7,t=41+e,n=e;n<=t;n+=1){var i=this.calendarDate.clone().startOf("month").add(n,"days");this.calendarDays.push(i)}},e.prototype.parseToReturnObjectType=function(e){switch(this.returnObject){case"js":return e.toDate();case"string":return e.format(this.viewFormat);case"moment":default:return e;case"json":return e.toJSON();case"array":return e.toArray();case"iso":return e.toISOString();case"object":return e.toObject()}},e}();Ve.decorators=[{type:t.Component,args:[{selector:"date-picker",template:'<picker-modal (onOverlayClick)="cancelDatePicker()">\n <div class="picker-wrap">\n <div class="picker-box">\n <div class="picker-header">\n <div class="picker-header-nav">\n <span class="nav-prev" (click)="prev()"></span>\n </div>\n <div class="picker-header-content">\n <div class="content">\n <span (click)="showMonthSelection()" class="month">{{\n calendarDate | moment: \'MMMM\'\n }}</span>\n <span class="seperator">|</span>\n <span (click)="showYearSelection()" class="year">{{\n calendarDate | moment: \'YYYY\'\n }}</span>\n </div>\n </div>\n <div class="picker-header-nav">\n <span class="nav-next" (click)="next()"></span>\n </div>\n </div>\n <div class="picker-calendar">\n <div\n class="picker-calendar-row"\n *ngIf="!onDisplayMonths && !onDisplayYears"\n >\n <span class="picker-weekday" *ngFor="let day of dayNames">{{\n day\n }}</span>\n </div>\n <div\n class="picker-calendar-row"\n *ngIf="!onDisplayMonths && !onDisplayYears"\n >\n <span\n class="picker-day"\n (click)="selectDay(day)"\n [ngClass]="{\n \'out-focus\': day.month() != calendarDate.month(),\n today: day.isSame(today),\n selected: day.isSame(selectedDate)\n }"\n *ngFor="let day of calendarDays"\n >\n {{ day | moment: \'D\' }}\n </span>\n </div>\n <div class="picker-calendar-row" *ngIf="onDisplayMonths">\n <span\n class="picker-month"\n *ngFor="let month of monthsShort"\n (click)="selectMonth(month)"\n [ngClass]="{\n selected: month === currentMonth\n }"\n >\n {{ month }}\n </span>\n </div>\n <div class="picker-calendar-row" *ngIf="onDisplayYears">\n <span\n class="picker-year"\n *ngFor="let year of displayYearRange"\n (click)="selectYear(year)"\n [ngClass]="{\n selected: year === currentYear\n }"\n >\n {{ year }}\n </span>\n </div>\n </div>\n <div class="picker-footer">\n <div class="picker-action action-today" (click)="selectToday()">\n <span class="text">Today</span>\n </div>\n <div class="picker-action action-clear" (click)="clearPickDate()">\n <span class="text">Clear</span>\n </div>\n <div class="picker-action action-close" (click)="cancelDatePicker()">\n <span class="text">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n',styles:['*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:666px}.picker-box{font-family:Open Sans;min-width:400px!important;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;display:flex;height:2.5rem;width:100%}.picker-header-nav{position:relative;cursor:pointer;width:calc(100% / 8)}.picker-header-nav>*{position:absolute;top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}.picker-header-nav .nav-next:before,.picker-header-nav .nav-prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker-header-nav .nav-next:before{border-right:0;border-left:.75em solid #000}.picker-header-content{width:calc(100% * 6 / 8);text-align:center}.picker-header-content .month{font-size:1.778rem;line-height:2.5rem;margin-right:.5rem;font-weight:700}.picker-header-content .year{font-style:italic;color:#999}.picker-calendar{width:100%}.picker-calendar .picker-calendar-row{display:flex;flex-wrap:wrap;width:100%;margin-bottom:.625rem}.picker-calendar .picker-weekday{font-weight:700;text-align:left;color:#999;width:calc(100% / 7)}.picker-calendar .picker-day,.picker-calendar .picker-month,.picker-calendar .picker-year{font-size:1.333rem;line-height:2.5rem;position:relative;height:2.5rem;text-align:center;cursor:pointer;width:calc(100% / 7)}.picker-calendar .picker-day:hover,.picker-calendar .picker-month:hover,.picker-calendar .picker-year:hover{background:#b1dcfb}.picker-calendar .out-focus{color:#ddd}.picker-calendar .out-focus:hover{color:#000}.picker-calendar .selected{background:#0089ec;color:#fff}.picker-calendar .selected:hover{background:#0089ec}.picker-calendar .today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker-footer{cursor:pointer}.picker-footer .picker-action{text-align:center;width:calc(100% / 3)}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-today:before{content:" ";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-today:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}']}]}],Ve.ctorParameters=function(){return[]},Ve.propDecorators={initDate:[{type:t.Input}],locale:[{type:t.Input}],viewFormat:[{type:t.Input}],returnObject:[{type:t.Input}],onDatePickerCancel:[{type:t.Output}],onSelectDate:[{type:t.Output}]};var qe=function(){function e(){this.showSecond=!0,this.viewFormat="hh:mm A",this.use12Hour=!1,this.returnObject="js",this.onSelectTime=new t.EventEmitter,this.onTimePickerCancel=new t.EventEmitter,this.hourFormat="HH"}return e.prototype.ngOnInit=function(){this.use12Hour&&(this.hourFormat="hh"),this.time=this.initTime?C.default(this.initTime,this.viewFormat):C.default(),this.initTime?this.time="string"===this.returnObject?C.default(this.initTime,this.viewFormat):C.default(this.initTime):this.time=C.default()},e.prototype.increaseHour=function(){this.time=this.time.clone().add(1,"h")},e.prototype.decreaseHour=function(){this.time=this.time.clone().subtract(1,"h")},e.prototype.increaseMinute=function(){this.time=this.time.clone().add(1,"m")},e.prototype.decreaseMinute=function(){this.time=this.time.clone().subtract(1,"m")},e.prototype.increaseSecond=function(){this.time=this.time.clone().add(1,"s")},e.prototype.decreaseSecond=function(){this.time=this.time.clone().subtract(1,"s")},e.prototype.selectTime=function(){var e=this.parseToReturnObjectType(this.time);this.onSelectTime.emit(e),this.cancelTimePicker()},e.prototype.selectNow=function(){var e=this.parseToReturnObjectType(C.default());this.onSelectTime.emit(e),this.cancelTimePicker()},e.prototype.clearTime=function(){this.onSelectTime.emit(null),this.cancelTimePicker()},e.prototype.cancelTimePicker=function(){this.onTimePickerCancel.emit(!1)},e.prototype.parseToReturnObjectType=function(e){switch(this.returnObject){case"js":return e.toDate();case"string":return e.format(this.viewFormat);case"moment":default:return e;case"json":return e.toJSON();case"array":return e.toArray();case"iso":return e.toISOString();case"object":return e.toObject()}},e}();qe.decorators=[{type:t.Component,args:[{selector:"time-picker",template:'<picker-modal (onOverlayClick)="cancelTimePicker()">\n <div class="picker-wrap">\n <div class="picker-box">\n <div class="picker-header">Time Picker</div>\n <div class="picker-table">\n <ul class="picker-table-time">\n <li class="picker-table-number hour">\n <span class="arrow up" (click)="increaseHour()"></span>\n {{ time | moment: hourFormat }}\n <span class="arrow down" (click)="decreaseHour()"></span>\n </li>\n <li class="picker-table-separator">:</li>\n <li class="picker-table-number minute">\n <span class="arrow up" (click)="increaseMinute()"></span>\n {{ time | moment: \'mm\' }}\n <span class="arrow down" (click)="decreaseMinute()"></span>\n </li>\n <li *ngIf="showSecond" class="picker-table-separator">:</li>\n <li *ngIf="showSecond" class="picker-table-number second">\n <span class="arrow up" (click)="increaseSecond()"></span>\n {{ time | moment: \'ss\' }}\n <span class="arrow down" (click)="decreaseSecond()"></span>\n </li>\n <li *ngIf="use12Hour" class="picker-table-meridiem meridiem">\n {{ time | moment: \'A\' }}\n </li>\n </ul>\n </div>\n <div class="picker-footer">\n <div class="picker-action action-now" (click)="selectNow()">\n <span class="text">Now</span>\n </div>\n <div class="picker-action action-confirm" (click)="selectTime()">\n <span class="text">Confirm</span>\n </div>\n <div class="picker-action action-clear" (click)="clearTime()">\n <span class="text">Clear</span>\n </div>\n <div class="picker-action action-close" (click)="cancelTimePicker()">\n <span class="text">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n',styles:['*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:40rem;font-family:Open Sans}.picker-box{width:100%;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;height:2.5rem;width:100%}.picker-header{text-align:center}.picker-table{width:100%;margin:2.5rem 0}.picker-table-time{font-size:2.37rem;line-height:2.5rem;list-style:none;margin:0;padding:0;display:flex;justify-content:center;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none}.picker-table-meridiem,.picker-table-number,.picker-table-separator{text-align:center}.picker-table-meridiem,.picker-table-number{position:relative;width:20%}.arrow{position:absolute;left:50%;border:solid #777;border-width:0 .2rem .2rem 0;display:inline-block;padding:.25rem;cursor:pointer}.arrow.up{top:-1rem;transform:translateX(-50%) rotate(-135deg)}.arrow.down{bottom:-1rem;transform:translateX(-50%) rotate(45deg)}.arrow:hover{border-color:#1975d2}.picker-table-separator{width:calc(20% / 3)}.picker-footer{display:flex;justify-content:center;width:100%;cursor:pointer}.picker-footer .picker-action{width:25%;text-align:center}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-confirm:before,.picker-footer .action-now:before{content:" ";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-now:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-confirm:before{width:1rem;height:1rem;border-radius:100%;background-color:#00b5ad}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}']}]}],qe.ctorParameters=function(){return[]},qe.propDecorators={initTime:[{type:t.Input}],showSecond:[{type:t.Input}],viewFormat:[{type:t.Input}],use12Hour:[{type:t.Input}],returnObject:[{type:t.Input}],onSelectTime:[{type:t.Output}],onTimePickerCancel:[{type:t.Output}]};var Fe=function(){function e(){this.onOverlayClick=new t.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.closeModal=function(){this.onOverlayClick.emit(!1)},e}();Fe.decorators=[{type:t.Component,args:[{selector:"picker-modal",template:'<section class="x-modal">\n <section class="modal-overlay" (click)="closeModal()"></section>\n <section class="modal-main" id="section-modal-main">\n <ng-content></ng-content>\n </section>\n</section>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,animations:[],styles:[":host{z-index:9999999999}*,:after,:before{box-sizing:border-box}.modal-main{position:absolute;left:19.6%;right:auto;top:auto;z-index:111;background-color:#fff;border:1px solid #d7dad7;border-radius:6px;transform:translate(-50%);box-shadow:0 5px 15px rgba(0,0,0,.3)}"]}]}],Fe.ctorParameters=function(){return[]},Fe.propDecorators={onOverlayClick:[{type:t.Output}]};var je=function(){function e(){}return e.prototype.transform=function(e,t){return t?e.format(t):e.format("MMM DD, YYYY")},e}();je.decorators=[{type:t.Pipe,args:[{name:"moment"}]}];var Re=function(){function e(){this.showDate=!0,this.showTime=!1,this.showWeeks=!1,this.weeks=[2,4,6,8,12,16,24],this.onDateChange=new t.EventEmitter,this.showDatePicker=!1,this.showTimePicker=!1,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){},e.prototype.weeksSelected=function(e){var t=new Date,n=t.setDate(t.getDate()+7*e);this.value=C.default(n).format()},e.prototype.setDate=function(e){this.value=e&&""!==e?C.default(e).format():e},e.prototype.setTime=function(e){this.value=e&&""!==e?C.default(e).format():e},e.prototype.toggleDatePicker=function(e){this.showDatePicker=e},e.prototype.toggleTimePicker=function(e){this.showTimePicker=e},Object.defineProperty(e.prototype,"value",{get:function(){return this.modelValue},set:function(e){this.modelValue=e,this.onDateChange.emit(e),this.onChange(e),this.onTouched()},enumerable:!1,configurable:!0}),e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.writeValue=function(e){e instanceof Date?this.value=C.default(e).format():this.value=e},e}();Re.decorators=[{type:t.Component,args:[{selector:"date-time-picker",template:'<div class="row">\n <div *ngIf="!showTime" class="col-xs-12 col-md-12">\n <input\n *ngIf="!showWeeks"\n type="text"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div *ngIf="showWeeks" class="input-group">\n <input\n type="text"\n class="form-control"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div class="input-group-btn">\n <button\n type="button"\n class="btn btn-default dropdown-toggle"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n Weeks <span class="caret"></span>\n </button>\n <ul class="dropdown-menu up">\n <li (click)="weeksSelected(count)" *ngFor="let count of weeks">\n <span> {{ count }} Weeks</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div *ngIf="showTime" class="col-xs-8 col-md-8">\n <input\n *ngIf="!showWeeks"\n type="text"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div *ngIf="showWeeks" class="input-group">\n <input\n type="text"\n class="form-control"\n class="form-control"\n [value]="value | date: \'mediumDate\'"\n (focus)="toggleDatePicker(true)"\n readonly\n placeholder="Select Date"\n />\n <div class="input-group-btn">\n <button\n type="button"\n class="btn btn-default dropdown-toggle"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false"\n >\n Weeks <span class="caret"></span>\n </button>\n <ul class="dropdown-menu up">\n <li (click)="weeksSelected(count)" *ngFor="let count of weeks">\n <span> {{ count }} Weeks</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div *ngIf="showTime" class="col-xs-4 col-md-4">\n <input\n type="text"\n class="form-control"\n [value]="value | date: \'shortTime\'"\n (focus)="toggleTimePicker(true)"\n readonly\n placeholder="Select Time"\n />\n </div>\n</div>\n<date-picker\n *ngIf="showDatePicker"\n [initDate]="value"\n (onSelectDate)="setDate($event)"\n (onDatePickerCancel)="toggleDatePicker($event)"\n></date-picker>\n\n<time-picker\n *ngIf="showTimePicker"\n [initTime]="value"\n [use12Hour]="true"\n (onSelectTime)="setTime($event)"\n (onTimePickerCancel)="toggleTimePicker($event)"\n></time-picker>\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Re})),multi:!0}],styles:["input[readonly]{background-color:#fff}.up{bottom:100%!important;top:auto!important}.glyphicon{top:1px}"]}]}],Re.ctorParameters=function(){return[]},Re.propDecorators={modelValue:[{type:t.Input}],showDate:[{type:t.Input}],showTime:[{type:t.Input}],showWeeks:[{type:t.Input}],weeks:[{type:t.Input}],onDateChange:[{type:t.Output}]};var Ne=function(){};Ne.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule],declarations:[Ve,qe,Fe,je,Re],exports:[Ve,qe,Fe,je,Re],providers:[]}]}];var Le=function(){function e(){this.value="",this.isDisabled=!1,this.id="",this.theme="dark",this.showWeeks=!1,this.onChange=function(e){},this.onTouch=function(){}}return e.prototype.onInput=function(e){this.onTouch(),this.onChange(C.default(e.value).format())},e.prototype.writeValue=function(e){this.value=e&&""!==e?C.default(e).format():""},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouch=e},e.prototype.setDisabledState=function(e){this.isDisabled=e},e.prototype.onWeeksSelected=function(e){var t=(new Date).toString();this.onInput({value:C.default(t).add(e,"weeks")})},e}();Le.decorators=[{type:t.Component,args:[{selector:"ngx-datetimepicker",template:'<div class="date-time-picker-container">\n <div data-date-picker data-date-picker-type="single"\n class="bx--date-picker bx--date-picker--single bx--date-picker--light" [ngClass]="{\n \'bx--date-picker--light\': theme === \'light\'\n}">\n <div class="bx--date-picker-container fill">\n <div class="bx--date-picker-input__wrapper">\n <input [disabled]="isDisabled" (dateTimeChange)="onInput($event)" type="text"\n class="bx--date-picker__input fill" [id]="id" [value]="value" [owlDateTime]="dt1"\n [owlDateTimeTrigger]="dt1" placeholder="mm/dd/yyyy" data-date-picker-input />\n <svg [owlDateTimeTrigger]="dt1" focusable="false" preserveAspectRatio="xMidYMid meet" style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg" data-date-picker-icon="true" class="bx--date-picker__icon"\n width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">\n <path\n d="M13,2h-2V1h-1v1H6V1H5v1H3C2.4,2,2,2.4,2,3v10c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1V3C14,2.4,13.6,2,13,2z M13,13H3V6h10V13z M13,5H3V3h2v1h1V3h4v1h1V3h2V5z">\n </path>\n </svg>\n </div>\n </div>\n </div>\n\n\n <div *ngIf="showWeeks" class="bx--select some-class week-select-wrapper" [ngClass]="{\'bx--select--light\': theme === \'light\'}">\n <div class="bx--select-input__wrapper">\n <select (change)="onWeeksSelected($event.target.value)" id="select-1" class="bx--select-input">\n <option class="bx--select-option" value="placeholder-item" disabled="" hidden="" selected="">Select\n Weeks</option>\n <option class="bx--select-option" [value]="week" *ngFor="let week of weeks">{{week}} Weeks</option>\n </select>\n <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"\n fill="currentColor" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"\n class="bx--select__arrow">\n <path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path>\n </svg>\n </div>\n </div>\n\n</div>\n<owl-date-time [pickerType]="\'calendar\'" [disabled]="isDisabled" #dt1></owl-date-time>',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Le})),multi:!0}],styles:[".date-time-picker-container{display:flex;justify-content:space-between}.week-select-wrapper{margin-left:1rem;width:30%}"]}]}],Le.propDecorators={id:[{type:t.Input}],theme:[{type:t.Input}],showWeeks:[{type:t.Input}],weeks:[{type:t.Input}]};var He=function(){function e(e){this.changeDetector=e,this.stateChanges=r.Subscription.EMPTY}return Object.defineProperty(e.prototype,"disabled",{get:function(){return void 0===this._disabled?this.dtPicker.disabled:!!this._disabled},set:function(e){this._disabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTriggerDisabledClass",{get:function(){return this.disabled},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){e.datepicker&&this.watchStateChanges()},e.prototype.ngAfterContentInit=function(){this.watchStateChanges()},e.prototype.ngOnDestroy=function(){this.stateChanges.unsubscribe()},e.prototype.handleClickOnHost=function(e){this.dtPicker&&(this.dtPicker.open(),e.stopPropagation())},e.prototype.watchStateChanges=function(){var e=this;this.stateChanges.unsubscribe();var t=this.dtPicker&&this.dtPicker.dtInput?this.dtPicker.dtInput.disabledChange:r.of(),n=this.dtPicker?this.dtPicker.disabledChange:r.of();this.stateChanges=r.merge(n,t).subscribe((function(){e.changeDetector.markForCheck()}))},e}();He.decorators=[{type:t.Directive,args:[{selector:"[owlDateTimeTrigger]",host:{"(click)":"handleClickOnHost($event)","[class.owl-dt-trigger-disabled]":"owlDTTriggerDisabledClass"}}]}],He.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},He.propDecorators={dtPicker:[{type:t.Input,args:["owlDateTimeTrigger"]}],disabled:[{type:t.Input}]};var Ye=function(){this.changes=new r.Subject,this.upSecondLabel="Add a second",this.downSecondLabel="Minus a second",this.upMinuteLabel="Add a minute",this.downMinuteLabel="Minus a minute",this.upHourLabel="Add a hour",this.downHourLabel="Minus a hour",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 21 years",this.nextMultiYearLabel="Next 21 years",this.switchToMonthViewLabel="Change to month view",this.switchToMultiYearViewLabel="Choose month and year",this.cancelBtnLabel="Cancel",this.setBtnLabel="Set",this.rangeFromLabel="From",this.rangeToLabel="To",this.hour12AMLabel="AM",this.hour12PMLabel="PM"};Ye.ɵprov=k.ɵɵdefineInjectable({factory:function(){return new Ye},token:Ye,providedIn:"root"}),Ye.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var Be=new t.InjectionToken("OWL_DATE_TIME_LOCALE",{providedIn:"root",factory:Qe});function Qe(){return t.inject(t.LOCALE_ID)}t.LOCALE_ID;var ze=function(){function e(){this._localeChanges=new r.Subject,this.millisecondsInDay=864e5,this.milliseondsInMinute=6e4}return Object.defineProperty(e.prototype,"localeChanges",{get:function(){return this._localeChanges},enumerable:!1,configurable:!0}),e.prototype.compare=function(e,t){if(!this.isValid(e)||!this.isValid(t))throw Error("JSNativeDate: Cannot compare invalid dates.");var n=this.clone(e),i=this.clone(t),r=this.getTime(n)-this.getTime(i);return r<0?-1:r>0?1:r},e.prototype.compareYear=function(e,t){if(!this.isValid(e)||!this.isValid(t))throw Error("JSNativeDate: Cannot compare invalid dates.");var n=this.getYear(e)-this.getYear(t);return n<0?-1:n>0?1:0},e.prototype.deserialize=function(e){return null==e||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()},e.prototype.setLocale=function(e){this.locale=e,this._localeChanges.next()},e.prototype.clampDate=function(e,t,n){return t&&this.compare(e,t)<0?t:n&&this.compare(e,n)>0?n:e},e}(),We=new t.InjectionToken("OWL_DATE_TIME_FORMATS"),Ge=function(){function e(e,n,i,o,a,s){var l=this;this.elmRef=e,this.pickerIntl=n,this.ngZone=i,this.cdRef=o,this.dateTimeAdapter=a,this.dateTimeFormats=s,this.firstDayOfWeek=0,this._selecteds=[],this.startView="month",this.pickerMomentChange=new t.EventEmitter,this.selectedChange=new t.EventEmitter,this.userSelection=new t.EventEmitter,this.yearSelected=new t.EventEmitter,this.monthSelected=new t.EventEmitter,this.intlChangesSub=r.Subscription.EMPTY,this.moveFocusOnNextTick=!1,this.dateFilterForViews=function(e){return!!e&&(!l.dateFilter||l.dateFilter(e))&&(!l.minDate||l.dateTimeAdapter.compare(e,l.minDate)>=0)&&(!l.maxDate||l.dateTimeAdapter.compare(e,l.maxDate)<=0)},this.intlChangesSub=this.pickerIntl.changes.subscribe((function(){l.cdRef.markForCheck()}))}return Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),e=this.getValidDate(e),this._minDate=e?this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(e),this.dateTimeAdapter.getMonth(e),this.dateTimeAdapter.getDate(e)):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),e=this.getValidDate(e),this._maxDate=e?this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(e),this.dateTimeAdapter.getMonth(e),this.dateTimeAdapter.getDate(e)):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){var t=this;this._selecteds=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"periodButtonText",{get:function(){return this.isMonthView?this.dateTimeAdapter.format(this.pickerMoment,this.dateTimeFormats.monthYearLabel):this.dateTimeAdapter.getYearName(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"periodButtonLabel",{get:function(){return this.isMonthView?this.pickerIntl.switchToMultiYearViewLabel:this.pickerIntl.switchToMonthViewLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prevButtonLabel",{get:function(){return"month"===this._currentView?this.pickerIntl.prevMonthLabel:"year"===this._currentView?this.pickerIntl.prevYearLabel:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextButtonLabel",{get:function(){return"month"===this._currentView?this.pickerIntl.nextMonthLabel:"year"===this._currentView?this.pickerIntl.nextYearLabel:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentView",{get:function(){return this._currentView},set:function(e){this._currentView=e,this.moveFocusOnNextTick=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showControlArrows",{get:function(){return"multi-years"!==this._currentView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMonthView",{get:function(){return"month"===this._currentView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarClass",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngAfterContentInit=function(){this._currentView=this.startView},e.prototype.ngAfterViewChecked=function(){this.moveFocusOnNextTick&&(this.moveFocusOnNextTick=!1,this.focusActiveCell())},e.prototype.ngOnDestroy=function(){this.intlChangesSub.unsubscribe()},e.prototype.toggleViews=function(){this.currentView="month"===this._currentView?"multi-years":"month"},e.prototype.previousClicked=function(){this.pickerMoment=this.isMonthView?this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-1):this.dateTimeAdapter.addCalendarYears(this.pickerMoment,-1),this.pickerMomentChange.emit(this.pickerMoment)},e.prototype.nextClicked=function(){this.pickerMoment=this.isMonthView?this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,1):this.dateTimeAdapter.addCalendarYears(this.pickerMoment,1),this.pickerMomentChange.emit(this.pickerMoment)},e.prototype.dateSelected=function(e){this.dateFilterForViews(e)&&this.selectedChange.emit(e)},e.prototype.goToDateInView=function(e,t){this.handlePickerMomentChange(e),this.currentView=t},e.prototype.handlePickerMomentChange=function(e){this.pickerMoment=this.dateTimeAdapter.clampDate(e,this.minDate,this.maxDate),this.pickerMomentChange.emit(this.pickerMoment)},e.prototype.userSelected=function(){this.userSelection.emit()},e.prototype.prevButtonEnabled=function(){return!this.minDate||!this.isSameView(this.pickerMoment,this.minDate)},e.prototype.nextButtonEnabled=function(){return!this.maxDate||!this.isSameView(this.pickerMoment,this.maxDate)},e.prototype.focusActiveCell=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.ngZone.onStable.asObservable().pipe(g.take(1)).subscribe((function(){e.elmRef.nativeElement.querySelector(".owl-dt-calendar-cell-active").focus()}))}))},e.prototype.selectYearInMultiYearView=function(e){this.yearSelected.emit(e)},e.prototype.selectMonthInYearView=function(e){this.monthSelected.emit(e)},e.prototype.isSameView=function(e,t){return"month"===this._currentView?!(!e||!t||this.dateTimeAdapter.getYear(e)!==this.dateTimeAdapter.getYear(t)||this.dateTimeAdapter.getMonth(e)!==this.dateTimeAdapter.getMonth(t)):"year"===this._currentView&&!(!e||!t||this.dateTimeAdapter.getYear(e)!==this.dateTimeAdapter.getYear(t))},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e}();Ge.decorators=[{type:t.Component,args:[{selector:"owl-date-time-calendar",exportAs:"owlDateTimeCalendar",template:'<div class="owl-dt-calendar-control">\n \x3c!-- focus when keyboard tab (http://kizu.ru/en/blog/keyboard-only-focus/#x) --\x3e\n <button class="owl-dt-control owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="0"\n [style.visibility]="showControlArrows? \'visible\': \'hidden\'"\n [disabled]="!prevButtonEnabled()"\n [attr.aria-label]="prevButtonLabel"\n (click)="previousClicked()">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Left"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 250.738 250.738"\n style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve"\n width="100%" height="100%">\n <path style="fill-rule: evenodd; clip-rule: evenodd;" d="M96.633,125.369l95.053-94.533c7.101-7.055,7.101-18.492,0-25.546 c-7.1-7.054-18.613-7.054-25.714,0L58.989,111.689c-3.784,3.759-5.487,8.759-5.238,13.68c-0.249,4.922,1.454,9.921,5.238,13.681 l106.983,106.398c7.101,7.055,18.613,7.055,25.714,0c7.101-7.054,7.101-18.491,0-25.544L96.633,125.369z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n </button>\n <div class="owl-dt-calendar-control-content">\n <button class="owl-dt-control owl-dt-control-button owl-dt-control-period-button"\n type="button" tabindex="0"\n [attr.aria-label]="periodButtonLabel"\n (click)="toggleViews()">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n {{periodButtonText}}\n\n <span class="owl-dt-control-button-arrow"\n [style.transform]="\'rotate(\' + (isMonthView? 0 : 180) +\'deg)\'">\n \x3c!-- <editor-fold desc="SVG Arrow"> --\x3e\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n width="50%" height="50%" viewBox="0 0 292.362 292.362" style="enable-background:new 0 0 292.362 292.362;"\n xml:space="preserve">\n <g>\n <path d="M286.935,69.377c-3.614-3.617-7.898-5.424-12.848-5.424H18.274c-4.952,0-9.233,1.807-12.85,5.424\n C1.807,72.998,0,77.279,0,82.228c0,4.948,1.807,9.229,5.424,12.847l127.907,127.907c3.621,3.617,7.902,5.428,12.85,5.428\n s9.233-1.811,12.847-5.428L286.935,95.074c3.613-3.617,5.427-7.898,5.427-12.847C292.362,77.279,290.548,72.998,286.935,69.377z"/>\n </g>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n </span>\n </button>\n </div>\n <button class="owl-dt-control owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="0"\n [style.visibility]="showControlArrows? \'visible\': \'hidden\'"\n [disabled]="!nextButtonEnabled()"\n [attr.aria-label]="nextButtonLabel"\n (click)="nextClicked()">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Right"> --\x3e\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 250.738 250.738" style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve">\n <path style="fill-rule:evenodd;clip-rule:evenodd;" d="M191.75,111.689L84.766,5.291c-7.1-7.055-18.613-7.055-25.713,0\n c-7.101,7.054-7.101,18.49,0,25.544l95.053,94.534l-95.053,94.533c-7.101,7.054-7.101,18.491,0,25.545\n c7.1,7.054,18.613,7.054,25.713,0L191.75,139.05c3.784-3.759,5.487-8.759,5.238-13.681\n C197.237,120.447,195.534,115.448,191.75,111.689z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n </button>\n</div>\n<div class="owl-dt-calendar-main" cdkMonitorSubtreeFocus [ngSwitch]="currentView" tabindex="-1">\n <owl-date-time-month-view\n *ngSwitchCase="\'month\'"\n [pickerMoment]="pickerMoment"\n [firstDayOfWeek]="firstDayOfWeek"\n [selected]="selected"\n [selecteds]="selecteds"\n [selectMode]="selectMode"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [dateFilter]="dateFilter"\n [hideOtherMonths]="hideOtherMonths"\n (pickerMomentChange)="handlePickerMomentChange($event)"\n (selectedChange)="dateSelected($event)"\n (userSelection)="userSelected()"></owl-date-time-month-view>\n\n <owl-date-time-year-view\n *ngSwitchCase="\'year\'"\n [pickerMoment]="pickerMoment"\n [selected]="selected"\n [selecteds]="selecteds"\n [selectMode]="selectMode"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [dateFilter]="dateFilter"\n (keyboardEnter)="focusActiveCell()"\n (pickerMomentChange)="handlePickerMomentChange($event)"\n (monthSelected)="selectMonthInYearView($event)"\n (change)="goToDateInView($event, \'month\')"></owl-date-time-year-view>\n\n <owl-date-time-multi-year-view\n *ngSwitchCase="\'multi-years\'"\n [pickerMoment]="pickerMoment"\n [selected]="selected"\n [selecteds]="selecteds"\n [selectMode]="selectMode"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [dateFilter]="dateFilter"\n (keyboardEnter)="focusActiveCell()"\n (pickerMomentChange)="handlePickerMomentChange($event)"\n (yearSelected)="selectYearInMultiYearView($event)"\n (change)="goToDateInView($event, \'year\')"></owl-date-time-multi-year-view>\n</div>\n',host:{"[class.owl-dt-calendar]":"owlDTCalendarClass"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],Ge.ctorParameters=function(){return[{type:t.ElementRef},{type:Ye},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:ze,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[We]}]}]},Ge.propDecorators={minDate:[{type:t.Input}],maxDate:[{type:t.Input}],pickerMoment:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],dateFilter:[{type:t.Input}],firstDayOfWeek:[{type:t.Input}],selectMode:[{type:t.Input}],startView:[{type:t.Input}],hideOtherMonths:[{type:t.Input}],pickerMomentChange:[{type:t.Output}],selectedChange:[{type:t.Output}],userSelection:[{type:t.Output}],yearSelected:[{type:t.Output}],monthSelected:[{type:t.Output}]};var Ue=function(){function e(e,n,i,r,o){this.ngZone=e,this.elmRef=n,this.pickerIntl=i,this.cdRef=r,this.dateTimeAdapter=o,this.isPM=!1,this.stepHour=1,this.stepMinute=1,this.stepSecond=1,this.selectedChange=new t.EventEmitter}return Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDateTime",{get:function(){return this._minDateTime},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDateTime=this.getValidDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDateTime",{get:function(){return this._maxDateTime},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDateTime=this.getValidDate(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hourValue",{get:function(){return this.dateTimeAdapter.getHours(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hourBoxValue",{get:function(){var e=this.hourValue;return this.hour12Timer?(0===e?(e=12,this.isPM=!1):e>0&&e<12?this.isPM=!1:12===e?this.isPM=!0:e>12&&e<24&&(e-=12,this.isPM=!0),e):e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minuteValue",{get:function(){return this.dateTimeAdapter.getMinutes(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secondValue",{get:function(){return this.dateTimeAdapter.getSeconds(this.pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"upHourButtonLabel",{get:function(){return this.pickerIntl.upHourLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"downHourButtonLabel",{get:function(){return this.pickerIntl.downHourLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"upMinuteButtonLabel",{get:function(){return this.pickerIntl.upMinuteLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"downMinuteButtonLabel",{get:function(){return this.pickerIntl.downMinuteLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"upSecondButtonLabel",{get:function(){return this.pickerIntl.upSecondLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"downSecondButtonLabel",{get:function(){return this.pickerIntl.downSecondLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hour12ButtonLabel",{get:function(){return this.isPM?this.pickerIntl.hour12PMLabel:this.pickerIntl.hour12AMLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTimerClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTimeTabIndex",{get:function(){return-1},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.focus=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.ngZone.onStable.asObservable().pipe(g.take(1)).subscribe((function(){e.elmRef.nativeElement.focus()}))}))},e.prototype.setHourValueViaInput=function(e){this.hour12Timer&&this.isPM&&e>=1&&e<=11?e+=12:this.hour12Timer&&!this.isPM&&12===e&&(e=0),this.setHourValue(e)},e.prototype.setHourValue=function(e){var t=this.dateTimeAdapter.setHours(this.pickerMoment,e);this.selectedChange.emit(t),this.cdRef.markForCheck()},e.prototype.setMinuteValue=function(e){var t=this.dateTimeAdapter.setMinutes(this.pickerMoment,e);this.selectedChange.emit(t),this.cdRef.markForCheck()},e.prototype.setSecondValue=function(e){var t=this.dateTimeAdapter.setSeconds(this.pickerMoment,e);this.selectedChange.emit(t),this.cdRef.markForCheck()},e.prototype.setMeridiem=function(e){this.isPM=!this.isPM;var t=this.hourValue;this.isPM?t+=12:t-=12,t>=0&&t<=23&&this.setHourValue(t),this.cdRef.markForCheck(),e.preventDefault()},e.prototype.upHourEnabled=function(){return!this.maxDateTime||this.compareHours(this.stepHour,this.maxDateTime)<1},e.prototype.downHourEnabled=function(){return!this.minDateTime||this.compareHours(-this.stepHour,this.minDateTime)>-1},e.prototype.upMinuteEnabled=function(){return!this.maxDateTime||this.compareMinutes(this.stepMinute,this.maxDateTime)<1},e.prototype.downMinuteEnabled=function(){return!this.minDateTime||this.compareMinutes(-this.stepMinute,this.minDateTime)>-1},e.prototype.upSecondEnabled=function(){return!this.maxDateTime||this.compareSeconds(this.stepSecond,this.maxDateTime)<1},e.prototype.downSecondEnabled=function(){return!this.minDateTime||this.compareSeconds(-this.stepSecond,this.minDateTime)>-1},e.prototype.compareHours=function(e,t){var n=this.dateTimeAdapter.getHours(this.pickerMoment)+e,i=this.dateTimeAdapter.setHours(this.pickerMoment,n);return this.dateTimeAdapter.compare(i,t)},e.prototype.compareMinutes=function(e,t){var n=this.dateTimeAdapter.getMinutes(this.pickerMoment)+e,i=this.dateTimeAdapter.setMinutes(this.pickerMoment,n);return this.dateTimeAdapter.compare(i,t)},e.prototype.compareSeconds=function(e,t){var n=this.dateTimeAdapter.getSeconds(this.pickerMoment)+e,i=this.dateTimeAdapter.setSeconds(this.pickerMoment,n);return this.dateTimeAdapter.compare(i,t)},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e}();Ue.decorators=[{type:t.Component,args:[{exportAs:"owlDateTimeTimer",selector:"owl-date-time-timer",template:'<owl-date-time-timer-box\n [upBtnAriaLabel]="upHourButtonLabel"\n [downBtnAriaLabel]="downHourButtonLabel"\n [upBtnDisabled]="!upHourEnabled()"\n [downBtnDisabled]="!downHourEnabled()"\n [boxValue]="hourBoxValue"\n [value]="hourValue" [min]="0" [max]="23"\n [step]="stepHour" [inputLabel]="\'Hour\'"\n (inputChange)="setHourValueViaInput($event)"\n (valueChange)="setHourValue($event)"></owl-date-time-timer-box>\n<owl-date-time-timer-box\n [showDivider]="true"\n [upBtnAriaLabel]="upMinuteButtonLabel"\n [downBtnAriaLabel]="downMinuteButtonLabel"\n [upBtnDisabled]="!upMinuteEnabled()"\n [downBtnDisabled]="!downMinuteEnabled()"\n [value]="minuteValue" [min]="0" [max]="59"\n [step]="stepMinute" [inputLabel]="\'Minute\'"\n (inputChange)="setMinuteValue($event)"\n (valueChange)="setMinuteValue($event)"></owl-date-time-timer-box>\n<owl-date-time-timer-box\n *ngIf="showSecondsTimer"\n [showDivider]="true"\n [upBtnAriaLabel]="upSecondButtonLabel"\n [downBtnAriaLabel]="downSecondButtonLabel"\n [upBtnDisabled]="!upSecondEnabled()"\n [downBtnDisabled]="!downSecondEnabled()"\n [value]="secondValue" [min]="0" [max]="59"\n [step]="stepSecond" [inputLabel]="\'Second\'"\n (inputChange)="setSecondValue($event)"\n (valueChange)="setSecondValue($event)"></owl-date-time-timer-box>\n\n<div *ngIf="hour12Timer" class="owl-dt-timer-hour12">\n <button class="owl-dt-control-button owl-dt-timer-hour12-box"\n type="button" tabindex="0"\n (click)="setMeridiem($event)">\n <span class="owl-dt-control-button-content" tabindex="-1">\n {{hour12ButtonLabel}}\n </span>\n </button>\n</div>\n',preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,host:{"[class.owl-dt-timer]":"owlDTTimerClass","[attr.tabindex]":"owlDTTimeTabIndex"},styles:[""]}]}],Ue.ctorParameters=function(){return[{type:t.NgZone},{type:t.ElementRef},{type:Ye},{type:t.ChangeDetectorRef},{type:ze,decorators:[{type:t.Optional}]}]},Ue.propDecorators={pickerMoment:[{type:t.Input}],minDateTime:[{type:t.Input}],maxDateTime:[{type:t.Input}],showSecondsTimer:[{type:t.Input}],hour12Timer:[{type:t.Input}],stepHour:[{type:t.Input}],stepMinute:[{type:t.Input}],stepSecond:[{type:t.Input}],selectedChange:[{type:t.Output}]};var $e={transformPicker:s.trigger("transformPicker",[s.state("void",s.style({opacity:0,transform:"scale(1, 0)"})),s.state("enter",s.style({opacity:1,transform:"scale(1, 1)"})),s.transition("void => enter",s.group([s.query("@fadeInPicker",s.animateChild(),{optional:!0}),s.animate("400ms cubic-bezier(0.25, 0.8, 0.25, 1)")])),s.transition("enter => void",s.animate("100ms linear",s.style({opacity:0})))]),fadeInPicker:s.trigger("fadeInPicker",[s.state("enter",s.style({opacity:1})),s.state("void",s.style({opacity:0})),s.transition("void => enter",s.animate("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])},Je=function(){function e(e,t,n,i){this.cdRef=e,this.elmRef=t,this.pickerIntl=n,this.dateTimeAdapter=i,this.activeSelectedIndex=0,this.hidePicker$=new r.Subject,this.confirmSelected$=new r.Subject,this.pickerOpened$=new r.Subject}return Object.defineProperty(e.prototype,"hidePickerStream",{get:function(){return this.hidePicker$.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"confirmSelectedStream",{get:function(){return this.confirmSelected$.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerOpenedStream",{get:function(){return this.pickerOpened$.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._clamPickerMoment},set:function(e){e&&(this._clamPickerMoment=this.dateTimeAdapter.clampDate(e,this.picker.minDateTime,this.picker.maxDateTime)),this.cdRef.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerType",{get:function(){return this.picker.pickerType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cancelLabel",{get:function(){return this.pickerIntl.cancelBtnLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setLabel",{get:function(){return this.pickerIntl.setBtnLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fromLabel",{get:function(){return this.pickerIntl.rangeFromLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toLabel",{get:function(){return this.pickerIntl.rangeToLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fromFormattedValue",{get:function(){var e=this.picker.selecteds[0];return e?this.dateTimeAdapter.format(e,this.picker.formatString):""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toFormattedValue",{get:function(){var e=this.picker.selecteds[1];return e?this.dateTimeAdapter.format(e,this.picker.formatString):""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showControlButtons",{get:function(){return"dialog"===this.picker.pickerMode||"calendar"!==this.picker.pickerType&&"inline"!==this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerElm",{get:function(){return this.elmRef.nativeElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTPopupContainerClass",{get:function(){return"popup"===this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTDialogContainerClass",{get:function(){return"dialog"===this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTInlineContainerClass",{get:function(){return"inline"===this.picker.pickerMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerDisabledClass",{get:function(){return this.picker.disabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerId",{get:function(){return this.picker.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTContainerAnimation",{get:function(){return"inline"===this.picker.pickerMode?"":"enter"},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngAfterContentInit=function(){this.initPicker()},e.prototype.ngAfterViewInit=function(){this.focusPicker()},e.prototype.handleContainerAnimationDone=function(e){"enter"===e.toState&&this.pickerOpened$.next()},e.prototype.dateSelected=function(e){var t;this.picker.isInSingleMode?(t=this.dateSelectedInSingleMode(e))?(this.pickerMoment=t,this.picker.select(t)):"calendar"===this.pickerType&&this.hidePicker$.next(null):this.picker.isInRangeMode&&(t=this.dateSelectedInRangeMode(e))&&(this.pickerMoment=t[this.activeSelectedIndex],this.picker.select(t))},e.prototype.timeSelected=function(e){if(this.pickerMoment=this.dateTimeAdapter.clone(e),this.picker.dateTimeChecker(this.pickerMoment))if(this.picker.isInSingleMode)this.picker.select(this.pickerMoment);else if(this.picker.isInRangeMode){var t=V(this.picker.selecteds);0===this.activeSelectedIndex&&t[1]&&1===this.dateTimeAdapter.compare(this.pickerMoment,t[1])||1===this.activeSelectedIndex&&t[0]&&-1===this.dateTimeAdapter.compare(this.pickerMoment,t[0])?(t[0]=this.pickerMoment,t[1]=this.pickerMoment):t[this.activeSelectedIndex]=this.pickerMoment,this.picker.select(t)}},e.prototype.onCancelClicked=function(e){this.hidePicker$.next(null),e.preventDefault()},e.prototype.onSetClicked=function(e){if(!this.picker.dateTimeChecker(this.pickerMoment))return this.hidePicker$.next(null),void e.preventDefault();this.confirmSelected$.next(e),e.preventDefault()},e.prototype.handleClickOnInfoGroup=function(e,t){this.setActiveSelectedIndex(t),e.preventDefault(),e.stopPropagation()},e.prototype.handleKeydownOnInfoGroup=function(e,t,n){switch(e.keyCode){case m.DOWN_ARROW:case m.RIGHT_ARROW:case m.UP_ARROW:case m.LEFT_ARROW:t.focus(),this.setActiveSelectedIndex(0===n?1:0),e.preventDefault(),e.stopPropagation();break;case m.SPACE:this.setActiveSelectedIndex(n),e.preventDefault(),e.stopPropagation();break;default:return}},e.prototype.setActiveSelectedIndex=function(e){if("range"===this.picker.selectMode&&this.activeSelectedIndex!==e){this.activeSelectedIndex=e;var t=this.picker.selecteds[this.activeSelectedIndex];this.picker.selecteds&&t&&(this.pickerMoment=this.dateTimeAdapter.clone(t))}},e.prototype.initPicker=function(){this.pickerMoment=this.picker.startAt||this.dateTimeAdapter.now(),this.activeSelectedIndex="rangeTo"===this.picker.selectMode?1:0},e.prototype.dateSelectedInSingleMode=function(e){return this.dateTimeAdapter.isSameDay(e,this.picker.selected)?null:this.updateAndCheckCalendarDate(e)},e.prototype.dateSelectedInRangeMode=function(e){var t=this.picker.selecteds[0],n=this.picker.selecteds[1],i=this.updateAndCheckCalendarDate(e);return i?("range"===this.picker.selectMode?this.picker.selecteds&&this.picker.selecteds.length&&!n&&t&&this.dateTimeAdapter.differenceInCalendarDays(i,t)>=0?(n=i,this.activeSelectedIndex=1):(t=i,n=null,this.activeSelectedIndex=0):"rangeFrom"===this.picker.selectMode?(t=i,n&&this.dateTimeAdapter.compare(t,n)>0&&(n=null)):"rangeTo"===this.picker.selectMode&&(n=i,t&&this.dateTimeAdapter.compare(t,n)>0&&(t=null)),[t,n]):null},e.prototype.updateAndCheckCalendarDate=function(e){var t;return"both"===this.picker.pickerType?(t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(e),this.dateTimeAdapter.getMonth(e),this.dateTimeAdapter.getDate(e),this.dateTimeAdapter.getHours(this.pickerMoment),this.dateTimeAdapter.getMinutes(this.pickerMoment),this.dateTimeAdapter.getSeconds(this.pickerMoment)),t=this.dateTimeAdapter.clampDate(t,this.picker.minDateTime,this.picker.maxDateTime)):t=this.dateTimeAdapter.clone(e),this.picker.dateTimeChecker(t)?t:null},e.prototype.focusPicker=function(){"inline"!==this.picker.pickerMode&&(this.calendar?this.calendar.focusActiveCell():this.timer&&this.timer.focus())},e}();Je.decorators=[{type:t.Component,args:[{exportAs:"owlDateTimeContainer",selector:"owl-date-time-container",template:'<div [cdkTrapFocus]="picker.pickerMode !== \'inline\'"\n [@fadeInPicker]="picker.pickerMode === \'inline\'? \'\' : \'enter\'"\n class="owl-dt-container-inner">\n\n <owl-date-time-calendar\n *ngIf="pickerType === \'both\' || pickerType === \'calendar\'"\n class="owl-dt-container-row"\n [firstDayOfWeek]="picker.firstDayOfWeek"\n [(pickerMoment)]="pickerMoment"\n [selected]="picker.selected"\n [selecteds]="picker.selecteds"\n [selectMode]="picker.selectMode"\n [minDate]="picker.minDateTime"\n [maxDate]="picker.maxDateTime"\n [dateFilter]="picker.dateTimeFilter"\n [startView]="picker.startView"\n [hideOtherMonths]="picker.hideOtherMonths"\n (yearSelected)="picker.selectYear($event)"\n (monthSelected)="picker.selectMonth($event)"\n (selectedChange)="dateSelected($event)"></owl-date-time-calendar>\n\n <owl-date-time-timer\n *ngIf="pickerType === \'both\' || pickerType === \'timer\'"\n class="owl-dt-container-row"\n [pickerMoment]="pickerMoment"\n [minDateTime]="picker.minDateTime"\n [maxDateTime]="picker.maxDateTime"\n [showSecondsTimer]="picker.showSecondsTimer"\n [hour12Timer]="picker.hour12Timer"\n [stepHour]="picker.stepHour"\n [stepMinute]="picker.stepMinute"\n [stepSecond]="picker.stepSecond"\n (selectedChange)="timeSelected($event)"></owl-date-time-timer>\n\n <div *ngIf="picker.isInRangeMode"\n role="radiogroup"\n class="owl-dt-container-info owl-dt-container-row">\n <div role="radio" [tabindex]="activeSelectedIndex === 0 ? 0 : -1"\n [attr.aria-checked]="activeSelectedIndex === 0"\n class="owl-dt-control owl-dt-container-range owl-dt-container-from"\n [ngClass]="{\'owl-dt-container-info-active\': activeSelectedIndex === 0}"\n (click)="handleClickOnInfoGroup($event, 0)"\n (keydown)="handleKeydownOnInfoGroup($event, to, 0)" #from>\n <span class="owl-dt-control-content owl-dt-container-range-content" tabindex="-1">\n <span class="owl-dt-container-info-label">{{fromLabel}}:</span>\n <span class="owl-dt-container-info-value">{{fromFormattedValue}}</span>\n </span>\n </div>\n <div role="radio" [tabindex]="activeSelectedIndex === 1 ? 0 : -1"\n [attr.aria-checked]="activeSelectedIndex === 1"\n class="owl-dt-control owl-dt-container-range owl-dt-container-to"\n [ngClass]="{\'owl-dt-container-info-active\': activeSelectedIndex === 1}"\n (click)="handleClickOnInfoGroup($event, 1)"\n (keydown)="handleKeydownOnInfoGroup($event, from, 1)" #to>\n <span class="owl-dt-control-content owl-dt-container-range-content" tabindex="-1">\n <span class="owl-dt-container-info-label">{{toLabel}}:</span>\n <span class="owl-dt-container-info-value">{{toFormattedValue}}</span>\n </span>\n </div>\n </div>\n\n <div *ngIf="showControlButtons" class="owl-dt-container-buttons owl-dt-container-row">\n <button class="owl-dt-control owl-dt-control-button owl-dt-container-control-button"\n type="button" tabindex="0"\n (click)="onCancelClicked($event)">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n {{cancelLabel}}\n </span>\n </button>\n <button class="owl-dt-control owl-dt-control-button owl-dt-container-control-button"\n type="button" tabindex="0"\n (click)="onSetClicked($event)">\n <span class="owl-dt-control-content owl-dt-control-button-content" tabindex="-1">\n {{setLabel}}\n </span>\n </button>\n </div>\n</div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,animations:[$e.transformPicker,$e.fadeInPicker],host:{"(@transformPicker.done)":"handleContainerAnimationDone($event)","[class.owl-dt-container]":"owlDTContainerClass","[class.owl-dt-popup-container]":"owlDTPopupContainerClass","[class.owl-dt-dialog-container]":"owlDTDialogContainerClass","[class.owl-dt-inline-container]":"owlDTInlineContainerClass","[class.owl-dt-container-disabled]":"owlDTContainerDisabledClass","[attr.id]":"owlDTContainerId","[@transformPicker]":"owlDTContainerAnimation"},styles:[""]}]}],Je.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:Ye},{type:ze,decorators:[{type:t.Optional}]}]},Je.propDecorators={calendar:[{type:t.ViewChild,args:[Ge,{static:!1}]}],timer:[{type:t.ViewChild,args:[Ue,{static:!1}]}]};var Ze=0,Xe=function(){function e(e,t){var n=this;if(this.dateTimeAdapter=e,this.dateTimeFormats=t,this._showSecondsTimer=!1,this._hour12Timer=!1,this.startView="month",this._stepHour=1,this._stepMinute=1,this._stepSecond=1,this._firstDayOfWeek=0,this._hideOtherMonths=!1,this.dateTimeChecker=function(e){return!!e&&(!n.dateTimeFilter||n.dateTimeFilter(e))&&(!n.minDateTime||n.dateTimeAdapter.compare(e,n.minDateTime)>=0)&&(!n.maxDateTime||n.dateTimeAdapter.compare(e,n.maxDateTime)<=0)},!this.dateTimeAdapter)throw Error("OwlDateTimePicker: No provider found for DateTimeAdapter. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");if(!this.dateTimeFormats)throw Error("OwlDateTimePicker: No provider found for OWL_DATE_TIME_FORMATS. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");this._id="owl-dt-picker-"+Ze++}return Object.defineProperty(e.prototype,"showSecondsTimer",{get:function(){return this._showSecondsTimer},set:function(e){this._showSecondsTimer=y.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hour12Timer",{get:function(){return this._hour12Timer},set:function(e){this._hour12Timer=y.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stepHour",{get:function(){return this._stepHour},set:function(e){this._stepHour=y.coerceNumberProperty(e,1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stepMinute",{get:function(){return this._stepMinute},set:function(e){this._stepMinute=y.coerceNumberProperty(e,1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stepSecond",{get:function(){return this._stepSecond},set:function(e){this._stepSecond=y.coerceNumberProperty(e,1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstDayOfWeek",{get:function(){return this._firstDayOfWeek},set:function(e){e=y.coerceNumberProperty(e,0),this._firstDayOfWeek=e>6||e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hideOtherMonths",{get:function(){return this._hideOtherMonths},set:function(e){this._hideOtherMonths=y.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formatString",{get:function(){return"both"===this.pickerType?this.dateTimeFormats.fullPickerInput:"calendar"===this.pickerType?this.dateTimeFormats.datePickerInput:this.dateTimeFormats.timePickerInput},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e}();Xe.decorators=[{type:t.Injectable}],Xe.ctorParameters=function(){return[{type:ze,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[We]}]}]},Xe.propDecorators={showSecondsTimer:[{type:t.Input}],hour12Timer:[{type:t.Input}],stepHour:[{type:t.Input}],stepMinute:[{type:t.Input}],stepSecond:[{type:t.Input}],firstDayOfWeek:[{type:t.Input}],hideOtherMonths:[{type:t.Input}],startView:[{type:t.Input}]};var Ke=0,et=function(){this.ariaDescribedBy=null,this.autoFocus=!0,this.hasBackdrop=!0,this.data=null,this.disableClose=!1,this.role="dialog",this.paneClass="",this.event=null,this.backdropClass="",this.closeOnNavigation=!0,this.width="",this.height="",this.maxWidth="85vw",this.scrollStrategy=new h.NoopScrollStrategy,this.id="owl-dialog-"+Ke++},tt=function(){function e(e,t,n,i){var o=this;this.overlayRef=e,this.container=t,this.id=n,this._beforeClose$=new r.Subject,this._afterOpen$=new r.Subject,this._afterClosed$=new r.Subject,this.locationChanged=r.Subscription.EMPTY,this.disableClose=this.container.config.disableClose,this.container.animationStateChanged.pipe(g.filter((function(e){return"done"===e.phaseName&&"enter"===e.toState})),g.take(1)).subscribe((function(){o._afterOpen$.next(),o._afterOpen$.complete()})),this.container.animationStateChanged.pipe(g.filter((function(e){return"done"===e.phaseName&&"exit"===e.toState})),g.take(1)).subscribe((function(){o.overlayRef.dispose(),o.locationChanged.unsubscribe(),o._afterClosed$.next(o.result),o._afterClosed$.complete(),o.componentInstance=null})),this.overlayRef.keydownEvents().pipe(g.filter((function(e){return e.keyCode===m.ESCAPE&&!o.disableClose}))).subscribe((function(){return o.close()})),i&&(this.locationChanged=i.subscribe((function(){o.container.config.closeOnNavigation&&o.close()})))}return e.prototype.close=function(e){var t=this;this.result=e,this.container.animationStateChanged.pipe(g.filter((function(e){return"start"===e.phaseName})),g.take(1)).subscribe((function(){t._beforeClose$.next(e),t._beforeClose$.complete(),t.overlayRef.detachBackdrop()})),this.container.startExitAnimation()},e.prototype.backdropClick=function(){return this.overlayRef.backdropClick()},e.prototype.keydownEvents=function(){return this.overlayRef.keydownEvents()},e.prototype.updatePosition=function(e){var t=this.getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this.overlayRef.updatePosition(),this},e.prototype.updateSize=function(e,t){return void 0===e&&(e="auto"),void 0===t&&(t="auto"),this.getPositionStrategy().width(e).height(t),this.overlayRef.updatePosition(),this},e.prototype.isAnimating=function(){return this.container.isAnimating},e.prototype.afterOpen=function(){return this._afterOpen$.asObservable()},e.prototype.beforeClose=function(){return this._beforeClose$.asObservable()},e.prototype.afterClosed=function(){return this._afterClosed$.asObservable()},e.prototype.getPositionStrategy=function(){return this.overlayRef.getConfig().positionStrategy},e}(),nt=function(e){function n(n,i,r,o){var a=e.call(this)||this;return a.changeDetector=n,a.elementRef=i,a.focusTrapFactory=r,a.document=o,a.ariaLabelledBy=null,a.animationStateChanged=new t.EventEmitter,a.isAnimating=!1,a.state="enter",a.params={x:"0px",y:"0px",ox:"50%",oy:"50%",scale:0},a.elementFocusedBeforeDialogWasOpened=null,a}return _(n,e),Object.defineProperty(n.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerTabIndex",{get:function(){return-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerId",{get:function(){return this._config.id},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerRole",{get:function(){return this._config.role||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerAriaLabelledby",{get:function(){return this.ariaLabelledBy},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerAriaDescribedby",{get:function(){return this._config.ariaDescribedBy||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDialogContainerAnimation",{get:function(){return{value:this.state,params:this.params}},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){},n.prototype.attachComponentPortal=function(e){if(this.portalOutlet.hasAttached())throw Error("Attempting to attach dialog content after content is already attached");return this.savePreviouslyFocusedElement(),this.portalOutlet.attachComponentPortal(e)},n.prototype.attachTemplatePortal=function(e){throw new Error("Method not implemented.")},n.prototype.setConfig=function(e){this._config=e,e.event&&this.calculateZoomOrigin(event)},n.prototype.onAnimationStart=function(e){this.isAnimating=!0,this.animationStateChanged.emit(e)},n.prototype.onAnimationDone=function(e){"enter"===e.toState?this.trapFocus():"exit"===e.toState&&this.restoreFocus(),this.animationStateChanged.emit(e),this.isAnimating=!1},n.prototype.startExitAnimation=function(){this.state="exit",this.changeDetector.markForCheck()},n.prototype.calculateZoomOrigin=function(e){if(e){var t=e.clientX,n=e.clientY,i=t-window.innerWidth/2,r=n-window.innerHeight/2,o=t/window.innerWidth,a=n/window.innerHeight;this.params.x=i+"px",this.params.y=r+"px",this.params.ox=100*o+"%",this.params.oy=100*a+"%",this.params.scale=0}},n.prototype.savePreviouslyFocusedElement=function(){var e=this;this.document&&(this.elementFocusedBeforeDialogWasOpened=this.document.activeElement,Promise.resolve().then((function(){return e.elementRef.nativeElement.focus()})))},n.prototype.trapFocus=function(){this.focusTrap||(this.focusTrap=this.focusTrapFactory.create(this.elementRef.nativeElement)),this._config.autoFocus&&this.focusTrap.focusInitialElementWhenReady()},n.prototype.restoreFocus=function(){var e=this.elementFocusedBeforeDialogWasOpened;e&&"function"==typeof e.focus&&e.focus(),this.focusTrap&&this.focusTrap.destroy()},n}(f.BasePortalOutlet);nt.decorators=[{type:t.Component,args:[{selector:"owl-dialog-container",template:"<ng-template cdkPortalOutlet></ng-template>\n",animations:[s.trigger("slideModal",[s.transition("void => enter",[s.style({opacity:0,transform:"translateX({{ x }}) translateY({{ y }}) scale({{scale}})",transformOrigin:"{{ ox }} {{ oy }}"}),s.animate("300ms cubic-bezier(0.35, 0, 0.25, 1)",s.style("*")),s.animate("150ms",s.keyframes([s.style({transform:"scale(1)",offset:0}),s.style({transform:"scale(1.05)",offset:.3}),s.style({transform:"scale(.95)",offset:.8}),s.style({transform:"scale(1)",offset:1})])),s.animateChild()],{params:{x:"0px",y:"0px",ox:"50%",oy:"50%",scale:1}}),s.transition("enter => exit",[s.animateChild(),s.animate(200,s.style({opacity:0,transform:"translateX({{ x }}) translateY({{ y }}) scale({{scale}})"}))],{params:{x:"0px",y:"0px",ox:"50%",oy:"50%"}})])],host:{"(@slideModal.start)":"onAnimationStart($event)","(@slideModal.done)":"onAnimationDone($event)","[class.owl-dialog-container]":"owlDialogContainerClass","[attr.tabindex]":"owlDialogContainerTabIndex","[attr.id]":"owlDialogContainerId","[attr.role]":"owlDialogContainerRole","[attr.aria-labelledby]":"owlDialogContainerAriaLabelledby","[attr.aria-describedby]":"owlDialogContainerAriaDescribedby","[@slideModal]":"owlDialogContainerAnimation"}}]}],nt.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:p.FocusTrapFactory},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[n.DOCUMENT]}]}]},nt.propDecorators={portalOutlet:[{type:t.ViewChild,args:[f.CdkPortalOutlet,{static:!0}]}]};var it=new t.InjectionToken("OwlDialogData"),rt=new t.InjectionToken("owl-dialog-scroll-strategy");function ot(e){return function(){return e.scrollStrategies.block()}}var at={provide:rt,deps:[h.Overlay],useFactory:ot},st=new t.InjectionToken("owl-dialog-default-options"),lt=function(){function e(e,t,n,i,o,a,s){var l=this;this.overlay=e,this.injector=t,this.location=n,this.defaultOptions=o,this.parentDialog=a,this.overlayContainer=s,this.ariaHiddenElements=new Map,this._openDialogsAtThisLevel=[],this._afterOpenAtThisLevel=new r.Subject,this._afterAllClosedAtThisLevel=new r.Subject,this.afterAllClosed=r.defer((function(){return l._openDialogsAtThisLevel.length?l._afterAllClosed:l._afterAllClosed.pipe(g.startWith(void 0))})),this.scrollStrategy=i,!a&&n&&n.subscribe((function(){return l.closeAll()}))}return Object.defineProperty(e.prototype,"openDialogs",{get:function(){return this.parentDialog?this.parentDialog.openDialogs:this._openDialogsAtThisLevel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"afterOpen",{get:function(){return this.parentDialog?this.parentDialog.afterOpen:this._afterOpenAtThisLevel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_afterAllClosed",{get:function(){var e=this.parentDialog;return e?e._afterAllClosed:this._afterAllClosedAtThisLevel},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){var n=this;if(t=function(e,t){return function(e){for(var t,n,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(null==e)throw TypeError("Cannot convert undefined or null to object");try{for(var o=P(i),a=o.next();!a.done;a=o.next()){var s=a.value;if(null!=s)for(var l in s)s.hasOwnProperty(l)&&(e[l]=s[l])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e}(new et,e,t)}(t,this.defaultOptions),t.id&&this.getDialogById(t.id))throw Error('Dialog with id "'+t.id+'" exists already. The dialog id must be unique.');var i=this.createOverlay(t),r=this.attachDialogContainer(i,t),o=this.attachDialogContent(e,r,i,t);return this.openDialogs.length||this.hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe((function(){return n.removeOpenDialog(o)})),this.afterOpen.next(o),o},e.prototype.closeAll=function(){for(var e=this.openDialogs.length;e--;)this.openDialogs[e].close()},e.prototype.getDialogById=function(e){return this.openDialogs.find((function(t){return t.id===e}))},e.prototype.attachDialogContent=function(e,n,i,r){var o=new tt(i,n,r.id,this.location);if(r.hasBackdrop&&i.backdropClick().subscribe((function(){o.disableClose||o.close()})),e instanceof t.TemplateRef);else{var a=this.createInjector(r,o,n),s=n.attachComponentPortal(new f.ComponentPortal(e,void 0,a));o.componentInstance=s.instance}return o.updateSize(r.width,r.height).updatePosition(r.position),o},e.prototype.createInjector=function(e,t,n){var i=e&&e.viewContainerRef&&e.viewContainerRef.injector,r=new WeakMap;return r.set(tt,t),r.set(nt,n),r.set(it,e.data),new f.PortalInjector(i||this.injector,r)},e.prototype.createOverlay=function(e){var t=this.getOverlayConfig(e);return this.overlay.create(t)},e.prototype.attachDialogContainer=function(e,t){var n=new f.ComponentPortal(nt,t.viewContainerRef),i=e.attach(n);return i.instance.setConfig(t),i.instance},e.prototype.getOverlayConfig=function(e){var t=new h.OverlayConfig({positionStrategy:this.overlay.position().global(),scrollStrategy:e.scrollStrategy||this.scrollStrategy(),panelClass:e.paneClass,hasBackdrop:e.hasBackdrop,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight});return e.backdropClass&&(t.backdropClass=e.backdropClass),t},e.prototype.removeOpenDialog=function(e){var t=this._openDialogsAtThisLevel.indexOf(e);t>-1&&(this.openDialogs.splice(t,1),this.openDialogs.length||(this.ariaHiddenElements.forEach((function(e,t){e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")})),this.ariaHiddenElements.clear(),this._afterAllClosed.next()))},e.prototype.hideNonDialogContentFromAssistiveTechnology=function(){var e=this.overlayContainer.getContainerElement();if(e.parentElement)for(var t=e.parentElement.children,n=t.length-1;n>-1;n--){var i=t[n];i===e||"SCRIPT"===i.nodeName||"STYLE"===i.nodeName||i.hasAttribute("aria-live")||(this.ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}},e}();lt.decorators=[{type:t.Injectable}],lt.ctorParameters=function(){return[{type:h.Overlay},{type:t.Injector},{type:n.Location,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Inject,args:[rt]}]},{type:et,decorators:[{type:t.Optional},{type:t.Inject,args:[st]}]},{type:lt,decorators:[{type:t.Optional},{type:t.SkipSelf}]},{type:h.OverlayContainer}]};var ct=new t.InjectionToken("owl-dtpicker-scroll-strategy");function ut(e){return function(){return e.scrollStrategies.block()}}var dt={provide:ct,deps:[h.Overlay],useFactory:ut},pt=function(e){function n(n,i,o,a,s,l,c,u,d){var p=e.call(this,l,u)||this;return p.overlay=n,p.viewContainerRef=i,p.dialogService=o,p.ngZone=a,p.changeDetector=s,p.dateTimeAdapter=l,p.dateTimeFormats=u,p.document=d,p.backdropClass=[],p.panelClass=[],p._pickerType="both",p._pickerMode="popup",p._opened=!1,p.afterPickerClosed=new t.EventEmitter,p.afterPickerOpen=new t.EventEmitter,p.yearSelected=new t.EventEmitter,p.monthSelected=new t.EventEmitter,p.confirmSelectedChange=new t.EventEmitter,p.disabledChange=new t.EventEmitter,p.dtInputSub=r.Subscription.EMPTY,p.hidePickerStreamSub=r.Subscription.EMPTY,p.confirmSelectedStreamSub=r.Subscription.EMPTY,p.pickerOpenedStreamSub=r.Subscription.EMPTY,p.focusedElementBeforeOpen=null,p._selecteds=[],p.defaultScrollStrategy=c,p}return _(n,e),Object.defineProperty(n.prototype,"startAt",{get:function(){return this._startAt?this._startAt:this._dtInput?"single"===this._dtInput.selectMode?this._dtInput.value||null:"range"===this._dtInput.selectMode||"rangeFrom"===this._dtInput.selectMode?this._dtInput.values[0]||null:"rangeTo"===this._dtInput.selectMode?this._dtInput.values[1]||null:void 0:null},set:function(e){this._startAt=this.getValidDate(this.dateTimeAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pickerType",{get:function(){return this._pickerType},set:function(e){e!==this._pickerType&&(this._pickerType=e,this._dtInput&&this._dtInput.formatNativeInputValue())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pickerMode",{get:function(){return this._pickerMode},set:function(e){this._pickerMode="popup"===e?e:"dialog"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return void 0===this._disabled&&this._dtInput?this._dtInput.disabled:!!this._disabled},set:function(e){(e=y.coerceBooleanProperty(e))!==this._disabled&&(this._disabled=e,this.disabledChange.next(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opened",{get:function(){return this._opened},set:function(e){e?this.open():this.close()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dtInput",{get:function(){return this._dtInput},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){this._selecteds=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"minDateTime",{get:function(){return this._dtInput&&this._dtInput.min},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"maxDateTime",{get:function(){return this._dtInput&&this._dtInput.max},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dateTimeFilter",{get:function(){return this._dtInput&&this._dtInput.dateTimeFilter},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectMode",{get:function(){return this._dtInput.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInSingleMode",{get:function(){return this._dtInput.isInSingleMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInRangeMode",{get:function(){return this._dtInput.isInRangeMode},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){},n.prototype.ngOnDestroy=function(){this.close(),this.dtInputSub.unsubscribe(),this.disabledChange.complete(),this.popupRef&&this.popupRef.dispose()},n.prototype.registerInput=function(e){var t=this;if(this._dtInput)throw Error("A Owl DateTimePicker can only be associated with a single input.");this._dtInput=e,this.dtInputSub=this._dtInput.valueChange.subscribe((function(e){Array.isArray(e)?t.selecteds=e:t.selected=e}))},n.prototype.open=function(){var e=this;if(!this._opened&&!this.disabled){if(!this._dtInput)throw Error("Attempted to open an DateTimePicker with no associated input.");this.document&&(this.focusedElementBeforeOpen=this.document.activeElement),this.isInSingleMode?this.selected=this._dtInput.value:this.isInRangeMode&&(this.selecteds=this._dtInput.values),this.selected&&"calendar"!==this.pickerType&&this._startAt&&(this.selected=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.selected),this.dateTimeAdapter.getMonth(this.selected),this.dateTimeAdapter.getDate(this.selected),this.dateTimeAdapter.getHours(this._startAt),this.dateTimeAdapter.getMinutes(this._startAt),this.dateTimeAdapter.getSeconds(this._startAt))),"dialog"===this.pickerMode?this.openAsDialog():this.openAsPopup(),this.pickerContainer.picker=this,this.hidePickerStreamSub=this.pickerContainer.hidePickerStream.subscribe((function(){e.close()})),this.confirmSelectedStreamSub=this.pickerContainer.confirmSelectedStream.subscribe((function(t){e.confirmSelect(t)}))}},n.prototype.select=function(e){Array.isArray(e)?this.selecteds=V(e):this.selected=e,"dialog"!==this.pickerMode&&"calendar"===this.pickerType&&("single"===this.selectMode&&this.selected||"rangeFrom"===this.selectMode&&this.selecteds[0]||"rangeTo"===this.selectMode&&this.selecteds[1]||"range"===this.selectMode&&this.selecteds[0]&&this.selecteds[1])&&this.confirmSelect()},n.prototype.selectYear=function(e){this.yearSelected.emit(e)},n.prototype.selectMonth=function(e){this.monthSelected.emit(e)},n.prototype.close=function(){var e=this;if(this._opened){this.popupRef&&this.popupRef.hasAttached()&&this.popupRef.detach(),this.pickerContainerPortal&&this.pickerContainerPortal.isAttached&&this.pickerContainerPortal.detach(),this.hidePickerStreamSub&&(this.hidePickerStreamSub.unsubscribe(),this.hidePickerStreamSub=null),this.confirmSelectedStreamSub&&(this.confirmSelectedStreamSub.unsubscribe(),this.confirmSelectedStreamSub=null),this.pickerOpenedStreamSub&&(this.pickerOpenedStreamSub.unsubscribe(),this.pickerOpenedStreamSub=null),this.dialogRef&&(this.dialogRef.close(),this.dialogRef=null);var t=function(){e._opened&&(e._opened=!1,e.afterPickerClosed.emit(null),e.focusedElementBeforeOpen=null)};this.focusedElementBeforeOpen&&"function"==typeof this.focusedElementBeforeOpen.focus?(this.focusedElementBeforeOpen.focus(),setTimeout(t)):t()}},n.prototype.confirmSelect=function(e){if(this.isInSingleMode){var t=this.selected||this.startAt||this.dateTimeAdapter.now();this.confirmSelectedChange.emit(t)}else this.isInRangeMode&&this.confirmSelectedChange.emit(this.selecteds);this.close()},n.prototype.openAsDialog=function(){var e=this;this.dialogRef=this.dialogService.open(Je,{autoFocus:!1,backdropClass:V(["cdk-overlay-dark-backdrop"],y.coerceArray(this.backdropClass)),paneClass:V(["owl-dt-dialog"],y.coerceArray(this.panelClass)),viewContainerRef:this.viewContainerRef,scrollStrategy:this.scrollStrategy||this.defaultScrollStrategy(),closeOnNavigation:!0,width:"",height:""}),this.pickerContainer=this.dialogRef.componentInstance,this.dialogRef.afterOpen().subscribe((function(){e.afterPickerOpen.emit(null),e._opened=!0})),this.dialogRef.afterClosed().subscribe((function(){return e.close()}))},n.prototype.openAsPopup=function(){var e=this;if(this.pickerContainerPortal||(this.pickerContainerPortal=new f.ComponentPortal(Je,this.viewContainerRef)),this.popupRef||this.createPopup(),!this.popupRef.hasAttached()){var t=this.popupRef.attach(this.pickerContainerPortal);this.pickerContainer=t.instance,this.ngZone.onStable.asObservable().pipe(g.take(1)).subscribe((function(){e.popupRef.updatePosition()})),this.pickerOpenedStreamSub=this.pickerContainer.pickerOpenedStream.pipe(g.take(1)).subscribe((function(){e.afterPickerOpen.emit(null),e._opened=!0}))}},n.prototype.createPopup=function(){var e=this,t=new h.OverlayConfig({positionStrategy:this.createPopupPositionStrategy(),hasBackdrop:!0,backdropClass:V(["cdk-overlay-transparent-backdrop"],y.coerceArray(this.backdropClass)),scrollStrategy:this.scrollStrategy||this.defaultScrollStrategy(),panelClass:V(["owl-dt-popup"],y.coerceArray(this.panelClass))});this.popupRef=this.overlay.create(t),r.merge(this.popupRef.backdropClick(),this.popupRef.detachments(),this.popupRef.keydownEvents().pipe(g.filter((function(t){return t.keyCode===m.ESCAPE||e._dtInput&&t.altKey&&t.keyCode===m.UP_ARROW})))).subscribe((function(){return e.close()}))},n.prototype.createPopupPositionStrategy=function(){return this.overlay.position().flexibleConnectedTo(this._dtInput.elementRef).withTransformOriginOn(".owl-dt-container").withFlexibleDimensions(!1).withPush(!1).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"start",overlayY:"top",offsetY:-176},{originX:"start",originY:"top",overlayX:"start",overlayY:"top",offsetY:-352}])},n}(Xe);pt.decorators=[{type:t.Component,args:[{selector:"owl-date-time",exportAs:"owlDateTime",template:"",changeDetection:t.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,styles:[""]}]}],pt.ctorParameters=function(){return[{type:h.Overlay},{type:t.ViewContainerRef},{type:lt},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:ze,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Inject,args:[ct]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[We]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[n.DOCUMENT]}]}]},pt.propDecorators={backdropClass:[{type:t.Input}],panelClass:[{type:t.Input}],startAt:[{type:t.Input}],pickerType:[{type:t.Input}],pickerMode:[{type:t.Input}],disabled:[{type:t.Input}],opened:[{type:t.Input}],scrollStrategy:[{type:t.Input}],afterPickerClosed:[{type:t.Output}],afterPickerOpen:[{type:t.Output}],yearSelected:[{type:t.Output}],monthSelected:[{type:t.Output}]};var ht={provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return mt})),multi:!0},ft={provide:i.NG_VALIDATORS,useExisting:t.forwardRef((function(){return mt})),multi:!0},mt=function(){function e(e,n,o,a){var s=this;if(this.elmRef=e,this.renderer=n,this.dateTimeAdapter=o,this.dateTimeFormats=a,this._selectMode="single",this.rangeSeparator="~",this._values=[],this.dateTimeChange=new t.EventEmitter,this.dateTimeInput=new t.EventEmitter,this.dtPickerSub=r.Subscription.EMPTY,this.localeSub=r.Subscription.EMPTY,this.lastValueValid=!0,this.parseValidator=function(){return s.lastValueValid?null:{owlDateTimeParse:{text:s.elmRef.nativeElement.value}}},this.minValidator=function(e){if(s.isInSingleMode){var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value));return!s.min||!t||s.dateTimeAdapter.compare(s.min,t)<=0?null:{owlDateTimeMin:{min:s.min,actual:t}}}if(s.isInRangeMode&&e.value){var n=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[0])),i=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[1]));return!s.min||!n||!i||s.dateTimeAdapter.compare(s.min,n)<=0?null:{owlDateTimeMin:{min:s.min,actual:[n,i]}}}},this.maxValidator=function(e){if(s.isInSingleMode){var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value));return!s.max||!t||s.dateTimeAdapter.compare(s.max,t)>=0?null:{owlDateTimeMax:{max:s.max,actual:t}}}if(s.isInRangeMode&&e.value){var n=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[0])),i=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[1]));return!s.max||!n||!i||s.dateTimeAdapter.compare(s.max,i)>=0?null:{owlDateTimeMax:{max:s.max,actual:[n,i]}}}},this.filterValidator=function(e){var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value));return s._dateTimeFilter&&t&&!s._dateTimeFilter(t)?{owlDateTimeFilter:!0}:null},this.rangeValidator=function(e){if(s.isInSingleMode||!e.value)return null;var t=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[0])),n=s.getValidDate(s.dateTimeAdapter.deserialize(e.value[1]));return!t||!n||s.dateTimeAdapter.compare(t,n)<=0?null:{owlDateTimeRange:!0}},this.validator=i.Validators.compose([this.parseValidator,this.minValidator,this.maxValidator,this.filterValidator,this.rangeValidator]),this.valueChange=new t.EventEmitter,this.disabledChange=new t.EventEmitter,this.onModelChange=function(){},this.onModelTouched=function(){},this.validatorOnChange=function(){},!this.dateTimeAdapter)throw Error("OwlDateTimePicker: No provider found for DateTimePicker. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");if(!this.dateTimeFormats)throw Error("OwlDateTimePicker: No provider found for OWL_DATE_TIME_FORMATS. You must import one of the following modules at your application root: OwlNativeDateTimeModule, OwlMomentDateTimeModule, or provide a custom implementation.");this.localeSub=this.dateTimeAdapter.localeChanges.subscribe((function(){s.value=s.value}))}return Object.defineProperty(e.prototype,"owlDateTime",{set:function(e){this.registerDateTimePicker(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeFilter",{set:function(e){this._dateTimeFilter=e,this.validatorOnChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateTimeFilter",{get:function(){return this._dateTimeFilter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return!!this._disabled},set:function(e){var t=y.coerceBooleanProperty(e),n=this.elmRef.nativeElement;this._disabled!==t&&(this._disabled=t,this.disabledChange.emit(t)),t&&n.blur&&n.blur()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this._min},set:function(e){this._min=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.validatorOnChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},set:function(e){this._max=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.validatorOnChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){if("single"!==e&&"range"!==e&&"rangeFrom"!==e&&"rangeTo"!==e)throw Error("OwlDateTime Error: invalid selectMode value!");this._selectMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){e=this.dateTimeAdapter.deserialize(e),this.lastValueValid=!e||this.dateTimeAdapter.isValid(e),e=this.getValidDate(e);var t=this._value;this._value=e,this.value,this.dtPicker&&this.formatNativeInputValue(),this.dateTimeAdapter.isEqual(t,e)||this.valueChange.emit(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._values},set:function(e){var t=this;e&&e.length>0?(this._values=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)})),this.lastValueValid=(!this._values[0]||this.dateTimeAdapter.isValid(this._values[0]))&&(!this._values[1]||this.dateTimeAdapter.isValid(this._values[1]))):(this._values=[],this.lastValueValid=!0),this.formatNativeInputValue(),this.valueChange.emit(this._values)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elementRef",{get:function(){return this.elmRef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this._selectMode||"rangeFrom"===this._selectMode||"rangeTo"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeInputAriaHaspopup",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeInputAriaOwns",{get:function(){return this.dtPicker.opened&&this.dtPicker.id||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minIso8601",{get:function(){return this.min?this.dateTimeAdapter.toIso8601(this.min):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxIso8601",{get:function(){return this.max?this.dateTimeAdapter.toIso8601(this.max):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDateTimeInputDisabled",{get:function(){return this.disabled},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){if(!this.dtPicker)throw Error("OwlDateTimePicker: the picker input doesn't have any associated owl-date-time component");this.formatNativeInputValue()},e.prototype.ngAfterContentInit=function(){var e=this;this.dtPickerSub=this.dtPicker.confirmSelectedChange.subscribe((function(t){Array.isArray(t)?e.values=t:e.value=t,e.onModelChange(t),e.onModelTouched(),e.dateTimeChange.emit({source:e,value:t,input:e.elmRef.nativeElement}),e.dateTimeInput.emit({source:e,value:t,input:e.elmRef.nativeElement})}))},e.prototype.ngOnDestroy=function(){this.dtPickerSub.unsubscribe(),this.localeSub.unsubscribe(),this.valueChange.complete(),this.disabledChange.complete()},e.prototype.writeValue=function(e){this.isInSingleMode?this.value=e:this.values=e},e.prototype.registerOnChange=function(e){this.onModelChange=e},e.prototype.registerOnTouched=function(e){this.onModelTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.validate=function(e){return this.validator?this.validator(e):null},e.prototype.registerOnValidatorChange=function(e){this.validatorOnChange=e},e.prototype.handleKeydownOnHost=function(e){e.altKey&&e.keyCode===m.DOWN_ARROW&&(this.dtPicker.open(),e.preventDefault())},e.prototype.handleBlurOnHost=function(e){this.onModelTouched()},e.prototype.handleInputOnHost=function(e){var t=e.target.value;"single"===this._selectMode?this.changeInputInSingleMode(t):"range"===this._selectMode?this.changeInputInRangeMode(t):this.changeInputInRangeFromToMode(t)},e.prototype.handleChangeOnHost=function(e){var t;this.isInSingleMode?t=this.value:this.isInRangeMode&&(t=this.values),this.dateTimeChange.emit({source:this,value:t,input:this.elmRef.nativeElement})},e.prototype.formatNativeInputValue=function(){if(this.isInSingleMode)this.renderer.setProperty(this.elmRef.nativeElement,"value",this._value?this.dateTimeAdapter.format(this._value,this.dtPicker.formatString):"");else if(this.isInRangeMode)if(this._values&&this.values.length>0){var e=this._values[0],t=this._values[1],n=e?this.dateTimeAdapter.format(e,this.dtPicker.formatString):"",i=t?this.dateTimeAdapter.format(t,this.dtPicker.formatString):"";n||i?"range"===this._selectMode?this.renderer.setProperty(this.elmRef.nativeElement,"value",n+" "+this.rangeSeparator+" "+i):"rangeFrom"===this._selectMode?this.renderer.setProperty(this.elmRef.nativeElement,"value",n):"rangeTo"===this._selectMode&&this.renderer.setProperty(this.elmRef.nativeElement,"value",i):this.renderer.setProperty(this.elmRef.nativeElement,"value",null)}else this.renderer.setProperty(this.elmRef.nativeElement,"value","")},e.prototype.registerDateTimePicker=function(e){e&&(this.dtPicker=e,this.dtPicker.registerInput(this))},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.convertTimeStringToDateTimeString=function(e,t){if(e){var n=t||this.dateTimeAdapter.now();return this.dateTimeAdapter.format(n,this.dateTimeFormats.datePickerInput)+" "+e}return null},e.prototype.changeInputInSingleMode=function(e){var t=e;"timer"===this.dtPicker.pickerType&&(t=this.convertTimeStringToDateTimeString(t,this.value));var n=this.dateTimeAdapter.parse(t,this.dateTimeFormats.parseInput);this.lastValueValid=!n||this.dateTimeAdapter.isValid(n),n=this.getValidDate(n),this.isSameValue(n,this._value)&&null!==n||(this._value=n,this.valueChange.emit(n),this.onModelChange(n),this.dateTimeInput.emit({source:this,value:n,input:this.elmRef.nativeElement}))},e.prototype.changeInputInRangeFromToMode=function(e){var t="rangeFrom"===this._selectMode?this._values[0]:this._values[1];"timer"===this.dtPicker.pickerType&&(e=this.convertTimeStringToDateTimeString(e,t));var n=this.dateTimeAdapter.parse(e,this.dateTimeFormats.parseInput);this.lastValueValid=!n||this.dateTimeAdapter.isValid(n),n=this.getValidDate(n),"rangeFrom"===this._selectMode&&this.isSameValue(n,this._values[0])&&n||"rangeTo"===this._selectMode&&this.isSameValue(n,this._values[1])&&n||(this._values="rangeFrom"===this._selectMode?[n,this._values[1]]:[this._values[0],n],this.valueChange.emit(this._values),this.onModelChange(this._values),this.dateTimeInput.emit({source:this,value:this._values,input:this.elmRef.nativeElement}))},e.prototype.changeInputInRangeMode=function(e){var t=e.split(this.rangeSeparator),n=t[0],i=t[1];"timer"===this.dtPicker.pickerType&&(n=this.convertTimeStringToDateTimeString(n,this.values[0]),i=this.convertTimeStringToDateTimeString(i,this.values[1]));var r=this.dateTimeAdapter.parse(n,this.dateTimeFormats.parseInput),o=this.dateTimeAdapter.parse(i,this.dateTimeFormats.parseInput);this.lastValueValid=(!r||this.dateTimeAdapter.isValid(r))&&(!o||this.dateTimeAdapter.isValid(o)),r=this.getValidDate(r),o=this.getValidDate(o),this.isSameValue(r,this._values[0])&&this.isSameValue(o,this._values[1])&&(null!==r||null!==o)||(this._values=[r,o],this.valueChange.emit(this._values),this.onModelChange(this._values),this.dateTimeInput.emit({source:this,value:this._values,input:this.elmRef.nativeElement}))},e.prototype.isSameValue=function(e,t){return e&&t?0===this.dateTimeAdapter.compare(e,t):e===t},e}();mt.decorators=[{type:t.Directive,args:[{selector:"input[owlDateTime]",exportAs:"owlDateTimeInput",host:{"(keydown)":"handleKeydownOnHost($event)","(blur)":"handleBlurOnHost($event)","(input)":"handleInputOnHost($event)","(change)":"handleChangeOnHost($event)","[attr.aria-haspopup]":"owlDateTimeInputAriaHaspopup","[attr.aria-owns]":"owlDateTimeInputAriaOwns","[attr.min]":"minIso8601","[attr.max]":"maxIso8601","[disabled]":"owlDateTimeInputDisabled"},providers:[ht,ft]}]}],mt.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:ze,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[We]}]}]},mt.propDecorators={owlDateTime:[{type:t.Input}],owlDateTimeFilter:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],selectMode:[{type:t.Input}],value:[{type:t.Input}],values:[{type:t.Input}],_disabled:[{type:t.Input}],rangeSeparator:[{type:t.Input}],dateTimeChange:[{type:t.Output}],dateTimeInput:[{type:t.Output}]};var yt=function(e,t,n,i,r,o){void 0===r&&(r=!1),void 0===o&&(o=""),this.value=e,this.displayValue=t,this.ariaLabel=n,this.enabled=i,this.out=r,this.cellClass=o},gt=function(){function e(e,n){this.elmRef=e,this.ngZone=n,this.activeCell=0,this.numCols=7,this.cellRatio=1,this.select=new t.EventEmitter}return Object.defineProperty(e.prototype,"owlDTCalendarBodyClass",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.selectCell=function(e){this.select.emit(e)},e.prototype.isActiveCell=function(e,t){return e*this.numCols+t===this.activeCell},e.prototype.isSelected=function(e){if(!this.selectedValues||0===this.selectedValues.length)return!1;if(this.isInSingleMode)return e===this.selectedValues[0];if(this.isInRangeMode){var t=this.selectedValues[0],n=this.selectedValues[1];return e===t||e===n}},e.prototype.isInRange=function(e){if(this.isInRangeMode){var t=this.selectedValues[0],n=this.selectedValues[1];return null!==t&&null!==n?e>=t&&e<=n:e===t||e===n}},e.prototype.isRangeFrom=function(e){if(this.isInRangeMode){var t=this.selectedValues[0];return null!==t&&e===t}},e.prototype.isRangeTo=function(e){if(this.isInRangeMode){var t=this.selectedValues[1];return null!==t&&e===t}},e.prototype.focusActiveCell=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.ngZone.onStable.asObservable().pipe(g.take(1)).subscribe((function(){e.elmRef.nativeElement.querySelector(".owl-dt-calendar-cell-active").focus()}))}))},e}();gt.decorators=[{type:t.Component,args:[{selector:"[owl-date-time-calendar-body]",exportAs:"owlDateTimeCalendarBody",template:'<tr *ngFor="let row of rows; let rowIndex = index" role="row">\n <td *ngFor="let item of row; let colIndex = index"\n class="owl-dt-calendar-cell {{item.cellClass}}"\n [tabindex]="isActiveCell(rowIndex, colIndex) ? 0 : -1"\n [class.owl-dt-calendar-cell-active]="isActiveCell(rowIndex, colIndex)"\n [class.owl-dt-calendar-cell-disabled]="!item.enabled"\n [class.owl-dt-calendar-cell-in-range]="isInRange(item.value)"\n [class.owl-dt-calendar-cell-range-from]="isRangeFrom(item.value)"\n [class.owl-dt-calendar-cell-range-to]="isRangeTo(item.value)"\n [attr.aria-label]="item.ariaLabel"\n [attr.aria-disabled]="!item.enabled || null"\n [style.width.%]="100 / numCols"\n [style.paddingTop.%]="50 * cellRatio / numCols"\n [style.paddingBottom.%]="50 * cellRatio / numCols"\n (click)="selectCell(item)">\n <span class="owl-dt-calendar-cell-content"\n [ngClass]="{\n \'owl-dt-calendar-cell-out\': item.out,\n \'owl-dt-calendar-cell-today\': item.value === todayValue,\n \'owl-dt-calendar-cell-selected\': isSelected(item.value)\n }">\n {{item.displayValue}}\n </span>\n </td>\n</tr>\n',host:{"[class.owl-dt-calendar-body]":"owlDTCalendarBodyClass"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],gt.ctorParameters=function(){return[{type:t.ElementRef},{type:t.NgZone}]},gt.propDecorators={activeCell:[{type:t.Input}],rows:[{type:t.Input}],numCols:[{type:t.Input}],cellRatio:[{type:t.Input}],todayValue:[{type:t.Input}],selectedValues:[{type:t.Input}],selectMode:[{type:t.Input}],select:[{type:t.Output}]};var bt=function(){function e(e,n,i){this.cdRef=e,this.dateTimeAdapter=n,this.dateTimeFormats=i,this.hideOtherMonths=!1,this._firstDayOfWeek=0,this._selectMode="single",this._selecteds=[],this.localeSub=r.Subscription.EMPTY,this.initiated=!1,this.selectedDates=[],this.selectedChange=new t.EventEmitter,this.userSelection=new t.EventEmitter,this.pickerMomentChange=new t.EventEmitter}return Object.defineProperty(e.prototype,"firstDayOfWeek",{get:function(){return this._firstDayOfWeek},set:function(e){(e=y.coerceNumberProperty(e))>=0&&e<=6&&e!==this._firstDayOfWeek&&(this._firstDayOfWeek=e,this.initiated&&(this.generateWeekDays(),this.generateCalendar(),this.cdRef.markForCheck()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){this._selectMode=e,this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){var t=this._selected;e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e),this.dateTimeAdapter.isSameDay(t,this._selected)||this.setSelectedDates()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){var t=this;this._selecteds=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)})),this.setSelectedDates()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){var t=this._pickerMoment;e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now(),this.firstDateOfMonth=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this._pickerMoment),this.dateTimeAdapter.getMonth(this._pickerMoment),1),!this.isSameMonth(t,this._pickerMoment)&&this.initiated&&this.generateCalendar()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateFilter",{get:function(){return this._dateFilter},set:function(e){this._dateFilter=e,this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDate=this.getValidDate(e),this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDate=this.getValidDate(e),this.initiated&&(this.generateCalendar(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weekdays",{get:function(){return this._weekdays},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"days",{get:function(){return this._days},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeCell",{get:function(){if(this.pickerMoment)return this.dateTimeAdapter.getDate(this.pickerMoment)+this.firstRowOffset-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarView",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.generateWeekDays(),this.localeSub=this.dateTimeAdapter.localeChanges.subscribe((function(){e.generateWeekDays(),e.generateCalendar(),e.cdRef.markForCheck()}))},e.prototype.ngAfterContentInit=function(){this.generateCalendar(),this.initiated=!0},e.prototype.ngOnDestroy=function(){this.localeSub.unsubscribe()},e.prototype.selectCalendarCell=function(e){!e.enabled||this.hideOtherMonths&&e.out||this.selectDate(e.value)},e.prototype.selectDate=function(e){var t=e-1,n=this.dateTimeAdapter.addCalendarDays(this.firstDateOfMonth,t);this.selectedChange.emit(n),this.userSelection.emit()},e.prototype.handleCalendarKeydown=function(e){var t;switch(e.keyCode){case m.LEFT_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,-1),this.pickerMomentChange.emit(t);break;case m.RIGHT_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,1),this.pickerMomentChange.emit(t);break;case m.UP_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,-7),this.pickerMomentChange.emit(t);break;case m.DOWN_ARROW:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,7),this.pickerMomentChange.emit(t);break;case m.HOME:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,1-this.dateTimeAdapter.getDate(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case m.END:t=this.dateTimeAdapter.addCalendarDays(this.pickerMoment,this.dateTimeAdapter.getNumDaysInMonth(this.pickerMoment)-this.dateTimeAdapter.getDate(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case m.PAGE_UP:t=e.altKey?this.dateTimeAdapter.addCalendarYears(this.pickerMoment,-1):this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-1),this.pickerMomentChange.emit(t);break;case m.PAGE_DOWN:t=e.altKey?this.dateTimeAdapter.addCalendarYears(this.pickerMoment,1):this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,1),this.pickerMomentChange.emit(t);break;case m.ENTER:this.dateFilter&&!this.dateFilter(this.pickerMoment)||this.selectDate(this.dateTimeAdapter.getDate(this.pickerMoment));break;default:return}this.focusActiveCell(),e.preventDefault()},e.prototype.generateWeekDays=function(){var e=this.dateTimeAdapter.getDayOfWeekNames("long"),t=this.dateTimeAdapter.getDayOfWeekNames("short"),n=this.dateTimeAdapter.getDayOfWeekNames("narrow"),i=this.firstDayOfWeek,r=e.map((function(e,i){return{long:e,short:t[i],narrow:n[i]}}));this._weekdays=r.slice(i).concat(r.slice(0,i)),this.dateNames=this.dateTimeAdapter.getDateNames()},e.prototype.generateCalendar=function(){if(this.pickerMoment){this.todayDate=null;var e=0-(this.dateTimeAdapter.getDay(this.firstDateOfMonth)+(7-this.firstDayOfWeek))%7;this.firstRowOffset=Math.abs(e),this._days=[];for(var t=0;t<6;t++){for(var n=[],i=0;i<7;i++){var r=this.dateTimeAdapter.addCalendarDays(this.firstDateOfMonth,e),o=this.createDateCell(r,e);this.dateTimeAdapter.isSameDay(this.dateTimeAdapter.now(),r)&&(this.todayDate=e+1),n.push(o),e+=1}this._days.push(n)}this.setSelectedDates()}},e.prototype.createDateCell=function(e,t){var n=this.dateTimeAdapter.getNumDaysInMonth(this.pickerMoment),i=this.dateTimeAdapter.getDate(e).toString(),r=this.dateTimeAdapter.format(e,this.dateTimeFormats.dateA11yLabel),o=this.isDateEnabled(e),a=t+1,s=a<1||a>n,l="owl-dt-day-"+this.dateTimeAdapter.getDay(e);return new yt(a,i,r,o,s,l)},e.prototype.isDateEnabled=function(e){return!!e&&(!this.dateFilter||this.dateFilter(e))&&(!this.minDate||this.dateTimeAdapter.compare(e,this.minDate)>=0)&&(!this.maxDate||this.dateTimeAdapter.compare(e,this.maxDate)<=0)},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.isSameMonth=function(e,t){return!!(e&&t&&this.dateTimeAdapter.isValid(e)&&this.dateTimeAdapter.isValid(t)&&this.dateTimeAdapter.getYear(e)===this.dateTimeAdapter.getYear(t)&&this.dateTimeAdapter.getMonth(e)===this.dateTimeAdapter.getMonth(t))},e.prototype.setSelectedDates=function(){var e=this;if(this.selectedDates=[],this.firstDateOfMonth)if(this.isInSingleMode&&this.selected){var t=this.dateTimeAdapter.differenceInCalendarDays(this.selected,this.firstDateOfMonth);this.selectedDates[0]=t+1}else this.isInRangeMode&&this.selecteds&&(this.selectedDates=this.selecteds.map((function(t){return e.dateTimeAdapter.isValid(t)?e.dateTimeAdapter.differenceInCalendarDays(t,e.firstDateOfMonth)+1:null})))},e.prototype.focusActiveCell=function(){this.calendarBodyElm.focusActiveCell()},e}();bt.decorators=[{type:t.Component,args:[{selector:"owl-date-time-month-view",exportAs:"owlYearView",template:'<table class="owl-dt-calendar-table owl-dt-calendar-month-table"\n [class.owl-dt-calendar-only-current-month]="hideOtherMonths">\n <thead class="owl-dt-calendar-header">\n <tr class="owl-dt-weekdays">\n <th *ngFor="let weekday of weekdays"\n [attr.aria-label]="weekday.long"\n class="owl-dt-weekday" scope="col">\n <span>{{weekday.short}}</span>\n </th>\n </tr>\n <tr>\n <th class="owl-dt-calendar-table-divider" aria-hidden="true" colspan="7"></th>\n </tr>\n </thead>\n <tbody owl-date-time-calendar-body role="grid"\n [rows]="days" [todayValue]="todayDate"\n [selectedValues]="selectedDates"\n [selectMode]="selectMode"\n [activeCell]="activeCell"\n (keydown)="handleCalendarKeydown($event)"\n (select)="selectCalendarCell($event)">\n </tbody>\n</table>\n',host:{"[class.owl-dt-calendar-view]":"owlDTCalendarView"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],bt.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:ze,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[We]}]}]},bt.propDecorators={hideOtherMonths:[{type:t.Input}],firstDayOfWeek:[{type:t.Input}],selectMode:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],pickerMoment:[{type:t.Input}],dateFilter:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],selectedChange:[{type:t.Output}],userSelection:[{type:t.Output}],pickerMomentChange:[{type:t.Output}],calendarBodyElm:[{type:t.ViewChild,args:[gt,{static:!0}]}]};var vt=function(){function e(e,n,i){this.cdRef=e,this.dateTimeAdapter=n,this.dateTimeFormats=i,this._selectMode="single",this._selecteds=[],this.localeSub=r.Subscription.EMPTY,this.initiated=!1,this.selectedMonths=[],this.change=new t.EventEmitter,this.monthSelected=new t.EventEmitter,this.pickerMomentChange=new t.EventEmitter,this.keyboardEnter=new t.EventEmitter,this.monthNames=this.dateTimeAdapter.getMonthNames("short")}return Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){this._selectMode=e,this.initiated&&(this.generateMonthList(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e),this.setSelectedMonths()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){this._selecteds=[];for(var t=0;t<e.length;t++){var n=this.dateTimeAdapter.deserialize(e[t]);this._selecteds.push(this.getValidDate(n))}this.setSelectedMonths()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){var t=this._pickerMoment;e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now(),!this.hasSameYear(t,this._pickerMoment)&&this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateFilter",{get:function(){return this._dateFilter},set:function(e){this._dateFilter=e,this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDate=this.getValidDate(e),this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDate=this.getValidDate(e),this.initiated&&this.generateMonthList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"months",{get:function(){return this._months},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeCell",{get:function(){if(this._pickerMoment)return this.dateTimeAdapter.getMonth(this._pickerMoment)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarView",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.localeSub=this.dateTimeAdapter.localeChanges.subscribe((function(){e.generateMonthList(),e.cdRef.markForCheck()}))},e.prototype.ngAfterContentInit=function(){this.generateMonthList(),this.initiated=!0},e.prototype.ngOnDestroy=function(){this.localeSub.unsubscribe()},e.prototype.selectCalendarCell=function(e){this.selectMonth(e.value)},e.prototype.selectMonth=function(e){var t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,1);this.monthSelected.emit(t);var n=this.dateTimeAdapter.getNumDaysInMonth(t),i=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,Math.min(n,this.dateTimeAdapter.getDate(this.pickerMoment)),this.dateTimeAdapter.getHours(this.pickerMoment),this.dateTimeAdapter.getMinutes(this.pickerMoment),this.dateTimeAdapter.getSeconds(this.pickerMoment));this.change.emit(i)},e.prototype.handleCalendarKeydown=function(e){var t;switch(e.keyCode){case m.LEFT_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-1),this.pickerMomentChange.emit(t);break;case m.RIGHT_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,1),this.pickerMomentChange.emit(t);break;case m.UP_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-3),this.pickerMomentChange.emit(t);break;case m.DOWN_ARROW:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,3),this.pickerMomentChange.emit(t);break;case m.HOME:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,-this.dateTimeAdapter.getMonth(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case m.END:t=this.dateTimeAdapter.addCalendarMonths(this.pickerMoment,11-this.dateTimeAdapter.getMonth(this.pickerMoment)),this.pickerMomentChange.emit(t);break;case m.PAGE_UP:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?-10:-1),this.pickerMomentChange.emit(t);break;case m.PAGE_DOWN:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?10:1),this.pickerMomentChange.emit(t);break;case m.ENTER:this.selectMonth(this.dateTimeAdapter.getMonth(this.pickerMoment)),this.keyboardEnter.emit();break;default:return}this.focusActiveCell(),e.preventDefault()},e.prototype.generateMonthList=function(){if(this.pickerMoment){this.setSelectedMonths(),this.todayMonth=this.getMonthInCurrentYear(this.dateTimeAdapter.now()),this._months=[];for(var e=0;e<4;e++){for(var t=[],n=0;n<3;n++){var i=n+3*e,r=this.createMonthCell(i);t.push(r)}this._months.push(t)}}},e.prototype.createMonthCell=function(e){var t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,1),n=this.dateTimeAdapter.format(t,this.dateTimeFormats.monthYearA11yLabel),i="owl-dt-month-"+e;return new yt(e,this.monthNames[e],n,this.isMonthEnabled(e),!1,i)},e.prototype.isMonthEnabled=function(e){for(var t=this.dateTimeAdapter.createDate(this.dateTimeAdapter.getYear(this.pickerMoment),e,1);this.dateTimeAdapter.getMonth(t)===e;t=this.dateTimeAdapter.addCalendarDays(t,1))if(t&&(!this.dateFilter||this.dateFilter(t))&&(!this.minDate||this.dateTimeAdapter.compare(t,this.minDate)>=0)&&(!this.maxDate||this.dateTimeAdapter.compare(t,this.maxDate)<=0))return!0;return!1},e.prototype.getMonthInCurrentYear=function(e){if(this.getValidDate(e)&&this.getValidDate(this._pickerMoment)){var t=this.dateTimeAdapter.compareYear(e,this._pickerMoment);return t<0?-1:t>0?12:this.dateTimeAdapter.getMonth(e)}return null},e.prototype.setSelectedMonths=function(){this.selectedMonths=[],this.isInSingleMode&&this.selected&&(this.selectedMonths[0]=this.getMonthInCurrentYear(this.selected)),this.isInRangeMode&&this.selecteds&&(this.selectedMonths[0]=this.getMonthInCurrentYear(this.selecteds[0]),this.selectedMonths[1]=this.getMonthInCurrentYear(this.selecteds[1]))},e.prototype.hasSameYear=function(e,t){return!(!e||!t||this.dateTimeAdapter.getYear(e)!==this.dateTimeAdapter.getYear(t))},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.focusActiveCell=function(){this.calendarBodyElm.focusActiveCell()},e}();vt.decorators=[{type:t.Component,args:[{selector:"owl-date-time-year-view",exportAs:"owlMonthView",template:'<table class="owl-dt-calendar-table owl-dt-calendar-year-table">\n <thead class="owl-dt-calendar-header">\n <tr>\n <th class="owl-dt-calendar-table-divider" aria-hidden="true" colspan="3"></th>\n </tr>\n </thead>\n <tbody owl-date-time-calendar-body role="grid"\n [rows]="months" [numCols]="3" [cellRatio]="3 / 7"\n [activeCell]="activeCell"\n [todayValue]="todayMonth"\n [selectedValues]="selectedMonths"\n [selectMode]="selectMode"\n (keydown)="handleCalendarKeydown($event)"\n (select)="selectCalendarCell($event)">\n </tbody>\n</table>\n',host:{"[class.owl-dt-calendar-view]":"owlDTCalendarView"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],vt.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:ze,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[We]}]}]},vt.propDecorators={selectMode:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],pickerMoment:[{type:t.Input}],dateFilter:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],change:[{type:t.Output}],monthSelected:[{type:t.Output}],pickerMomentChange:[{type:t.Output}],keyboardEnter:[{type:t.Output}],calendarBodyElm:[{type:t.ViewChild,args:[gt,{static:!0}]}]};var wt=function(){function e(e,n,i){this.cdRef=e,this.pickerIntl=n,this.dateTimeAdapter=i,this._selectMode="single",this._selecteds=[],this.initiated=!1,this.change=new t.EventEmitter,this.yearSelected=new t.EventEmitter,this.pickerMomentChange=new t.EventEmitter,this.keyboardEnter=new t.EventEmitter}return Object.defineProperty(e.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){this._selectMode=e,this.initiated&&(this.setSelectedYears(),this.cdRef.markForCheck())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){var t=this._selected;e=this.dateTimeAdapter.deserialize(e),this._selected=this.getValidDate(e),this.dateTimeAdapter.isSameDay(t,this._selected)||this.setSelectedYears()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){var t=this;this._selecteds=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),t.getValidDate(e)})),this.setSelectedYears()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pickerMoment",{get:function(){return this._pickerMoment},set:function(e){var t=this._pickerMoment;e=this.dateTimeAdapter.deserialize(e),this._pickerMoment=this.getValidDate(e)||this.dateTimeAdapter.now(),t&&this._pickerMoment&&!this.isSameYearList(t,this._pickerMoment)&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dateFilter",{get:function(){return this._dateFilter},set:function(e){this._dateFilter=e,this.initiated&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._minDate=this.getValidDate(e),this.initiated&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){e=this.dateTimeAdapter.deserialize(e),this._maxDate=this.getValidDate(e),this.initiated&&this.generateYearList()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todayYear",{get:function(){return this._todayYear},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"years",{get:function(){return this._years},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedYears",{get:function(){return this._selectedYears},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSingleMode",{get:function(){return"single"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInRangeMode",{get:function(){return"range"===this.selectMode||"rangeFrom"===this.selectMode||"rangeTo"===this.selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeCell",{get:function(){if(this._pickerMoment)return this.dateTimeAdapter.getYear(this._pickerMoment)%21},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableHeader",{get:function(){if(this._years&&this._years.length>0)return this._years[0][0].displayValue+" ~ "+this._years[6][2].displayValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prevButtonLabel",{get:function(){return this.pickerIntl.prevMultiYearLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextButtonLabel",{get:function(){return this.pickerIntl.nextMultiYearLabel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarView",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTCalendarMultiYearView",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.ngAfterContentInit=function(){this._todayYear=this.dateTimeAdapter.getYear(this.dateTimeAdapter.now()),this.generateYearList(),this.initiated=!0},e.prototype.selectCalendarCell=function(e){this.selectYear(e.value)},e.prototype.selectYear=function(e){this.yearSelected.emit(this.dateTimeAdapter.createDate(e,0,1));var t=this.dateTimeAdapter.createDate(e,this.dateTimeAdapter.getMonth(this.pickerMoment),1),n=this.dateTimeAdapter.getNumDaysInMonth(t),i=this.dateTimeAdapter.createDate(e,this.dateTimeAdapter.getMonth(this.pickerMoment),Math.min(n,this.dateTimeAdapter.getDate(this.pickerMoment)),this.dateTimeAdapter.getHours(this.pickerMoment),this.dateTimeAdapter.getMinutes(this.pickerMoment),this.dateTimeAdapter.getSeconds(this.pickerMoment));this.change.emit(i)},e.prototype.prevYearList=function(e){this._pickerMoment=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,-21),this.generateYearList(),e.preventDefault()},e.prototype.nextYearList=function(e){this._pickerMoment=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,21),this.generateYearList(),e.preventDefault()},e.prototype.generateYearList=function(){this._years=[];for(var e=this.dateTimeAdapter.getYear(this._pickerMoment),t=e%21,n=0;n<7;n++){for(var i=[],r=0;r<3;r++){var o=e-t+(r+3*n),a=this.createYearCell(o);i.push(a)}this._years.push(i)}},e.prototype.previousEnabled=function(){return!this.minDate||(!this.minDate||!this.isSameYearList(this._pickerMoment,this.minDate))},e.prototype.nextEnabled=function(){return!this.maxDate||!this.isSameYearList(this._pickerMoment,this.maxDate)},e.prototype.handleCalendarKeydown=function(e){var t;switch(e.keyCode){case m.LEFT_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,-1),this.pickerMomentChange.emit(t);break;case m.RIGHT_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,1),this.pickerMomentChange.emit(t);break;case m.UP_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,-3),this.pickerMomentChange.emit(t);break;case m.DOWN_ARROW:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,3),this.pickerMomentChange.emit(t);break;case m.HOME:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,-this.dateTimeAdapter.getYear(this._pickerMoment)%21),this.pickerMomentChange.emit(t);break;case m.END:t=this.dateTimeAdapter.addCalendarYears(this._pickerMoment,21-this.dateTimeAdapter.getYear(this._pickerMoment)%21-1),this.pickerMomentChange.emit(t);break;case m.PAGE_UP:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?-210:-21),this.pickerMomentChange.emit(t);break;case m.PAGE_DOWN:t=this.dateTimeAdapter.addCalendarYears(this.pickerMoment,e.altKey?210:21),this.pickerMomentChange.emit(t);break;case m.ENTER:this.selectYear(this.dateTimeAdapter.getYear(this._pickerMoment)),this.keyboardEnter.emit();break;default:return}this.focusActiveCell(),e.preventDefault()},e.prototype.createYearCell=function(e){var t=this.dateTimeAdapter.createDate(e,0,1),n=this.dateTimeAdapter.getYearName(t),i="owl-dt-year-"+e;return new yt(e,e.toString(),n,this.isYearEnabled(e),!1,i)},e.prototype.setSelectedYears=function(){var e=this;this._selectedYears=[],this.isInSingleMode&&this.selected&&(this._selectedYears[0]=this.dateTimeAdapter.getYear(this.selected)),this.isInRangeMode&&this.selecteds&&(this._selectedYears=this.selecteds.map((function(t){return e.dateTimeAdapter.isValid(t)?e.dateTimeAdapter.getYear(t):null})))},e.prototype.isYearEnabled=function(e){if(null==e||this.maxDate&&e>this.dateTimeAdapter.getYear(this.maxDate)||this.minDate&&e<this.dateTimeAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(var t=this.dateTimeAdapter.createDate(e,0,1);this.dateTimeAdapter.getYear(t)===e;t=this.dateTimeAdapter.addCalendarDays(t,1))if(this.dateFilter(t))return!0;return!1},e.prototype.isSameYearList=function(e,t){return Math.floor(this.dateTimeAdapter.getYear(e)/21)===Math.floor(this.dateTimeAdapter.getYear(t)/21)},e.prototype.getValidDate=function(e){return this.dateTimeAdapter.isDateInstance(e)&&this.dateTimeAdapter.isValid(e)?e:null},e.prototype.focusActiveCell=function(){this.calendarBodyElm.focusActiveCell()},e}();wt.decorators=[{type:t.Component,args:[{selector:"owl-date-time-multi-year-view",template:'<button class="owl-dt-control-button owl-dt-control-arrow-button"\n [disabled]="!previousEnabled()" [attr.aria-label]="prevButtonLabel"\n type="button" tabindex="0" (click)="prevYearList($event)">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Left"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 250.738 250.738"\n style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve"\n width="100%" height="100%">\n <path style="fill-rule: evenodd; clip-rule: evenodd;" d="M96.633,125.369l95.053-94.533c7.101-7.055,7.101-18.492,0-25.546 c-7.1-7.054-18.613-7.054-25.714,0L58.989,111.689c-3.784,3.759-5.487,8.759-5.238,13.68c-0.249,4.922,1.454,9.921,5.238,13.681 l106.983,106.398c7.101,7.055,18.613,7.055,25.714,0c7.101-7.054,7.101-18.491,0-25.544L96.633,125.369z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n<table class="owl-dt-calendar-table owl-dt-calendar-multi-year-table">\n <thead class="owl-dt-calendar-header">\n <tr>\n <th colspan="3">{{tableHeader}}</th>\n </tr>\n </thead>\n <tbody owl-date-time-calendar-body role="grid"\n [rows]="years" [numCols]="3" [cellRatio]="3 / 7"\n [activeCell]="activeCell"\n [todayValue]="todayYear"\n [selectedValues]="selectedYears"\n [selectMode]="selectMode"\n (keydown)="handleCalendarKeydown($event)"\n (select)="selectCalendarCell($event)"></tbody>\n</table>\n<button class="owl-dt-control-button owl-dt-control-arrow-button"\n [disabled]="!nextEnabled()" [attr.aria-label]="nextButtonLabel"\n type="button" tabindex="0" (click)="nextYearList($event)">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Right"> --\x3e\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 250.738 250.738" style="enable-background:new 0 0 250.738 250.738;" xml:space="preserve">\n <path style="fill-rule:evenodd;clip-rule:evenodd;" d="M191.75,111.689L84.766,5.291c-7.1-7.055-18.613-7.055-25.713,0\n c-7.101,7.054-7.101,18.49,0,25.544l95.053,94.534l-95.053,94.533c-7.101,7.054-7.101,18.491,0,25.545\n c7.1,7.054,18.613,7.054,25.713,0L191.75,139.05c3.784-3.759,5.487-8.759,5.238-13.681\n C197.237,120.447,195.534,115.448,191.75,111.689z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n',host:{"[class.owl-dt-calendar-view]":"owlDTCalendarView","[class.owl-dt-calendar-multi-year-view]":"owlDTCalendarMultiYearView"},preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[""]}]}],wt.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:Ye},{type:ze,decorators:[{type:t.Optional}]}]},wt.propDecorators={selectMode:[{type:t.Input}],selected:[{type:t.Input}],selecteds:[{type:t.Input}],pickerMoment:[{type:t.Input}],dateFilter:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],change:[{type:t.Output}],yearSelected:[{type:t.Output}],pickerMomentChange:[{type:t.Output}],keyboardEnter:[{type:t.Output}],calendarBodyElm:[{type:t.ViewChild,args:[gt,{static:!0}]}]};var xt=function(){function e(){this.showDivider=!1,this.step=1,this.valueChange=new t.EventEmitter,this.inputChange=new t.EventEmitter,this.inputStream=new r.Subject,this.inputStreamSub=r.Subscription.EMPTY}return Object.defineProperty(e.prototype,"displayValue",{get:function(){return this.boxValue||this.value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"owlDTTimerBoxClass",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.inputStreamSub=this.inputStream.pipe(g.debounceTime(500),g.distinctUntilChanged()).subscribe((function(t){if(t){var n=y.coerceNumberProperty(t,0);e.updateValueViaInput(n)}}))},e.prototype.ngOnDestroy=function(){this.inputStreamSub.unsubscribe()},e.prototype.upBtnClicked=function(){this.updateValue(this.value+this.step)},e.prototype.downBtnClicked=function(){this.updateValue(this.value-this.step)},e.prototype.handleInputChange=function(e){this.inputStream.next(e)},e.prototype.updateValue=function(e){this.valueChange.emit(e)},e.prototype.updateValueViaInput=function(e){e>this.max||e<this.min||this.inputChange.emit(e)},e}();xt.decorators=[{type:t.Component,args:[{exportAs:"owlDateTimeTimerBox",selector:"owl-date-time-timer-box",template:'<div *ngIf="showDivider" class="owl-dt-timer-divider" aria-hidden="true"></div>\n<button class="owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="-1"\n [disabled]="upBtnDisabled"\n [attr.aria-label]="upBtnAriaLabel"\n (click)="upBtnClicked()">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Up"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 451.847 451.846"\n style="enable-background:new 0 0 451.847 451.846;" xml:space="preserve"\n width="100%" height="100%">\n <path d="M248.292,106.406l194.281,194.29c12.365,12.359,12.365,32.391,0,44.744c-12.354,12.354-32.391,12.354-44.744,0\n L225.923,173.529L54.018,345.44c-12.36,12.354-32.395,12.354-44.748,0c-12.359-12.354-12.359-32.391,0-44.75L203.554,106.4\n c6.18-6.174,14.271-9.259,22.369-9.259C234.018,97.141,242.115,100.232,248.292,106.406z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n<label class="owl-dt-timer-content">\n <input class="owl-dt-timer-input" maxlength="2"\n [value]="displayValue | numberFixedLen : 2"\n (input)="handleInputChange(valueInput.value)" #valueInput>\n <span class="owl-hidden-accessible">{{inputLabel}}</span>\n</label>\n<button class="owl-dt-control-button owl-dt-control-arrow-button"\n type="button" tabindex="-1"\n [disabled]="downBtnDisabled"\n [attr.aria-label]="downBtnAriaLabel"\n (click)="downBtnClicked()">\n <span class="owl-dt-control-button-content" tabindex="-1">\n \x3c!-- <editor-fold desc="SVG Arrow Down"> --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n version="1.1" x="0px" y="0px" viewBox="0 0 451.847 451.846"\n style="enable-background:new 0 0 451.847 451.846;" xml:space="preserve"\n width="100%" height="100%">\n <path d="M225.923,354.706c-8.098,0-16.195-3.092-22.369-9.263L9.27,151.157c-12.359-12.359-12.359-32.397,0-44.751\n c12.354-12.354,32.388-12.354,44.748,0l171.905,171.915l171.906-171.909c12.359-12.354,32.391-12.354,44.744,0\n c12.365,12.354,12.365,32.392,0,44.751L248.292,345.449C242.115,351.621,234.018,354.706,225.923,354.706z"/>\n </svg>\n \x3c!-- </editor-fold> --\x3e\n </span>\n</button>\n',preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,host:{"[class.owl-dt-timer-box]":"owlDTTimerBoxClass"},styles:[""]}]}],xt.ctorParameters=function(){return[]},xt.propDecorators={showDivider:[{type:t.Input}],upBtnAriaLabel:[{type:t.Input}],upBtnDisabled:[{type:t.Input}],downBtnAriaLabel:[{type:t.Input}],downBtnDisabled:[{type:t.Input}],boxValue:[{type:t.Input}],value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],step:[{type:t.Input}],inputLabel:[{type:t.Input}],valueChange:[{type:t.Output}],inputChange:[{type:t.Output}]};var kt=function(){function e(){}return e.prototype.transform=function(e,t){var n=Math.floor(e),i=Math.floor(t);if(null===e||isNaN(n)||isNaN(i))return e;for(var r=n.toString();r.length<i;)r="0"+r;return r},e}();kt.decorators=[{type:t.Pipe,args:[{name:"numberFixedLen"}]}];var Ct={provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Tt})),multi:!0},Tt=function(e){function n(n,i,r){var o=e.call(this,i,r)||this;return o.changeDetector=n,o.dateTimeAdapter=i,o.dateTimeFormats=r,o._pickerType="both",o._disabled=!1,o._selectMode="single",o._values=[],o.yearSelected=new t.EventEmitter,o.monthSelected=new t.EventEmitter,o._selecteds=[],o.onModelChange=function(){},o.onModelTouched=function(){},o}return _(n,e),Object.defineProperty(n.prototype,"pickerType",{get:function(){return this._pickerType},set:function(e){e!==this._pickerType&&(this._pickerType=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return!!this._disabled},set:function(e){this._disabled=y.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectMode",{get:function(){return this._selectMode},set:function(e){if("single"!==e&&"range"!==e&&"rangeFrom"!==e&&"rangeTo"!==e)throw Error("OwlDateTime Error: invalid selectMode value!");this._selectMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"startAt",{get:function(){return this._startAt?this._startAt:"single"===this.selectMode?this.value||null:"range"===this.selectMode||"rangeFrom"===this.selectMode?this.values[0]||null:"rangeTo"===this.selectMode&&this.values[1]||null},set:function(e){this._startAt=this.getValidDate(this.dateTimeAdapter.deserialize(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dateTimeFilter",{get:function(){return this._dateTimeFilter},set:function(e){this._dateTimeFilter=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"minDateTime",{get:function(){return this._min||null},set:function(e){this._min=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"maxDateTime",{get:function(){return this._max||null},set:function(e){this._max=this.getValidDate(this.dateTimeAdapter.deserialize(e)),this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(e){e=this.dateTimeAdapter.deserialize(e),e=this.getValidDate(e),this._value=e,this.selected=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this._values},set:function(e){var t=this;e&&e.length>0?(e=e.map((function(e){return e=t.dateTimeAdapter.deserialize(e),(e=t.getValidDate(e))?t.dateTimeAdapter.clone(e):null})),this._values=V(e),this.selecteds=V(e)):(this._values=[],this.selecteds=[])},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selecteds",{get:function(){return this._selecteds},set:function(e){this._selecteds=e,this.changeDetector.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opened",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pickerMode",{get:function(){return"inline"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInSingleMode",{get:function(){return"single"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInRangeMode",{get:function(){return"range"===this._selectMode||"rangeFrom"===this._selectMode||"rangeTo"===this._selectMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"owlDTInlineClass",{get:function(){return!0},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){this.container.picker=this},n.prototype.writeValue=function(e){this.isInSingleMode?(this.value=e,this.container.pickerMoment=e):(this.values=e,this.container.pickerMoment=this._values[this.container.activeSelectedIndex])},n.prototype.registerOnChange=function(e){this.onModelChange=e},n.prototype.registerOnTouched=function(e){this.onModelTouched=e},n.prototype.setDisabledState=function(e){this.disabled=e},n.prototype.select=function(e){this.disabled||(Array.isArray(e)?this.values=V(e):this.value=e,this.onModelChange(e),this.onModelTouched())},n.prototype.selectYear=function(e){this.yearSelected.emit(e)},n.prototype.selectMonth=function(e){this.monthSelected.emit(e)},n}(Xe);Tt.decorators=[{type:t.Component,args:[{selector:"owl-date-time-inline",template:"<owl-date-time-container></owl-date-time-container>",host:{"[class.owl-dt-inline]":"owlDTInlineClass"},changeDetection:t.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,providers:[Ct],styles:[""]}]}],Tt.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:ze,decorators:[{type:t.Optional}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[We]}]}]},Tt.propDecorators={container:[{type:t.ViewChild,args:[Je,{static:!0}]}],pickerType:[{type:t.Input}],disabled:[{type:t.Input}],selectMode:[{type:t.Input}],startAt:[{type:t.Input}],dateTimeFilter:[{type:t.Input,args:["owlDateTimeFilter"]}],minDateTime:[{type:t.Input,args:["min"]}],maxDateTime:[{type:t.Input,args:["max"]}],value:[{type:t.Input}],values:[{type:t.Input}],yearSelected:[{type:t.Output}],monthSelected:[{type:t.Output}]};var Ot=function(){};Ot.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,p.A11yModule,h.OverlayModule,f.PortalModule],exports:[],declarations:[nt],providers:[at,lt],entryComponents:[nt]}]}];var Dt=function(){};Dt.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,h.OverlayModule,Ot,p.A11yModule],exports:[Ge,Ue,He,mt,pt,Tt,wt,vt,bt],declarations:[He,mt,pt,Je,wt,vt,bt,Ue,xt,Ge,gt,kt,Tt],providers:[Ye,dt],entryComponents:[Je]}]}];var Mt={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},At={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},St=Pt(31,(function(e){return String(e+1)})),_t="undefined"!=typeof Intl,It=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function Pt(e,t){for(var n=Array(e),i=0;i<e;i++)n[i]=t(i);return n}var Et=function(e){function t(t,n){var i=e.call(this)||this;return i.owlDateTimeLocale=t,e.prototype.setLocale.call(i,t),i.useUtcForDisplay=!n.TRIDENT,i._clampDate=n.TRIDENT||n.EDGE,i}return _(t,e),t.prototype.getYear=function(e){return e.getFullYear()},t.prototype.getMonth=function(e){return e.getMonth()},t.prototype.getDay=function(e){return e.getDay()},t.prototype.getDate=function(e){return e.getDate()},t.prototype.getHours=function(e){return e.getHours()},t.prototype.getMinutes=function(e){return e.getMinutes()},t.prototype.getSeconds=function(e){return e.getSeconds()},t.prototype.getTime=function(e){return e.getTime()},t.prototype.getNumDaysInMonth=function(e){var t=this.createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0);return this.getDate(t)},t.prototype.differenceInCalendarDays=function(e,t){if(this.isValid(e)&&this.isValid(t)){var n=this.createDate(this.getYear(e),this.getMonth(e),this.getDate(e)),i=this.createDate(this.getYear(t),this.getMonth(t),this.getDate(t)),r=this.getTime(n)-n.getTimezoneOffset()*this.milliseondsInMinute,o=this.getTime(i)-i.getTimezoneOffset()*this.milliseondsInMinute;return Math.round((r-o)/this.millisecondsInDay)}return null},t.prototype.getYearName=function(e){if(_t){var t=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this.stripDirectionalityCharacters(this._format(t,e))}return String(this.getYear(e))},t.prototype.getMonthNames=function(e){var t=this;if(_t){var n=new Intl.DateTimeFormat(this.locale,{month:e,timeZone:"utc"});return Pt(12,(function(e){return t.stripDirectionalityCharacters(t._format(n,new Date(2017,e,1)))}))}return Mt[e]},t.prototype.getDayOfWeekNames=function(e){var t=this;if(_t){var n=new Intl.DateTimeFormat(this.locale,{weekday:e,timeZone:"utc"});return Pt(7,(function(e){return t.stripDirectionalityCharacters(t._format(n,new Date(2017,0,e+1)))}))}return At[e]},t.prototype.getDateNames=function(){var e=this;if(_t){var t=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return Pt(31,(function(n){return e.stripDirectionalityCharacters(e._format(t,new Date(2017,0,n+1)))}))}return St},t.prototype.toIso8601=function(e){return e.toISOString()},t.prototype.isEqual=function(e,t){return!(!this.isValid(e)||!this.isValid(t))&&e.getTime()===t.getTime()},t.prototype.isSameDay=function(e,t){if(this.isValid(e)&&this.isValid(t)){var n=this.clone(e),i=this.clone(t);return n.setHours(0,0,0,0),i.setHours(0,0,0,0),n.getTime()===i.getTime()}return!1},t.prototype.isValid=function(e){return e&&!isNaN(e.getTime())},t.prototype.invalid=function(){return new Date(NaN)},t.prototype.isDateInstance=function(e){return e instanceof Date},t.prototype.addCalendarYears=function(e,t){return this.addCalendarMonths(e,12*t)},t.prototype.addCalendarMonths=function(e,t){var n=this.clone(e);t=Number(t);var i=n.getMonth()+t,r=new Date(0);r.setFullYear(n.getFullYear(),i,1),r.setHours(0,0,0,0);var o=this.getNumDaysInMonth(r);return n.setMonth(i,Math.min(o,n.getDate())),n},t.prototype.addCalendarDays=function(e,t){var n=this.clone(e);return t=Number(t),n.setDate(n.getDate()+t),n},t.prototype.setHours=function(e,t){var n=this.clone(e);return n.setHours(t),n},t.prototype.setMinutes=function(e,t){var n=this.clone(e);return n.setMinutes(t),n},t.prototype.setSeconds=function(e,t){var n=this.clone(e);return n.setSeconds(t),n},t.prototype.createDate=function(e,t,n,i,r,o){if(void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=0),t<0||t>11)throw Error('Invalid month index "'+t+'". Month index has to be between 0 and 11.');if(n<1)throw Error('Invalid date "'+n+'". Date has to be greater than 0.');if(i<0||i>23)throw Error('Invalid hours "'+i+'". Hours has to be between 0 and 23.');if(r<0||r>59)throw Error('Invalid minutes "'+r+'". Minutes has to between 0 and 59.');if(o<0||o>59)throw Error('Invalid seconds "'+o+'". Seconds has to be between 0 and 59.');var a=this.createDateWithOverflow(e,t,n,i,r,o);if(a.getMonth()!==t)throw Error('Invalid date "'+n+'" for month with index "'+t+'".');return a},t.prototype.clone=function(e){return this.createDate(this.getYear(e),this.getMonth(e),this.getDate(e),this.getHours(e),this.getMinutes(e),this.getSeconds(e))},t.prototype.now=function(){return new Date},t.prototype.format=function(e,t){if(!this.isValid(e))throw Error("JSNativeDate: Cannot format invalid date.");if(_t){this._clampDate&&(e.getFullYear()<1||e.getFullYear()>9999)&&(e=this.clone(e)).setFullYear(Math.max(1,Math.min(9999,e.getFullYear()))),t=Object.assign(Object.assign({},t),{timeZone:"utc"});var n=new Intl.DateTimeFormat(this.locale,t);return this.stripDirectionalityCharacters(this._format(n,e))}return this.stripDirectionalityCharacters(e.toDateString())},t.prototype.parse=function(e,t){return"number"==typeof e?new Date(e):e?new Date(Date.parse(e)):null},t.prototype.deserialize=function(t){if("string"==typeof t){if(!t)return null;if(It.test(t)){var n=new Date(t);if(this.isValid(n))return n}}return e.prototype.deserialize.call(this,t)},t.prototype.createDateWithOverflow=function(e,t,n,i,r,o){void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=0);var a=new Date(e,t,n,i,r,o);return e>=0&&e<100&&a.setFullYear(this.getYear(a)-1900),a},t.prototype.stripDirectionalityCharacters=function(e){return e.replace(/[\u200e\u200f]/g,"")},t.prototype._format=function(e,t){var n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.format(n)},t}(ze);Et.decorators=[{type:t.Injectable}],Et.ctorParameters=function(){return[{type:String,decorators:[{type:t.Optional},{type:t.Inject,args:[Be]}]},{type:b.Platform}]};var Vt={parseInput:null,fullPickerInput:{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"},datePickerInput:{year:"numeric",month:"numeric",day:"numeric"},timePickerInput:{hour:"numeric",minute:"numeric"},monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}},qt=function(){};qt.decorators=[{type:t.NgModule,args:[{imports:[b.PlatformModule],providers:[{provide:ze,useClass:Et}]}]}];var Ft=Vt,jt=function(){};jt.decorators=[{type:t.NgModule,args:[{imports:[qt],providers:[{provide:We,useValue:Ft}]}]}];var Rt=function(){};Rt.decorators=[{type:t.NgModule,args:[{schemas:[t.CUSTOM_ELEMENTS_SCHEMA],imports:[n.CommonModule,i.FormsModule,Dt,jt],declarations:[Le],exports:[Le],providers:[]}]}];var Nt=function(e){this.label=e.label,this.value=e.value},Lt=function(){function e(){this.question_options=[],this.errors=[],this.propagateChange=function(e){}}return e.prototype.getChangingText=function(e){var t=this;this.getData(e).subscribe((function(e){t.question_options=e}))},e.prototype.writeValue=function(e){},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.ngOnChanges=function(e){},e.prototype.ngOnInit=function(){var e=this;this.extras&&this.extras.originalValue&&this.resolveSelectedOption(this.extras.originalValue).subscribe((function(t){e.selected_question_option=t}))},e.prototype.getData=function(e){var t=this;return this.subject=new r.BehaviorSubject([]),this.dataSource.searchOptions(e).subscribe((function(e){for(var n=new Array,i=0;i<e.length;i++)n.push(new Nt(e[i]));t.subject.next(n)}),(function(e){t.subject.error(e)})),this.subject.asObservable()},e.prototype.onValueChange=function(e){},e.prototype.resolveSelectedOption=function(e){var t=this;return this.subjectOption=new r.BehaviorSubject(null),this.dataSource.resolveSelectedValue(e).subscribe((function(e){t.subjectOption.next(e)}),(function(e){t.subjectOption.error(e)})),this.subjectOption.asObservable()},e.prototype.resetOptions=function(){this.subject.next(new Array)},e}();Lt.decorators=[{type:t.Component,args:[{selector:"afe-ng-select",template:'<ng-select\n (searchInputText)="getChangingText($event)"\n (ngModelChange)="onValueChange($event)"\n [options]="question_options"\n [multiple]="multiple"\n >\n </ng-select> ',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Lt})),multi:!0}]}]}],Lt.propDecorators={dataSource:[{type:t.Input}],multiple:[{type:t.Input}],extras:[{type:t.Input}]};var Ht=function(){function e(){}return e.prototype.compileFormSchema=function(e,t){var n=this.getReferencedForms(e,t);if(T.isEmpty(n))return e;var i=this.getAllPlaceholderObjects(e);return T.isEmpty(i)||this.replaceAllPlaceholdersWithActualObjects(n,i),e},e.prototype.findSchemaByName=function(e,t){if(!T.isEmpty(e)&&!T.isEmpty(t)){var n={};return T.each(e,(function(e){e.name===t&&(n=e)})),n}},e.prototype.getPageInSchemaByLabel=function(e,t){if(!T.isEmpty(e)&&!T.isEmpty(t)){var n={};return T.each(e.pages,(function(e){e.label===t&&(n=e)})),n}},e.prototype.getSectionInSchemaByPageLabelBySectionLabel=function(e,t,n){if(!(T.isEmpty(e)||T.isEmpty(t)||T.isEmpty(n))){var i=this.getPageInSchemaByLabel(e,t);if(!T.isEmpty(i)){var r={};return T.each(i.sections,(function(e){e.label===n&&(r=e)})),r}}},e.prototype.getQuestionByIdInSchema=function(e,t){if(!T.isEmpty(e)&&!T.isEmpty(t)){if(Array.isArray(e)){for(var n=void 0,i=0;i<e.length&&(T.isEmpty(e[i])||(n=this.getQuestionByIdInSchema(e[i],t)),T.isEmpty(n));i++);return n}if("object"!=typeof e);else{if(this.isQuestionObjectWithId(e,t))return e;if(this.isSchemaSubObjectExpandable(e)){var r=e.pages||e.sections||e.questions;return this.getQuestionByIdInSchema(r,t)}}}},e.prototype.getQuestionsArrayByQuestionIdInSchema=function(e,t){if(!T.isEmpty(e)&&!T.isEmpty(t))return this.getQuestionsArrayByQuestionId(e,e,t)},e.prototype.getQuestionsArrayByQuestionId=function(e,t,n){if(Array.isArray(t)){for(var i=void 0,r=0;r<t.length&&(T.isEmpty(t[r])||(i=this.getQuestionsArrayByQuestionId(t,t[r],n)),T.isEmpty(i));r++);return i}if("object"!=typeof t);else{if(this.isQuestionObjectWithId(t,n))return e;if(this.isSchemaSubObjectExpandable(t)){var o=t.pages||t.sections||t.questions;return this.getQuestionsArrayByQuestionId(o,o,n)}}},e.prototype.isSchemaSubObjectExpandable=function(e){if("object"==typeof e){var t=Object.keys(e);if(T.includes(t,"pages")||T.includes(t,"sections")||T.includes(t,"questions"))return!0}return!1},e.prototype.isQuestionObjectWithId=function(e,t){return e.id===t},e.prototype.getAllPlaceholderObjects=function(e){var t=[];return this.extractPlaceholderObjects(e,t),t},e.prototype.extractPlaceholderObjects=function(e,t){if(!T.isEmpty(e))if(Array.isArray(e))for(var n=0;n<e.length;n++)T.isEmpty(e[n])||this.extractPlaceholderObjects(e[n],t);else if("object"==typeof e)if(T.isEmpty(e.reference)){if(this.isSchemaSubObjectExpandable(e)){var i=e.pages||e.sections||e.questions;this.extractPlaceholderObjects(i,t)}}else t.push(e)},e.prototype.fillPlaceholderObject=function(e,t){for(var n in t)T.isEmpty(e[n])&&(e[n]=t[n]);return e},e.prototype.replaceAllPlaceholdersWithActualObjects=function(e,t){var n=this;return T.each(t,(function(t){var i=n.getReferencedObject(t.reference,e);T.isEmpty(i)?console.error("Form compile: Error finding referenced object",t.reference):(t=n.fillPlaceholderObject(t,i),delete(t=n.removeExcludedQuestionsFromPlaceholder(t)).reference)})),t},e.prototype.removeObjectFromArray=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)},e.prototype.removeExcludedQuestionsFromPlaceholder=function(e){var t=this;return Array.isArray(e.reference.excludeQuestions)&&T.each(e.reference.excludeQuestions,(function(n){var i=t.getQuestionsArrayByQuestionIdInSchema(e,n);if(Array.isArray(i)){var r=t.getQuestionByIdInSchema(i,n);t.removeObjectFromArray(i,r)}})),e},e.prototype.getReferencedObject=function(e,t){if(T.isEmpty(e.form))console.error("Form compile: reference missing form attribute",e);else{if(!T.isEmpty(t[e.form]))return T.isEmpty(e.questionId)?T.isEmpty(e.page)||T.isEmpty(e.section)?T.isEmpty(e.page)?void console.error("Form compile: Unsupported reference type",e.reference):this.getPageInSchemaByLabel(t[e.form],e.page):this.getSectionInSchemaByPageLabelBySectionLabel(t[e.form],e.page,e.section):this.getQuestionByIdInSchema(t[e.form],e.questionId);console.error("Form compile: referenced form alias not found",e)}},e.prototype.getReferencedForms=function(e,t){var n=this,i=e.referencedForms;if(!T.isEmpty(i)){var r={};return T.each(i,(function(e){r[e.alias]=n.findSchemaByName(t,e.formName)})),r}},e}();Ht.decorators=[{type:t.Injectable}],Ht.ctorParameters=function(){return[]};var Yt=function(t){function n(n){var i=t.call(this,n)||this;return i.placeholder=n.placeholder||"",i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(K),Bt=function(t){function n(n){var i=t.call(this,n)||this;return i.placeholder=n.placeholder||"",i.isExpanded=n.isExpanded||!1,i.rows=n.rows||18,i.renderingType="textarea",i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(Yt),Qt=function(t){function n(n){var i=t.call(this,n)||this;return i.renderingType="select",i.options=n.options||[],i.controlType=e.AfeControlType.AfeFormControl,i.dataSource=n.dataSource||"",i}return _(n,t),n}(K),zt=function(t){function n(n){var i=t.call(this,n)||this;return i.renderingType="ui-select",i.options=n.options||[],i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(K),Wt=function(t){function n(n){var i=t.call(this,n)||this;return i.showTime=!0,i.showWeeksAdder=!1,i.renderingType="date",i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(K),Gt=function(t){function n(n){var i=t.call(this,n)||this;return i.renderingType="multi-select",i.options=n.options||[],i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(Qt),Ut=function(e){function t(t){return e.call(this,t)||this}return _(t,e),t}(K),$t=function(t){function n(n){var i=t.call(this,n)||this;return i.isExpanded=!0,i.renderingType="group",i.questions=n.questions||[],i.controlType=e.AfeControlType.AfeFormGroup,i}return _(n,t),n}(Ut),Jt=function(t){function n(n){var i=t.call(this,n)||this;return i.renderingType="repeating",i.questions=n.questions||[],i.controlType=e.AfeControlType.AfeFormArray,i}return _(n,t),n}(Ut),Zt=function(t){function n(n){var i=t.call(this,n)||this;return i.renderingType="checkbox",i.options=n.options||[],i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(K),Xt=function(t){function n(n){var i=t.call(this,n)||this;return i.showTime=!0,i.showWeeksAdder=!1,i.renderingType="file",i.dataSource=n.dataSource,i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(K),Kt=function(t){function n(n){var i=t.call(this,n)||this;return i.renderingType="select",i.orderType=n.orderType,i.selectableOrders=n.selectableOrders,i.options=n.options,i.orderSettingUuid=n.orderSettingUuid,i.rendering=n.orderSettingUuid,i.controlType=e.AfeControlType.AfeFormControl,i}return _(n,t),n}(K),en=function(e){function t(t){var n=e.call(this,t)||this;return n.allowFutureDates=!1,n.allowFutureDates="true"===t.allowFutureDates,n}return _(t,e),t}(Q),tn=function(e){function t(t){var n=e.call(this,t)||this,i=t.max;return n.max=+i,n}return _(t,e),t}(Q),nn=function(e){function t(t){var n=e.call(this,t)||this,i=t.min;return n.min=+i,n}return _(t,e),t}(Q),rn=function(){function e(){this.returnErrorOnNext=!1}return e.prototype.resolveSelectedValue=function(e){var t=this.sampleData();t=(t=t.map((function(e){return new Nt({label:e.label,value:e.concept})}))).filter((function(t){return t.value===e}));var n=new r.BehaviorSubject([]);return this.returnErrorOnNext?n.error(new Error("Error loading Options")):n.next(t[0]),n.asObservable()},e.prototype.fileUpload=function(e){return r.of({image:""})},e.prototype.fetchFile=function(e){return r.of({image:""})},e.prototype.searchOptions=function(e){var t=this.sampleData();t=(t=t.map((function(e){return new Nt({label:e.label,value:e.concept})}))).filter((function(t){return-1!==t.label.indexOf(e)}));var n=new r.BehaviorSubject([]);return this.returnErrorOnNext?n.error(new Error("Error loading Options")):n.next(t),n.asObservable()},e.prototype.sampleData=function(){return[{concept:"a899e0ac-1350-11df-a1f1-0026b9348838",label:"None"},{concept:"a8ad1276-1350-11df-a1f1-0026b9348838",label:"Breathlessness"},{concept:"a892e4b4-1350-11df-a1f1-0026b9348838",label:"Chest pain"},{concept:"a8afc8b8-1350-11df-a1f1-0026b9348838",label:"Cough = 2 weeks"},{concept:"d7adae14-c386-49cc-8f7c-765d8ceec566",label:"Fever for = 2 weeks"},{concept:"3f57aafc-7162-41da-a51b-6a804cb6f5e8",label:"New exposure to household contact with TB"},{concept:"a89807f0-1350-11df-a1f1-0026b9348838",label:"Noticeable Weight loss"},{concept:"e1862fef-68ed-4df4-90dd-a00152f719aa",label:"Night sweats = 2 weeks"},{concept:"a8ad462e-1350-11df-a1f1-0026b9348838",label:"Abdomen"},{concept:"f218c60e-4b54-475a-a4fa-facab9216da8",label:"Groin"},{concept:"a8a774b0-1350-11df-a1f1-0026b9348838",label:"Joints"},{concept:"4639388c-ee31-4dcf-abb4-ad71253493bb",label:"Neck Kw"}]},e}(),on=function(){function e(){this.dataSources={}}return e.prototype.registerEncounters=function(e,t){var n=this,i={data:[],getValue:function(e,t){void 0===t&&(t=0);var r=e.split(".");return r.length>0?n.getFirstValue(r,i.data[t]):i.data[t][e]},getAllObjects:function(){return i.data},getSingleObject:function(e){return void 0===e&&(e=0),i.data[e]}};if(O.default.isArray(t)){var r=[];O.default.each(t,(function(e){r.push(n._transformEncounter(e))})),i.data=O.default.sortBy(r,"encounterDatetime").reverse()}else i.data.push(this._transformEncounter(t));this.putObject(e,i)},e.prototype.putObject=function(e,t){this.dataSources[e]=t},e.prototype.getObject=function(e){return this.dataSources[e]||null},e.prototype.getFirstValue=function(e,t){var n=[];if(this.getAllValues(e,t,n),n.length>0)return{value:n[0],valueDate:C.default(t.encounterDatetime).format("ll")}},e.prototype.getAllValues=function(e,t,n){var i=this;if(!O.default.isNil(t))if(e.length<=1)O.default.isNil(t[e[0]])||n.push(t[e[0]]);else{var r=e.splice(1),o=e[0];O.default.isArray(t[o])&&t[o].length>0?O.default.each(t[o],(function(e){i.getAllValues(r.slice(0),e,n)})):this.getAllValues(r.slice(0),t[o],n)}},e.prototype._transformEncounter=function(e){if(!O.default.isNil(e)){var t={encounterDatetime:e.encounterDatetime};if(e.location&&e.location.uuid&&(t.location=e.location.uuid),e.patient&&e.patient.uuid&&(t.patient=e.patient.uuid),e.form&&e.form.uuid&&(t.form=e.form.uuid),e.encounterType&&e.encounterType.uuid&&(t.encounterType=e.encounterType.uuid),e.provider){var n=e.provider;t.provider=n.uuid}if(e.obs){var i=this._transformObs(e.obs);O.default.extend(t,i)}return t}},e.prototype._transformObs=function(e){var t=this;if(!e)return null;var n={};if(O.default.isArray(e))return O.default.each(e,(function(e){t._augumentObs(n,t._transformObs(e))})),n;if(e.groupMembers){var i={};return O.default.each(e.groupMembers,(function(e){t._augumentObs(i,t._transformObs(e))})),n[e.concept.uuid]&&O.default.isArray(n[e.concept.uuid])?n[e.concept.uuid].push(i):n[e.concept.uuid]=[i],n}return e.value instanceof Object?n[e.concept.uuid]=e.value.uuid:n[e.concept.uuid]=e.value,n},e.prototype._augumentObs=function(e,t){for(var n in t)if(O.default.has(e,n)){if(!O.default.isArray(e[n])){var i=e[n];e[n]=[i]}O.default.isArray(t[n])?Array.prototype.push.apply(e[n],t[n]):e[n].push(t[n])}else e[n]=t[n];return e},e}();on.decorators=[{type:t.Injectable}],on.ctorParameters=function(){return[]};var an=function(){function e(){}return e.prototype.evaluate=function(e,t,n){var i=new on;i.registerEncounters("prevEnc",t.rawPrevEnc);var r={HD:i};if(n)for(var o in n)n[o]&&(r[o]=n[o]);var a=new ce,s=new J;return(new U).getRunnable(e,s,a.helperFunctions,r).run()},e.prototype.evaluatePrecondition=function(e,t,n){var i={histValue:n};return this.evaluate(e,t,i)},e}();an.decorators=[{type:t.Injectable}],an.ctorParameters=function(){return[]};var sn=function(){function t(){this.dataSources={},this.historicalHelperService=new an}return t.prototype.createQuestionModel=function(e,t){if(t){var n=t.dataSourcesContainer.dataSources;this.dataSources=n}return this.toFormQuestionModel(e)},t.prototype.toSelectQuestion=function(e){var t=new Qt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.componentConfigs=e.componentConfigs||[],t.options=e.questionOptions.answers.map((function(e){return{label:e.label,value:e.concept}})),t.options.splice(0,0,{label:"",value:""}),t.renderingType=e.questionOptions.rendering,t.validators=this.addValidators(e),t.extras=e;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toNumericQuestion=function(e){var t=new Yt({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="number",t.placeholder=e.questionOptions.placeholder,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"",t.componentConfigs=e.componentConfigs||[];return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toNumberQuestion=function(e){var t=new Yt({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="number",t.placeholder=e.questionOptions.placeholder||"",t.extras=e,t.componentConfigs=e.componentConfigs||[];return this.copyProperties({label:"label",required:"required",id:"key"},e,t),t.validators=this.addValidators(e),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toDateQuestion=function(e){if("encounterDatetime"===e.type)return this.toEncounterDatetimeQuestion(e);var t=new Wt({type:"",key:""});t.renderingType="date",t.validators=this.addValidators(e),t.extras=e,t.showTime=e.questionOptions.showTime,t.componentConfigs=e.componentConfigs||[],t.showWeeksAdder=!!e.questionOptions.weeksList;return this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toEncounterDatetimeQuestion=function(e){var t=new Wt({type:"",key:""});t.label=e.label,t.renderingType="date",t.key=e.id,t.validators=this.addValidators(e),t.extras=e,t.showWeeksAdder=!!e.questionOptions.weeksList;return t.showTime=!0,t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toCheckBoxQuestion=function(e){var t=new Zt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.extras=e,t.options=e.questionOptions.answers.map((function(e){return{label:e.label,value:e.concept}})),t.options.splice(0,0),t.renderingType=e.questionOptions.rendering;return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toMultiCheckboxQuestion=function(e){var t=new Gt({renderType:"",options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.options=e.questionOptions.answers.map((function(e){return{label:e.label,value:e.concept}})),t.validators=this.addValidators(e),t.dataSource=new rn,t.extras=e;return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toTextAreaQuestion=function(e){var t=new Bt({isExpanded:!1,rows:18,placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.placeholder=e.questionOptions.placeholder,t.isExpanded=e.isExpanded,t.rows=e.questionOptions.rows,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toTextQuestion=function(e){var t=new Yt({placeholder:"",type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="text",t.placeholder=e.questionOptions.placeholder,t.validators=this.addValidators(e),t.extras=e,t.placeholder=e.questionOptions.placeholder||"";return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toFileUploadQuestion=function(e){var t=new Xt({type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="file",t.dataSource="file",t.validators=this.addValidators(e),t.extras=e;return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toDrugQuestion=function(e){var t=new Qt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="drug";return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toProblemQuestion=function(e){var t=new Qt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="problem";return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toConceptAnswerSelect=function(e){var t=new Qt({options:[],type:"",key:""});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource=e.questionOptions.dataSource||"conceptAnswers",t.dataSourceOptions={concept:e.questionOptions.concept};return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toRepeatingQuestion=function(e){var t=new Jt({questions:[],type:"",key:""});if(t.label=e.label,t.questions=this.getChildrenQuestionModels(e.questions),t.key=e.id,t.validators=this.addValidators(e),t.extras=e,"testOrder"===e.type){var n=this.toTestOrderQuestion(e),i=[];i.push(n),t.questions=i}return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toGroupQuestion=function(e){var t=new $t({questions:[],type:"",key:""});t.label=e.label,t.questions=this.getChildrenQuestionModels(e.questions),t.key=e.id,t.validators=this.addValidators(e),t.extras=e;return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toPageQuestion=function(t){var n=this,i=new $t({questions:[],type:"",key:""});return i.label=t.label,i.key=t.label,i.renderingType="page",i.controlType=e.AfeControlType.None,i.questions=[],t.sections.forEach((function(e){i.questions.push(n.toSectionQuestion(e))})),i.componentConfigs=t.componentConfigs||[],i},t.prototype.toFormQuestionModel=function(t){var n=this,i=new $t({questions:[],type:"",key:""});return i.label=t.label,i.key=t.label,i.renderingType="form",i.controlType=e.AfeControlType.AfeFormGroup,i.extras=t,i.questions=[],t.pages.forEach((function(e){i.questions.push(n.toPageQuestion(e))})),i.componentConfigs=t.componentConfigs||[],i},t.prototype.toSectionQuestion=function(t){var n=new $t({questions:[],type:"",key:""});return n.label=t.label,n.key=t.label,n.renderingType="section",n.controlType=e.AfeControlType.None,n.isExpanded="true"===t.isExpanded,n.questions=this.getSchemaQuestions(t.questions),n.componentConfigs=t.componentConfigs||[],n},t.prototype.toPersonAttributeQuestion=function(e){var t=new zt({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="personAttribute";return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addHistoricalExpressions(e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toEncounterProviderQuestion=function(e){var t=new zt({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="provider";return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toFieldSetQuestion=function(e){var t=this.toGroupQuestion(e);return t.renderingType="field-set",t.componentConfigs=e.componentConfigs||[],t},t.prototype.toEncounterLocationQuestion=function(e){var t=new zt({options:[],type:"",key:"",searchFunction:function(){},resolveFunction:function(){}});t.label=e.label,t.key=e.id,t.renderingType=e.type,t.renderingType="remote-select",t.validators=this.addValidators(e),t.extras=e,t.dataSource="location";return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),this.addDisableOrHideProperty(e,t),this.addAlertProperty(e,t),this.addHistoricalExpressions(e,t),this.addCalculatorProperty(e,t),t},t.prototype.toTestOrderQuestion=function(e){var t=new Kt({type:"",key:"",orderType:"",selectableOrders:[],orderSettingUuid:"",label:"",rendering:""});t.label=e.label,t.key=e.id,t.validators=this.addValidators(e),t.extras=e,t.options=e.questionOptions.selectableOrders.map((function(e){return{label:e.label,value:e.concept}}));return t.componentConfigs=e.componentConfigs||[],this.copyProperties({label:"label",required:"required",id:"key"},e,t),t},t.prototype.getSchemaQuestions=function(e){var t=new Array;return this.getQuestions(e,t),t},t.prototype.getQuestions=function(e,t){if(Array.isArray(t)||(t=[]),Array.isArray(e))for(var n in e)e.hasOwnProperty(n)&&this.getQuestions(e[n],t);if(e&&!Array.isArray(e)&&"object"==typeof e)if(e.questionOptions)"group"===e.questionOptions.rendering||"repeating"===e.questionOptions.rendering?t.push(this.toModel(e,e.questionOptions.rendering)):"field-set"===e.questionOptions.rendering||t.push(this.toModel(e,e.questionOptions.rendering));else for(var i in e)e.hasOwnProperty(i)&&this.getQuestions(e[i],t)},t.prototype.getChildrenQuestionModels=function(e){var t=[];return this.getQuestions(e,t),t},t.prototype.toModel=function(e,t){switch("ui-select-extended"===t&&(t=e.type),e.id||(e.id=this.generateId(10)),!e.questionOptions||!0!==e.questionOptions.showDate&&"true"!==e.questionOptions.showDate||(e=this.convertOldVersionComplexObsQuestionToNewVersion(e),t="field-set"),t){case"select":case"single-select":case"multi-select":return this.toSelectQuestion(e);case"numeric":return this.toNumericQuestion(e);case"number":return this.toNumberQuestion(e);case"encounterDatetime":case"encounterDatetime":return this.toEncounterDatetimeQuestion(e);case"date":return this.toDateQuestion(e);case"multiCheckbox":return this.toMultiCheckboxQuestion(e);case"drug":return this.toDrugQuestion(e);case"problem":return this.toProblemQuestion(e);case"group":return this.toGroupQuestion(e);case"field-set":return this.toFieldSetQuestion(e);case"repeating":return this.toRepeatingQuestion(e);case"personAttribute":return this.toPersonAttributeQuestion(e);case"text":return this.toTextQuestion(e);case"textarea":case"textarea":return this.toTextAreaQuestion(e);case"select-concept-answers":return this.toConceptAnswerSelect(e);case"encounterLocation":return this.toEncounterLocationQuestion(e);case"encounterProvider":case"encounterProvider":return this.toEncounterProviderQuestion(e);case"radio":case"checkbox":return this.toCheckBoxQuestion(e);case"file":return this.toFileUploadQuestion(e);default:return console.warn("New Schema Question Type found........."+t),this.toTextQuestion(e)}},t.prototype.convertOldVersionComplexObsQuestionToNewVersion=function(e){var t={type:"complex-obs"};t.label=e.label,t.id="complex_"+e.id,t.questionOptions={},t.questionOptions.concept=e.questionOptions.concept,t.questionOptions.rendering="field-set",t.questions=[],t.validators=[];var n=JSON.parse(JSON.stringify(e));n.type="complex-obs-child",delete n.questionOptions.showDate,delete n.questionOptions.shownDateOptions,n.questionOptions.obsField="value";var i={type:"complex-obs-child"};i.label="Date of "+n.label,i.id="date_"+n.id,i.questionOptions={},i.questionOptions.concept=e.questionOptions.concept,i.questionOptions.rendering="date",i.questionOptions.obsField="obsDatetime";var r=Object.assign({},e.questionOptions.shownDateOptions);return i.validators=r.validators,i.hide=r.hide,t.questions.push(n),t.questions.push(i),t},t.prototype.copyProperties=function(e,t,n){for(var i in t)e.hasOwnProperty(i)&&n.hasOwnProperty(e[i])&&(n[e[i]]=t[i])},t.prototype.addValidators=function(e){var t=[];e.validators&&O.default.forEach(e.validators,(function(e){switch(e.type){case"date":t.push(new en(e));break;case"js_expression":t.push(new z(e));break;case"conditionalAnswered":t.push(new W(e));break;default:t.push(new Q(e))}}));var n=e.questionOptions;if("number"===(n?n.rendering:""))n.max&&n.min&&(t.push(new tn({type:"max",max:n.max})),t.push(new nn({type:"min",min:n.min})));if("object"==typeof e.required){var i=e.required;"conditionalRequired"===i.type&&t.push(new W({referenceQuestionId:i.referenceQuestionId,referenceQuestionAnswers:i.referenceQuestionAnswers,type:i.type,message:i.message}))}return t},t.prototype.addHistoricalExpressions=function(e,t){if(e.historicalExpression&&e.historicalExpression.length>0){t.setHistoricalValue(!0),void 0!==e.showHistoricalEncounterDate?t.showHistoricalEncounterDate("true"===e.showHistoricalEncounterDate):t.showHistoricalEncounterDate();var n=this.historicalHelperService.evaluate(e.historicalExpression,this.dataSources,void 0);if(t.historicalDataValue=n,e.historicalPrepopulateCondition&&n)return void(this.historicalHelperService.evaluatePrecondition(e.historicalPrepopulateCondition,this.dataSources,n)&&(t.defaultValue=n.value));if(e.historicalPrepopulate&&n){var i=C.default(n.valueDate),r=C.default().diff(i,"days");Number.isInteger(e.allowedHistoricalValueAgeInDays)?r<=e.allowedHistoricalValueAgeInDays&&(t.defaultValue=n.value):t.defaultValue=n.value}}},t.prototype.addCalculatorProperty=function(e,t){e.questionOptions&&"object"==typeof e.questionOptions.calculate&&(t.calculateExpression=e.questionOptions.calculate.calculateExpression)},t.prototype.addAlertProperty=function(e,t){e.alert&&(t.alert=e.alert)},t.prototype.addDisableOrHideProperty=function(e,t){e.disable&&(t.disable=e.disable),"object"==typeof e.disable&&(t.disable=e.disable.disableWhenExpression),e.hide&&(t.hide=e.hide),"object"==typeof e.hide&&e.hide.hideWhenExpression&&(t.hide=e.hide.hideWhenExpression)},t.prototype.generateId=function(e){for(var t="_";t.length<e&&e>0;){var n=Math.random();t+=n<.1?Math.floor(100*n):String.fromCharCode(Math.floor(26*n)+(n>.5?97:65))}return"_"+t},t}();sn.decorators=[{type:t.Injectable}],sn.ctorParameters=function(){return[]};var ln=function(){function e(e,t,n){this.schema=e,this.formFactory=t,this.questionFactory=n,this.valueProcessingInfo={},this.existingOrders={},this._showErrors=!1,this._dataSourcesContainer=new be}return Object.defineProperty(e.prototype,"dataSourcesContainer",{get:function(){return this._dataSourcesContainer},enumerable:!1,configurable:!0}),e.prototype.searchNodeByPath=function(e,t,n){var i=this,r=e.children;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];if(a instanceof Y){if(t===a.path)return n.push(a),n;this.searchNodeByPath(a,t,n)}else if(a instanceof H){if(t===a.path)return n.push(a),n}else if(a instanceof B){if(t===a.path)return n.push(a),n;a.children.forEach((function(e){i.searchNodeByPath(e,t,n)}))}}return n},e.prototype.searchNodeByQuestionId=function(e,t){var n=[];return t?this.searchNodeByQuestionType(this.rootNode,t,n):this.findNodesByQuestionId(this.rootNode,e,n),n},e.prototype.searchNodeByQuestionType=function(e,t,n){var i=this;if(e instanceof Y){var r=e;for(var o in r.children)this.searchNodeByQuestionType(r.children[o],t,n)}e instanceof B&&e.children.forEach((function(e){i.searchNodeByQuestionType(e,t,n)}));if(e instanceof H){var a=e.question;a.extras&&a.extras.type&&a.extras.type===t&&n.push(e)}},e.prototype.findNodesByQuestionId=function(e,t,n){var i=this;if(e.question.key===t&&n.push(e),e instanceof Y){var r=e;for(var o in r.children)this.findNodesByQuestionId(r.children[o],t,n)}e instanceof B&&e.children.forEach((function(e){i.findNodesByQuestionId(e,t,n)}))},Object.defineProperty(e.prototype,"valid",{get:function(){return this.rootNode.control.valid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showErrors",{get:function(){return this._showErrors},set:function(e){this._showErrors=e},enumerable:!1,configurable:!0}),e.prototype.markInvalidControls=function(e,t){var n=this,i=e.children;for(var r in i)if(i.hasOwnProperty(r)){var o=i[r];if(o instanceof Y)this.markInvalidControls(o,t);else if(o instanceof H){var a=o.question;if(a.key&&a.key.length>0){var s=o.control;s.valid||s.disabled||(t&&t.push(o),s.markAsTouched())}}else if(o instanceof B){var l=o;l&&l.children&&l.children.length>0&&T.forEach(l.children,(function(e){n.markInvalidControls(e,t)}))}}return t},e.prototype.updateHiddenDisabledStateForAllControls=function(){this._updateHiddenDisabledStateForAllControls(this.rootNode)},e.prototype.updateAlertsForAllControls=function(){this._updateAlertsForAllControls(this.rootNode)},e.prototype._updateAlertsForAllControls=function(e){var t=this;if(e.control&&e.control.updateAlert&&e.control.updateAlert(),e instanceof Y){var n=e;for(var i in n.children)this._updateAlertsForAllControls(n.children[i])}e instanceof B&&e.children.forEach((function(e){t._updateAlertsForAllControls(e)}))},e.prototype._updateHiddenDisabledStateForAllControls=function(e){var t=this;if(e.control&&(e.control.updateDisabledState&&e.control.updateDisabledState(),e.control.updateHiddenState&&e.control.updateHiddenState()),e instanceof Y){var n=e;for(var i in n.children)this._updateHiddenDisabledStateForAllControls(n.children[i])}e instanceof B&&e.children.forEach((function(e){t._updateHiddenDisabledStateForAllControls(e)}))},e}(),cn=function(){function t(e,t,n){this.controlService=e,this.questionFactroy=t,this.controlRelationsFactory=n,this.hd={getValue:function(){return 20}}}return t.prototype.createForm=function(e,t){var n=new ln(e,this,this.questionFactroy);if(t)for(var i in t)t.hasOwnProperty(i)&&n.dataSourcesContainer.registerDataSource(i,t[i],!1);var r=this.questionFactroy.createQuestionModel(e,n);return n.rootNode=this.createNode(r,null,null,n),this.buildRelations(n.rootNode),n.updateHiddenDisabledStateForAllControls(),n.updateAlertsForAllControls(),n},t.prototype.buildRelations=function(e){ue.JSExpressionValidatorsEnabled=!1,this.controlRelationsFactory.buildRelations(e),ue.JSExpressionValidatorsEnabled=!0},t.prototype.createNode=function(e,t,n,i){return e instanceof Ut?e instanceof Jt?this.createArrayNode(e,t,n,i):this.createGroupNode(e,t,n,i):this.createLeafNode(e,t,n,i)},t.prototype.createLeafNode=function(e,t,n,i){var r=this.controlService.generateControlModel(e,n,!1,i);return new H(e,r,null,i,t?t.path:void 0)},t.prototype.createGroupNode=function(e,t,n,i){var r=this.controlService.generateControlModel(e,n,!1,i),o=new Y(e,r,null,i,t?t.path:void 0);return this.createNodeChildren(e,o,r||n,i),o},t.prototype.createArrayNode=function(e,t,n,i){var r=this,o=this.controlService.generateControlModel(e,n,!1,i),a=new B(e,o,n,this,i,t?t.path:void 0);return a.createChildFunc=this.createArrayNodeChild,a.removeChildFunc=this.removeArrayNodeChild,a.addChildNodeCreatedListener((function(e){ue.JSExpressionValidatorsEnabled=!1,r.controlRelationsFactory.buildArrayNodeRelations(e),ue.JSExpressionValidatorsEnabled=!0})),a},t.prototype.createNodeChildren=function(e,t,n,i){var r=this;return e.questions.forEach((function(e){var o=r.createNode(e,t,n,i);t.setChild(e.key,o)})),t.children},t.prototype.createArrayNodeChild=function(t,n,i){null==i&&(i=this);var r=new $t({key:n.path+"."+n.children.length,type:"group",extras:t.extras,label:"",questions:t.questions});t.controlType===e.AfeControlType.None&&(r.controlType=t.controlType);var o=i.createGroupNode(r,null,null,n.form);if(n.children.push(o),n.control instanceof X){var a=n.control;a.setControl(a.controls.length,o.control)}return o},t.prototype.removeArrayNodeChild=function(e,t){var n=t.children[e];if(t.children.splice(e,1),(null!==t.control||void 0!==t.control)&&t.control instanceof X){var i=t.control,r=i.controls.indexOf(n.control);r>=0&&i.removeAt(r)}},t}();cn.decorators=[{type:t.Injectable}],cn.ctorParameters=function(){return[{type:ye},{type:sn},{type:G}]};var un=function(){function e(){}return e.prototype.findObsAnswerToQuestion=function(e,t){var n=this,i=[];if(!this.isObsNode(e))return i;if(e instanceof H||e instanceof Y&&"complex-obs"===e.question.extras.type)return O.default.each(t,(function(t){t.concept&&t.concept.uuid===e.question.extras.questionOptions.concept&&i.push(t)})),i;var r=this.getChildQuestionsConceptUuids(e);return r.length>0&&O.default.each(t,(function(t){t.concept&&t.concept.uuid===e.question.extras.questionOptions.concept&&Array.isArray(t.groupMembers)&&n.isSubsetOf(r,n.getGroupMembersConceptUuids(t))&&i.push(t)})),i},e.prototype.getChildQuestionsConceptUuids=function(e){var t=[];return e.question.extras&&e.question.extras.questions&&O.default.each(e.question.extras.questions,(function(e){e.questionOptions&&e.questionOptions.concept&&t.push(e.questionOptions.concept)})),t},e.prototype.getGroupMembersConceptUuids=function(e){var t=[];return Array.isArray(e.groupMembers)&&O.default.each(e.groupMembers,(function(e){t.push(e.concept.uuid)})),t},e.prototype.isObsNode=function(e){return e.question.extras&&("obs"===e.question.extras.type||"obsGroup"===e.question.extras.type||"complex-obs"===e.question.extras.type||"complex-obs-child"===e.question.extras.type)},e.prototype.isSubsetOf=function(e,t){return 0===t.length&&0===e.length||t.every((function(t){return e.indexOf(t)>=0}))},e.prototype.setSimpleObsNodeValue=function(e,t){if(e&&t.length>0){var n=t[0];e.initialValue=n,!this.isEmpty(n.value)&&n.value.uuid?this.setNodeFormControlValue(e,n.value.uuid):this.isEmpty(n.value)||this.setNodeFormControlValue(e,n.value)}},e.prototype.setMultiselectObsNodeValue=function(e,t){var n,i;if(e&&t.length>0){e.initialValue=t;var r=[];try{for(var o=P(t),a=o.next();!a.done;a=o.next()){var s=a.value;r.push(s.value.uuid)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}this.setNodeFormControlValue(e,r)}},e.prototype.setComplexObsNodeValue=function(e,t){if(e&&t.length>0){var n=void 0,i=void 0,r=e;for(var o in r.children)"value"===r.children[o].question.extras.questionOptions.obsField&&(n=r.children[o]),"obsDatetime"===r.children[o].question.extras.questionOptions.obsField&&(i=r.children[o]);this.setNodeValue(n,t),e.initialValue=n.initialValue,i.initialValue=n.initialValue,this.setNodeFormControlValue(i,n.initialValue.obsDatetime)}},e.prototype.setGroupObsNodeValue=function(e,t){if(e&&t.length>0){var n=e;for(var i in n.initialValue=t[0],n.children)this.setNodeValue(n.children[i],t[0].groupMembers)}},e.prototype.setRepeatingGroupObsNodeValue=function(e,t){if(e&&t.length>0){var n=e;n.initialValue=t;for(var i=0;i<t.length;i++){var r=n.createChildNode();this.setGroupObsNodeValue(r,[t[i]])}}},e.prototype.setNodeValue=function(e,t){switch(this.getObsNodeType(e)){case"unknown":if(e instanceof Y){var n=e;for(var i in n.children)this.setNodeValue(n.children[i],t);break}if(e instanceof B){for(var r=e,o=0;o<r.children.length;o++)this.setNodeValue(r.children[o],t);break}break;case"simple":var a=this.findObsAnswerToQuestion(e,t);this.setSimpleObsNodeValue(e,a);break;case"multiselect":var s=this.findObsAnswerToQuestion(e,t);this.setMultiselectObsNodeValue(e,s);break;case"complex":var l=this.findObsAnswerToQuestion(e,t);this.setComplexObsNodeValue(e,l);break;case"group":var c=this.findObsAnswerToQuestion(e,t);c.length>0&&this.setGroupObsNodeValue(e,c);break;case"repeatingGroup":var u=this.findObsAnswerToQuestion(e,t);u.length>0&&this.setRepeatingGroupObsNodeValue(e,u);break;default:console.error("Unknown obs node",e)}},e.prototype.setNodeFormControlValue=function(e,t){e.control.setValue(t),e.question.enableHistoricalValue&&void 0!==e.initialValue&&e.question.setHistoricalValue(!1)},e.prototype.getObsNodeType=function(e){return this.isObsNode(e)?e instanceof H&&("multiCheckbox"===e.question.extras.questionOptions.rendering||"checkbox"===e.question.extras.questionOptions.rendering||"multi-select"===e.question.extras.questionOptions.rendering)?"multiselect":e instanceof H?"simple":e instanceof Y&&"complex-obs"===e.question.extras.type?"complex":e instanceof B&&"obsGroup"===e.question.extras.type&&"repeating"===e.question.extras.questionOptions.rendering?"repeatingGroup":e instanceof Y&&"obsGroup"===e.question.extras.type?"group":"unknownObs":"unknown"},e.prototype.getSimpleObsPayload=function(e){if(this.isEmpty(e.control.value))return e.initialValue?{uuid:e.initialValue.uuid,voided:!0}:null;if(e.initialValue&&!this.simpleNodeValueChanged(e))return null;var t={concept:e.question.extras.questionOptions.concept,value:e.control.value};return"date"===e.question.extras.questionOptions.rendering&&(t.value=this.toOpenMrsDateTimeString(e.control.value)),e.initialValue&&(delete t.concept,t.uuid=e.initialValue.uuid),t},e.prototype.getComplexObsPayload=function(e){var t,n,i=e;for(var r in i.children)"value"===i.children[r].question.extras.questionOptions.obsField&&(t=i.children[r]),"obsDatetime"===i.children[r].question.extras.questionOptions.obsField&&(n=i.children[r]);var o=this.getObsNodePayload(t);if(o.length>0)return o[0].obsDatetime=this.toOpenMrsDateTimeString(n.control.value),o[0];if(0===o.length&&e.initialValue&&!this.areDatesEqual(e.initialValue.obsDatetime,n.control.value)){var a={uuid:e.initialValue.uuid};return a.obsDatetime=this.toOpenMrsDateTimeString(n.control.value),a}return null},e.prototype.getMultiselectObsPayload=function(e){var t=[],n=[];return Array.isArray(e.initialValue)&&O.default.each(e.initialValue,(function(i){n.push(i.value.uuid),Array.isArray(e.control.value)?e.control.value.indexOf(i.value.uuid)<0&&t.push({uuid:i.uuid,voided:!0}):t.push({uuid:i.uuid,voided:!0})})),Array.isArray(e.control.value)&&O.default.each(e.control.value,(function(i){n.indexOf(i)<0&&t.push({concept:e.question.extras.questionOptions.concept,value:i})})),t},e.prototype.getGroupPayload=function(e){var t=this,n=e,i=[];if(O.default.each(n.children,(function(e){var n=t.getObsNodePayload(e);n.length>0&&(i=i.concat(n))})),0===i.length)return null;var r={groupMembers:i};return n.initialValue?r.uuid=n.initialValue.uuid:r.concept=n.question.extras.questionOptions.concept,r},e.prototype.getRepeatingGroupPayload=function(e){var t=this,n=e,i=[],r=[];return O.default.each(n.children,(function(e){var n=t.getObsNodePayload(e);n.length>0&&(i=i.concat(n)),e.initialValue&&e.initialValue.uuid&&r.push(e.initialValue.uuid)})),n.initialValue&&Array.isArray(n.initialValue)&&O.default.each(n.initialValue,(function(e){if(r.indexOf(e.uuid)<0){var t={uuid:e.uuid,voided:!0};i.push(t)}})),i.length<=0?null:i},e.prototype.getObsNodePayload=function(e){var t=[];switch(this.getObsNodeType(e)){case"unknown":if(e instanceof Y){var n=e;for(var i in n.children){var r=this.getObsNodePayload(n.children[i]);Array.isArray(r)&&r.length>0&&(t=t.concat(r))}break}if(e instanceof B){for(var o=e,a=0;a<o.children.length;a++){var s=this.getObsNodePayload(o.children[a]);Array.isArray(s)&&s.length>0&&(t=t.concat(s))}break}break;case"simple":var l=this.getSimpleObsPayload(e);null!==l&&t.push(l);break;case"multiselect":var c=this.getMultiselectObsPayload(e);Array.isArray(c)&&c.length>0&&(t=t.concat(c));break;case"complex":var u=this.getComplexObsPayload(e);null!==u&&t.push(u);break;case"group":var d=this.getGroupPayload(e);d&&null!==d&&t.push(d);break;case"repeatingGroup":var p=this.getRepeatingGroupPayload(e);Array.isArray(p)&&p.length>0&&(t=t.concat(p))}return t},e.prototype.simpleNodeValueChanged=function(e){return!!e.initialValue&&(e.initialValue.value&&e.initialValue.value.uuid?e.control.value!==e.initialValue.value.uuid:"date"===e.question.extras.questionOptions.rendering?!this.areDatesEqual(e.control.value,e.initialValue.value):e.control.value!==e.initialValue.value)},e.prototype.areDatesEqual=function(e,t){return C.default(e).isSame(t)},e.prototype.isEmpty=function(e){return""===e||null==e},e.prototype.toOpenMrsDateTimeString=function(e){if(!this.isEmpty(e)){var t=C.default(e).format().substring(0,19).replace("T"," ");return this.isEmpty(t)?void 0:t}},e}();un.decorators=[{type:t.Injectable}],un.ctorParameters=function(){return[]};var dn=function(){function e(e){this.helper=e}return e.prototype.generateFormPayload=function(e){return this.helper.getObsNodePayload(e.rootNode)},e.prototype.populateForm=function(e,t){this.helper.setNodeValue(e.rootNode,t)},e.prototype.setValues=function(e,t,n){var i,r;if(e){var o=function(e){if(e instanceof H)a.setObsValue(e,t),e.question.enableHistoricalValue&&void 0!==e.initialValue&&e.question.setHistoricalValue(!1);else if(e.question&&e.question.extras&&"group"===e.question.renderingType||n){var i=T.find(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept&&t.groupMembers}));i&&(e.node&&(e.node.initialValue=i),a.setValues(e.groupMembers,i.groupMembers)),n&&e.payload&&a.setValues(e.groupMembers,e.payload.groupMembers)}else if(e instanceof Y&&"complex-obs"===e.question.extras.type)a.setComplexObsValue(e,t);else{if(!e.question||!e.question.extras||"repeating"!==e.question.renderingType||n)throw new Error("not implemented");a.setRepeatingGroupValues(e,t),e.node.control.updateValueAndValidity()}},a=this;try{for(var s=P(e),l=s.next();!l.done;l=s.next()){o(l.value)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}}},e.prototype.setObsValue=function(e,t){if(e.question&&e.question.extras&&("obs"===e.question.extras.type||"complex-obs-child"===e.question.extras.type&&"value"===e.question.extras.questionOptions.obsField)&&"multiCheckbox"!==e.question.extras.questionOptions.rendering||"checkbox"!==e.question.extras.questionOptions.rendering||"multi-select"!==e.question.extras.questionOptions.rendering){var n=T.find(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept}));n&&(n.value instanceof Object?(e.control.setValue(n.value.uuid),e.control.updateValueAndValidity()):(e.control.setValue(n.value),e.control.updateValueAndValidity()),e.initialValue={obsUuid:n.uuid,value:n.value})}else{var i=T.filter(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept}));i&&i.length>0&&(e.control.setValue(this.getMultiselectValues(i)),e.control.updateValueAndValidity(),e.initialValue=i)}},e.prototype.setComplexObsValue=function(e,t){var n,i;for(var r in e.children)"value"===e.children[r].question.extras.questionOptions.obsField&&(n=e.children[r]),"obsDatetime"===e.children[r].question.extras.questionOptions.obsField&&(i=e.children[r]);this.setObsValue(n,t);var o=T.find(t,(function(t){return t.concept.uuid===e.question.extras.questionOptions.concept}));o&&(i.initialValue={obsUuid:o.uuid,value:o.obsDatetime},i.control.setValue(o.obsDatetime),i.control.updateValueAndValidity())},e.prototype.getMultiselectValues=function(e){var t,n,i=[];try{for(var r=P(e),o=r.next();!o.done;o=r.next()){var a=o.value;i.push(a.value.uuid)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i},e.prototype.setRepeatingGroupValues=function(e,t){var n,i,r=T.filter(t,(function(t){var n=t.concept.uuid===e.question.extras.questionOptions.concept,i=!1;if(n&&t.groupMembers){var r=t.groupMembers.map((function(e){return e.concept.uuid})),o=e.question.questions.map((function(e){return e.extras.questionOptions.concept}));i=T.intersection(r,o).length>0}return n&&i}));if(r.length>0){e.node.initialValue=r;for(var o=0;o<r.length;o++)e.node.createChildNode()}var a=[],s=0,l=function(t){var n=Object.keys(t.children).map((function(e){return t.children[e]})),i=r[s];a.push({question:e.question,groupMembers:n,payload:i}),s++};try{for(var c=P(e.node.children),u=c.next();!u.done;u=c.next()){l(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}this.setValues(a,r,!0)},e.prototype.getQuestionNodes=function(e){var t,n,i,r,o=[];try{for(var a=P(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var c=(i=void 0,P(l.page)),u=c.next();!u.done;u=c.next()){var d=u.value;o.push(d.section)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return[].concat.apply([],o)},e.prototype.repeatingGroup=function(e){var t,n,i=[];try{for(var r=P(e),o=r.next();!o.done;o=r.next()){var a=o.value;i.push({question:a.question,groupMembers:this.traverse(a)})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i},e.prototype.processGroup=function(e,t){if(e.question&&e.question.extras&&"group"===e.question.extras.questionOptions.rendering){var n=T.filter(this.getObsPayload(e.groupMembers),(function(e){return""!==e.value})),i=n.map((function(e){return e.voided}));n.length>0&&i.every(Boolean)?t.push({uuid:e.node.initialValue.uuid,voided:!0}):n.length>0&&(e.node.initialValue?t.push({uuid:e.node.initialValue.uuid,groupMembers:n}):t.push({concept:e.question.extras.questionOptions.concept,groupMembers:n}))}},e.prototype.mapInitialGroup=function(e){var t,n,i={};try{for(var r=P(e.groupMembers),o=r.next();!o.done;o=r.next()){var a=o.value,s="";a.value instanceof Object?s=a.value.uuid:a.value?s=a.value:a.groupMembers&&a.groupMembers.length>0&&(i=this.mapInitialGroup(e)),i[a.concept.uuid+":"+s]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i},e.prototype.mapModelGroup=function(e,t){var n={};for(var i in t)if(t.hasOwnProperty(i)){var r=T.find(e.question.questions,{key:i}),o=t[i];o instanceof Object||""!==o&&(n[r.extras.questionOptions.concept+":"+o]=o)}return n},e.prototype.processRepeatingGroups=function(e,t){var n,i,r,o,a,s,l,c,u=[];if(e.node.initialValue)try{for(var d=P(e.node.initialValue),p=d.next();!p.done;p=d.next()){var h=p.value;u.push({uuid:h.uuid,value:this.mapInitialGroup(h)})}}catch(e){n={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var f=[];try{for(var m=P(e.node.control.value),y=m.next();!y.done;y=m.next()){var g=y.value;f.push({value:this.mapModelGroup(e,g)})}}catch(e){r={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}var b=this.leftOuterJoinArrays(u,f),v=this.leftOuterJoinArrays(f,u),w=e.question.extras.questionOptions.concept,x=[];if(b.length>0){var k=this.createGroupDeletedObs(b);try{for(var C=P(k),T=C.next();!T.done;T=C.next()){var O=T.value;t.push(O)}}catch(e){a={error:e}}finally{try{T&&!T.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}v.length>0&&(x=this.createGroupNewObs(v,w))}else x=this.createGroupNewObs(v,w);if(x.length>0)try{for(var D=P(x),M=D.next();!M.done;M=D.next()){var A=M.value;t.push(A)}}catch(e){l={error:e}}finally{try{M&&!M.done&&(c=D.return)&&c.call(D)}finally{if(l)throw l.error}}},e.prototype.leftOuterJoinArrays=function(e,t){return e.filter((function(e){return!t.some((function(t){return T.isEqual(e.value,t.value)}))}))},e.prototype.createGroupNewObs=function(e,t){var n,i,r=[];try{for(var o=P(e),a=o.next();!a.done;a=o.next()){var s=a.value,l=[];for(var c in s.value){var u=c.split(":")[0],d=c.split(":")[1];l.push({concept:u,value:d})}r.push({concept:t,groupMembers:l})}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r},e.prototype.createGroupDeletedObs=function(e){var t,n,i=[];try{for(var r=P(e),o=r.next();!o.done;o=r.next()){var a=o.value;i.push({uuid:a.uuid,voided:!0})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i},e.prototype.getExactTime=function(e){return e.substring(0,19).replace("T"," ")},e.prototype.processObs=function(e,t){if(e.control&&e.question.extras){var n={concept:e.question.extras.questionOptions.concept,value:"date"!==e.question.extras.questionOptions.rendering||this.isEmpty(e.control.value)?e.control.value:this.getExactTime(e.control.value)};if("multiCheckbox"===e.question.extras.questionOptions.rendering||"checkbox"===e.question.extras.questionOptions.rendering||"multi-select"===e.question.extras.questionOptions.rendering){var i=this.processMultiSelect(e.question.extras.questionOptions.concept,e.control.value);if(e.initialValue){var r=e.initialValue.map((function(e){return{uuid:e.uuid,value:{concept:e.concept.uuid,value:e.value.uuid}}})),o=i.map((function(e){return{value:e}})),a=this.leftOuterJoinArrays(r,o),s=this.leftOuterJoinArrays(o,r);this.processDeletedMultiSelectObs(a,t),this.processNewMultiSelectObs(s,t)}else this.processNewMultiSelectObs(i,t)}else e.initialValue&&e.initialValue.value&&n?this.updateOrVoidObs(n,e.initialValue,t):""!==n.value&&null!==n.value&&t.push(n)}},e.prototype.processComplexObs=function(e,t){var n,i;for(var r in e.children)"value"===e.children[r].question.extras.questionOptions.obsField&&(n=e.children[r]),"obsDatetime"===e.children[r].question.extras.questionOptions.obsField&&(i=e.children[r]);if(n){this.processObs(n,t);var o=t.length>0?t[t.length-1]:void 0;o&&(o.concept&&o.concept===e.question.extras.questionOptions.concept||n.initialValue&&o.uuid===n.initialValue.obsUuid)&&i.initialValue&&i.control.value!==i.initialValue.value&&(o.obsDatetime=i.control.value)}},e.prototype.processDeletedMultiSelectObs=function(e,t){var n,i;try{for(var r=P(e),o=r.next();!o.done;o=r.next()){var a=o.value;t.push({uuid:a.uuid,voided:!0})}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},e.prototype.processNewMultiSelectObs=function(e,t){var n,i;try{for(var r=P(e),o=r.next();!o.done;o=r.next()){var a=o.value;a.value instanceof Object?t.push(a.value):t.push(a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},e.prototype.updateOrVoidObs=function(e,t,n){this.isEmpty(e.value)&&t.value?n.push({uuid:t.obsUuid,voided:!0}):!this.isEmpty(e.value)&&t.value&&n.push({uuid:t.obsUuid,value:e.value})},e.prototype.isEmpty=function(e){return""===e||null==e},e.prototype.traverse=function(e,t){var n=[];if(e.children){if(e.children instanceof Array)return this.repeatingGroup(e.children);if(e.children instanceof Object)for(var i in e.children)if(e.children.hasOwnProperty(i))switch(e.children[i].question.renderingType){case"page":var r=this.traverse(e.children[i]);n.push({page:r,label:e.children[i].question.label});break;case"section":var o=this.traverse(e.children[i]);n.push({section:o,node:e.children[i],label:e.children[i].question.label});break;case"group":var a=this.traverse(e.children[i]);n.push({node:e.children[i],question:e.children[i].question,groupMembers:a});break;case"repeating":var s=this.repeatingGroup(e.children[i].children);n.push({node:e.children[i],question:e.children[i].question,groupMembers:s});break;default:n.push(e.children[i])}}return n},e.prototype.processMultiSelect=function(e,t){var n,i,r=[];if(t&&null!==t)try{for(var o=P(t),a=o.next();!a.done;a=o.next()){var s={concept:e,value:a.value};r.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r},e.prototype.isObs=function(e){return"obs"===e.question.extras.type||"obsGroup"===e.question.extras.type||"complex-obs"===e.question.extras.type},e.prototype.getObsPayload=function(e){var t,n,i=[];try{for(var r=P(e),o=r.next();!o.done;o=r.next()){var a=o.value;this.isObs(a)&&(a.groupMembers,"group"===a.question.extras.questionOptions.rendering?this.processGroup(a,i):(a.groupMembers,"repeating"===a.question.extras.questionOptions.rendering?this.processRepeatingGroups(a,i):a instanceof Y&&"complex-obs"===a.question.extras.type?this.processComplexObs(a,i):this.processObs(a,i)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i},e}();dn.decorators=[{type:t.Injectable}],dn.ctorParameters=function(){return[{type:un}]};var pn=function(){function e(){this.formOrderNodes=[],this.provider=""}return e.prototype.generateFormPayload=function(e){return this.formOrderNodes=[],this._setOrderProvider(e),this._findTestOrderQuestionNodes(e.rootNode),this._createOrdersPayload(this.formOrderNodes,e)},e.prototype.populateForm=function(e,t){e.existingOrders=t,this.formOrderNodes=[],this._findTestOrderQuestionNodes(e.rootNode);var n=this._getExistingOrders(e);this._setOrderValues(this.formOrderNodes,n)},e.prototype._setOrderProvider=function(e){e.valueProcessingInfo.providerUuid&&(this.provider=e.valueProcessingInfo.providerUuid)},e.prototype._createOrdersPayload=function(e,t){var n,i,r,o=[],a=[],s=this._getExistingOrders(t),l=function(e){var t=e.control.value,n=[];for(var i in s&&s.map((function(e){n[e.concept]=e.concept})),t)if(t.hasOwnProperty(i)){var r=t[i][e.question.key],l=c._createPayloadOrder(r,e.question.extras);n[r]!==r&&""!==l.concept&&o.push(l),a[r]=r,""===l.orderNumber&&delete l.orderNumber,""===l.uuid&&delete l.uuid}},c=this;try{for(var u=P(e),d=u.next();!d.done;d=u.next()){l(d.value)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return r=this._getDeletedOrders(a,s),this._addDeletedOrdersToPayload(r,o)},e.prototype._getExistingOrders=function(e){if(e.existingOrders&&e.existingOrders.orders){var t=e.existingOrders.orders.map((function(e){return{concept:e.concept.uuid,orderNumber:e.orderNumber,orderUuid:e.uuid,voided:e.voided,dateVoided:e.auditInfo.dateVoided}}));return T.filter(t,(function(e){return!0!==e.voided&&!e.dateVoided}))}},e.prototype._setOrderValues=function(e,t){var n,i;this._findTestOrderQuestionNodes(e);var r=this.formOrderNodes;try{for(var o=P(r),a=o.next();!a.done;a=o.next()){var s=a.value;this._setOrderNodeValues(s,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype._addDeletedOrdersToPayload=function(e,t){for(var n in e)e.hasOwnProperty(n)&&t.push({uuid:e[n],voided:!0});return t},e.prototype._createPayloadOrder=function(e,t){var n={concept:"",type:"",orderer:"",careSetting:""};return n.concept=e,n.type=t.questionOptions.orderType,n.orderer=this.provider,n.careSetting=t.questionOptions.orderSettingUuid,""===n.orderer&&delete n.orderer,n},e.prototype._getDeletedOrders=function(e,t){var n=[];if(e)for(var i in t)if(t.hasOwnProperty(i)){var r=t[i].concept;e[r]!==r&&n.push(t[i].orderUuid)}return n},e.prototype._setOrderNodeValues=function(e,t){var n,i,r=0;e.initialValue=t;try{for(var o=P(t),a=o.next();!a.done;a=o.next()){var s=a.value;e.createChildNode();var l={};l[e.question.key]=s.concept;var c=e.children[r];c.control.setValue(l),c.initialValue=l,c.orderNumber=s.orderNumber,r++}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype._findTestOrderQuestionNodes=function(e){if(e.children&&e.children instanceof Object)for(var t in e.children)if(e.children.hasOwnProperty(t))switch(e.children[t].question.renderingType){case"page":case"section":case"group":this._findTestOrderQuestionNodes(e.children[t]);break;case"repeating":if(e.children)for(var n in e.children){var i=e.children[n].question;i.extras&&"testOrder"===i.extras.type&&this.formOrderNodes.push(e.children[n])}}},e}();pn.decorators=[{type:t.Injectable}];var hn=function(){function e(e,t){this.ordersAdapter=e,this.obsAdapter=t}return e.prototype.populateForm=function(e,t){this.populateNode(e.rootNode,t),Array.isArray(t.orders)&&this.ordersAdapter.populateForm(e,t),Array.isArray(t.obs)&&this.obsAdapter.populateForm(e,t.obs)},e.prototype.populateNode=function(e,t){if(null==t)throw new Error("Expected payload");this.getEncounterNodes(e).forEach((function(e){switch(e.question.extras.type){case"encounterDatetime":t.encounterDatetime&&(e.control.setValue(C.default(t.encounterDatetime).toDate()),e.initialValue=C.default(t.encounterDatetime).toDate());break;case"encounterProvider":if(Array.isArray(t.encounterProviders)&&t.encounterProviders.length>0){var n=t.encounterProviders[0].provider;n&&n.uuid&&(e.control.setValue(n.uuid),setTimeout((function(){e.control.setValue(n.uuid)})),e.initialValue=n.uuid)}break;case"encounterLocation":t.location&&t.location.uuid&&(e.control.setValue(t.location.uuid),e.initialValue=t.location.uuid)}}))},e.prototype.generateFormPayload=function(e){var t=this.generateNodePayload(e.rootNode);return this.setNonFilledPayloadMembers(e,t),t.obs=this.obsAdapter.generateFormPayload(e)||[],t.orders=this.ordersAdapter.generateFormPayload(e)||[],t},e.prototype.generateNodePayload=function(e){var t=this.getEncounterNodes(e),n={};return t.forEach((function(t){if(null!==t.control.value&&void 0!==t.control.value&&""!==t.control.value)switch(t.question.extras.type){case"encounterDatetime":var i=C.default(t.control.value).utcOffset(e.form.valueProcessingInfo.utcOffset||"+0300");n.encounterDatetime=i.format();break;case"encounterProvider":if(t.control.value&&""!==t.control.value){var r=[];r.push({provider:t.control.value,encounterRole:"a0b03050-c99b-11e0-9572-0800200c9a66"}),n.encounterProviders=r}break;case"encounterLocation":n.location=t.control.value}})),n},e.prototype.getEncounterNodes=function(e){var t=[];return this._getEncounterNodes(e,t),t},e.prototype.setNonFilledPayloadMembers=function(e,t){e.valueProcessingInfo.patientUuid&&this.setPayloadPatientUuid(t,e.valueProcessingInfo.patientUuid),e.valueProcessingInfo.visitUuid&&this.setPayloadVisitUuid(t,e.valueProcessingInfo.visitUuid),e.valueProcessingInfo.encounterTypeUuid&&this.setPayloadEncounterTypeUuid(t,e.valueProcessingInfo.encounterTypeUuid),e.valueProcessingInfo.formUuid&&this.setPayloadFormUuid(t,e.valueProcessingInfo.formUuid),e.valueProcessingInfo.encounterUuid&&this.setPayloadEncounterUuid(t,e.valueProcessingInfo.encounterUuid)},e.prototype.setPayloadPatientUuid=function(e,t){e.patient=t},e.prototype.setPayloadVisitUuid=function(e,t){e.visit=t},e.prototype.setPayloadEncounterTypeUuid=function(e,t){e.encounterType=t},e.prototype.setPayloadFormUuid=function(e,t){e.form=t},e.prototype.setPayloadEncounterUuid=function(e,t){e.uuid=t},e.prototype._getEncounterNodes=function(e,t){var n=this;if(this._isEncounterNode(e)&&t.push(e),e instanceof Y){var i=e;for(var r in i.children)i.children[r]instanceof L&&this._getEncounterNodes(i.children[r],t)}e instanceof B&&(i=e).children.forEach((function(e){n._getEncounterNodes(e,t)}))},e.prototype._isEncounterNode=function(e){return!(!e.question.extras||"encounterDatetime"!==e.question.extras.type&&"encounterProvider"!==e.question.extras.type&&"encounterLocation"!==e.question.extras.type)},e}();hn.decorators=[{type:t.Injectable}],hn.ctorParameters=function(){return[{type:pn},{type:dn}]};var fn=function(){function e(){}return e.prototype.generateFormPayload=function(e){return this.generateNodePayload(e.rootNode)},e.prototype.generateNodePayload=function(e){var t=this.getPersonAttributeNodes(e),n=[];return t.forEach((function(e){null!==e.control.value&&void 0!==e.control.value&&""!==e.control.value&&e.initialValue!==e.control.value&&(!0===e.question.extras.questionOptions.isSimpleValue?n.push({attributeType:e.question.extras.questionOptions.attributeType,value:e.control.value}):n.push({attributeType:e.question.extras.questionOptions.attributeType,hydratedObject:e.control.value}))})),n},e.prototype.populateForm=function(e,t){this.populateNode(e.rootNode,t)},e.prototype.populateNode=function(e,t){if(!Array.isArray(t))throw new Error("Expected an array of attributes");this.getPersonAttributeNodes(e).forEach((function(e){t.forEach((function(t){t.attributeType.uuid===e.question.extras.questionOptions.attributeType&&(t.value.uuid?(e.control.setValue(t.value.uuid),e.initialValue=t.value.uuid):(e.control.setValue(t.value),e.initialValue=t.value))}))}))},e.prototype.getPersonAttributeNodes=function(e){var t=[];return this._getPersonAttributesNodes(e,t),t},e.prototype._getPersonAttributesNodes=function(e,t){var n=this;if(e.question.extras&&"personAttribute"===e.question.extras.type&&t.push(e),e instanceof Y){var i=e;for(var r in i.children)i.children[r]instanceof L&&this._getPersonAttributesNodes(i.children[r],t)}e instanceof B&&(i=e).children.forEach((function(e){n._getPersonAttributesNodes(e,t)}))},e}();fn.decorators=[{type:t.Injectable}],fn.ctorParameters=function(){return[]};var mn=function(){function e(e){this.renderer=e,this.remoteOptionsLoading=!1,this.remoteOptionInput$=new r.Subject,this.placeholder="Search...",this.disabled=!1,this.theme="dark",this.items=[],this.value=[],this.loading=!1,this.searchText="",this.notFoundMsg="match no found",this.done=new t.EventEmitter,this.compareItems=function(e,t){return!(!e.value||!t.value)&&e.value===t.value},this.propagateChange=function(e){}}return Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},set:function(e){this._dataSource=e,this._dataSource&&this._dataSource.dataFromSourceChanged&&this.subscribeToDataSourceDataChanges()},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.loadOptions()},e.prototype.subscribeToDataSourceDataChanges=function(){var e=this;this._dataSource.dataFromSourceChanged.subscribe((function(t){t.length>0?(e.items=t,e.notFoundMsg=""):(e.notFoundMsg="Not found",e.items=[])}))},e.prototype.writeValue=function(e){var t=this;e&&""!==e&&this.dataSource&&(this.loading=!0,this.dataSource.resolveSelectedValue(e).subscribe((function(e){t.items=[e],t.selectedRemoteOptions=e,t.loading=!1}),(function(e){t.loading=!1})))},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(){},e.prototype.onChange=function(e){this.propagateChange(e.id)},e.prototype.selected=function(e){this.propagateChange(e)},e.prototype.trackByFn=function(e){return e.value},e.prototype.loadOptions=function(){var e=this;this.remoteOptions$=r.concat(r.of([]),this.remoteOptionInput$.pipe(g.distinctUntilChanged(),g.tap((function(){e.loading=!0})),g.switchMap((function(t){return e.dataSource.searchOptions(t).pipe(g.catchError((function(){return r.of([])})),g.tap((function(){return e.loading=!1})))}))))},e}();mn.decorators=[{type:t.Component,args:[{selector:"ngx-remote-select",template:'<div>\n <ng-select [ngClass]="{\'afe-custom\': theme === \'light\'}" [disabled]="disabled" [items]="remoteOptions$ | async" bindLabel="label" bindValue="value" [multiple]="false"\n [hideSelected]="true" [compareWith]="compareItems" [trackByFn]="trackByFn" [loading]="loading"\n typeToSearchText="Please enter 2 or more characters" [typeahead]="remoteOptionInput$"\n [(ngModel)]="selectedRemoteOptions" (ngModelChange)="selected($event)">\n </ng-select>\n</div>',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return mn})),multi:!0}]}]}],mn.ctorParameters=function(){return[{type:t.Renderer2}]},mn.propDecorators={placeholder:[{type:t.Input}],componentID:[{type:t.Input}],disabled:[{type:t.Input}],theme:[{type:t.Input}],done:[{type:t.Output}],dataSource:[{type:t.Input}]};var yn=function(){};yn.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,l.NgSelectModule,i.FormsModule],exports:[mn],declarations:[mn],providers:[]}]}];var gn=function(){function e(){this.showAppointments=!1,this.loadingAppointments=!1,this.errorLoadingAppointments=!1,this.appointmentsLoaded=!1,this.appointments=[],this.today=""}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(){var e=this;this.node.control.valueChanges.subscribe((function(t){var n,i;e.resetProperties();var r=e.node;if(r.question.extras.questionOptions.concept&&("a8a666ba-1350-11df-a1f1-0026b9348838"===r.question.extras.questionOptions.concept||"a89d2398-1350-11df-a1f1-0026b9348838"===r.question.extras.questionOptions.concept)&&!e.showAppointments){e.loadingAppointments=!0,e.showAppointments=!0;var o=void 0;r.form&&r.form.dataSourcesContainer.dataSources&&(o=r.form.dataSourcesContainer.dataSources.monthlyScheduleResourceService);var a=null===(i=null===(n=r.form.dataSourcesContainer.dataSources)||void 0===n?void 0:n.userLocation)||void 0===i?void 0:i.uuid;if(o&&a){var s=C.default(t).startOf("week").add(1,"day").format("YYYY-MM-DD"),l=C.default(t).endOf("week").subtract(1,"day").format("YYYY-MM-DD");e.today=C.default(t).format("DD-MM-YYYY");for(var c=[],u=["781d85b0-1359-11df-a1f1-0026b9348838","781d897a-1359-11df-a1f1-0026b9348838","96047aaf-7ab3-45e9-be6a-b61810fe617d","c19aec66-1a40-4588-9b03-b6be55a8dd1d","f7793d42-11ac-4cfd-9b35-e0a21a7a7c31","334c9e98-173f-4454-a8ce-f80b20b7fdf0","96ba279b-b23b-4e78-aba9-dcbd46a96b7b","781d8880-1359-11df-a1f1-0026b9348838"].join(),d=1;d<=5;d++)c.push({date:C.default(t).startOf("week").add(d,"day").format("DD-MM-YYYY"),count:0});o.getMonthlySchedule({startDate:s,endDate:l,limit:5,locationUuids:a,programType:u}).subscribe((function(t){var n=t.results;e.appointmentsLoaded=!0,e.loadingAppointments=!1,c.map((function(e,t){e.count=void 0!==n[t]?n[t].count.scheduled:0})),e.appointments=c}),(function(t){e.loadingAppointments=!1,e.errorLoadingAppointments=!0,e.showAppointments=!1,console.error(t)}))}else e.showAppointments=!1,e.errorLoadingAppointments=!0}}))},e.prototype.resetProperties=function(){this.loadingAppointments=!1,this.appointmentsLoaded=!1,this.errorLoadingAppointments=!1,this.showAppointments=!1,this.appointments=[],this.today=""},e}();gn.decorators=[{type:t.Component,args:[{selector:"appointments-overview",template:'<div *ngIf="showAppointments" class="container">\n <div *ngIf="loadingAppointments">\n <span *ngIf="!appointmentsLoaded && errorLoadingAppointments">Error checking appointments</span>\n <div *ngIf="loadingAppointments" class="bx--inline-loading" aria-live="assertive">\n <div class="bx--inline-loading__animation">\n <div aria-atomic="true" aria-labelledby="loading-id-2" aria-live="assertive"\n class="bx--loading bx--loading--small">\n <label id="loading-id-2" class="bx--visually-hidden">Active loading indicator</label><svg\n class="bx--loading__svg" viewBox="0 0 100 100">\n <title>Active loading indicator</title>\n <circle class="bx--loading__background" cx="50%" cy="50%" r="44"></circle>\n <circle class="bx--loading__stroke" cx="50%" cy="50%" r="44"></circle>\n </svg>\n </div>\n </div>\n <div class="bx--inline-loading__text">Loading...</div>\n </div>\n </div>\n\n <div class="bx--data-table-content" *ngIf="appointmentsLoaded && !errorLoadingAppointments">\n <table class="bx--data-table bx--data-table--no-border">\n <thead>\n <tr>\n <th *ngFor="let appointment of appointments" scope="col" [ngClass]="{ active: appointment.date === today }">\n {{ appointment.date }}\n </th>\n </tr>\n </thead>\n <tbody aria-live="polite">\n <tr>\n <td *ngFor="let appointment of appointments" [ngClass]="{ active: appointment.date === today }">\n {{ appointment.count }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>',styles:[".container{margin-top:.625rem}.active{background-color:#e0e0e0;cursor:pointer}"]}]}],gn.ctorParameters=function(){return[]},gn.propDecorators={node:[{type:t.Input}]};var bn=function(){function e(){this._value=[],this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){var e=this;this.options=this.options.map((function(t){return-1!==e.selected.indexOf(t.value)&&Object.assign(t,{checked:!0}),t}))},e.prototype.ngAfterViewInit=function(){},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},Object.defineProperty(e.prototype,"value",{get:function(){return 0===this._value.length?"":this._value||this._value[0]},set:function(e){if(null==e||""===e)e=[];else if("string"==typeof e)e=[e];else if(!Array.isArray(e))throw new TypeError("Value must be a string or an array.")},enumerable:!1,configurable:!0}),e.prototype.selectOpt=function(e,t){var n=this;t.target.checked?this._value.push(e.value):this.options.forEach((function(t){t.value===e.value&&n._value.splice(t,1)})),this.onChange(this.value)},e}();bn.decorators=[{type:t.Component,args:[{selector:"checkbox",template:'<fieldset class="bx--fieldset">\n <div class="bx--form-item bx--checkbox-wrapper" *ngFor="let option of options; let i = index">\n <input type="checkbox" class="bx--checkbox" [id]="i + \'id\'" [checked]="option.checked" (change)="selectOpt(option, $event)" [value]="option.value">\n <label [for]="i + \'id\'" class="bx--checkbox-label">\n <span class="bx--checkbox-label-text">{{ option.label }}</span>\n </label>\n </div>\n</fieldset>\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return bn})),multi:!0}]}]}],bn.propDecorators={options:[{type:t.Input}],selected:[{type:t.Input}]};var vn=function(){};vn.decorators=[{type:t.NgModule,args:[{declarations:[bn],exports:[bn],imports:[n.CommonModule,i.FormsModule]}]}];var wn=function(){this.active=!1,this.disabled=!1,this.bypassDOM=!1,this.customPaneClass=""};wn.decorators=[{type:t.Component,args:[{selector:"ngx-tab",template:'\n <div *ngIf="active" class="pane" [ngClass]="customPaneClass">\n <h4>{{ tabTitle }}</h4>\n <div *ngIf="bypassDOM">\n <ng-container [ngTemplateOutlet]="template"></ng-container>\n </div>\n <div *ngIf="!bypassDOM">\n <ng-content></ng-content>\n </div>\n </div>\n '}]}],wn.propDecorators={tabTitle:[{type:t.Input}],tabSubTitle:[{type:t.Input}],active:[{type:t.Input}],disabled:[{type:t.Input}],bypassDOM:[{type:t.Input}],customPaneClass:[{type:t.Input}],template:[{type:t.ContentChild,args:[t.TemplateRef]}]};var xn=function(){function e(){this.disableStyle=!1,this.customNavClass="",this.customTabsClass="",this.selectedIndex=0,this.onSelect=new t.EventEmitter}return e.prototype.ngOnChanges=function(e){e.selectedIndex&&!e.selectedIndex.firstChange&&this.selectTab(this.tabs.toArray()[e.selectedIndex.currentValue])},e.prototype.ngAfterContentInit=function(){var e=this,t=this.tabs.filter((function(e){return e.active}));setTimeout((function(){0===t.length&&e.selectTab(e.tabs.first)}))},e.prototype.onHover=function(e){console.log(e)},e.prototype.selectTab=function(e){!0!==e.disabled&&!0!==e.active&&(this.tabs.toArray().forEach((function(e){return e.active=!1})),e.active=!0,this.onSelect.emit(this.tabs.toArray().indexOf(e)))},e.prototype.getStatusClasses=function(e,t){return e?"active":t||e?t?"disabled":void 0:"enabled"},e}();xn.decorators=[{type:t.Component,args:[{selector:"ngx-tabset",template:'<div class="tab-container">\n <div class="tab">\n <button hover-class="hover" class="tablinks completed" *ngFor="let tab of tabs" (click)="selectTab(tab)"\n [class]="getStatusClasses(tab.active,tab.disabled)">\n <span>{{ tab.tabTitle }}</span>\n </button>\n </div>\n\n\n <div id="tab" class="tabcontent">\n <ng-content></ng-content>\n </div>\n\n</div>',styles:[".tab-container{overflow-x:hidden;display:flex;width:100%}.tab{width:219px;position:fixed}.tab button{font-family:inherit;display:block;background-color:inherit;width:100%;border:none;outline:none;text-align:left;transition:.3s;min-height:2rem;white-space:normal;word-wrap:break-word;margin:0 0 .063rem}@media screen and (max-width:768px){.tab button{height:3rem;border-bottom:.0125rem solid var(--open-mrs-background-gray);width:203px}}.tab button.active.hover,.tab button.enabled.hover{background-color:var(--gray-gray-10)}.tab button.completed{border-left:.5rem solid var(--inverse-support-02);background-color:var(--color-green-10);font-weight:400}.tab button.active,.tab button.completed{font-size:.875rem;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:.16px;color:#161616}.tab button.active{background-color:#ededed;border-left:.5rem solid #009d9a;font-weight:600}.tab button.enabled{background-color:#fff;border-left:.5rem solid #9ef0f0;line-height:1.43;color:var(--color-gray-100)}.tab button.enabled,.tab button.error{font-size:.875rem;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:.16px}.tab button.error{background-color:var(--color-red-10);border-left:.5rem solid var(--open-mrs-danger-red-60);line-height:1.29;color:#da1e28}.tab button.disabled{background-color:#fff;border-left:.5rem solid #dae0e0;font-weight:400;line-height:1.43;color:var(--gray-gray-30)}.tab button.active.error,.tab button.disabled{font-size:.875rem;font-stretch:normal;font-style:normal;letter-spacing:.16px}.tab button.active.error{background-color:var(--color-red-20);border-left:.5rem solid var(--open-mrs-danger-red-60);font-weight:600;line-height:1.29;color:#da1e28}.tabcontent{width:100%;padding:0 .625rem;margin-left:230px}"]}]}],xn.propDecorators={tabs:[{type:t.ContentChildren,args:[wn]}],disableStyle:[{type:t.Input}],customNavClass:[{type:t.Input}],customTabsClass:[{type:t.Input}],selectedIndex:[{type:t.Input}],onSelect:[{type:t.Output}]};var kn=function(){function e(e){this.elementRef=e}return e.prototype.onMouseEnter=function(){this.elementRef.nativeElement.classList.add(this.hoverClass)},e.prototype.onMouseLeave=function(){this.elementRef.nativeElement.classList.remove(this.hoverClass)},e}();kn.decorators=[{type:t.Directive,args:[{selector:"[hover-class]"}]}],kn.ctorParameters=function(){return[{type:t.ElementRef}]},kn.propDecorators={hoverClass:[{type:t.Input,args:["hover-class"]}],onMouseEnter:[{type:t.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:t.HostListener,args:["mouseleave"]}]};var Cn=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.forChild=function(){return{ngModule:e,providers:[]}},e}();Cn.decorators=[{type:t.NgModule,args:[{declarations:[wn,xn,kn],exports:[wn,xn],imports:[n.CommonModule]}]}];var Tn=function(){function e(){this.display="default",this.warn=!1,this.id="select-"+e.selectCount++,this.size="md",this.disabled=!1,this.skeleton=!1,this.invalid=!1,this.theme="dark",this.valueChange=new t.EventEmitter,this.onChangeHandler=function(e){},this.onTouchedHandler=function(){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this.select&&(this.select.nativeElement.value=this._value)},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){void 0!==this.value&&null!==this.value&&this.select&&this.select.nativeElement.value!==this.value&&(this.select.nativeElement.value=this.value)},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChangeHandler=e},e.prototype.registerOnTouched=function(e){this.onTouchedHandler=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.onChange=function(e){this.value=e.target.value,this.onChangeHandler(e.target.value),this.valueChange.emit(e.target.value)},e.prototype.focusOut=function(){this.onTouchedHandler()},e.prototype.isTemplate=function(e){return e instanceof t.TemplateRef},e}();Tn.selectCount=0,Tn.decorators=[{type:t.Component,args:[{selector:"ibm-select",template:'\n <div class="bx--form-item">\n <ng-template [ngIf]="skeleton">\n <div *ngIf="label" class="bx--label bx--skeleton"></div>\n <div class="bx--select bx--skeleton"></div>\n </ng-template>\n <div\n *ngIf="!skeleton"\n class="bx--select"\n [ngClass]="{\n \'bx--select--inline\': display === \'inline\',\n \'bx--select--light\': theme === \'light\',\n \'bx--select--invalid\': invalid,\n \'bx--select--warning\': warn,\n \'bx--select--disabled\': disabled\n }"\n >\n <label *ngIf="label" [for]="id" class="bx--label">\n <ng-container *ngIf="!isTemplate(label)">{{ label }}</ng-container>\n <ng-template\n *ngIf="isTemplate(label)"\n [ngTemplateOutlet]="label"\n ></ng-template>\n </label>\n <div *ngIf="helperText" class="bx--form__helper-text">\n <ng-container *ngIf="!isTemplate(helperText)">{{\n helperText\n }}</ng-container>\n <ng-template\n *ngIf="isTemplate(helperText)"\n [ngTemplateOutlet]="helperText"\n ></ng-template>\n </div>\n <div\n *ngIf="display === \'inline\'; else noInline"\n class="bx--select-input--inline__wrapper"\n >\n <ng-container *ngTemplateOutlet="noInline"></ng-container>\n </div>\n </div>\n </div>\n\n \x3c!-- select element: dynamically projected based on \'display\' variant --\x3e\n <ng-template #noInline>\n <div\n class="bx--select-input__wrapper extend"\n [attr.data-invalid]="invalid ? true : null"\n >\n <select\n #select\n [attr.id]="id"\n [attr.aria-label]="ariaLabel"\n [disabled]="disabled"\n (change)="onChange($event)"\n [attr.aria-invalid]="invalid ? \'true\' : null"\n class="bx--select-input"\n [ngClass]="{\n \'bx--select-input--xl\': size === \'xl\',\n \'bx--select-input--sm\': size === \'sm\'\n }"\n >\n <ng-content></ng-content>\n </select>\n <svg\n focusable="false"\n preserveAspectRatio="xMidYMid meet"\n style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg"\n class="bx--select__arrow"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n aria-hidden="true"\n >\n <path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path>\n </svg>\n <svg\n *ngIf="invalid"\n focusable="false"\n preserveAspectRatio="xMidYMid meet"\n style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg"\n class="bx--text-input__invalid-icon"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n aria-hidden="true"\n >\n <path\n d="M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"\n ></path>\n <path\n d="M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8 c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"\n data-icon-path="inner-path"\n opacity="0"\n ></path>\n </svg>\n </div>\n <div\n *ngIf="invalid && invalidText && !warn"\n role="alert"\n class="bx--form-requirement"\n aria-live="polite"\n >\n <ng-container *ngIf="!isTemplate(invalidText)">{{\n invalidText\n }}</ng-container>\n <ng-template\n *ngIf="isTemplate(invalidText)"\n [ngTemplateOutlet]="invalidText"\n ></ng-template>\n </div>\n <div *ngIf="!invalid && warn" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(warnText)">{{\n warnText\n }}</ng-container>\n <ng-template\n *ngIf="isTemplate(warnText)"\n [ngTemplateOutlet]="warnText"\n ></ng-template>\n </div>\n </ng-template>\n ',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:Tn,multi:!0}],styles:["\n .bx--select--inline .bx--form__helper-text {\n order: 4;\n }\n\n .bx--select--inline:not(.bx--select--invalid) .bx--form__helper-text {\n margin-top: 0;\n }\n .bx--select-input__wrapper {\n min-width: 16rem;\n }\n "]}]}],Tn.propDecorators={display:[{type:t.Input}],label:[{type:t.Input}],helperText:[{type:t.Input}],invalidText:[{type:t.Input}],warn:[{type:t.Input}],warnText:[{type:t.Input}],id:[{type:t.Input}],size:[{type:t.Input}],disabled:[{type:t.Input}],skeleton:[{type:t.Input}],invalid:[{type:t.Input}],theme:[{type:t.Input}],ariaLabel:[{type:t.Input}],valueChange:[{type:t.Output}],select:[{type:t.ViewChild,args:["select",{static:!1}]}],value:[{type:t.Input}],focusOut:[{type:t.HostListener,args:["focusout"]}]};var On=function(){this.inputClass="bx--select-option"};On.decorators=[{type:t.Directive,args:[{selector:"option"}]}],On.propDecorators={inputClass:[{type:t.HostBinding,args:["class"]}]};var Dn=function(){this.inputClass="bx--select-optgroup"};Dn.decorators=[{type:t.Directive,args:[{selector:"optgroup"}]}],Dn.propDecorators={inputClass:[{type:t.HostBinding,args:["class"]}]};var Mn=function(){};Mn.decorators=[{type:t.NgModule,args:[{declarations:[Tn,On,Dn],exports:[Tn,On,Dn],imports:[n.CommonModule,i.FormsModule]}]}];var An=function(){function e(){this.theme="dark",this.baseClass=!0,this.invalid=!1,this.skeleton=!1}return Object.defineProperty(e.prototype,"isLightTheme",{get:function(){return"light"===this.theme},enumerable:!1,configurable:!0}),e}();An.decorators=[{type:t.Directive,args:[{selector:"[ibmTextArea]"}]}],An.propDecorators={theme:[{type:t.Input}],baseClass:[{type:t.HostBinding,args:["class.bx--text-area"]}],invalid:[{type:t.HostBinding,args:["class.bx--text-area--invalid"]},{type:t.Input}],skeleton:[{type:t.HostBinding,args:["class.bx--skeleton"]},{type:t.Input}],isLightTheme:[{type:t.HostBinding,args:["class.bx--text-area--light"]}]};var Sn=function(){function e(){this.wrapperClass="bx--text-input__field-wrapper",this.labelInputID="ibm-label-"+e.labelCounter,this.labelState="",this.skeleton=!1,this.invalid=!1,this.warn=!1,this.labelClass=!0,e.labelCounter++}return e.prototype.ngAfterContentInit=function(){this.textArea&&(this.wrapperClass="bx--text-area__wrapper")},e.prototype.ngAfterViewInit=function(){if(this.wrapper){var e=this.wrapper.nativeElement.querySelector("input,textarea,div");e&&e.setAttribute("id",this.labelInputID)}},e.prototype.isTemplate=function(e){return e instanceof t.TemplateRef},e}();Sn.labelCounter=0,Sn.decorators=[{type:t.Component,args:[{selector:"ibm-label",template:'\n <label\n [for]="labelInputID"\n [attr.aria-label]="ariaLabel"\n class="bx--label"\n [ngClass]="{\n \'bx--skeleton\': skeleton\n }"\n >\n <ng-content></ng-content>\n </label>\n <div\n [class]="wrapperClass"\n [ngClass]="{\n \'bx--text-input__field-wrapper--warning\': warn\n }"\n [attr.data-invalid]="invalid ? true : null"\n #wrapper\n >\n <svg\n *ngIf="invalid"\n focusable="false"\n preserveAspectRatio="xMidYMid meet"\n style="will-change: transform;"\n xmlns="http://www.w3.org/2000/svg"\n class="bx--text-input__invalid-icon"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n aria-hidden="true"\n >\n <path\n d="M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"\n ></path>\n <path\n d="M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8 c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z"\n data-icon-path="inner-path"\n opacity="0"\n ></path>\n </svg>\n <ng-content select="input,textarea,div"></ng-content>\n </div>\n <div\n *ngIf="!skeleton && helperText && !invalid && !warn"\n class="bx--form__helper-text"\n >\n <ng-container *ngIf="!isTemplate(helperText)">{{\n helperText\n }}</ng-container>\n <ng-template\n *ngIf="isTemplate(helperText)"\n [ngTemplateOutlet]="helperText"\n ></ng-template>\n </div>\n <div *ngIf="!warn && invalid" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(invalidText)">{{\n invalidText\n }}</ng-container>\n <ng-template\n *ngIf="isTemplate(invalidText)"\n [ngTemplateOutlet]="invalidText"\n ></ng-template>\n </div>\n <div *ngIf="!invalid && warn" class="bx--form-requirement">\n <ng-container *ngIf="!isTemplate(warnText)">{{ warnText }}</ng-container>\n <ng-template\n *ngIf="isTemplate(warnText)"\n [ngTemplateOutlet]="warnText"\n ></ng-template>\n </div>\n '}]}],Sn.ctorParameters=function(){return[]},Sn.propDecorators={labelInputID:[{type:t.Input}],labelState:[{type:t.Input}],skeleton:[{type:t.Input}],helperText:[{type:t.Input}],invalidText:[{type:t.Input}],invalid:[{type:t.Input}],warn:[{type:t.Input}],warnText:[{type:t.Input}],ariaLabel:[{type:t.Input}],wrapper:[{type:t.ViewChild,args:["wrapper",{static:!1}]}],textArea:[{type:t.ContentChild,args:[An,{static:!1}]}],labelClass:[{type:t.HostBinding,args:["class.bx--form-item"]}]};var _n=function(){function e(){this.theme="dark",this.size="md",this.inputClass=!0,this.invalid=!1,this.warn=!1,this.skeleton=!1}return Object.defineProperty(e.prototype,"isSizeXl",{get:function(){return"xl"===this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSizeSm",{get:function(){return"sm"===this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLightTheme",{get:function(){return"light"===this.theme},enumerable:!1,configurable:!0}),e}();_n.decorators=[{type:t.Directive,args:[{selector:"[ibmText]"}]}],_n.propDecorators={theme:[{type:t.Input}],size:[{type:t.Input}],inputClass:[{type:t.HostBinding,args:["class.bx--text-input"]}],isSizeXl:[{type:t.HostBinding,args:["class.bx--text-input--xl"]}],isSizeSm:[{type:t.HostBinding,args:["class.bx--text-input--sm"]}],invalid:[{type:t.HostBinding,args:["class.bx--text-input--invalid"]},{type:t.Input}],warn:[{type:t.HostBinding,args:["class.bx--text-input__field-wrapper--warning"]},{type:t.Input}],skeleton:[{type:t.HostBinding,args:["class.bx--skeleton"]},{type:t.Input}],isLightTheme:[{type:t.HostBinding,args:["class.bx--text-input--light"]}]};var In=function(){};In.decorators=[{type:t.NgModule,args:[{declarations:[Sn,_n,An],exports:[Sn,_n,An],imports:[n.CommonModule,i.FormsModule]}]}];var Pn=function(){function e(){this.customControlConfig={tag:"",url:"",module:""},this.config={},this.touched=!1,this.disabled=!1,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.registerOnValidatorChange=function(e){throw new Error("Method not implemented.")},e.prototype.ngOnInit=function(){var e,t;this.customControlConfig=null===(t=null===(e=this.question)||void 0===e?void 0:e.extras)||void 0===t?void 0:t.customControlConfig},e.prototype.onValueChange=function(e){var t;this.markAsTouched(),this.disabled||(this.value=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.data,this.onChange(this.value))},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.markAsTouched=function(){this.touched||(this.onTouched(),this.touched=!0)},e.prototype.setDisabledState=function(e){this.disabled=e},e}();Pn.decorators=[{type:t.Component,args:[{selector:"app-custom-control-wrapper",template:'<div>\n <ng-template #error>Loading failed...</ng-template>\n <ng-template #loading>Loading...</ng-template>\n <ax-lazy-element\n *axLazyElementDynamic="customControlConfig.tag, url: customControlConfig.url; module: true; errorTemplate: error; loadingTemplate: loading"\n [question]="question" [value]="value" [disabled]=\'disabled\' (on-change)="onValueChange($event)" [config]="config">\n </ax-lazy-element>\n</div>',providers:[{provide:i.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return Pn}))}]}]}],Pn.propDecorators={question:[{type:t.Input}]};var En=function(){};En.decorators=[{type:t.NgModule,args:[{schemas:[t.CUSTOM_ELEMENTS_SCHEMA],imports:[n.CommonModule,i.FormsModule,v.LazyElementsModule],exports:[Pn],declarations:[Pn],providers:[]}]}];var Vn=function(){function e(){this.dark=!0}return e.prototype.ngOnInit=function(){},e}();Vn.decorators=[{type:t.Component,args:[{selector:"app-custom-component-wrapper",template:'<div>\n <ng-template #error>Component Loading failed...</ng-template>\n <ng-template #loading>Loading Component...</ng-template>\n <div *ngFor="let componentConfig of componentConfigs">\n <ax-lazy-element\n *axLazyElementDynamic="componentConfig.tag, url: componentConfig.url; module: true; errorTemplate: error; loadingTemplate: loading"\n [config]="componentConfig" [dark]=\'dark\'>\n </ax-lazy-element>\n </div>\n</div>'}]}],Vn.propDecorators={componentConfigs:[{type:t.Input}],dark:[{type:t.Input}]};var qn=function(){};qn.decorators=[{type:t.NgModule,args:[{schemas:[t.CUSTOM_ELEMENTS_SCHEMA],imports:[n.CommonModule,v.LazyElementsModule],exports:[Vn],declarations:[Vn],providers:[]}]}];var Fn=function(){};Fn.decorators=[{type:t.NgModule,args:[{schemas:[t.CUSTOM_ELEMENTS_SCHEMA],imports:[n.CommonModule,i.ReactiveFormsModule,Mn,l.NgSelectModule,Se,In,Ne,yn,Ee,vn,Rt,Ie,En,qn,Cn.forRoot()],declarations:[ve,Lt,gn,ke,we,M,De],providers:[i.FormBuilder,ye,A,he,fe,me,U,ce,xe,Ht,cn,sn,he,G,un,dn,hn,fn,pn,D],exports:[ve,Lt,we,Ne,Rt]}]}];var jn,Rn=function(e,t){this.key=e,this.value=t};e.RenderingType=void 0,(jn=e.RenderingType||(e.RenderingType={}))[jn.Form=0]="Form",jn[jn.Page=1]="Page",jn[jn.Section=2]="Section",jn[jn.Select=3]="Select",jn[jn.DropDown=4]="DropDown",e.AfeFormArray=X,e.AfeFormControl=J,e.AfeFormGroup=Z,e.CheckBoxQuestion=Zt,e.ConditionalValidationModel=W,e.ControlRelationsFactory=G,e.DataSources=be,e.DateQuestion=Wt,e.DateTimePickerModule=Ne,e.DateValidationModel=en,e.EncounterAdapter=hn,e.FileUploadQuestion=Xt,e.Form=ln,e.FormControlService=ye,e.FormEntryModule=Fn,e.FormErrorsService=A,e.FormFactory=cn,e.FormSchemaCompiler=Ht,e.HistoricalEncounterDataService=on,e.JsExpressionHelper=ce,e.JsExpressionValidationModel=z,e.MaxValidationModel=tn,e.MinValidationModel=nn,e.MultiSelectQuestion=Gt,e.NestedQuestion=Ut,e.NgxDateTimePickerModule=Rt,e.ObsAdapterHelper=un,e.ObsValueAdapter=dn,e.Option=Nt,e.OrderValueAdapter=pn,e.Pair=Rn,e.PersonAttribuAdapter=fn,e.QuestionBase=K,e.QuestionFactory=sn,e.QuestionGroup=$t,e.RepeatingQuestion=Jt,e.SelectQuestion=Qt,e.TestOrderQuestion=Kt,e.TextAreaInputQuestion=Bt,e.TextInputQuestion=Yt,e.UiSelectQuestion=zt,e.ValidationFactory=he,e.ValidationModel=Q,e["ɵa"]=Mn,e["ɵb"]=Tn,e["ɵba"]=rt,e["ɵbb"]=ot,e["ɵbc"]=at,e["ɵbd"]=st,e["ɵbe"]=lt,e["ɵbf"]=et,e["ɵbg"]=Ge,e["ɵbi"]=We,e["ɵbj"]=Ye,e["ɵbk"]=Be,e["ɵbl"]=Qe,e["ɵbm"]=ze,e["ɵbn"]=Ue,e["ɵbo"]=He,e["ɵbp"]=ht,e["ɵbq"]=ft,e["ɵbr"]=mt,e["ɵbs"]=ct,e["ɵbt"]=ut,e["ɵbu"]=dt,e["ɵbv"]=pt,e["ɵbw"]=Xe,e["ɵbx"]=Ct,e["ɵby"]=Tt,e["ɵbz"]=Je,e["ɵc"]=On,e["ɵca"]=$e,e["ɵcb"]=wt,e["ɵcc"]=gt,e["ɵcd"]=vt,e["ɵce"]=bt,e["ɵcf"]=xt,e["ɵcg"]=kt,e["ɵch"]=qt,e["ɵci"]=jt,e["ɵcj"]=Et,e["ɵck"]=Vt,e["ɵcl"]=Le,e["ɵcm"]=En,e["ɵcn"]=Pn,e["ɵco"]=qn,e["ɵcp"]=Vn,e["ɵcq"]=Cn,e["ɵcr"]=wn,e["ɵcs"]=xn,e["ɵct"]=kn,e["ɵcu"]=ve,e["ɵcv"]=ge,e["ɵcw"]=Lt,e["ɵcx"]=gn,e["ɵcy"]=ke,e["ɵcz"]=xe,e["ɵd"]=Dn,e["ɵda"]=we,e["ɵdb"]=M,e["ɵdc"]=De,e["ɵdd"]=fe,e["ɵde"]=U,e["ɵdf"]=D,e["ɵdg"]=me,e["ɵe"]=Se,e["ɵf"]=Ae,e["ɵg"]=In,e["ɵh"]=Sn,e["ɵi"]=An,e["ɵj"]=_n,e["ɵk"]=Ve,e["ɵl"]=qe,e["ɵm"]=Fe,e["ɵn"]=je,e["ɵo"]=Re,e["ɵp"]=yn,e["ɵq"]=mn,e["ɵr"]=Ee,e["ɵs"]=Ie,e["ɵt"]=_e,e["ɵu"]=Pe,e["ɵv"]=vn,e["ɵw"]=bn,e["ɵx"]=Dt,e["ɵy"]=Ot,e["ɵz"]=nt,Object.defineProperty(e,"__esModule",{value:!0})}));
2
- //# sourceMappingURL=openmrs-ngx-formentry.umd.min.js.map