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;IAhDD;QAAC,KAAK,EAAE;QACP,WAAW,CAAC,oBAAoB,CAAC;;8CAAA;IAYlC;QAAC,KAAK,EAAE;;oDAAA;IAgBR;QAAC,KAAK,EAAE;QACP,WAAW,CAAC,WAAW,CAAC;;+CAAA;IA9C3B;QAAC,SAAS,CAAC;YACT,QAAQ,EAAE,MAAM,CAAC,EAAE;YACnB,QAAQ,EAAE,iBAAiB;YAC3B,IAAI,EAAE;gBACJ,MAAM,EAAE,aAAa;gBACrB,eAAe,EAAE,GAAG;gBACpB,eAAe,EAAE,KAAK;aACvB;YACD,WAAW,EAAE,mBAAmB;YAChC,SAAS,EAAE,CAAC,kBAAkB,CAAC;YAC/B,eAAe,EAAE,uBAAuB,CAAC,MAAM;SAChD,CAAC;;qBAAA;IAsDF,oBAAC;AAAD,CArDA,AAqDC,IAAA;AAED,sEAAsE;AACtE,eAAe,CAAS,EAAE,GAAO,EAAE,GAAS;IAAlB,mBAAO,GAAP,OAAO;IAAE,mBAAS,GAAT,SAAS;IAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAQD;IAAA;IAOA,CAAC;IANQ,2BAAO,GAAd;QACE,MAAM,CAAC;YACL,QAAQ,EAAE,mBAAmB;YAC7B,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;IAXH;QAAC,QAAQ,CAAC;YACR,OAAO,EAAE,CAAC,YAAY,CAAC;YACvB,OAAO,EAAE,CAAC,aAAa,CAAC;YACxB,YAAY,EAAE,CAAC,aAAa,CAAC;SAC9B,CAAC;;2BAAA;IAQF,0BAAC;AAAD,CAPA,AAOC,IAAA","file":"progress-bar/progress-bar.js","sourcesContent":["import {\n NgModule,\n ModuleWithProviders,\n Component,\n ChangeDetectionStrategy,\n HostBinding,\n Input,\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\n// TODO(josephperrott): Benchpress tests.\n// TODO(josephperrott): Add ARIA attributes for progressbar \"for\".\n\n\n/**\n * <md-progress-bar> component.\n */\n@Component({\n moduleId: module.id,\n selector: 'md-progress-bar',\n host: {\n 'role': 'progressbar',\n 'aria-valuemin': '0',\n 'aria-valuemax': '100',\n },\n templateUrl: 'progress-bar.html',\n styleUrls: ['progress-bar.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MdProgressBar {\n /** Value of the progressbar. Defaults to zero. Mirrored to aria-valuenow. */\n private _value: number = 0;\n\n @Input()\n @HostBinding('attr.aria-valuenow')\n get value() {\n return this._value;\n }\n\n set value(v: number) {\n this._value = clamp(v || 0);\n }\n\n /** Buffer value of the progress bar. Defaults to zero. */\n private _bufferValue: number = 0;\n\n @Input()\n get bufferValue() {\n return this._bufferValue;\n }\n\n set bufferValue(v: number) {\n this._bufferValue = clamp(v || 0);\n }\n\n /**\n * Mode of the progress bar.\n *\n * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to\n * 'determinate'.\n * Mirrored to mode attribute.\n */\n @Input()\n @HostBinding('attr.mode')\n mode: 'determinate' | 'indeterminate' | 'buffer' | 'query' = 'determinate';\n\n /** Gets the current transform value for the progress bar's primary indicator. */\n _primaryTransform() {\n let scale = this.value / 100;\n return {transform: `scaleX(${scale})`};\n }\n\n /**\n * Gets the current transform value for the progress bar's buffer indicator. Only used if the\n * progress mode is set to buffer, otherwise returns an undefined, causing no transformation.\n */\n _bufferTransform() {\n if (this.mode == 'buffer') {\n let scale = this.bufferValue / 100;\n return {transform: `scaleX(${scale})`};\n }\n }\n}\n\n/** Clamps a value to be between two numbers, by default 0 and 100. */\nfunction clamp(v: number, min = 0, max = 100) {\n return Math.max(min, Math.min(max, v));\n}\n\n\n@NgModule({\n imports: [CommonModule],\n exports: [MdProgressBar],\n declarations: [MdProgressBar],\n})\nexport class MdProgressBarModule {\n static forRoot(): ModuleWithProviders {\n return {\n ngModule: MdProgressBarModule,\n providers: []\n };\n }\n}\n"],"sourceRoot":"/source/"}
\No newline at end of file