\n )\n}\n","import React from 'react'\n\n/**\n * @description PhotoCard component for UnsplashImagePicker\n * @param {Object} photo - The photo to display.\n * @param {funtion} onPhotoSelect - Function to call when a photo is selected.\n */\nexport default function UnsplashPhotoCard({\n photo,\n onPhotoSelect = (_: any) => {}\n}: any) {\n return (\n
onPhotoSelect(photo)}\n >\n \n
\n
\n
\n \n
{photo.user.name}
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport UnsplashPhotoCard from './photo-card'\n\ninterface Props {\n isLoading?: boolean\n isLoadingMore?: boolean\n photoList: Array\n total?: number | undefined\n onPhotoSelect: (photo: any) => void\n loadMore: () => void\n}\nfunction PhotoList({\n isLoading = false,\n isLoadingMore = false,\n photoList,\n total,\n onPhotoSelect,\n loadMore\n}: Props) {\n const listHeight = '700px' // 'calc(100 - 125px)'\n const ref = React.useMemo(() => React.createRef(), [])\n\n const onScroll = () => {\n if (ref.current) {\n const { scrollTop, scrollHeight, clientHeight } = ref.current\n if (scrollHeight - (scrollTop + clientHeight) < 20) {\n // Contributors list lazy loading you're at the bottom of the page\n // do this when we reach end\n loadMore()\n }\n }\n }\n\n return (\n
\n )\n}\n","import React from 'react'\nimport Modal from '../modal'\nimport ImagePicker from '../picker'\n\ninterface Props {\n unsplashAccessKey: any\n active?: boolean\n modalWidth?: number\n modalClassName?: string\n initialPhotoSearchQuery?: string\n setActive?: (active: boolean) => void\n onPhotoSelect?: (photo: any) => void\n}\n\n/**\n * @description ImagePickerModal search image from Unsplash.\n * @param {string} unsplashAccessKey - The unsplash access key.\n * @param {string} initialPhotoSearchQuery - The initial search query.\n * @param {boolean} active - Whether the image picker is active.\n * @param {function} setActive - Function to set the image picker active.\n * @param {function} onPhotoSelect - Function to call when a photo is selected.\n * @param {number} modalWidth - The width of the modal. Default is 840px.\n * @param {string} modalClassName - The classname for the modal.\n */\nexport default function ImagePickerModal({\n unsplashAccessKey,\n active = false,\n initialPhotoSearchQuery = '',\n setActive = (_: boolean) => {},\n onPhotoSelect = (_: any) => {},\n modalWidth = 840,\n modalClassName = ''\n}: Props) {\n if (!active) {\n return null\n }\n\n return (\n
\n \n \n \n
\n )\n}\n"],"names":["Modal","children","className","width","padding","active","setActive","_e","props","React","onClick","onKeyUp","e","key","cx","Card","stopPropagation","style","maxWidth","_","UnsplashPhotoCard","photo","onPhotoSelect","id","src","urls","thumb","alt","alt_description","color","user","profile_image","small","username","name","PhotoList","isLoading","isLoadingMore","photoList","total","loadMore","listHeight","ref","useMemo","createRef","onScroll","current","scrollTop","scrollHeight","clientHeight","Loader","Array","isArray","length","maxHeight","map","xmlns","fill","viewBox","cy","r","stroke","strokeWidth","d","SearchBar","setQuery","query","onSearch","searchPhotos","preventDefault","onSubmit","placeholder","type","value","onChange","target","ImagePicker","unsplashAccessKey","initialPhotoSearchQuery","pics","setPics","useState","setTotal","setIsLoading","setIsLoadingMore","page","setPage","unsplash","createApi","accessKey","useEffect","fetchPhotos","text","reset","search","getPhotos","perPage","orientation","then","response","newPics","results","mergedPics","error","console","log","ImagePickerModal","modalWidth","modalClassName"],"mappings":";;;;SAGwBA,MAAM;EAC5BC,QAD4B;EAE5BC,SAAS,GAAG,EAFgB;EAG5BC,KAAK,GAAG,GAHoB;EAI5BC,OAAO,GAAG,IAJkB;EAK5BC,MAAM,GAAG,KALmB;EAM5BC,SAAS,GAAG,UAAUC,EAAV,IANgB;EAO5B,GAAGC;AAPyB;EAS5B,OACEC,mBAAA,MAAA;IACEC,OAAO,EAAGH,EAAD;MACP,IAAIF,MAAJ,EAAY;QACVC,SAAS,CAAC,KAAD,CAAT;OADF,MAEO;QACLA,SAAS,CAAC,IAAD,CAAT;;;IAGJK,OAAO,EAAGC,CAAD;MACP,IAAIA,CAAC,CAACC,GAAF,KAAU,QAAd,EAAwB;QACtBP,SAAS,CAAC,KAAD,CAAT;;;IAGJJ,SAAS,EAAEY,EAAE,QAAA,EAAU;MACrBT,MAAM,EAAEA;KADG;KAGTG,MAhBN,EAkBEC,mBAAA,CAACM,IAAD;IACEL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IACXC,aAAa,EAAEA;IACfG,QAAQ,EAAE;MACRmD,WAAW,CAACN,IAAI,GAAG,CAAR,EAAWnB,KAAX,CAAX;;IAEF5C,aAAa,EAAE,MAAOD,KAAP;MACb,IAAI;QAGFC,aAAa,CAACD,KAAD,CAAb;OAHF,CAIE,OAAOkF,KAAP,EAAc;QACdC,OAAO,CAACC,GAAR,CAAYF,KAAZ;;;GAdN,CAlBF,CADF,CADF,CADF;AA2CD;;SCzFuBG,iBAAiB;EACvC7B,iBADuC;EAEvCxE,MAAM,GAAG,KAF8B;EAGvCyE,uBAAuB,GAAG,EAHa;EAIvCxE,SAAS,GAAIa,CAAD,MAJ2B;EAKvCG,aAAa,GAAIH,CAAD,MALuB;EAMvCwF,UAAU,GAAG,GAN0B;EAOvCC,cAAc,GAAG;AAPsB;EASvC,IAAI,CAACvG,MAAL,EAAa;IACX,OAAO,IAAP;;;EAGF,OACEI,mBAAA,MAAA;IAAKP,SAAS,EAAC;GAAf,EACEO,mBAAA,CAACT,KAAD;IACEK,MAAM,EAAEA;IACRC,SAAS,EAAEA;IACXH,KAAK,KAAKwG;IACVvG,OAAO,EAAE;IACTF,SAAS,EAAE0G;GALb,EAOEnG,mBAAA,CAACmE,WAAD;IACEC,iBAAiB,EAAEA;IACnBC,uBAAuB,EAAEA;IACzBxD,aAAa,EAAEA;GAHjB,CAPF,CADF,CADF;AAiBD;;;;;"}
\ No newline at end of file
+{"version":3,"file":"index.modern.js","sources":["../src/component/modal.tsx","../src/component/picker/photo-card.tsx","../src/component/picker/photo-list.component.tsx","../src/component/picker/search-bar.component.tsx","../src/component/picker/index.tsx","../src/component/picker-modal/picker-modal.tsx"],"sourcesContent":["import cx from 'classnames'\nimport React from 'react'\n\nexport default function Modal({\n children,\n className = '',\n width = 540,\n padding = true,\n active = false,\n setActive = function (_e: any) {},\n ...props\n}: any): JSX.Element {\n return (\n
{\n if (active) {\n setActive(false)\n } else {\n setActive(true)\n }\n }}\n onKeyUp={(e) => {\n if (e.key === 'Escape') {\n setActive(false)\n }\n }}\n className={cx(`Modal`, {\n active: active\n })}\n {...props}\n >\n {\n // stop the card being closed when we click on inner divs\n if (active) {\n e.stopPropagation()\n }\n }}\n padding={padding}\n className='overflow-hidden h-full'\n style={{ maxWidth: width, width: '100%' }}\n >\n {children}\n \n
\n )\n}\n","import React from 'react'\n\n/**\n * @description PhotoCard component for UnsplashImagePicker\n * @param {Object} photo - The photo to display.\n * @param {funtion} onPhotoSelect - Function to call when a photo is selected.\n */\nexport default function UnsplashPhotoCard({\n photo,\n onPhotoSelect = (_: any) => {}\n}: any) {\n return (\n
onPhotoSelect(photo)}\n >\n \n
\n
\n
\n \n
{photo.user.name}
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport UnsplashPhotoCard from './photo-card'\n\ninterface Props {\n isLoading?: boolean\n isLoadingMore?: boolean\n photoList: Array\n total?: number | undefined\n onPhotoSelect: (photo: any) => void\n loadMore: () => void\n}\nfunction PhotoList({\n isLoading = false,\n isLoadingMore = false,\n photoList,\n total,\n onPhotoSelect,\n loadMore\n}: Props) {\n const listHeight = '700px' // 'calc(100 - 125px)'\n const ref = React.useMemo(() => React.createRef(), [])\n\n const onScroll = () => {\n if (ref.current) {\n const { scrollTop, scrollHeight, clientHeight } = ref.current\n if (scrollHeight - (scrollTop + clientHeight) < 20) {\n // Contributors list lazy loading you're at the bottom of the page\n // do this when we reach end\n loadMore()\n }\n }\n }\n\n return (\n