{"version":3,"sources":["webpack:///./node_modules/@aws-amplify/ui-components/dist/esm-es5/amplify-photo-picker.entry.js"],"names":["amplifyPhotoPickerCss","AmplifyPhotoPicker","hostRef","_this","this","headerTitle","PHOTO_PICKER_TITLE","headerHint","PHOTO_PICKER_HINT","placeholderHint","PHOTO_PICKER_PLACEHOLDER_HINT","buttonText","PHOTO_PICKER_BUTTON_TEXT","handleClick","handleInput","ev","file","target","files","reader","FileReader","onload","_e","url","result","previewState","readAsDataURL","prototype","componentWillLoad","previewSrc","render","class","get","acceptValue","inputHandler","slot","src","name","handleButtonClick","style"],"mappings":"gHAAA,oGAIIA,EAAwB,ipCACxBC,EAAoC,WACpC,SAASA,EAAmBC,GACxB,IAAIC,EAAQC,KACZ,eAAiBA,KAAMF,GAEvBE,KAAKC,YAAc,OAAaC,mBAEhCF,KAAKG,WAAa,OAAaC,kBAE/BJ,KAAKK,gBAAkB,OAAaC,8BAEpCN,KAAKO,WAAa,OAAaC,yBAE/BR,KAAKS,YAAc,aACnBT,KAAKU,YAAc,SAAUC,GACzBZ,EAAMa,KAAOD,EAAGE,OAAOC,MAAM,GAC7B,IAAIC,EAAS,IAAIC,WACjBD,EAAOE,OAAS,SAAUC,GACtB,IAAIC,EAAMJ,EAAOK,OACjBrB,EAAMsB,aAAeF,GAEzBJ,EAAOO,cAAcvB,EAAMa,OAUnC,OAPAf,EAAmB0B,UAAUC,kBAAoB,WAC7CxB,KAAKqB,aAAerB,KAAKyB,YAE7B5B,EAAmB0B,UAAUG,OAAS,WAClC,IAAI3B,EAAQC,KACZ,OAAQ,cAAD,CAAG,MAAO,CAAE2B,MAAO,0BAA4B,eAAE,kBAAmB,KAAM,eAAE,MAAO,CAAEA,MAAO,UAAY,OAAKC,IAAI5B,KAAKC,cAAe,eAAE,MAAO,CAAE0B,MAAO,eAAiB,OAAKC,IAAI5B,KAAKG,aAAc,eAAE,iBAAkB,CAAE0B,YAAa,UAAWC,aAAc9B,KAAKU,aAAe,eAAE,MAAO,CAAEiB,MAAO,cAAeI,KAAM,UAAY/B,KAAKqB,aAAgB,cAAD,CAAG,MAAO,CAAEW,IAAK,GAAKhC,KAAKqB,eAAoB,cAAD,CAAG,eAAgB,CAAEY,KAAM,uBAA0B,eAAE,MAAO,CAAEN,MAAO,oBAAsB,OAAKC,IAAI5B,KAAKK,kBAAmB,eAAE,iBAAkB,CAAE6B,kBAAmB,WAAc,OAAOnC,EAAMU,YAAYV,EAAMa,QAAY,OAAKgB,IAAI5B,KAAKO,gBAE3nBV,EA/B4B,GAiCvCA,EAAmBsC,MAAQvC","file":"js/chunk-2d217172.8f3050a4.js","sourcesContent":["import { r as registerInstance, h } from './index-83f2275b.js';\nimport { I18n } from '@aws-amplify/core';\nimport '@aws-amplify/auth';\nimport { T as Translations } from './Translations-108d469f.js';\nvar amplifyPhotoPickerCss = \":host{--object-fit:cover;--hint-color:var(--amplify-grey);--header-color:var(--amplify-secondary-color);--header-size:var(--amplify-text-lg);--header-hint-size:var(--amplify-text-md);--placeholder-hint-size:var(--amplify-text-sm);--placeholder-border-color:var(--amplify-grey)}.photo-picker-container{max-width:50rem}img{-o-object-fit:var(--object-fit);object-fit:var(--object-fit);width:100%;height:100%}input[type=file]{width:100%;height:100%;display:inline-block;position:absolute;left:0;top:0;opacity:0;cursor:pointer}.header{color:var(--header-color);font-size:var(--header-size);font-weight:bold;margin-bottom:24px}.header-hint{color:var(--hint-color);font-size:var(--header-hint-size);word-break:break-word;margin-bottom:24px}.picker-body{position:relative;width:25rem;height:16rem;border:2px dotted var(--placeholder-border-color);padding:10px;margin-bottom:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;overflow:hidden}.placeholder-hint{color:var(--hint-color);font-family:Helvetica;font-style:italic;font-size:var(--placeholder-hint-size);word-break:break-word;margin-bottom:30px}\";\nvar AmplifyPhotoPicker = /** @class */ (function () {\n function AmplifyPhotoPicker(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Title string value */\n this.headerTitle = Translations.PHOTO_PICKER_TITLE;\n /** Header Hint value in string */\n this.headerHint = Translations.PHOTO_PICKER_HINT;\n /** Placeholder hint that goes under the placeholder image */\n this.placeholderHint = Translations.PHOTO_PICKER_PLACEHOLDER_HINT;\n /** Picker button text as string */\n this.buttonText = Translations.PHOTO_PICKER_BUTTON_TEXT;\n /** Function that handles file pick onClick */\n this.handleClick = function () { };\n this.handleInput = function (ev) {\n _this.file = ev.target.files[0];\n var reader = new FileReader();\n reader.onload = function (_e) {\n var url = reader.result;\n _this.previewState = url;\n };\n reader.readAsDataURL(_this.file);\n };\n }\n AmplifyPhotoPicker.prototype.componentWillLoad = function () {\n this.previewState = this.previewSrc;\n };\n AmplifyPhotoPicker.prototype.render = function () {\n var _this = this;\n return (h(\"div\", { class: \"photo-picker-container\" }, h(\"amplify-section\", null, h(\"div\", { class: \"header\" }, I18n.get(this.headerTitle)), h(\"div\", { class: \"header-hint\" }, I18n.get(this.headerHint)), h(\"amplify-picker\", { acceptValue: 'image/*', inputHandler: this.handleInput }, h(\"div\", { class: \"picker-body\", slot: \"picker\" }, this.previewState ? (h(\"img\", { src: \"\" + this.previewState })) : (h(\"amplify-icon\", { name: \"photoPlaceholder\" })))), h(\"div\", { class: \"placeholder-hint\" }, I18n.get(this.placeholderHint)), h(\"amplify-button\", { handleButtonClick: function () { return _this.handleClick(_this.file); } }, I18n.get(this.buttonText)))));\n };\n return AmplifyPhotoPicker;\n}());\nAmplifyPhotoPicker.style = amplifyPhotoPickerCss;\nexport { AmplifyPhotoPicker as amplify_photo_picker };\n"],"sourceRoot":""}