{"version":3,"file":"PDFViewer.B5XWFixp.mjs","names":["React.useRef"],"sources":["https:/framerusercontent.com/modules/Kb4m2B21B56t324JIFU5/xhHz4rRntOGCSkBfroK8/PDFViewer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function PDFViewer(props){const{pdfUrl,borderRadius,cropTop,showFullscreen}=props;const containerRef=React.useRef(null);// Fungsi Fullscreen\nconst toggleFullscreen=()=>{if(!containerRef.current)return;if(!document.fullscreenElement){containerRef.current.requestFullscreen().catch(err=>{console.error(`Error: ${err.message}`);});}else{document.exitFullscreen();}};if(!pdfUrl){return /*#__PURE__*/_jsx(\"div\",{style:placeholderStyle,children:/*#__PURE__*/_jsx(\"p\",{children:\"Masukkan URL PDF di sidebar kanan →\"})});}let finalUrl=\"\";if(pdfUrl.includes(\"google.com/viewer\")){finalUrl=pdfUrl;}else{const cleanUrl=pdfUrl.replace(\"&embedded=true\",\"\");finalUrl=`https://docs.google.com/viewer?url=${encodeURIComponent(cleanUrl)}&embedded=true`;}return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{...containerStyle,borderRadius:`${borderRadius}px`,position:\"relative\",overflow:\"hidden\",backgroundColor:\"#fff\"},children:[/*#__PURE__*/_jsx(\"iframe\",{src:finalUrl,style:{width:\"100%\",height:`calc(100% + ${cropTop}px)`,border:\"none\",marginTop:`-${cropTop}px`},title:\"PDF Document\",allowFullScreen:true}),showFullscreen&&/*#__PURE__*/_jsx(\"button\",{onClick:toggleFullscreen,style:buttonStyle,title:\"Fullscreen\",children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 24 24\",width:\"20\",height:\"20\",fill:\"white\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z\"})})})]});}// Default Properties\nPDFViewer.defaultProps={pdfUrl:\"https://raw.githubusercontent.com/rizkibii/ngejarkaweruhbooks/ef8ff2e0616f97a2c361bc8dc3976f177242ae56/modul1-bindo.pdf\",borderRadius:12,cropTop:45,showFullscreen:true};// Property Controls\naddPropertyControls(PDFViewer,{pdfUrl:{type:ControlType.String,title:\"PDF URL\"},borderRadius:{type:ControlType.Number,title:\"Radius\",min:0,max:50},cropTop:{type:ControlType.Number,title:\"Crop Top\",min:0,max:100},showFullscreen:{type:ControlType.Boolean,title:\"Fullscreen BTN\"}});const containerStyle={width:\"100%\",height:\"100%\",display:\"flex\"};const placeholderStyle={...containerStyle,justifyContent:\"center\",alignItems:\"center\",color:\"#999\",border:\"1px dashed #ccc\",fontSize:\"12px\",padding:\"20px\"};const buttonStyle={position:\"absolute\",bottom:\"16px\",right:\"16px\",width:\"42px\",height:\"42px\",borderRadius:\"10px\",backgroundColor:\"rgba(0, 0, 0, 0.5)\",backdropFilter:\"blur(8px)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",border:\"none\",cursor:\"pointer\",zIndex:100,boxShadow:\"0 4px 12px rgba(0,0,0,0.15)\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PDFViewer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PDFViewer.map"],"mappings":"kLAGG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,SAAO,eAAa,UAAQ,kBAAgB,EAAY,EAAaA,EAAa,KAAK,CACnI,MAAqB,CAAK,EAAa,UAAmB,SAAS,kBAAwH,SAAS,gBAAgB,CAA9H,EAAa,QAAQ,mBAAmB,CAAC,MAAM,GAAK,CAAC,QAAQ,MAAM,UAAU,EAAI,UAAU,EAAG,G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