PageSourceSearch

https://www.werla-apotheke.de/modern-build/102.93a59a41.js

js werla-apotheke.de collected 2026-10-07 05:21:38 UTC 11,036 bytes, 2 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3176b4f8-b782-4bd4-af26-87bd14e6e640",e._sentryDebugIdIdentifier="sentry-dbid-3176b4f8-b782-4bd4-af26-87bd14e6e640")}catch(e){}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"v276.0-0-gf58f8bf"};(globalThis.webpackChunk||=[]).push([[102],{7077(__unused_webpack_module,__webpack_exports__,__webpack_require__){function __WEBPACK_DEFAULT_EXPORT__(thumbnailCanvas,sessionStorageKey,recipeData){const thumbnail=new Image;thumbnail.onload=()=>{if(thumbnail.width===thumbnail.height)thumbnailCanvas.getContext("2d").drawImage(thumbnail,0,0,thumbnailCanvas.width,thumbnailCanvas.height);else{const minVal=Math.min(thumbnail.width,thumbnail.height);let sx=0,sy=(thumbnail.height-minVal)/2;thumbnail.width>thumbnail.height&&(sx=(thumbnail.width-minVal)/2,sy=0),thumbnailCanvas.getContext("2d").drawImage(thumbnail,sx,sy,minVal,minVal,0,0,thumbnailCanvas.width,thumbnailCanvas.height)}const thumbnailImageData=thumbnailCanvas.toDataURL("image/jpeg");try{sessionStorage.setItem(sessionStorageKey,thumbnailImageData)}catch(err){console.error(err)}},thumbnail.src=recipeData}__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__}),__webpack_require__.dn(__WEBPACK_DEFAULT_EXPORT__)},4841(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__}),__webpack_require__.dn(__WEBPACK_DEFAULT_EXPORT__);__webpack_require__(4423);async function __WEBPACK_DEFAULT_EXPORT__(videoSelectTarget){videoSelectTarget.innerHTML="",await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(mediaStream=>{mediaStream.getTracks().forEach(track=>track.stop())});let selectedDeviceIdValue=null,lastDeviceIdValue=null;const isMobile=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);return await navigator.mediaDevices.enumerateDevices().then(devices=>{let count=0;devices.forEach(device=>{if("videoinput"===device.kind){(!isMobile()&&0===count||isMobile()&&(device.label.toLowerCase().includes("back")||device.label.toLowerCase().includes("rück")))&&(selectedDeviceIdValue=device.deviceId);const sourceOption=document.createElement("option");sourceOption.text=""===device.label?`Kamera ${count+1}`:device.label,sourceOption.value=device.deviceId,videoSelectTarget.append(sourceOption),count+=1}lastDeviceIdValue=device.deviceId}),count>1&&!isMobile()&&videoSelectTarget.classList.remove("d-none")}),selectedDeviceIdValue||lastDeviceIdValue}},102(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__(4423);var _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2891),_hotwired_turbo__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(89),_lib_cart__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(5427),_lib_video_select__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(4841),_lib_thumbnail_creation__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(7077);const validFileTypes=["image/jpg","image/jpeg","image/png","application/pdf"],__WEBPACK_DEFAULT_EXPORT__=class extends _hotwired_stimulus__WEBPACK_IMPORTED_MODULE_1__.xI{static values={pzn:Number,prescriptionOnly:{type:Boolean,default:!1},cartEntryId:Number,index:Number,addToCartUrl:String,addRecipeToCartUrl:String,cartUrl:String,selectedDeviceId:String,uploadButtonClicked:String};static targets=["cameraToggle","cameraForm","cameraInput","fileUpload","fileUploadStatus","fileUploadProgressBar","fileUploadImages","deleteFileUploadImage","webcamVideo","webcamCanvas","webcamResetButton","thumbnailCanvas","videoSelect","uploadError","consentUpload","consentOptions","consentCheckbox","consentButton","cameraFallback","webcamUserMessage"];connect(){const cameraSupported=void 0!==document.createElement("input").capture;this.isVideoSelected=!1,"#upload"===window.location.hash&&this.checkConsentUpload(null),cameraSupported?this.cameraInputTarget.removeAttribute("disabled"):(this.cameraFormTarget.classList.add("d-none"),this.cameraToggleTarget.classList.remove("d-none"),"#camera"===window.location.hash&&this.cameraToggleTarget.click())}changeVideoInput(){this.selectedDeviceIdValue=this.videoSelectTarget.value,this.activateWebcamVideo()}disconnect(){this.webcamVideoTarget.srcObject&&this.webcamVideoTarget.srcObject.getTracks().forEac
1h(track=>track.stop())}checkConsentUpload(event){null!=event&&(this.uploadButtonClickedValue=event.currentTarget.id);return!(!(JSON.parse(window.localStorage.getItem("dav-upload-consent"))??!1)&&"clicked"!==this.consentButtonTarget.value)||(null!==event&&event.preventDefault(),this.consentUploadTarget.classList.add("show"),!1)}cancelConsent(){this.consentOptionsTarget.classList.add("show"),this.consentUploadTarget.classList.remove("show"),this.cameraFallbackTarget.classList.remove("show")}saveConsent(event){event.preventDefault(),this.consentButtonTarget.value="clicked",this.consentCheckboxTarget.checked&&localStorage.setItem("dav-upload-consent",JSON.stringify(!0)),this.consentUploadTarget.classList.remove("show"),this.uploadButtonClickedValue.startsWith("input-prescription-image")?this.fileUploadTarget.click():this.uploadButtonClickedValue.startsWith("toggle-collapse-camera")&&this.activateWebcamVideo(null)}fileUpload(event){if(0===event.target.files.length)return;const file=event.target.files[0];if(this.uploadErrorTarget.innerHTML="",this.fileUploadStatusTarget.classList.add("show"),file.size>4710400)return void(this.uploadErrorTarget.innerHTML="Maximale Dateigröße überschritten (4MB sind erlaubt)");if(!validFileTypes.includes(file.type))return void(this.uploadErrorTarget.innerHTML="Unzulässiges Dateiformat");this.fileUploadProgressBarTarget.style.width="10%";const reader=new FileReader;reader.onload=fileReadEvent=>{0===this.pznValue||this.prescriptionOnlyValue||this.cartEntryIdValue>0?(this.addToCart(fileReadEvent.target.result,file.type),this.fileUploadProgressBarTarget.style.width="50%"):this.addImageDataToPdp(fileReadEvent.target.result)},reader.readAsDataURL(file),(0===this.pznValue||this.prescriptionOnlyValue)&&setTimeout(()=>{(0,_hotwired_turbo__WEBPACK_IMPORTED_MODULE_2__.YR)(window.location.href)},2e3)}async activateWebcamVideo(event){if(!1!==this.checkConsentUpload(event))try{if(this.isVideoSelected||(this.selectedDeviceIdValue=await(0,_lib_video_select__WEBPACK_IMPORTED_MODULE_4__.A)(this.videoSelectTarget),this.isVideoSelected=!0),void 0===navigator.mediaDevices)return void this.#displayCameraBrowserNotice();this.webcamVideoTarget.srcObject=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.selectedDeviceIdValue},audio:!1})}catch(e){this.#displayCameraBrowserNotice()}}captureWebcamImage(){this.fileUploadStatusTarget.classList.add("show"),this.fileUploadProgressBarTarget.style.width="10%",this.webcamCanvasTarget.getContext("2d").drawImage(this.webcamVideoTarget,0,0,this.webcamCanvasTarget.width,this.webcamCanvasTarget.height);const imageData=this.webcamCanvasTarget.toDataURL("image/jpeg");if(imageData.length>4710400)return this.uploadErrorTarget.innerHTML="Maximale Dateigröße überschritten (4MB sind erlaubt)",void this.webcamResetButtonTarget.click();this.fileUploadProgressBarTarget.style.width="50%",0===this.pznValue||this.prescriptionOnlyValue||this.cartEntryIdValue>0?(this.addToCart(imageData,"image/jpeg",!0),setTimeout(()=>{(0,_hotwired_turbo__WEBPACK_IMPORTED_MODULE_2__.YR)(window.location.href)},2e3)):this.addImageDataToPdp(imageData),this.webcamResetButtonTarget.click()}addToCart(imageData,contentType,fromWebcam=!1){const url=0===this.pznValue||this.cartEntryIdValue>0?this.addRecipeToCartUrlValue:this.addToCartUrlValue;fetch(url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pzn:this.pznValue,cartEntryId:this.cartEntryIdValue,quantity:1,recipeData:imageData.replace(/\s/g,"+")})}).then(async response=>{if(!response.ok)throw this.uploadErrorTarget.innerHTML="Ein Fehler ist aufgetreten.",new Error("addToCart was not successful");const newId=await response.text();contentType.match(/image/)&&(0,_lib_thumbnail_creation__WEBPACK_IMPORTED_MODULE_5__.A)(this.thumbnailCanvasTarget,`cartEntryMedia${newId}`,imageData),(0===this.pznValue||this.prescriptionOnlyValue)&&(_lib_cart__WEBPACK_IMPORTED_MODULE_3__.A.modifyCount(1),_lib_cart__WEBPACK_IMPORTED_MODULE_3__.A.showAddedAlert("recipe",this.cartUrlValue)),fromWebcam&&this.disconnect(),this.fileUploadProgressBarTarget.style.width="100%",setTimeout(()=>{this.fileUploadStatusTarget.classList.remove("show");const prescriptionShoppingButtons=document.getElementById("prescription-shopping-buttons");null!==prescriptionShoppingButtons&&prescriptionShoppingButtons.classList.remove("d-none")},_lib_cart__WEBPACK_IMPORTED_MODULE_3__.A.timeoutDuration)})}addImageDataToPdp(imageData){const existingUploadImageFile=document.getElementById(`uploadImageFile${this.indexValue}`);null!==existingUploadImageFile&&existingUploadImageFile.parentNode.removeChild(existingUploadImageFile);const productListTemplates=document.getElementsByClassName("productListTemplate"),productListTemplateClone=productListTemplates[this.indexValue].cloneNode(!0);if(productListTemplateClone.id=`uploadImageFile${this.indexValue}`,productListTemplateClone.classList.remove("d-none"),imageData.startsWith("data:application/pdf;"))productListTemplateClone.querySelector("i.theme_icon-pdf").classList.remove("d-none"),productListTemplateClone.querySelector("figure.prescription-photo").classList.add("d-none"),productListTemplateClone.querySelector("h2.products-name").textContent="Rezept-PDF";else{productListTemplateClone.querySelector("img").src=imageData.replace(/\s/g,"+")}const inputField=productListTemplateClone.querySelector(".inputUploadedFile");inputField.id=`inputUploadedFile${this.indexValue}`,inputField.value=imageData.replace(/\s/g,"+"),productListTemplates[this.indexValue].parentNode.insertBefore(productListTemplateClone,productListTemplates[this.indexValue]),this.fileUploadProgressBarTarget.style.width="100%",this.fileUploadStatusTarget.classList.remove("show")}deleteFileUploadImage(event){event.preventDefault();const imageElement=document.getElementById(`uploadImageFile${this.indexValue}`);null!==imageElement&&imageElement.parentNode.removeChild(imageElement)}#displayCameraBrowserNotice(){this.webcamUserMessageTarget.innerHTML="Bitte stellen Sie sicher, dass Sie ein kamerafähiges Gerät und einen aktuellen Browser verwenden.<br>Die Berechtigung für den Zugriff auf die Kamera muss erteilt sein.",this.webcamVideoTarget.classList.add("d-none"),this.videoSelectTarget.classList.add("d-none")}};__webpack_require__.d(__webpack_exports__,["default",0,__WEBPACK_DEFAULT_EXPORT__])}}]);
2//# sourceMappingURL=102.93a59a41.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.