{"version":3,"file":"SignUpForm.DRePVtAZ.mjs","names":["useStore","textureStoreData","useStore","_Fragment","useState"],"sources":["https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/z6QBu2dISWYWjUE5jI9c/7Tiz4engtHU8P0GxGQgo/UploadTexture.js","https:/framerusercontent.com/modules/27LpsBfn0auCgG9AOqtA/mA19RVGJkoL3MnsglCbg/Upload3dModel.js","https:/framerusercontent.com/modules/MTh2DgZ0IDZLVrDCHSw0/NEk0ZZAyTlNMqRUmWyq7/SignUpForm.js"],"sourcesContent":["export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";import{useStore as modelStoreData}from\"https://framerusercontent.com/modules/27LpsBfn0auCgG9AOqtA/mA19RVGJkoL3MnsglCbg/Upload3dModel.js\";import{convertBytesInMB,getExtension,NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,MAX_3D_MODEL_PRODUCT_NAME_LENGTH}from\"https://framerusercontent.com/modules/27LpsBfn0auCgG9AOqtA/mA19RVGJkoL3MnsglCbg/Upload3dModel.js\";import{checkIsMobile}from\"https://framerusercontent.com/modules/R5zJOGROjfodUtklU0BX/b5PBCG1xyLprWiP6wjAA/QRCodeGenerator.js\";// import { callTrackEvent } from \"./UseSegment.tsx\"\n// import { USERPILOT_EVENTS } from \"./Hubspot_Events.tsx\"\nimport{callTrackEvent}from\"https://framerusercontent.com/modules/bAQLHHtmcrHXb2DGrreX/G2vfRCDF2LSWtJNJwdWd/segment.js\";import{ROOT_API}from\"https://framerusercontent.com/modules/d7epF7O1CCyyY1cu4tfT/jU4iGXfCNDYPtFheK3hY/imagine.js\";import{USERPILOT_EVENTS}from\"https://framerusercontent.com/modules/KubsT0m9HaPj7huiDD5T/eFW1UnY9SDW16b0m9d0i/userpilot.js\";const ROOT_URL=\"https://app.imagine.io/\";const GUIDELINE_URL=`${ROOT_URL}3d-model-help-center`;const ACCEPT_TEXTURE=\".jpg, .jpeg, .png\";// Learn more: https://www.framer.com/docs/guides/overrides/\nfunction getModelStoreData(){const[store,setStore]=modelStoreData();return{modelStore:store,setModelStore:setStore};}export const useStore=createStore({background:\"#0099FF\",images:[{id:28332,name:\"Duffle Bag 360\",thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/duffle_bag/bag_thumb.jpg\",baseImage:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/duffle_bag/bag_main.jpg\",propUrl:\"https://media-stag.imagine.io/media/public/self_serve_tex_upload_model/bag_tx.glb\",hotspot_data:[{id:11,name:\"Apply here\",objectName:\"leather1__Send\",position:{x:22,y:19},thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/duffle_bag/bag_hotspot1.png\",is_reverse:false},{id:12,name:\"Apply here\",objectName:\"leather2__Send\",position:{x:75,y:55},thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/duffle_bag/bag_hotspot2.png\",is_reverse:true}]},{id:19472,name:\"Hand Knotted Rug\",thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/rug/rug_thumb.jpg\",baseImage:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/rug/Rug_main.jpg\",propUrl:\"https://media-stag.imagine.io/media/public/self_serve_tex_upload_model/rug_tx.glb\",hotspot_data:[{id:11,name:\"Apply here\",objectName:\"carpet__Bak\",position:{x:75,y:30},thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/rug/Rug_hotspot1.png\",is_reverse:true}]},{id:16151,name:\"Vanity Sink With Mirror\",thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/vanity/vanity_thumb.jpg\",baseImage:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/vanity/vanity_main.jpg\",propUrl:\"https://media-stag.imagine.io/media/public/self_serve_tex_upload_model/vanity_tx.glb\",hotspot_data:[{id:11,name:\"Apply here\",objectName:\"base__Bak\",position:{x:75,y:50},thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/vanity/vanity_hotspot1.png\",is_reverse:true},{id:12,name:\"Apply here\",objectName:\"top_1__Send\",position:{x:67,y:22},thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/vanity/vanity_hotspot2.png\",is_reverse:true}]},{id:20188,name:\"Wallpaper Roll\",thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/wall/wallpaper_thumb.jpg\",baseImage:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/wall/wallpaper_main.jpg\",propUrl:\"https://media-stag.imagine.io/media/public/self_serve_tex_upload_model/paper_roll_tx.glb\",hotspot_data:[{id:11,name:\"Apply here\",objectName:\"wallpaper_roll_front__Bak\",position:{x:63,y:42},thumbnail:\"https://media.imagine.io/media/public/self-serve-models/models_to_apply_textures/wall/wallpaper_hotspot1.png\",is_reverse:true}]}],selectedImage:null,selectedHotspotImage:null,fileData:null,files:[]});export const DEFAULT_DPI=72;export const MAX_UPLOAD_WIDTH_PIXELS=16384;export const MAX_UPLOAD_HEIGHT_PIXELS=16384;export const getImageDetails=src=>{let isBlob=src instanceof Blob;if(isBlob){src=URL.createObjectURL(src);}return new Promise((resolve,reject)=>{const dpi=DEFAULT_DPI//Static dpi for now, need to find a method to get dpi form image uploaded\n;const img=new Image;img.onload=()=>{if(isBlob)URL.revokeObjectURL(src);resolve({width:img.width,height:img.height,dpi:dpi,widthInches:img.width/dpi,heightInches:img.height/dpi});};img.onerror=(error,source)=>{console.error(error,source);if(isBlob)URL.revokeObjectURL(src);reject(error);};img.src=src;});};export function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}export function withClosePopup(Component){return props=>{const{modelStore,setModelStore}=getModelStoreData();const[store,setStore]=useStore();const{trackTextureModelUploadCancelled}=USERPILOT_EVENTS;const closePopup=()=>{// deleteDatabase(\"MyDatabase\")\ntrackTextureModelUploadCancelled({model_id:store?.selectedImage?.id,model_name:store?.selectedImage?.name,upload_type:\"Texture upload\",upload_extension:store?.files?.length>0?store?.files?.[0]?.extension:\"\",file_name:store?.files?.length>0?store?.files?.[0]?.name:\"\",hotspot_name:store?.selectedHotspotImage?store?.selectedHotspotImage?.objectName:\"\",reason:\"Popup closed\"});setModelStore(prev=>({...prev,showTextureModal:false}));setStore(prev=>({...prev,selectedImage:null,selectedHotspotImage:null,fileData:null,files:[]}));};return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,cursor:\"pointer\"},onClick:closePopup});};}export function withImageHotspots(Component){return props=>{const[store,setStore]=useStore();const{selectedHotspotImage}=store;const{selectedImage,files}=store;const[hotspotImage,setHotspotImage]=useState(null);const{trackTextureHotspotSelected}=USERPILOT_EVENTS;const imageStyle={width:\"100%\",height:\"100%\",position:\"absolute\",top:\"0px\",left:\"0px\",objectFit:\"cover\"};const divStyle={width:\"100%\",height:\"100%\"};const hotspotStyle={alignItems:\"center\",borderRadius:\"4px\",display:\"flex\",flex:\"0 0 auto\",gap:\"10px\",height:\"32px\",overflow:\"hidden\",padding:\"4px 12px\",position:\"relative\",cursor:\"pointer\",fontWeight:\"bold\"};const setSelectedHotspotImage=image=>{setStore(prev=>({...prev,selectedHotspotImage:image}));};const selectHotspotImage=val=>{if(selectedHotspotImage?.id===val?.id){setSelectedHotspotImage(null);}else{trackTextureHotspotSelected({model_id:selectedImage?.id,model_name:selectedImage?.name,file_name:files?.[0]?.name?.trim()||\"\",upload_type:\"Texture\",upload_extension:files?.[0]?.extension,hotspot_name:val?.objectName});setSelectedHotspotImage(val);}};const onMouseEnter=val=>{setHotspotImage(val);};const onMouseLeave=val=>{setHotspotImage(null);};return /*#__PURE__*/_jsx(Component,{...props,children:/*#__PURE__*/_jsxs(\"div\",{style:{...divStyle,position:\"relative\",overflow:\"visible\",borderRadius:\"8px\"},children:[/*#__PURE__*/_jsx(\"img\",{src:selectedImage?.baseImage,style:{...imageStyle,zIndex:1}}),(hotspotImage?.thumbnail||selectedHotspotImage?.thumbnail)&&/*#__PURE__*/_jsx(\"img\",{src:hotspotImage?.thumbnail||selectedHotspotImage?.thumbnail,style:{...imageStyle,zIndex:2}}),/*#__PURE__*/_jsx(\"div\",{style:{...divStyle,position:\"absolute\",top:\"0px\",left:\"0px\",zIndex:3},children:selectedImage?.hotspot_data?.map((val,index)=>{return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",flexDirection:!val?.is_reverse?\"row\":\"row-reverse\",top:`${val.position.y}%`,left:`${val.position.x}%`},children:[/*#__PURE__*/_jsx(\"div\",{style:{...hotspotStyle,color:selectedHotspotImage?.id===val.id||hotspotImage?.id===val.id?\"white\":\"rgb(235, 78, 10)\",backgroundColor:selectedHotspotImage?.id===val.id||hotspotImage?.id===val.id?\"rgba(235, 78, 10, 1)\":\"rgba(235, 78, 10, 0.25)\",[!val?.is_reverse?\"marginRight\":\"marginLeft\"]:\"5px\"},onClick:()=>selectHotspotImage(val),onMouseEnter:()=>onMouseEnter(val),onMouseLeave:()=>onMouseLeave(val),children:val.name}),/*#__PURE__*/_jsx(\"div\",{className:\"hotspot-dot animate\"})]},index);})})]})});};}export function withImages(Component){return props=>{const[store,setStore]=useStore();const{images,selectedImage,files,selectedHotspotImage}=store;const{trackModelSelectedForTexture}=USERPILOT_EVENTS;useEffect(()=>{if(!selectedImage){setStore(prev=>({...prev,selectedImage:images[0]}));}});const onSelectImage=image=>{trackModelSelectedForTexture({model_id:image?.id,model_name:image?.name,file_name:files?.[0]?.name?.trim()||\"\",upload_type:\"Texture\",upload_extension:files?.[0]?.extension,hotspot_name:selectedHotspotImage?.objectName});setStore(prev=>({...prev,selectedImage:image,selectedHotspotImage:null}));};return /*#__PURE__*/_jsx(Component,{...props,children:images.map((val,index)=>{return /*#__PURE__*/_jsx(\"div\",{style:{height:\"40px\",width:\"40px\",opacity:val.id===selectedImage?.id?1:.5,border:val.id===selectedImage?.id?\"1px solid rgb(235, 78, 10)\":\"1px solid transparent\",borderRadius:\"3px\",position:\"relative\",flex:\"0 0 auto\",cursor:\"pointer\",overflow:\"hidden\"},onClick:()=>onSelectImage(val),children:/*#__PURE__*/_jsx(\"img\",{src:val.thumbnail,style:{height:\"100%\",width:\"100%\",objectFit:\"cover\"}})},index);})});};}export function withContinueBtn(Component){return props=>{const[store,setStore]=useStore();const{selectedHotspotImage}=store;const onContinue=()=>{if(!selectedHotspotImage){return;}// window.location.href = \"/self-serve-model-viewer?isTexture=true\"\nconst uploadProcess=document.getElementById(\"upload-model-viewer-loading-parent\");const textureModal=document.getElementById(\"texture-upload-modal\");if(uploadProcess&&textureModal){uploadProcess.style.display=\"flex\";textureModal.style.display=\"none\";}};return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,cursor:\"pointer\",opacity:selectedHotspotImage?1:.5},onClick:onContinue});};}export function withHideImage(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,display:\"none\"}});};}export function withTextureImage(Component){return props=>{const[store,setStore]=useStore();const{fileData,files}=store;useEffect(()=>{getUploadedFile();},[files]);const getUploadedFile=async()=>{if(files?.length){let allowedFiles=files[files.length-1];const fileName=allowedFiles.name||\"\";allowedFiles=allowedFiles?.file;let fileData={};console.log(allowedFiles,\"allowedFiles\");const size=convertBytesInMB(allowedFiles?.size||allowedFiles?.sizeBytes||allowedFiles?.bytes);const isAvailableToUpload=true;const id=crypto.randomUUID().slice(2);const{width,height,dpi}=await getImageDetails(allowedFiles);fileData={id:id,fildId:allowedFiles?.id||id,filename:fileName?.trim(),extension:getExtension(fileName),size,width:toUnityFixed(width/dpi)*CM_IN_ONE_INCHES,height:toUnityFixed(height/dpi)*CM_IN_ONE_INCHES,dpi,file:allowedFiles,url:allowedFiles?.link||allowedFiles?.blobUrl||URL.createObjectURL(allowedFiles),isUploaded:false,isFailed:\"\",isAvailableToUpload,access_token:\"it does not work without token :( waiting for backend update\",type:1};console.log(fileData,\"fileData to check\");setStore(prev=>({...prev,fileData:fileData}));}};return /*#__PURE__*/_jsx(Component,{...props,children:fileData?.url&&/*#__PURE__*/_jsx(\"img\",{src:fileData?.url,style:checkIsMobile()?{width:\"100%\",height:\"100px\",objectFit:\"contain\"}:{width:\"100%\",height:\"100%\",objectFit:\"contain\"}})});};}export function withTextureFileName(Component){return props=>{const[store,setStore]=useStore();const{fileData}=store;return /*#__PURE__*/_jsx(Component,{...props,children:fileData?.filename&&/*#__PURE__*/_jsx(\"p\",{className:\"framer-text\",style:{fontSize:\"15px\",overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:fileData?.filename})});};}export function withTextureFileSize(Component){return props=>{const[store,setStore]=useStore();const{fileData}=store;return /*#__PURE__*/_jsx(Component,{...props,children:fileData?.size&&/*#__PURE__*/_jsx(\"p\",{className:\"framer-text\",style:{fontSize:\"12px\",color:\"rgb(128, 125, 119)\"},children:`${fileData?.size} mb`})});};}export function withGuideLines(Component){return props=>{const[store,setStore]=useStore();const{files,selectedHotspotImage,selectedImage}=store;const{trackGuidelinesClicked}=USERPILOT_EVENTS;const clickedGuidelines=()=>{let dataForSegment={};dataForSegment[\"Upload type\"]=\"Texture\";dataForSegment[\"Hotspot_id\"]=selectedHotspotImage?.id||\"\";dataForSegment[\"FileName\"]=files?.[0]?.name?.trim()||\"\";dataForSegment[\"widget_id\"]=selectedImage?.id||\"\";dataForSegment[\"widget_name\"]=selectedImage?.name||\"\";trackGuidelinesClicked({model_id:selectedImage?.id,model_name:selectedImage?.name,file_name:files?.[0]?.name?.trim()||\"\",upload_type:\"Texture\",upload_extension:files?.[0]?.extension});callTrackEvent(\"Guidelines\",dataForSegment,true);window.open(GUIDELINE_URL);};return /*#__PURE__*/_jsx(Component,{...props,style:{cursor:\"pointer\"},onClick:()=>clickedGuidelines()});};}export function withReplaceTexture(Component){return props=>{const[store,setStore]=useStore();const{fileData,selectedHotspotImage,selectedImage}=store;const{trackReplaceTextureClicked,trackTextureReplacedSuccessfully}=USERPILOT_EVENTS;const uploadTexture=async fileList=>{const maxSize=200*1024*1024;const currentFile=fileList?.[0];if(currentFile?.size>=maxSize){alert(\"You can upload a model of maximum 200mb size\");return;}// openDatabase().then((db) => saveDataToIdb(db, {file: fileToBlob(currentFile), name: currentFile.name}))\nlet allowedFiles=[...fileList]?.filter(f=>ACCEPT_TEXTURE.includes(getExtension(f?.name)));const haveOtherFormat=[...fileList].some(a=>!ACCEPT_TEXTURE.includes(getExtension(a?.name)));if(haveOtherFormat){alert(`Only ${ACCEPT_TEXTURE.split(\",\").join(\", \")} is allowed for upload.`);}const _files=[];[...allowedFiles].forEach(async(f,i)=>{const size=convertBytesInMB(f?.size||f?.sizeBytes||f?.bytes);if(size>=200){// checking if file size is greater than 20 0MB\nalert(`File \"${f.name}\" is too large. Maximum file size is 200 MB.`);return;}let name=f?.name?.split(\".\")?.[0]?.trim()?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\");name=name?.substring(0,MAX_3D_MODEL_PRODUCT_NAME_LENGTH-4);const isAvailableToUpload=true//i < _uploadAvailableLimit;\n;const id=crypto.randomUUID().slice(2);trackTextureReplacedSuccessfully({model_id:selectedImage?.id,model_name:selectedImage?.name,file_name:name,upload_type:\"Texture\",upload_extension:getExtension(f.name)});_files.push({id:id,fildId:f?.id||id,name:name,filename:f.name?.trim(),extension:getExtension(f.name),size,file:f,url:f?.link||f?.blobUrl||URL.createObjectURL(f),isUploaded:false,isFailed:\"it does not work without token :( waiting for backend update\",isAvailableToUpload,access_token:1,type:1});});let dataForSegment={};dataForSegment[\"Upload type\"]=\"Texture\";dataForSegment[\"Hotspot_id\"]=selectedHotspotImage?.id||\"\";dataForSegment[\"FileName\"]=currentFile?.name?.trim()||\"\";dataForSegment[\"widget_id\"]=selectedImage?.id||\"\";dataForSegment[\"widget_name\"]=selectedImage?.name||\"\";callTrackEvent(\"Replace Texture\",dataForSegment,true);setStore(prev=>({...prev,files:[...new Set(_files)]}));};return /*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(Component,{...props,style:{...props?.style,cursor:\"pointer\"},onClick:()=>{const element=document.getElementById(\"inputModelUploadTexture\");if(element){trackReplaceTextureClicked({upload_type:\"Texture\"});element?.click();}}}),/*#__PURE__*/_jsx(\"input\",{style:{display:\"none\"},accept:ACCEPT_TEXTURE,id:\"inputModelUploadTexture\",type:\"file\",multiple:false,onChange:async e=>{await uploadTexture(e.target.files);e.target.value=\"\";}})]});};}export const toUnityFixed=size=>parseFloat(parseFloat(size).toFixed(2));export const NAME_EXCLUDED_SPECIAL_CHARS_GLOBAL=/[!@#$%^~`*+\\=\\[\\]{};':\"\\\\|<>\\/?]+/gi;export const CM_IN_ONE_INCHES=2.54;export const BULK_TEXTURE_UPLOAD=\"/texture/api/v3/texture/bulk-create/v2/\";const TEXTURE_FILTER_API=\"/users/api/v3/filters/\";const getFilterOptions=async({token})=>{if(!token)return null;const params=`?per_page=20&page=1&type=2`;try{const response=await fetch(`${ROOT_API}${TEXTURE_FILTER_API}${params}`,{method:\"GET\",headers:{Authorization:`Bearer ${token}`}});const result=await response.json();if(result?.results?.length>0){const option=result?.results?.find(a=>a?.label_name?.trim()?.toLowerCase()===\"uploaded from\")?.options?.find(a=>a?.name?.trim()?.toLowerCase()===\"my texture\");return option?.id||null;}return null;}catch(error){console.error(\"An error occured\",error);return null;}};const bulkUploadTexture=async(formObj,token)=>{try{const response=await fetch(`${ROOT_API}${BULK_TEXTURE_UPLOAD}`,{method:\"POST\",headers:{Authorization:`Bearer ${token}`},body:formObj});const result=await response.json();return result;}catch(error){console.error(\"An error occured\",error);return null;}};export const uploadTexture=async(file,filename,token)=>{// showHideLoading({ loading: true })\nconst{width,height,dpi}=await getImageDetails(file);// showHideLoading({ loading: false })\nlet filterOptions=await getFilterOptions({token});if(filterOptions){filterOptions=`${filterOptions}, 1520`;}else{filterOptions=\"1520\"// design option id\n;}const formData=new FormData;const nameArr=filename.split(\".\");nameArr.pop();formData.append(\"name\",nameArr.join(\".\").replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_GLOBAL,\"_\"));formData.append(\"is_map\",false);formData.append(\"width\",toUnityFixed(width/dpi)*CM_IN_ONE_INCHES);formData.append(\"height\",toUnityFixed(height/dpi)*CM_IN_ONE_INCHES);formData.append(\"texture_file_url_key\",filename);formData.append(\"filteroptions\",filterOptions);return await bulkUploadTexture(formData,token);};\nexport const __FramerMetadata__ = {\"exports\":{\"CM_IN_ONE_INCHES\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImages\":{\"type\":\"reactHoc\",\"name\":\"withImages\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"uploadTexture\":{\"type\":\"function\",\"isAsync\":true,\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHideImage\":{\"type\":\"reactHoc\",\"name\":\"withHideImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"MAX_UPLOAD_WIDTH_PIXELS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTextureImage\":{\"type\":\"reactHoc\",\"name\":\"withTextureImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withClosePopup\":{\"type\":\"reactHoc\",\"name\":\"withClosePopup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGuideLines\":{\"type\":\"reactHoc\",\"name\":\"withGuideLines\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReplaceTexture\":{\"type\":\"reactHoc\",\"name\":\"withReplaceTexture\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getImageDetails\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_DPI\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NAME_EXCLUDED_SPECIAL_CHARS_GLOBAL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BULK_TEXTURE_UPLOAD\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTextureFileName\":{\"type\":\"reactHoc\",\"name\":\"withTextureFileName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTextureFileSize\":{\"type\":\"reactHoc\",\"name\":\"withTextureFileSize\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withContinueBtn\":{\"type\":\"reactHoc\",\"name\":\"withContinueBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"MAX_UPLOAD_HEIGHT_PIXELS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageHotspots\":{\"type\":\"reactHoc\",\"name\":\"withImageHotspots\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"toUnityFixed\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";// import { ROOT_API } from \"./PayAsYouGo.tsx\"\nimport{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{useEffect,useState,useRef}from\"react\";// import * as THREE from \"https://cdn.jsdelivr.net/npm/three@0.132.0/build/three.module.js\"\n// import { OrbitControls } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/controls/OrbitControls.js\"\n// import { GLTFLoader } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/GLTFLoader.js\"\n// import { FBXLoader } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/FBXLoader.js\"\n// import { OBJLoader } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/OBJLoader.js\"\n// import { DRACOLoader } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/DRACOLoader.js\"\n// import { USDZLoader } from \"./USDZLoader.js\"\n// import { unzip } from \"https://cdn.jsdelivr.net/npm/unzipit@1.4.3/+esm\"\n// import { EffectComposer } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/postprocessing/EffectComposer.js\"\n// import { RenderPass } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/postprocessing/RenderPass.js\"\n// import { SMAAPass } from \"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/postprocessing/SMAAPass.js\"\n// ---- 3D libraries, loaded on demand ---------------------------------\n// Only withDragDropUploadSelfServe touches these. Importing them statically\n// pulled three.js into every page that imports anything else from this file -\n// and the store, IndexedDB and string helpers below are imported widely, so\n// that was most of the site. The bindings stay module-scoped and keep their\n// original names, so every call site below is unchanged.\nlet THREE;let OrbitControls;let GLTFLoader;let FBXLoader;let OBJLoader;let DRACOLoader;let USDZLoader;let unzip;let EffectComposer;let RenderPass;let threeReady=null;const loadThree=()=>{if(threeReady)return threeReady;threeReady=Promise.all([import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/build/three.module.js\"),import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/controls/OrbitControls.js\"),import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/GLTFLoader.js\"),import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/FBXLoader.js\"),import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/OBJLoader.js\"),import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/loaders/DRACOLoader.js\"),import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/postprocessing/EffectComposer.js\"),import(\"https://cdn.jsdelivr.net/npm/three@0.132.0/examples/jsm/postprocessing/RenderPass.js\"),import(\"https://framerusercontent.com/modules/51u3njNuoF9dIHST7Nda/j7oC5BBIcXf3b75DjZEv/USDZLoader.js\"),import(\"https://cdn.jsdelivr.net/npm/unzipit@1.4.3/+esm\")]).then(([three,orbit,gltf,fbx,obj,draco,composer,renderPass,usdz,unzipit])=>{THREE=three;OrbitControls=orbit.OrbitControls;GLTFLoader=gltf.GLTFLoader;FBXLoader=fbx.FBXLoader;OBJLoader=obj.OBJLoader;DRACOLoader=draco.DRACOLoader;EffectComposer=composer.EffectComposer;RenderPass=renderPass.RenderPass;USDZLoader=usdz.USDZLoader;unzip=unzipit.unzip;}).catch(error=>{threeReady=null// let a later attempt try again\n;throw error;});return threeReady;};import{uploadTexture,useStore as textureStoreData}from\"https://framerusercontent.com/modules/z6QBu2dISWYWjUE5jI9c/7Tiz4engtHU8P0GxGQgo/UploadTexture.js\";import{showHideLoading}from\"https://framerusercontent.com/modules/OOTEhGHcmjgDAX6AjJX8/RVrvPYB5XOUxMrhkJcYl/Products.js\";// import { callTrackEvent } from \"./UseSegment.tsx\"\n// import {\n//     isApplicationNotGuestUserLoggedIn,\n//     useStore as selfServeStoreData,\n//     initialSelfServeStoreValues,\n// } from \"./SelfServe.tsx\"\n// import { USERPILOT_EVENTS, getOrGenerateEpochUUID } from \"./Hubspot_Events.tsx\"\n// import * as OV from \"./O3DV.js\"\nimport{APP_DOMAIN,ROOT_API}from\"https://framerusercontent.com/modules/d7epF7O1CCyyY1cu4tfT/jU4iGXfCNDYPtFheK3hY/imagine.js\";import{checkAndDoGuestLogin,initialSelfServeStoreValues,useSelfServeStore}from\"https://framerusercontent.com/modules/byNafBI6bONoXnNvpJpV/uo03nslo0eJ6BVhnMxkF/selfServe.js\";import{USERPILOT_EVENTS}from\"https://framerusercontent.com/modules/KubsT0m9HaPj7huiDD5T/eFW1UnY9SDW16b0m9d0i/userpilot.js\";import{callTrackEvent}from\"https://framerusercontent.com/modules/bAQLHHtmcrHXb2DGrreX/G2vfRCDF2LSWtJNJwdWd/segment.js\";// const {\n//     trackUploadTextureModelClicked,\n//     trackTextureModelUploadStarted,\n//     trackTextureModelUploadedSuccessfully,\n//     trackTextureModelUploadCancelled,\n//     trackTextureModelSelected,\n//     trackDragToRotateClick,\n// } = USERPILOT_EVENTS\n// import * as OV from \"./O3DV.js\"\nexport const getSearch=value=>{const search=window.location.search.split(\"&\").find(_item=>_item.includes(value));return search?.split(value)?.at(-1)||null;};const GUEST_LOGIN=\"/users/api/v3/demo-register/\";// const CONVERT_GUEST_TO_TEST_USER = \"/users/api/v3/update-to-test-user/\"\nconst PRODUCT_3D_MODEL_UPLOAD_API=\"/assetbundles/api/v3/products/detail/user/upload/\";const PRODUCT_3D_MODEL_JOB_API=\"/assetbundles/api/v3/products-viewer-job/detail/\";const ACCEPT_3D_MODELS=\".glb, .obj, .fbx, .blend, .usdz, .jpg, .jpeg, .png, .zip\";const ACCEPT_TEXTURE_IMAGES=\".jpg, .jpeg, .png\";const ACCEPT_3D_MODELS_WITH_MIME_TYPE=`${ACCEPT_3D_MODELS}, model/gltf-binary, application/x-tgif, application/octet-stream, application/x-blender, model/vnd.usdz+zip, image/jpeg, image/png, application/zip`;const ACCEPT_3D_MODELS_IN_ZIP=\".gltf, .fbx, .obj, .blend\";export const NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL=/[!@#$&%^~`*+\\=\\[\\]{};':\"\\\\|<>\\/?]+/gi;export const MAX_3D_MODEL_PRODUCT_NAME_LENGTH=100;// export const APP_DOMAIN = \"https://app.imagine.io\"\nexport const RENDER_API=\"/rendering-system/api/v3/framer/render-details/\";export const GET_MODEL_TEMPLATE=\"/rendering-system/api/v3/get-model-template/\";const GET_MODEL_DATA=\"/rendering-system/api/v3/public-share/get-model-data/\";export const DEFAULT_DB_NAME=\"LFDB\";export const MODEL_TEXTURE_DB_NAME=\"TLFDB\";export const VIEWER_TYPE={TEXTURE:\"TEXTURE\",MODEL:\"MODEL\"};// const REFRESH_TOKEN = `/users/api/v3/login/refresh/`\n// const USER_DETAILS = `/organization/api/v3/my-orgs/`\nlet loginInterval=null;let userValidated;const handIcon=()=>{const element=document.createElement(\"div\");element.id=\"model-viewer-hand-icon\";element.innerHTML=`<svg width=\"44\" height=\"52\" viewBox=\"0 0 44 52\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M37.3045 21.0034L37.3046 21.012L37.3519 26.5266C37.3519 26.5277 37.3519 26.5288 37.3519 26.53C37.3501 27.0179 36.9571 27.4222 36.4331 27.4222C35.9079 27.4222 35.5143 27.016 35.5143 26.5266V17.8908C35.5143 16.3373 34.2425 15.0419 32.6665 15.0419C31.0988 15.0419 29.8188 16.3056 29.8188 17.8908V24.0458C29.8188 24.5353 29.4252 24.9415 28.9 24.9415C28.3748 24.9415 27.9812 24.5353 27.9812 24.0458V15.41C27.9812 13.8565 26.7095 12.5612 25.1334 12.5612C23.5657 12.5612 22.2857 13.8249 22.2857 15.41V21.5885C22.2857 22.0779 21.8921 22.4842 21.3669 22.4842C20.8417 22.4842 20.4481 22.0779 20.4481 21.5885V3.84885C20.4481 2.29534 19.1764 1 17.6003 1C16.0326 1 14.7526 2.2637 14.7526 3.84885V31.3008C14.7526 31.6625 14.5316 31.9945 14.1625 32.1369C13.7704 32.2643 13.3511 32.1442 13.1124 31.8767C13.1122 31.8765 13.112 31.8763 13.1118 31.8761L5.69837 23.5225L5.67659 23.4979L5.65324 23.4749C5.12557 22.9536 4.39543 22.6714 3.67123 22.6714C2.93016 22.6714 2.19779 22.949 1.66553 23.4749C0.959875 24.172 0.92944 25.0885 1.06361 25.7854C1.19784 26.4826 1.52611 27.1614 1.83584 27.6852C3.98553 31.4365 6.34689 34.9942 8.42821 38.1252C8.49019 38.2189 8.55202 38.3124 8.61369 38.4056C10.1134 40.6727 11.5155 42.7921 12.5688 44.5854L12.5706 44.5884C13.266 45.763 14.6932 48.6661 15.5183 50.3444L15.5659 50.4412L15.8406 51H16.4633H38.1624H38.8954L39.116 50.301C39.8066 48.113 40.7716 44.8768 41.565 41.7854C42.3464 38.741 43 35.6969 43 33.9688V21.0034C43 19.4499 41.7283 18.1546 40.1523 18.1546C38.5845 18.1546 37.3045 19.4183 37.3045 21.0034Z\" fill=\"white\" stroke=\"#333333\" stroke-width=\"2\"/>\n</svg>`;element.style.position=\"absolute\";element.style.top=\"50%\";element.style.left=\"50%\";element.style.transform=\"translate(-50%, -50%)\";return element;};// Function to detect if the user is on iOS\nfunction isIOS(){return/iPhone|iPad|iPod/i.test(navigator.userAgent);}export function getTextureStoreData(){const[store,setStore]=textureStoreData();console.log(\"texture store : \",store);return{textureStore:store,setTextureStore:setStore};}// export async function refreshToken(_refreshToken) {\n//     const response = await fetch(ROOT_API + REFRESH_TOKEN, {\n//         method: \"POST\",\n//         headers: {\n//             \"Content-Type\": \"application/json\",\n//         },\n//         body: JSON.stringify({ refresh: _refreshToken }),\n//     })\n//     return await response.json()\n// }\n// export async function validUser(token) {\n//     const response = await fetch(ROOT_API + USER_DETAILS, {\n//         method: \"GET\",\n//         headers: {\n//             \"Content-Type\": \"application/json\",\n//             Authorization: `Bearer ${token}`,\n//         },\n//     })\n//     const data = await response.json()\n//     console.log(\"TEST123\", data)\n//     return data?.results\n// }\nexport const openDatabase=(databaseName=DEFAULT_DB_NAME)=>{return new Promise((resolve,reject)=>{const request=indexedDB.open(databaseName,1)// 'LFDB' is the default databse name, 1 is the version\n;// On successful opening or creation\nrequest.onsuccess=event=>{console.log(\"Database opened successfully\");resolve(event.target.result)// Database instance\n;};// On error while opening or creating the database\nrequest.onerror=event=>{console.error(\"Database failed to open\",event);reject(event);};// Create the object store if it doesn't exist\nrequest.onupgradeneeded=event=>{const db=event.target.result;if(!db.objectStoreNames.contains(\"items\")){const objectStore=db.createObjectStore(\"items\",{keyPath:\"id\",autoIncrement:true});objectStore.createIndex(\"name\",\"name\",{unique:false});}console.log(\"Object store created\");};});};export const openModelTextureFileDb=()=>openDatabase(MODEL_TEXTURE_DB_NAME)// texture livefurnish database\n;const initialStoreValue={modelId:null,textureId:null,files:[],url:\"\",extension:\"\",uploadingFile:false,customizingScene:false,renderJson:null,fileName:\"\",progress:7.5,apiProgress:0,showTextureModal:false,guestLoginData:null,modelLoading:false,viewerLoaded:false};export const useStore=createStore(initialStoreValue);const apiPostUpload3DModel=async(formData,token)=>{try{const response=await fetch(`${ROOT_API}${PRODUCT_3D_MODEL_UPLOAD_API}`,{method:\"POST\",headers:{Authorization:`Bearer ${token}`},body:formData});const result=await response.json();return result;}catch(error){console.error(\"An error occured\",error);return null;}};const apiPost3DModelJob=async(formData,token)=>{try{const response=await fetch(`${ROOT_API}${PRODUCT_3D_MODEL_JOB_API}`,{method:\"POST\",headers:{Authorization:`Bearer ${token}`},body:formData});const result=await response.json();return result;}catch(error){console.error(\"An error occured\",error);return null;}};const apiPostImageOnPresignedData=async(file,presigned_data)=>{const formData=new FormData;Object.entries(presigned_data.fields).forEach(([k,v])=>{formData.append(k,v);});formData.append(\"file\",file);const response=await fetch(presigned_data.url,{method:\"POST\",body:formData});};// const setGuestLoginUserData = (data = null, setData = null) => {\n//     if (data && setData) {\n//         const dataToSend = {\n//             access: data?.data?.access,\n//             refresh: data?.data?.refresh,\n//             is_active_org: data?.data?.is_active_org,\n//             is_email_verified: data?.data?.is_email_verified,\n//             is_guest: data?.data?.is_guest,\n//             id: data?.data?.info?.id,\n//         }\n//         setData?.((prev) => ({\n//             ...prev,\n//             guestLoginData: JSON.stringify(dataToSend),\n//         }))\n//     }\n// }\n// const isInternalGuestUser = () => {\n//     const isInternal = localStorage.getItem(\"INTERNAL\")\n//     return isInternal && isInternal === \"true\"\n// }\n// export const checkAndDoGuestLogin = async (setData = null) => {\n//     try {\n//         if (isApplicationNotGuestUserLoggedIn()) {\n//             const token = localStorage.getItem(\"token\")\n//             return { data: { access: token } }\n//         }\n//         const user = localStorage.getItem(\"current_user\")\n//         if (user) {\n//             let loginData = localStorage.getItem(\"loginData\")\n//             let isUser\n//             loginData = loginData ? JSON.parse(loginData) : null\n//             if (loginData) {\n//                 isUser = await validUser(loginData?.data?.access)\n//                 // if (tokenData?.access) {\n//                 //     loginData.data.access = tokenData?.access\n//                 //     loginData.data.refresh = tokenData?.refresh\n//                 //     localStorage.setItem(\"loginData\", JSON.stringify(loginData))\n//                 // }\n//             }\n//             if (isUser) {\n//                 if (setData && loginData)\n//                     setGuestLoginUserData(loginData, setData)\n//                 if (\n//                     isInternalGuestUser() &&\n//                     localStorage.getItem(\"CONVERTED_TO_INTERNAL\") !== \"true\"\n//                 ) {\n//                     fetch(`${ROOT_API}${CONVERT_GUEST_TO_TEST_USER}`, {\n//                         method: \"POST\",\n//                         headers: {\n//                             Authorization: `Bearer ${loginData?.data?.access}`,\n//                         },\n//                     }).then((response) => {\n//                         if (response.ok) {\n//                             localStorage.setItem(\"CONVERTED_TO_INTERNAL\", true)\n//                         }\n//                     })\n//                 }\n//                 return loginData\n//             }\n//             userValidated = true\n//         }\n//         const formData = new FormData()\n//         if (\n//             isInternalGuestUser() ||\n//             window.location.origin !== \"https://imagine.io\"\n//         ) {\n//             formData.append(\"is_test_user\", true)\n//         }\n//         formData.append(\"user_pilot_id\", getOrGenerateEpochUUID())\n//         const response = await fetch(`${ROOT_API}${GUEST_LOGIN}`, {\n//             method: \"POST\",\n//             body: formData,\n//             // ...(isInternalGuestUser()\n//             //     ? { body: formData }\n//             //     : {\n//             //           headers: {\n//             //               \"Content-Type\": \"application/json\",\n//             //           },\n//             //       }),\n//         })\n//         const result = await response.json()\n//         if (result?.status) {\n//             localStorage.setItem(\n//                 \"current_user\",\n//                 JSON.stringify({\n//                     ...result?.data?.info,\n//                     was_guest_user: result?.data?.was_guest_user,\n//                     user_pilot_id: result?.data?.user_pilot_id,\n//                 })\n//             )\n//             localStorage.setItem(\"loginData\", JSON.stringify(result))\n//             if (setData) setGuestLoginUserData(result, setData)\n//         }\n//         return result\n//     } catch (error) {\n//         console.error(\"An error occured\", error)\n//         return null\n//     }\n// }\nexport function withCancelButton(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{...props?.style,backgroundColor:\"rgb(33, 37, 41)\"}});};}export const getTextSubstring=(text=\"\",maxLength=50)=>{if(text&&typeof text===\"string\"&&text?.length>maxLength){return`${text.substring(0,maxLength)}...`;}return text;};export const getExtension=(name=null)=>{if(!name)return name;const ext=name.split(\".\").pop();return ext?.trim()?.toLowerCase();};export function getAllData(db){return new Promise((resolve,reject)=>{const transaction=db.transaction([\"items\"],\"readonly\");const objectStore=transaction.objectStore(\"items\");const request=objectStore.getAll()// Fetch all data\n;request.onsuccess=event=>{console.log(\"Data retrieved successfully\",event.target.result);resolve(event.target.result)// Contains the array of items\n;};request.onerror=event=>{console.error(\"Failed to retrieve data\",event);reject(event);};});}export function saveDataToIdb(db,data){return new Promise((resolve,reject)=>{const transaction=db.transaction([\"items\"],\"readwrite\")// Create a transaction\n;const objectStore=transaction.objectStore(\"items\")// Access the object store\n;try{const request=objectStore.add(data)// Add the data to the store\n;request.onsuccess=()=>{console.log(\"Data saved successfully\");resolve(true);};request.onerror=event=>{console.error(\"Failed to save data\",event);reject(event);};}catch(error){console.error(\"Failed to save data\",error);reject(error);}});}export const saveDataToIdbV2=(db,data)=>{return new Promise((resolve,reject)=>{const transaction=db.transaction([\"items\"],\"readwrite\");const objectStore=transaction.objectStore(\"items\");try{if(!data?.id){const request=objectStore.add(data)// Add the data to the store\n;request.onsuccess=()=>{console.log(\"Data saved successfully\");resolve(true);};request.onerror=event=>{console.error(\"Failed to save data\",event);};}else{// First, try to get the existing item\nconst getRequest=objectStore.get(data.id);getRequest.onsuccess=event=>{if(event.target.result){// If the item exists, update it\nconst updateRequest=objectStore.put(data);updateRequest.onsuccess=()=>{console.log(\"Data updated successfully\");resolve(true);};updateRequest.onerror=event=>{console.error(\"Failed to update data\",event);reject(event);};}else{// If the item doesn't exist, add it\nconst addRequest=objectStore.add(data);addRequest.onsuccess=()=>{console.log(\"Data added successfully\");resolve(true);};addRequest.onerror=event=>{console.error(\"Failed to add data\",event);reject(event);};}};getRequest.onerror=event=>{console.error(\"Error checking for existing data\",event);reject(event);};}}catch(error){console.error(\"Failed to save data\",error);reject(error);}});};export const getDataFromIdb=(db,id)=>{return new Promise((resolve,reject)=>{const transaction=db.transaction([\"items\"],\"readonly\");const objectStore=transaction.objectStore(\"items\");const request=objectStore.get(id);request.onsuccess=event=>{if(event.target.result){console.log(\"File retrieved successfully\");resolve(event.target.result);}else{console.log(\"File not found\");resolve(null);}};request.onerror=event=>{console.error(\"Failed to retrieve file\",event);reject(event);};});};export function deleteDatabase(name=DEFAULT_DB_NAME){return new Promise((resolve,reject)=>{const request=indexedDB.deleteDatabase(name)// Delete the database by name\n;request.onsuccess=()=>{console.log(`Database ${name} deleted successfully.`);resolve(true);};request.onerror=event=>{console.error(`Failed to delete database ${name}:`,event);reject(event);};request.onblocked=()=>{console.warn(`Deletion of database ${name} is blocked.`);resolve(false);};});}const getExtensionFroms3Url=url=>{const a=url.split(\"?\");const b=a[0].split(\".\");return b[b.length-1];};const getAllDataFromUnicode=async(unicode,token)=>{try{const response=await fetch(`${ROOT_API}${GET_MODEL_DATA}?unicode=${unicode}`,{method:\"GET\",headers:{Authorization:`Bearer ${token}`}});const result=await response.json();return result;}catch(error){console.error(\"An error occured\",error);return null;}};export const sizeDecimals=size=>parseFloat(size.toFixed(2));export const convertBytesInMB=(size=0)=>size?sizeDecimals(size*1e-6):size;// this is component of Model Viewer in which the model loads\nexport function withModelViewer(Component){return props=>{const[store,setStore]=useStore();const{textureStore,setTextureStore}=getTextureStoreData();const[selfServeStore,setSelfServeStore]=useSelfServeStore();const cleanUpFunction=()=>{console.log(\"CLEANUP_FUNCTION\");setStore(initialStoreValue);setTextureStore(prev=>({...prev,selectedImage:null,selectedHotspotImage:null,fileData:null,files:[]}));setSelfServeStore(prev=>({...prev,...initialSelfServeStoreValues}));showHideLoading({loading:false});const element=document.getElementById(\"upload-model-viewer-loading-parent\");if(element){element.style.display=\"none\";}const viewerContainer=document.getElementById(\"model-viewer-container\");if(viewerContainer){viewerContainer.style.display=\"none\";}const uploaderContainer=document.getElementById(\"model-upload-container\");if(uploaderContainer){uploaderContainer.style.display=\"flex\";}const textureModal=document.getElementById(\"texture-upload-modal\");if(textureModal)textureModal.style.display=\"none\";};useEffect(()=>{setStore(prev=>({...prev,modelLoading:true}));return()=>cleanUpFunction();},[]);return /*#__PURE__*/_jsxs(Component,{...props,style:{...props.style,position:\"relative\"},children:[/*#__PURE__*/_jsx(\"div\",{id:\"model-viewer\",style:{width:\"100%\",height:\"100%\"}}),store?.modelLoading&&/*#__PURE__*/_jsx(\"div\",{className:\"loader-container\",style:{position:\"absolute\",zIndex:\"1\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexDirection:\"column\",gap:\"1rem\"},children:/*#__PURE__*/_jsxs(\"div\",{className:\"modelLoader-container\",children:[/*#__PURE__*/_jsx(\"p\",{style:{position:\"absolute\",width:\"100%\",margin:\"1rem 0\",textAlign:\"center\",top:\"50%\",fontSize:\"0.85rem\"},children:\"Loading product...\"}),/*#__PURE__*/_jsx(\"div\",{id:\"modelLoader\"}),/*#__PURE__*/_jsx(\"div\",{id:\"modelLoaderBase\"})]})})})]});};}export async function urlToFile(url,fileName){const response=await fetch(url);const blob=await response.blob();// Create a new File instance from the Blob\nconst file=new File([blob],fileName,{type:blob.type});return file;}export function fileToBlob(file){return new Blob([file],{type:file.type});}// this is a used for to upload to model either by click or drag & drop\nexport function withDragDropUploadSelfServe(Component){return props=>{const[store,setStore]=useStore();const[files,setFiles]=useState([]);const[selected,setSelected]=useState(null);const[tokenData,setTokenData]=useState(null);const[fileBtn,setFileBtn]=useState(true);const[dimension,setDimension]=useState({width:510,height:480});// const [modelLoading, setModelLoading] = useState(false)\nconst[error,setError]=useState(false);const ref=useRef();const[url,setUrl]=useState(\"\");const[extension,setExtension]=useState(\"\");const[uploadedProductId,setUpdatedProductId]=useState(null);const[startRender,setStartRender]=useState(false);const{textureStore,setTextureStore}=getTextureStoreData();const isTexture=Boolean(textureStore?.selectedImage&&textureStore?.selectedHotspotImage);const hotSpotData=textureStore?.selectedHotspotImage;const selectedImage=textureStore?.selectedImage;const unicode=getSearch(\"unicode=\");const[isTextureFromUnicode,setIsTextureFromUnicode]=useState(\"\");const[selfServeStore,setSelfServeStore]=useSelfServeStore();const{expandedImage}=selfServeStore;const{trackUploadTextureModelClicked,trackTextureModelUploadStarted,trackTextureModelUploadedSuccessfully,trackTextureModelUploadCancelled,trackTextureModelSelected,trackDragToRotateClick}=USERPILOT_EVENTS;let scene=null;let viewer=null;console.log(\"isTexture : \",isTexture,hotSpotData);useEffect(()=>{callTrackEvent(\"Curator Landing Page View\",{},true);},[]);const getDataFromLocalStorage=()=>{const currentUser=localStorage.getItem(\"current_user\")||null;const USER_DATA=currentUser?JSON.parse(currentUser):null;console.log(fileBtn,USER_DATA,\"check the user filebtn\");const user=USER_DATA?.user;if(USER_DATA?.id&&user?.id&&!user?.is_guest){setFileBtn(false);}else{setFileBtn(true);}};const handleLogin=()=>getDataFromLocalStorage();const clearLocalData=()=>{localStorage.removeItem(\"renderJson\");localStorage.removeItem(\"updatedProductId\");// localStorage.removeItem(\"tokenForRefresh\")\n};clearLocalData();const handleDrop=event=>{event.preventDefault();};const onFileSelected=(file=null)=>{if(!file){setSelected(null);return;}clearLocalData();setSelected(file);};const onUpload=async({fileList=[],access_token=\"it does not work without token :( waiting for backend update\",type=1}={})=>{await loadThree();if(isTexture&&!hotSpotData){return;}if(!fileBtn){window.open(APP_DOMAIN,\"_blank\");return;}showHideLoading({loading:true});const userData=await checkAndDoGuestLogin(setStore);if(!userData)return;setSelfServeStore(prev=>({...prev,loginData:userData}));setTokenData(userData?.data?.access);// }\nclearLocalData();await deleteDatabase();const maxSize=1023*1024*1024;const currentFile=fileList?.[0];console.log(currentFile,currentFile?.size,maxSize,\"check all sizes\");if(currentFile?.size>=maxSize){console.log(\"Show size error\");const element=document.getElementById(\"model-upload-size-error\");if(element){element.style.display=\"flex\";}showHideLoading({loading:false});alert(`File \"${currentFile.name}\" is too large. Maximum file size is 1 GB.`);trackTextureModelUploadCancelled({upload_type:\"Model\",upload_extension:getExtension(currentFile?.name?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\")),file_name:currentFile.name,reason:\"File is too large\",detail:`File size is \"${convertBytesInMB(currentFile?.size)}mb\"`});return;}let allowedFiles=[...fileList]?.filter(f=>ACCEPT_3D_MODELS.includes(getExtension(f?.name)));const haveOtherFormat=[...fileList].some(a=>!ACCEPT_3D_MODELS.includes(getExtension(a?.name)));if(haveOtherFormat){alert(`Only ${ACCEPT_3D_MODELS.split(\",\").join(\", \")} is allowed for upload.`);trackTextureModelUploadCancelled({upload_type:\"Model\",upload_extension:getExtension(haveOtherFormat?.[0]?.name),file_name:haveOtherFormat?.[0]?.name,reason:\"Extension not allowed\",detail:`Uploading extension \"${getExtension(haveOtherFormat?.[0]?.name)}\"`});showHideLoading({loading:false});return;}//zip validation ********** begin *****************\nlet zipFiles=allowedFiles.filter(file=>getExtension(file.name)===\"zip\");let zipdata;for(let i=0;i<zipFiles.length;i++){const file=zipFiles[i];console.log(\"zip file found__________________________1\");let filePathList=[];if(file.blobUrl){console.log(\"zip file found__________________________2\",file);const{entries}=await unzip(file.blobUrl);zipdata=entries;filePathList=Object.keys(entries).filter(filePath=>{return!filePath.includes(\"__MACOSX\");});}else{const{entries}=await unzip(file);zipdata=entries;filePathList=Object.keys(entries).filter(filePath=>{return!filePath.includes(\"__MACOSX\");});}filePathList=filePathList.map(path=>path.replace(/^.*[\\\\/]/,\"\"));const allowedFileExt=filePathList.filter(f=>{if(f.trim()===\"\"){return false;}return ACCEPT_3D_MODELS_IN_ZIP.includes(getExtension(f));});console.log(\"file contains after validation:\",allowedFileExt);file.isValidZip=allowedFileExt.length===1?true:false;if(allowedFileExt.length==1&&[\"blend\"].includes(getExtension(allowedFileExt[0]))){file.isInstantPreviewNotSupported=true;}}if(zipFiles.length>0){console.log(\"zipfiles\",zipFiles);allowedFiles=[...allowedFiles].filter(f=>{if(f.isValidZip===undefined)return true;else{if(!f.isValidZip){alert(`File \"${f.name}\" contains invalid model data. Kindly refer to upload guideline for zip`);trackTextureModelUploadCancelled({upload_type:\"Model\",file_name:f.name,reason:\"Invalid model data\",detail:\"User trying to upload invalid file in a zip\"});}return f.isValidZip;}});console.log(\"all files\",allowedFiles);}//zip validation **********  end  *****************\n// try{\n//     openDatabase().then((db) => saveDataToIdb(db, {file: fileToBlob(currentFile), name:currentFile.name}))\n// }\n// catch (error){\n//     console.log(\"save to index db\", error)\n// }\nconst _files=[];[...allowedFiles].forEach((f,i)=>{const size=convertBytesInMB(f?.size||f?.sizeBytes||f?.bytes);let name=f?.name?.split(\".\")?.[0]?.trim()?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\");name=name?.substring(0,MAX_3D_MODEL_PRODUCT_NAME_LENGTH-4);const isAvailableToUpload=true//i < _uploadAvailableLimit;\n;const id=crypto.randomUUID().slice(2);_files.push({id:id,fildId:f?.id||id,name:name,filename:f.name?.trim(),extension:getExtension(f.name),size,file:f,url:f?.link||f?.blobUrl||URL.createObjectURL(f),isUploaded:false,isFailed:\"\",isAvailableToUpload,access_token,type});});// setFiles((prev) => [...prev, ...new Set(_files)])\nsetFiles(prev=>[...new Set(_files)]);onFileSelected(_files?.[0]);showHideLoading({loading:false});};const onDelete=(file=null)=>{if(!file?.id)return;const _files=files.filter(f=>f.id!==file?.id);setFiles(_files);onFileSelected(_files?.[0]||null);};// model viewer\nconst getModelDetail=async uploadedProductId=>{const _formData=new FormData;_formData.append(\"product\",uploadedProductId);let status=0;_formData.append(\"status\",status);_formData.append(\"is_guest_request\",true);await apiPost3DModelJob(_formData,tokenData);};const getModelTemplateData=async()=>{try{let url=`${ROOT_API}${GET_MODEL_TEMPLATE}?is_texture_template=${isTexture}&product_model_template=false&product_texture_template=false`;if(isTexture){if(selectedImage?.id){url+=`&model=${selectedImage.id}`;}}const response=await fetch(url,{method:\"GET\",headers:{Authorization:`Bearer ${tokenData}`}});const result=await response.json();return result;}catch(error){console.error(\"An error occured\",error);return null;}};const getJson=async url=>{const res=await fetch(url);return res.json();};const sendRenderData=async uploadedProductId=>{localStorage.removeItem(\"renderJson\");const modelTemplateData=await getModelTemplateData();const resultJson=[];setStartRender(false);await Promise.all(modelTemplateData?.results?.map(async(templateData,index)=>{if(templateData?.id){const templateJson=await getJson(templateData?.template_json);const copyJson=JSON.parse(JSON.stringify(templateJson));const formObj=new FormData;formObj.append(\"is_preview\",\"false\");formObj.append(\"is_main_render\",\"false\");formObj.append(\"render_name\",\"Render_\"+templateData.id);formObj.append(\"count\",\"1\");formObj.append(\"is_meta_data\",\"false\");formObj.append(\"is_water_mark\",\"false\");formObj.append(\"is_transparent_bg\",\"false\");formObj.append(\"is_shadow_on_floor\",\"true\");formObj.append(\"render_extension\",\"jpg\");formObj.append(\"type\",templateData?.room_type);formObj.append(\"room\",templateData?.template);formObj.append(\"model_template\",templateData?.id);formObj.append(\"is_self_serve_model\",\"true\");addIdsToRequestData({data:formObj,roomInfo:templateJson,includedIds:{products:true,textures:true}});if(isTexture){formObj.append(\"is_self_serve_texture\",\"true\");const hotspotMaterialDetails=copyJson[\"hotspotMaterialDetails\"];const currentHotSpot=hotspotMaterialDetails.find(_item=>_item?.hotspotName===hotSpotData?.objectName);copyJson[\"materialDetails\"]=copyJson[\"materialDetails\"].reduce((a,c)=>{if(currentHotSpot?.objectName===c?.objectName){const textureDetail=JSON.parse(localStorage.getItem(\"textureDetail\"));const{width,height}=textureDetail;const tilingOffsetValues=c?.tilingOffsetValues.map(_item=>{if(_item?.key===\"_MainTex\"){return{..._item,tilingX:10/(width/(12*2.54)),tilingY:10/(height/(12*2.54))};}return _item;});const _data={...c,skuId:textureDetail?.name,diffuseId:textureDetail?.id,isTexture:true,isColor:false,isTextureChanged:true,diffuseName:textureDetail?.name,tilingOffsetValues};return[...a,_data];}else if(hotspotMaterialDetails.find(_item=>_item?.objectName===c?.objectName)){return a;}return[...a,c];},[]);}else{// for (let pair of formObj.entries()) {\n//     console.log(pair[0] + \": \" + pair[1])\n// }\ncopyJson[\"uploaded_model_id\"]=uploadedProductId;let newBlenderAssetData={assetBundleName:null,objectName:\"1@\"+uploadedProductId,blenderAssetbundleId:uploadedProductId,parentName:null,id:uploadedProductId,objectIndex:\"1\",parentMat:null,childrenObjects:[],childrenMaterials:[],isDuplicateProp:false,isWindowAndDoor:false,loadedPropType:\"None\",modelType:\"UserImportModel\"};copyJson[\"blenderAssetBundleDatas\"].push(newBlenderAssetData);copyJson[\"transformChangedObjectData\"][\"1@\"+uploadedProductId]={objectName:\"1@\"+uploadedProductId,xPosition:templateData?.position_x,yPosition:templateData?.position_y,zPosition:templateData?.position_z,xRotation:templateData?.rotation_x,yRotation:templateData?.rotation_y,zRotation:templateData?.rotation_z,wRotation:templateData?.rotation_w,xScale:templateData?.scale_x,yScale:templateData?.scale_y,zScale:templateData?.scale_z,isScaled:getScaleValue(templateData),centerPivotPositionX:0,centerPivotPositionY:0,centerPivotPositionZ:0};}copyJson[\"cameraList\"]=templateData?.camera_angle_details?[templateData?.camera_angle_details]:[];copyJson[\"roomId\"]=templateData?.template;copyJson[\"baseRoomId\"]=+copyJson?.blenderLayoutBundleDatas?.[0]?.id;const blob=new Blob([JSON.stringify(copyJson)],{type:\"application/json\"});formObj.append(\"json_file\",blob,\"room_info.json\");const renderData=await sendRenderToApi(formObj);console.log(\"renderData\",renderData);resultJson.push({renderId:renderData?.data?.id,type:templateData?.room_type,tokenData:tokenData,renderUploadId:renderData?.data?.render_upload_id,cameraData:renderData?.data?.CameraData?.[0]});console.log(\"resultJson\",resultJson);const progressData=(index+1)*50;setStore(prev=>({...prev,apiProgress:progressData,customizingScene:progressData>=100?true:false}));}}));if(resultJson?.length){const onlyIds=resultJson.map(data=>data.renderId);if(onlyIds?.length){localStorage.setItem(\"renderJson\",JSON.stringify(resultJson));}console.log(resultJson,\"result json check 111\");setStore(prev=>({...prev,renderJson:JSON.stringify(resultJson)}));}};const sendRenderToApi=async formObj=>{try{const response=await fetch(`${ROOT_API}${RENDER_API}`,{method:\"POST\",headers:{Authorization:`Bearer ${tokenData}`},body:formObj});const result=await response.json();return result;}catch(error){console.error(\"An error occured\",error);return null;}};const getScaleValue=data=>{let flag=false;if(parseInt(data.scale_x)!=1||parseInt(data.scale_y)!=1||parseInt(data.scale_z)!=1){flag=true;}return flag;};const addIdsToRequestData=({data,roomInfo,includedIds={textures:true,products:false}})=>{const isFormData=data instanceof FormData;if(includedIds.products){const key=\"products\";const propIds=roomInfo.blenderAssetBundleDatas?.map(item=>item.id);const groupPropIds=roomInfo?.groupPropsMapping?Object.keys(roomInfo?.groupPropsMapping):[];const ids=[...propIds,...groupPropIds];if(isFormData){ids?.forEach(id=>{data.append(key,id);});}else{data[key]=ids;}}// textures and materials\nconst textureIds=[];const materialIds=[];roomInfo.materialDetails.map(md=>{if(md.loadedMaterialId){materialIds.push(md.loadedMaterialId);}[\"diffuseId\",\"AOId\",\"metallicId\",\"normalId\",\"roughnessId\",\"transparencyId\"].forEach(key=>{if(md[key]){textureIds.push(md[key]);}});});if(includedIds.textures){const uniqueTextureIds=duplicateArrayRemove(textureIds);if(isFormData){uniqueTextureIds.forEach(id=>{data.append(\"textures\",id);});}else{data.textures=uniqueTextureIds;}}};const duplicateArrayRemove=arr=>arr.filter((a,i)=>arr.indexOf(a)===i);async function uploadFileWithProgress(url,formData){const xhr=new XMLHttpRequest;// Set up the request\nxhr.open(\"POST\",url);// Track upload progress\nxhr.upload.addEventListener(\"progress\",event=>{if(event.lengthComputable){const percentComplete=event.loaded/event.total*100;if(percentComplete>7.5)setStore(prev=>({...prev,progress:percentComplete}));// if (percentComplete >= 100) {\n//     setStartRender(true)\n// }\n}});// Handle when the upload is complete\nxhr.onload=()=>{if([200,201,202,203,204].includes(xhr.status)){setStartRender(true);console.log(\"Upload complete!\");}else{console.log(`Upload failed with status: ${xhr.status}`);}};// Handle errors\n// xhr.onerror = () => {\n//     console.log(\"An error occurred during the upload.\")\n// }\n// Send the request with the file\nxhr.send(formData);}const uploadImageData=async(file,presigned_data)=>{const formData=new FormData;Object.entries(presigned_data.fields).forEach(([k,v])=>{formData.append(k,v);});formData.append(\"file\",file);// const response = await fetch(presigned_data.url, {\n//     method: \"POST\",\n//     body: formData,\n// })\nconst response=await uploadFileWithProgress(presigned_data.url,formData);return response;};const saveToLibrary=async files=>{if(files.length===0){alert(\"Please upload atleast one 3D model.\");return;}localStorage.removeItem(\"updatedProductId\");// setShowLoader(true)\n// let token = localStorage.getItem(\"tokenForRefresh\")\nconst guestLoginResponse=await checkAndDoGuestLogin(setStore);const token=guestLoginResponse?.data?.access;// if (!token || token === \"undefined\") {\n//     console.log(\"TOKEN LOGGED : \", token)\n//     // showHideLoading({ loading: true })\n//     const guestLoginResponse = await checkAndDoGuestLogin(setStore)\n//     // showHideLoading({ loading: false })\n//     // const refresh = guestLoginResponse?.data?.refresh\n//     // const currentUser = guestLoginResponse?.data?.user\n//     token = guestLoginResponse?.data?.access\n//     // const dataToSend = {\n//     //     access: guestLoginResponse?.data?.access,\n//     //     refresh: guestLoginResponse?.data?.refresh,\n//     //     is_active_org: guestLoginResponse?.data?.is_active_org,\n//     //     is_email_verified:\n//     //         guestLoginResponse?.data?.is_email_verified,\n//     //     is_guest: guestLoginResponse?.data?.is_guest,\n//     //     id: guestLoginResponse?.data?.info?.id,\n//     // }\n//     // setStore((prev) => ({\n//     //     ...prev,\n//     //     guestLoginData: JSON.stringify(dataToSend),\n//     // }))\n// }\nsetTokenData(token);console.log(\"files : \",files);const result=await Promise.allSettled(files.filter(a=>a.isAvailableToUpload&&!a.isUploaded&&!a.isFailed).map(async({id,fildId,name,filename,file,type,url,access_token})=>{let response;try{const urlRes=await fetch(url);const blob=await urlRes.blob();// Convert Blob to File (File constructor requires the file name)\nconst newFile=new File([blob],filename,{type:type});if(isTexture){trackTextureModelUploadStarted({upload_type:\"Texture\",upload_extension:getExtension(filename?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\")),file_name:name,model_id:textureStore?.selectedImage?.id,model_name:textureStore?.selectedImage?.name,hotspot_name:isTexture&&textureStore?.selectedHotspotImage?textureStore?.selectedHotspotImage?.objectName:\"\"});response=await uploadTexture(file,filename,token);if(response?.status&&response?.data?.length){if(type===1){await uploadImageData(newFile,response?.data?.[0]?.presigned_data);trackTextureModelUploadedSuccessfully({upload_type:\"Texture\",upload_extension:getExtension(filename?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\")),file_name:name,model_id:textureStore?.selectedImage?.id,model_name:textureStore?.selectedImage?.name,hotspot_name:isTexture&&textureStore?.selectedHotspotImage?textureStore?.selectedHotspotImage?.objectName:\"\"});}response={...response,data:response?.data?.[0]};}if(response?.data?.available_texture_count===0){alert(\"Your texture upload limit is finished\");trackTextureModelUploadCancelled({upload_type:\"Texture\",upload_extension:getExtension(filename?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\")),file_name:name,model_id:textureStore?.selectedImage?.id,model_name:textureStore?.selectedImage?.name,hotspot_name:isTexture&&textureStore?.selectedHotspotImage?textureStore?.selectedHotspotImage?.objectName:\"\",reason:\"Reload\",detail:\"Your texture upload limit is finished\"});window.location.reload();}}else{const formData=new FormData;formData.append(\"name\",name);formData.append(\"main_asset_name\",name?.replaceAll(\" \",\"_\"));// formData.append(\"is_assetbundle\", false)\nformData.append(\"upload_type\",type);formData.append(\"access_token\",access_token);formData.append(\"prop_data_user_file_name\",filename?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\"));trackTextureModelUploadStarted({upload_type:\"Model\",upload_extension:getExtension(filename?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\")),file_name:name});response=await apiPostUpload3DModel(formData,token);if(response?.status&&response?.data?.id){if(type===1){await uploadImageData(newFile,response?.data?.presigned_url_prop_user_file);trackTextureModelUploadedSuccessfully({upload_type:\"Model\",upload_extension:getExtension(filename?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\")),file_name:name});}}else{const element=document.getElementById(\"upload-model-viewer-loading-parent\");if(element){element.style.display=\"none\";}alert(\"Your 3d model upload limit is finished\");trackTextureModelUploadCancelled({upload_type:\"Model\",upload_extension:getExtension(filename?.replaceAll(\" \",\"_\")?.replaceAll(NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\"\")),file_name:name,reason:\"Reload\",detail:\"Your 3d model upload limit is finished\"});// \"You don't have 3D Model File Upload Limit.\"\nwindow.location.reload();return;}}}catch(e){let message=e?.message;if(message?.toLowerCase()?.includes(\"already exists\")){message=`The model with name \"${getTextSubstring(name)}\" is already exists. Please rename it to upload again.`;}alert(message||\"Something went wrong. Please try again.\");let failedMessage=\"\";if(message?.toLowerCase()?.includes(\"already exists\")){failedMessage=\"Name already exists in library.\";}}return response;}));if(result.length>0){const success=result.every(res=>res?.status===\"fulfilled\"&&res?.value);console.log(\"success : \",success);if(success){setStore(prev=>({...prev,modelId:!isTexture?result?.[0]?.value?.data?.id.toString():null,textureId:isTexture?result?.[0]?.value?.data?.id.toString():null}));setUpdatedProductId(result?.[0]?.value?.data?.id);localStorage.setItem(\"updatedProductId\",result?.[0]?.value?.data?.id);localStorage.setItem(\"textureDetail\",JSON.stringify(result?.[0]?.value?.data));// if (!localStorage.getItem(\"tokenForRefresh\")) {\n//     localStorage.setItem(\n//         \"tokenForRefresh\",\n//         tokenData || token\n//     )\n// }\n}}else{// warningToast('No Model is uploaded.');\n}};function saveFileToIndexDB(){// openDatabase()\n//     .then((db) => getAllData(db))\n//     .then(async (data) => {\nconst _file=files?.[0];if(_file){// let allowedFiles = _files\n// let fileData = {}\n// let name = allowedFiles?.name\n//     ?.split(\".\")?.[0]\n//     ?.trim()\n//     ?.replaceAll(\n//         NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL,\n//         \"\"\n//     )\n// name = name?.substring(\n//     0,\n//     MAX_3D_MODEL_PRODUCT_NAME_LENGTH - 4\n// )\n// const isAvailableToUpload = true //i < _uploadAvailableLimit;\n// const id = crypto.randomUUID().slice(2)\n// fileData = {\n//     id: id,\n//     fildId: allowedFiles?.id || id,\n//     name: name,\n//     filename: allowedFiles.name?.trim(),\n//     extension: allowedFiles?.extension || getExtension(allowedFiles.name),\n//     size: allowedFiles?.file?.size,\n//     file: allowedFiles?.file,\n//     url:\n//         allowedFiles?.link ||\n//         allowedFiles?.blobUrl ||\n//         URL.createObjectURL(allowedFiles?.file),\n//     isUploaded: false,\n//     isFailed: \"\",\n//     isAvailableToUpload,\n//     access_token:\n//         \"it does not work without token :( waiting for backend update\",\n//     type: 1,\n// }\nsetStore(prev=>({...prev,fileName:_file?.name,extension:_file?.extension}));if(isTexture){openModelTextureFileDb().then(db=>getAllData(db)).then(async data=>{console.log(\"db data\",data);if(data){const _file=data.find(_item=>_item.name===`${selectedImage?.id}.glb`)?.file;if(_file){console.log(\"DB texture url : \",URL.createObjectURL(_file));setUrl(URL.createObjectURL(_file));setExtension(\"glb\");}else{setUrl(selectedImage?.propUrl);setExtension(\"glb\");}}else{setUrl(selectedImage?.propUrl);setExtension(\"glb\");}});}else{setUrl(_file?.url);setExtension(_file?.extension);}console.log(localStorage.getItem(\"renderJson\"),_file?.url,_file?.extension,\"check render json\");if(localStorage.getItem(\"renderJson\")){const resultJson=JSON.parse(localStorage.getItem(\"renderJson\"));setUpdatedProductId(localStorage.getItem(\"updatedProductId\"));// const guestLoginResponse = await checkAndDoGuestLogin(setStore)\n// setTokenData(guestLoginResponse?.data?.access)\nconsole.log(resultJson,\"result json check 222\");setStore(prev=>({...prev,renderJson:JSON.stringify(resultJson),modelId:!isTexture?localStorage.getItem(\"updatedProductId\"):null,textureId:isTexture?localStorage.getItem(\"updatedTextureId\"):null}));}else{saveToLibrary([_file]);}}// })\n}useEffect(()=>{if(!unicode){if(!loginInterval){loginInterval=setTimeout(()=>{loginInterval=null;},100);if(localStorage.getItem(\"current_user\")){checkAndDoGuestLogin(setStore);}}}handleLogin();window.addEventListener(\"storage\",handleLogin);ref.current=document.getElementById(\"model-viewer\");return()=>{window.removeEventListener(\"storage\",handleLogin);};},[]);useEffect(()=>{if(!isTexture){const isTexturePresent=files.find(file=>file.extension===\"jpeg\"||file.extension===\"jpg\"||file.extension===\"png\");if(isTexturePresent){setStore(prev=>({...prev,showTextureModal:true}));setTextureStore(prev=>({...prev,files:files}));// setTextureStoreData({files: files.map(_item => _item.file)})\nreturn;}}if(files.length){const element=document.getElementById(\"upload-model-viewer-loading-parent\");const viewerContainer=document.getElementById(\"model-viewer-container\");const uploaderContainer=document.getElementById(\"model-upload-container\");if(viewerContainer){viewerContainer.style.display=\"flex\";}if(uploaderContainer){uploaderContainer.style.display=\"none\";}if(element){element.style.display=\"flex\";}if(isTexture){const textureModal=document.getElementById(\"texture-upload-modal\");if(textureModal)textureModal.style.display=\"none\";}saveFileToIndexDB();// window.location.href =\n//     localStorage.getItem(\"REDIRECT_URL\") || REDIRECT_URL // get REDIRECT_URL from local is for Mayank' s work. Remove it after his work completed\n}},[files,selected]);useEffect(()=>{setStore(prev=>({...prev,files:files}));},[files]);useEffect(()=>{setStore(prev=>({...prev,url:selected?.url||\"\",extension:selected?.extension||\"\"}));},[selected]);useEffect(()=>{async function fetchData(){const viewerContainer=document.getElementById(\"model-viewer-container\");const uploaderContainer=document.getElementById(\"model-upload-container\");if(viewerContainer){viewerContainer.style.display=\"flex\";}if(uploaderContainer){uploaderContainer.style.display=\"none\";}const guestLoginResponse=await checkAndDoGuestLogin(setStore);const tokenNew=guestLoginResponse?.data?.access;const allUnicodeData=await getAllDataFromUnicode(unicode,tokenNew);console.log(allUnicodeData,\"allUnicodeData\");if(allUnicodeData?.status){let productUrl=allUnicodeData?.data?.product_details?.prop_data_user_file;let extension;if(allUnicodeData?.data?.is_texture_share){const allTextureData=allUnicodeData?.data?.texture_data;const texData=allTextureData?.hotspotData;const textureFile=allUnicodeData?.data?.texture_details?.texture_file;if(texData?.propUrl){productUrl=texData?.propUrl;extension=\"glb\";localStorage.setItem(\"hotspotData\",JSON.stringify(texData));}const texDetail=allTextureData?.textureDetail;texDetail[\"texture_file\"]=textureFile;console.log(texData,\"texData\",texDetail);localStorage.setItem(\"textureDetail\",JSON.stringify(texDetail));}else{extension=getExtensionFroms3Url(productUrl);}setUrl(productUrl);setExtension(extension);setStore(prev=>({...prev,url:productUrl||\"\",extension:extension||\"\"}));const renderJson=[];const projectRender=allUnicodeData?.data?.project_render?.sort();const mainRender=allUnicodeData?.data?.main_render?.sort();const allRenderImages=allUnicodeData?.data?.render_images_details;for(let i=0;i<allRenderImages?.length;i++){let obj={renderId:allRenderImages[i]?.render_job||mainRender[i],renderUploadId:allRenderImages[i]?.main_render,type:allRenderImages[i]?.room_type,tokenData:tokenNew,cameraData:{cameraName:allRenderImages[i]?.angle_name}};renderJson.push(obj);}localStorage.setItem(\"renderJson\",JSON.stringify(renderJson));let productId;if(allUnicodeData?.data?.is_texture_share){productId=allUnicodeData?.data?.texture;}else{productId=allUnicodeData?.data?.product;}localStorage.setItem(\"updatedProductId\",productId);console.log(renderJson,\"result json check 333\");setStore(prev=>({...prev,renderJson:JSON.stringify(renderJson),modelId:!allUnicodeData?.data?.is_texture_share?productId:null,textureId:allUnicodeData?.data?.is_texture_share?productId:null}));setTextureStore(prev=>({...prev,fileData:{width:allUnicodeData?.data?.texture_data?.textureDetail?.width,height:allUnicodeData?.data?.texture_data?.textureDetail?.height,url:allUnicodeData?.data?.texture_details?.texture_file},selectedHotspotImage:allUnicodeData?.data?.texture_data?.hotspotData,selectedImage:allUnicodeData?.data?.texture_data?.hotspotData}));console.log(renderJson,extension,productUrl,\"check all values\");}return;}if(unicode&&!textureStore?.fileData&&!store?.resultJson){loginInterval=setTimeout(()=>{fetchData();if(loginInterval)clearInterval(loginInterval);},10);}},[]);useEffect(()=>{console.log(\"DEBUG___STORE\",{textureStore,store});},[textureStore,store]);useEffect(()=>{if(store.progress>=100&&store.apiProgress>=100){const element=document.getElementById(\"upload-model-viewer-loading-parent\");if(element?.style?.display===\"none\")return;if(element){element.style.display=\"none\";}let dataForSegment={};console.log(isTexture,\"checking texture upload\",hotSpotData,textureStore,store);const params=new URLSearchParams(window.location.search);if(!params?.get(\"unique\")){if(isTexture){dataForSegment[\"Upload_Type\"]=\"Texture\";dataForSegment[\"Hotspot_id\"]=hotSpotData?.id;dataForSegment[\"widget_id\"]=selectedImage?.id;dataForSegment[\"widget_name\"]=selectedImage?.name;callTrackEvent(\"Texture/Model Upload\",dataForSegment,true);}else{dataForSegment[\"Upload_Type\"]=\"Model\";dataForSegment[\"widget_id\"]=\"\";dataForSegment[\"widget_name\"]=\"\";dataForSegment[\"Hotspot_id\"]=\"\";callTrackEvent(\"Texture/Model Upload\",dataForSegment,true);}}}},[store.progress,store.apiProgress]);useEffect(()=>{if(uploadedProductId&&startRender){setStore(prev=>({...prev,uploadingFile:true}));if(!isTexture)getModelDetail(uploadedProductId);sendRenderData(uploadedProductId);}},[uploadedProductId,startRender]);const callSegmentEvent=()=>{let dataForSegment={};dataForSegment[\"Upload_Type\"]=isTexture?\"Texture\":\"Model\";dataForSegment[\"Hotspot_id\"]=hotSpotData?.id||\"\";dataForSegment[\"widget_id\"]=selectedImage?.id||\"\";dataForSegment[\"widget_name\"]=selectedImage?.name||\"\";callTrackEvent(\"Drag to rotate click\",dataForSegment,true);};useEffect(()=>{async function fetchData(){await loadThree();if(// extension !== \"glb\" &&\n!isTexture&&!isTextureFromUnicode){OV.SetExternalLibLocation(\"lib\");viewer=new OV.EmbeddedViewer(ref?.current,{backgroundColor:new OV.RGBAColor(255,255,255,255),defaultColor:new OV.RGBColor(200,200,200),edgeSettings:new OV.EdgeSettings(false,new OV.RGBColor(0,0,0),1),environmentSettings:new OV.EnvironmentSettings([\"https://framerusercontent.com/images/pMLb7hshOstBTCZK2fMrWxvrCY.jpg\",\"https://framerusercontent.com/images/7vpD1JcHrmXRWLNbX8sHbQLpTkE.jpg\",\"https://framerusercontent.com/images/PPL7Uac5MndWWkIYN3EBVziy49U.jpg\",\"https://framerusercontent.com/images/Xgf92plfEhjzYdbe0iYJCap5JMs.jpg\",\"https://framerusercontent.com/images/CBQmx242Pq4V9i4f69C5naFktX4.jpg\",\"https://framerusercontent.com/images/pQpPNmjTdRUL27poJnYKlDoAsDc.jpg\"],false),onModelLoaded:()=>{const loader=document.getElementById(\"modelLoader\");loader.style.width=\"100%\";let element=document.getElementById(\"model-viewer-hand-icon\");console.log(\"viweer : \",element,ref?.current);if(!element){element=handIcon();ref?.current.appendChild(element);ref?.current?.addEventListener(\"mousedown\",e=>{if(element!==\"REMOVED\"){e.preventDefault();ref?.current.removeChild(element);element=\"REMOVED\";callSegmentEvent();}});ref?.current?.addEventListener(\"touchstart\",e=>{if(element!==\"REMOVED\"){e?.preventDefault();ref?.current.removeChild(element);element=\"REMOVED\";callSegmentEvent();}});if(ref?.current){ref.current.querySelector(\"canvas\").onclick=function(){trackDragToRotateClick({curatorOpenSource:isTexture?\"Texture upload\":\"Model upload\",is_expand:expandedImage?\"Yes\":\"No\",upload_type:isTexture?\"Texture\":\"Model\",model_id:textureStore?.selectedImage?.id,model_name:textureStore?.selectedImage?.name,upload_extension:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.extension:files?.[0]?.extension,file_name:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.name:files?.[0]?.name,hotspot_name:isTexture&&textureStore?.selectedHotspotImage?textureStore?.selectedHotspotImage?.objectName:\"\"});};}}// setTimeout(() => {\nsetStore(prev=>({...prev,modelLoading:false}));// }, 100)\nviewer.GetViewer().scene.traverse(obj=>{if(obj.isMesh){console.log(\"mesh : \",obj);}});},onLoadStart:()=>{const loader=document.getElementById(\"modelLoader\");loader.style.width=\"50%\";},onImportStart:()=>{const loader=document.getElementById(\"modelLoader\");loader.style.width=\"60%\";},onVisualizationStart:()=>{const loader=document.getElementById(\"modelLoader\");loader.style.width=\"80%\";},onLoadError:()=>{setTimeout(()=>{setStore(prev=>({...prev,modelLoading:false}));});}});// viewer = new OV.EmbeddedViewer(ref?.current, {})\nconsole.log(\"model upload:\",url,viewer,store);fetch(url).then(r=>r.blob()).then(blobdata=>{console.log(\"after loading\");viewer.LoadModelFromFileList([new File([blobdata],\"name.\"+extension)]);});}else if(!scene){scene=new THREE.Scene;// Step 2: Define the Paths to the Six Cubemap Images\nconst loader=new THREE.CubeTextureLoader;const textureCube=loader.load([\"https://framerusercontent.com/images/pMLb7hshOstBTCZK2fMrWxvrCY.jpg\",\"https://framerusercontent.com/images/7vpD1JcHrmXRWLNbX8sHbQLpTkE.jpg\",\"https://framerusercontent.com/images/PPL7Uac5MndWWkIYN3EBVziy49U.jpg\",\"https://framerusercontent.com/images/Xgf92plfEhjzYdbe0iYJCap5JMs.jpg\",\"https://framerusercontent.com/images/CBQmx242Pq4V9i4f69C5naFktX4.jpg\",\"https://framerusercontent.com/images/pQpPNmjTdRUL27poJnYKlDoAsDc.jpg\"]);scene.environment=textureCube// Useful for reflective materials\n;const canvas=document.createElement(\"canvas\");canvas.width=512;canvas.height=512;const context=canvas.getContext(\"2d\");// Create a linear gradient (vertical)\nconst gradient=context.createLinearGradient(0,0,0,canvas.height);gradient.addColorStop(0,\"#f5f5f5\")// Top color (blue)\n;gradient.addColorStop(1,\" #e0e0e0\")// Bottom color (light blue)\n;// Apply the gradient to the canvas\ncontext.fillStyle=gradient;context.fillRect(0,0,canvas.width,canvas.height);// Use the canvas as a texture\nconst texture=new THREE.CanvasTexture(canvas);// Set the texture as the scene's background\nscene.background=texture;const camera=new THREE.PerspectiveCamera(35,ref?.current?.clientWidth/ref?.current?.clientHeight,.1,1e4);// Set Camera Position for Initial Rotation (45-degree angle)\nconst radius=60// Distance from the origin\n;const angle=THREE.MathUtils.degToRad(-25)// Convert 45 degrees to radians\n;// Use polar coordinates for positioning\nconst x=radius*Math.sin(angle)// Horizontal offset\n;// const y = radius * Math.sin(angle) // Vertical offset\nconst z=radius*Math.cos(angle)// Depth offset\n;camera.position.set(x,25,z)// Set camera position at a 45-degree angle\n;camera.lookAt(0,0,0);console.log(\"camera : \",camera);const renderer=new THREE.WebGLRenderer({antialias:true});renderer.setSize(ref?.current?.clientWidth,ref?.current?.clientHeight);// renderer.outputEncoding = THREE.LinearEncoding\n// renderer.outputColorSpace = THREE.LinearSRGBColorSpace\nrenderer.outputEncoding=THREE.sRGBEncoding// Correct color space encoding\n;renderer.toneMapping=THREE.ACESFilmicToneMapping// Tone mapping for photorealistic colors\n;renderer.toneMappingExposure=1.2// Adjust exposure if needed\n;renderer.setPixelRatio(window.devicePixelRatio);renderer.setClearColor(16777215,1);//post processing\nconst composer=new EffectComposer(renderer);const renderPass=new RenderPass(scene,camera);composer.addPass(renderPass);if(renderer?.domElement){renderer.domElement.onclick=function(){trackDragToRotateClick({curatorOpenSource:isTexture?\"Texture upload\":\"Model upload\",is_expand:expandedImage?\"Yes\":\"No\",upload_type:isTexture?\"Texture\":\"Model\",model_id:textureStore?.selectedImage?.id,model_name:textureStore?.selectedImage?.name,upload_extension:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.extension:files?.[0]?.extension,file_name:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.name:files?.[0]?.name,hotspot_name:isTexture&&textureStore?.selectedHotspotImage?textureStore?.selectedHotspotImage?.objectName:\"\"});};}ref?.current?.appendChild(renderer.domElement);var ambientLight=new THREE.AmbientLight(8947848,.5);var directionalLight=new THREE.DirectionalLight(8947848,.5);scene.add(directionalLight);scene.add(ambientLight);const controls=new OrbitControls(camera,renderer.domElement);controls.enableDamping=true;const updateDimension=()=>{if(!ref?.current)return;const width=ref?.current?.clientWidth;let height=ref?.current?.clientHeight;// if (width > 510) height = 510\n// if (height > 480) height = 480\ncamera.aspect=width/height;camera.updateProjectionMatrix();renderer.setSize(width,height);render();setDimension({width,height});};const loadModel=async()=>{await loadThree();let loader;if(extension===\"fbx\"){loader=new FBXLoader;}else if(extension===\"obj\"){loader=new OBJLoader;}else if(extension===\"glb\"||extension===\"gltf\"){loader=new GLTFLoader;const draco=new DRACOLoader;// draco.setDecoderPath(\"/draco/\") // getting the draco files from the public folder\ndraco.setDecoderPath(\"https://media-stag.imagine.io/media/public/self_serve_tex_upload_model/\");draco.setDecoderConfig({type:\"js\"});loader.setDRACOLoader(draco);}else if(extension===\"usdz\"){// usda support\nloader=new USDZLoader;//usdc & usd support\n// const usdzloader = new USDZLoader();\n// setModelLoading(true)\n// console.log('extension ______________1 : ', url);\n// let object = new THREE.Group();\n// let blob = await fetch(url).then((r) => r.blob());\n// console.log('blob loaded successfully ______________2 : ', blob);\n// usdzloader.loadFile(new File([blob], 'name.usdz'), object).then(\n//   (usdzobj) => {\n//     console.log('loaded successfully ______________2 : ', object);\n//     object.position.set(0, 0, 0);\n//     scene.add(object);\n//     fitCameraToSelection(camera, controls, [object], 1.15);\n//     setModelLoading(false)\n//     // animate();\n//   },\n//   (err) => {\n//     console.log(err);\n//   }\n// );\n}let modelViewerUrl=url;if(!url.startsWith(\"blob:\")){try{const db=await openModelTextureFileDb();const data=await getAllData(db);const fileName=`${selectedImage?.id}.glb`;const existingFile=data?.find(_dataItem=>_dataItem.name===fileName)?.file;if(existingFile){const blobToUrl=URL.createObjectURL(existingFile);modelViewerUrl=blobToUrl;}if(!existingFile)urlToFile(url,`${selectedImage?.id}.glb`).then(file=>{if(file.type===\"binary/octet-stream\")openModelTextureFileDb().then(db=>{saveDataToIdb(db,{file:fileToBlob(file),name:file.name});});});}catch(error){console.error(\"Error loading model\",error);}}console.log(\"modelViewerUrl\",modelViewerUrl);loader?.load(url,obj=>{let object;if(extension===\"glb\"||extension===\"gltf\"||obj.scene){object=obj.scene;}else{object=obj;}object.position.set(0,0,0);console.log(\"Model loaded successfully ______________2 : \",object);object.traverse(function(child){if(child.isMesh){// if (\n//     isIOS() &&\n//     child.material.map &&\n//     (child.material.map.image.width >\n//         1024 ||\n//         child.material.map.image\n//             .height > 1024)\n// ) {\n//     child.material.map =\n//         resizeTextureTo2K(\n//             child.material.map\n//         )\n//     child.material.needsUpdate = true // Ensure the material is updated\n//     console.log(\n//         \"texture resolution downgraded to 1k\"\n//     )\n// }\nlet oldMat=child.material;child.castShadow=true;child.receiveShadow=true;console.log(\"DEBUG__child\",child);if(isMeshPhysicalMaterial(oldMat)){console.log(\"meshphysical material\");child.material=convertToStandardMaterial(oldMat);}else if(child.material.map){console.log(\"Texture loaded:\",child.material.map);}else if(!child.material){child.material=new THREE.MeshPhongMaterial({color:11908533});// console.log('No texture map found for mesh:', child);\n}else{// child.material = new THREE.MeshPhongMaterial({\n//   color: 0xb5b5b5,\n// });\n// console.log('No texture map found for mesh:', child);\n}console.log(\"isTexture :\"+isTexture+\" objectname:\"+hotSpotData?.objectName+\" childname:\"+child.name);if(isTexture&&child.name===hotSpotData?.objectName){//calculating tiling\nconst{fileData:{url,width,height}={}}=textureStore;const tilingX=10/(width/(12*2.54));const tilingY=10/(height/(12*2.54));//***************** */\nif(url){const loader=new THREE.TextureLoader;// load a resource\nloader.load(// resource URL\nurl,// onLoad callback\nfunction(texture){// in this example we create the material when the texture is loaded\n// Set the wrapping mode to RepeatWrapping to allow tiling\ntexture.wrapS=THREE.RepeatWrapping;texture.wrapT=THREE.RepeatWrapping;// Set the tiling values\ntexture.repeat.set(tilingX,-tilingY);// Set the offset values\nconst offsetX=0// Example offset value along X-axis\n;const offsetY=tilingY// Example offset value along Y-axis\n;texture.offset.set(offsetX,offsetY);child.material.map=texture;setStore(prev=>({...prev,modelLoading:false}));},// onProgress callback currently not supported\nundefined,// onError callback\nfunction(err){console.error(\"An error happened.\");});}}child.material.envMap=textureCube;child.material.needsUpdate=true;}});scene.add(object);fitCameraToSelection(camera,controls,[object],1.15);animate();// console.log('DEBUG___object', object);\n},xhr=>{// setModelLoading((xhr.loaded / xhr.total) * 100 !== 100);\n// console.log((xhr.loaded / xhr.total) * 100 + '% loaded');\n},error=>{console.log(error);setStore(prev=>({...prev,modelLoading:false}));setError(true);});// setStore(prev => ({\n//     ...prev,\n//     modelLoading: false,\n// }))\n};function resizeTextureTo2K(texture){const canvas=document.createElement(\"canvas\");const context=canvas.getContext(\"2d\");// Set the canvas to 2048x2048 (2K resolution)\ncanvas.width=1024;canvas.height=1024;// Draw the original texture onto the resized canvas\ncontext.drawImage(texture.image,0,0,1024,1024);// Create a new texture from the resized canvas\nconst resizedTexture=new THREE.Texture(canvas);resizedTexture.needsUpdate=true;return resizedTexture;}function convertToStandardMaterial(physicalMaterial){// const standardMaterial = new THREE.MeshPhongMaterial()\nconst standardMaterial=new THREE.MeshStandardMaterial;// Copy common properties\nstandardMaterial.color.copy(physicalMaterial.color);standardMaterial.map=physicalMaterial.map;standardMaterial.roughness=physicalMaterial.roughness;standardMaterial.metalness=physicalMaterial.metalness;standardMaterial.normalMap=physicalMaterial.normalMap;standardMaterial.normalScale.copy(physicalMaterial.normalScale);standardMaterial.envMap=physicalMaterial.envMap;standardMaterial.envMapIntensity=physicalMaterial.envMapIntensity;standardMaterial.emissive.copy(physicalMaterial.emissive);standardMaterial.emissiveMap=physicalMaterial.emissiveMap;standardMaterial.emissiveIntensity=physicalMaterial.emissiveIntensity;standardMaterial.aoMap=physicalMaterial.aoMap;standardMaterial.aoMapIntensity=physicalMaterial.aoMapIntensity;standardMaterial.bumpMap=physicalMaterial.bumpMap;standardMaterial.bumpScale=physicalMaterial.bumpScale;standardMaterial.alphaMap=physicalMaterial.alphaMap;standardMaterial.displacementMap=physicalMaterial.displacementMap;standardMaterial.displacementScale=physicalMaterial.displacementScale;standardMaterial.displacementBias=physicalMaterial.displacementBias;standardMaterial.lightMap=physicalMaterial.lightMap;standardMaterial.lightMapIntensity=physicalMaterial.lightMapIntensity;standardMaterial.transparent=physicalMaterial.transparent;standardMaterial.opacity=physicalMaterial.opacity;// Other custom properties you may want to copy\n// standardMaterial.wireframe = physicalMaterial.wireframe;\nreturn standardMaterial;}function isMeshPhysicalMaterial(material){// return material instanceof THREE.MeshPhysicalMaterial\nreturn material.type===\"MeshPhysicalMaterial\";}function onWindowResize(){updateDimension();}function animate(){requestAnimationFrame(animate);controls?.update();directionalLight.position.copy(camera.position);directionalLight.rotation.copy(camera.rotation);// render()\ncomposer.render();}const size=new THREE.Vector3;const center=new THREE.Vector3;const box=new THREE.Box3;function fitCameraToSelection(camera,controls,selection,fitOffset=1.2){box.makeEmpty();for(const object of selection){box.expandByObject(object);}box.getSize(size);box.getCenter(center);const maxSize=Math.max(size.x,size.y,size.z);const fitHeightDistance=maxSize/(2*Math.atan(Math.PI*camera.fov/360));const fitWidthDistance=fitHeightDistance/camera.aspect;const distance=fitOffset*Math.max(fitHeightDistance,fitWidthDistance);const direction=controls.target.clone().sub(camera.position).normalize().multiplyScalar(distance);controls.minDistance=distance*.3;controls.maxDistance=distance*3.5;controls.autoRotate=true;controls.target.copy(center);camera.near=distance/100;camera.far=distance*100;camera.updateProjectionMatrix();camera.position.copy(controls.target).sub(direction);controls.update();}function render(){renderer.render(scene,camera);}// const handleWindowClick = (event) => {\n//     controls.autoRotate = false\n// }\n// Register the event listener\nanimate();loadModel();if(ref?.current){updateDimension();}window.addEventListener(\"resize\",onWindowResize,false);window.addEventListener(\"click\",()=>{controls.autoRotate=false;},false);return()=>{window.removeEventListener(\"resize\",onWindowResize,false);// window.removeEventListener(\n//     \"click\",\n//     handleWindowClick,\n//     false\n// )\n// ref?.current?.removeChild(renderer.domElement)\n};}}if(url&&!store?.viewerLoaded){setStore(prev=>({...prev,viewerLoaded:true}));fetchData();}return()=>{if(!unicode){while(ref?.current&&ref?.current.firstChild){ref?.current.firstChild.remove();}viewer?.Destroy();}};},[url]);return /*#__PURE__*/_jsxs(\"div\",{id:\"upload-container\",style:{position:\"relative\"},className:\"upload-container-1\",children:[/*#__PURE__*/_jsx(Component,{...props,onDragOver:e=>{e.stopPropagation();e.preventDefault();},onDrop:e=>{e.preventDefault();const _files=Array.from(e.dataTransfer.files);const _filteredFiles=[..._files]?.filter(a=>ACCEPT_3D_MODELS.includes(getExtension(a?.name)));const targetText=e?.target?.innerText?.toLowerCase()===\"imagine your product here\";if([..._files]?.length>_filteredFiles?.length){alert(`Only ${ACCEPT_3D_MODELS.split(\",\").join(\",\")} files are supported.`);trackTextureModelUploadCancelled({is_drag:\"Yes\",// upload_type: \"Model\",\nupload_extension:getExtension(_files?.[0]?.name),reason:\"Extension not allowed\",detail:`Uploading extension \"${getExtension(_files?.[0]?.name)}\"`});}if(_filteredFiles?.length===1){trackTextureModelSelected({upload_type:ACCEPT_TEXTURE_IMAGES.includes(getExtension(_filteredFiles?.[0]?.name))?\"Texture\":\"Model\",upload_extension:getExtension(_filteredFiles?.[0]?.name),file_name:_filteredFiles?.[0]?.name,imagine_your_product:targetText?\"Yes\":\"No\",is_drag:\"Yes\"});callTrackEvent(\"Texture/Model Click \",{Upload_Source:\"Click and drop\"},true);onUpload({fileList:_filteredFiles});}else{alert(`Cannot upload more than 1 file`);trackTextureModelUploadCancelled({imagine_your_product:targetText?\"Yes\":\"No\",is_drag:\"Yes\",upload_type:\"Model\",reason:\"Multiple file upload\",detail:\"User is trying to upload multiple files\"});}},onClick:e=>{if(textureStore?.selectedImage){if(hotSpotData){const _file=textureStore?.fileData?.file;const fileData={name:_file?.name,filename:_file.name?.trim(),extension:getExtension(_file.name),size:_file?.size,file:_file,url:URL.createObjectURL(_file),isUploaded:false,isFailed:\"\",isAvailableToUpload:true,type:1};setFiles([fileData]);}}else{const targetText=e?.target?.innerText?.toLowerCase()===\"imagine your product here\";trackUploadTextureModelClicked({imagine_your_product:targetText?\"Yes\":\"No\",is_drag:\"No\"});document.getElementById(\"inputModelUpload\")?.click();}},style:{...props.style,cursor:\"pointer\",opacity:textureStore?.selectedImage?hotSpotData?1:.5:1}}),/*#__PURE__*/_jsx(\"input\",{style:{display:\"none\"},accept:isIOS()?ACCEPT_3D_MODELS_WITH_MIME_TYPE:ACCEPT_3D_MODELS,id:\"inputModelUpload\",type:fileBtn?\"file\":\"button\",onChange:async e=>{// trackUploadTextureModelClicked({\n//     imagine_your_product: \"No\",\n//     is_drag: \"No\",\n// })\nconst targetText=e?.target?.innerText?.toLowerCase()===\"imagine your product here\";const textures=Array.from(e.target.files);if(textures?.length===1){trackTextureModelSelected({upload_type:ACCEPT_TEXTURE_IMAGES.includes(getExtension(textures?.[0]?.name))?\"Texture\":\"Model\",upload_extension:getExtension(textures?.[0]?.name),file_name:textures?.[0]?.name,imagine_your_product:targetText?\"Yes\":\"No\",is_drag:\"No\"});}callTrackEvent(\"Texture/Model Click \",{Upload_Source:\"Click and drop\"},true);await onUpload({fileList:Array.from(e.target.files)});e.target.value=\"\";},onClick:async e=>{if(!fileBtn){await onUpload({fileList:[]});}}})]});};}export function withModelUpload(Component){return props=>{const{textureStore,setTextureStore}=getTextureStoreData();props.id=\"model-upload-container\";const unicode=getSearch(\"unicode=\");useEffect(()=>{const fetchData=async()=>{try{const db=await openModelTextureFileDb();const data=await getAllData(db);console.log(\"data\",data,textureStore);textureStore?.images?.forEach(async _item=>{const fileName=`${_item?.id}.glb`;const existingFile=data?.find(_dataItem=>_dataItem.name===fileName)?.file;if(!existingFile){const file=await urlToFile(_item?.propUrl,fileName);if(file.type===\"binary/octet-stream\"){await saveDataToIdb(db,{file:fileToBlob(file),name:file.name});}}});}catch(error){console.error(\"Error fetching data:\",error);}};if(!unicode)fetchData();},[]);return /*#__PURE__*/_jsx(Component,{...props});};}export function withModelViewerContainer(Component){return props=>{props.id=\"model-viewer-container\";return /*#__PURE__*/_jsx(Component,{...props,style:{display:\"none\"}});};}// this a rendering in process model\nexport function withModelUploadLoader(Component){return props=>{return /*#__PURE__*/_jsx(\"div\",{id:\"upload-model-viewer-loading-parent\",style:{position:\"fixed\",zIndex:\"10\",width:\"100%\",height:\"100%\",top:\"0px\",left:\"0px\",display:\"none\",justifyContent:\"center\",alignItems:\"center\",background:\"rgba(0, 0, 0, 0.8)\"},children:/*#__PURE__*/_jsx(Component,{...props,style:{...props?.style,position:\"relative\",top:\"initial\",left:\"initial\",opacity:1,transform:\"translate(0, 0)\"}})});};}export function withShowTextureUpload(Component){return props=>{const[store,setStore]=useStore();const{showTextureModal}=store;props.id=\"texture-upload-modal\";return /*#__PURE__*/_jsx(_Fragment,{children:showTextureModal&&/*#__PURE__*/_jsx(Component,{...props,style:{...props.style,position:\"fixed\",top:\"0px\",left:\"0px\",width:\"100%\",height:\"100%\",zIndex:\"10\"}})});};}export function withSizeError(Component){return props=>{return /*#__PURE__*/_jsx(\"div\",{id:\"model-upload-size-error\",style:{position:\"fixed\",zIndex:\"10\",width:\"100%\",height:\"100%\",left:\"0px\",top:\"100px\",display:\"none\",justifyContent:\"center\",alignItems:\"center\",background:\"rgba(0, 0, 0, 0.8)\"},children:/*#__PURE__*/_jsx(Component,{...props,style:{// position: \"relative\",\ntop:\"180px\",// left: \"initial\",\nopacity:1}})});};}export function withCloseSizeErrorPopup(Component){const closePopup=()=>{console.log(\"clicked close\");const element=document.getElementById(\"model-upload-size-error\");if(element){element.style.display=\"none\";}};return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{cursor:\"pointer\"},onClick:e=>closePopup()});};}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};\nexport const __FramerMetadata__ = {\"exports\":{\"GET_MODEL_TEMPLATE\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getDataFromIdb\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"MAX_3D_MODEL_PRODUCT_NAME_LENGTH\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"saveDataToIdbV2\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withModelUpload\":{\"type\":\"reactHoc\",\"name\":\"withModelUpload\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"MODEL_TEXTURE_DB_NAME\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RENDER_API\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getSearch\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowTextureUpload\":{\"type\":\"reactHoc\",\"name\":\"withShowTextureUpload\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSizeError\":{\"type\":\"reactHoc\",\"name\":\"withSizeError\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withModelUploadLoader\":{\"type\":\"reactHoc\",\"name\":\"withModelUploadLoader\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getExtension\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getAllData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"VIEWER_TYPE\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"saveDataToIdb\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_DB_NAME\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NAME_EXCLUDED_SPECIAL_CHARS_V2_GLOBAL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"deleteDatabase\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseSizeErrorPopup\":{\"type\":\"reactHoc\",\"name\":\"withCloseSizeErrorPopup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getTextSubstring\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withModelViewerContainer\":{\"type\":\"reactHoc\",\"name\":\"withModelViewerContainer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"openDatabase\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"sizeDecimals\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"openModelTextureFileDb\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"urlToFile\":{\"type\":\"function\",\"isAsync\":true,\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCancelButton\":{\"type\":\"reactHoc\",\"name\":\"withCancelButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getTextureStoreData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDragDropUploadSelfServe\":{\"type\":\"reactHoc\",\"name\":\"withDragDropUploadSelfServe\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withModelViewer\":{\"type\":\"reactHoc\",\"name\":\"withModelViewer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"convertBytesInMB\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fileToBlob\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const SIGNUP_CONVERT_USER=\"/users/api/v3/convert-demo/\";// import { ROOT_API, createUserInHubspot } from \"./PayAsYouGo.tsx\"\n// import { openCurator, getGuestLoginDataFromLocal } from \"./SelfServe.tsx\"\nimport{emailIsValid,emailIsValidWithExtension}from\"https://framerusercontent.com/modules/d7epF7O1CCyyY1cu4tfT/jU4iGXfCNDYPtFheK3hY/imagine.js\";// import { emailIsValid } from \"./ShareData.tsx\"\n// import { useStore as selfServeStore } from \"./SelfServe.tsx\"\nimport{getTextureStoreData}from\"https://framerusercontent.com/modules/27LpsBfn0auCgG9AOqtA/mA19RVGJkoL3MnsglCbg/Upload3dModel.js\";// import { callTrackEvent } from \"./UseSegment.tsx\"\n// import { USERPILOT_EVENTS, getUserpilotFlowDetails } from \"./Hubspot_Events.tsx\"\nimport{USERPILOT_EVENTS}from\"https://framerusercontent.com/modules/KubsT0m9HaPj7huiDD5T/eFW1UnY9SDW16b0m9d0i/userpilot.js\";import{checkAndDoGuestLogin,openCurator,useSelfServeStore}from\"https://framerusercontent.com/modules/byNafBI6bONoXnNvpJpV/uo03nslo0eJ6BVhnMxkF/selfServe.js\";import{decodeJwtPayload,loadScript,ROOT_API}from\"https://framerusercontent.com/modules/d7epF7O1CCyyY1cu4tfT/jU4iGXfCNDYPtFheK3hY/imagine.js\";import{createUserInHubspot}from\"https://framerusercontent.com/modules/v94ckslSZiJgw45mFxVR/sZmOBPevNbLLQRDFVx6i/hubspot.js\";import{callTrackEvent}from\"https://framerusercontent.com/modules/bAQLHHtmcrHXb2DGrreX/G2vfRCDF2LSWtJNJwdWd/segment.js\";// export const RESTRICT_PERSONAL_EMAIL_FROM_REGISTER = !localStorage.getItem(\n//     \"RESTRICT_PERSONAL_EMAIL_FROM_REGISTER\"\n// )\n//     ? true\n//     : localStorage.getItem(\"RESTRICT_PERSONAL_EMAIL_FROM_REGISTER\") === \"true\"\n//       ? true\n//       : false\n// const getRestrictPersonalEmailFlag = () => {\n//     if (typeof localStorage === \"undefined\") return true\n//     const value = localStorage.getItem(\"RESTRICT_PERSONAL_EMAIL_FROM_REGISTER\")\n//     return !value || value === \"true\"\n// }\n// export const RESTRICT_PERSONAL_EMAIL_FROM_REGISTER =\n//     getRestrictPersonalEmailFlag()\n// export const emailRegExp = RESTRICT_PERSONAL_EMAIL_FROM_REGISTER\n//     ? /^(?!.*@(?:gmail\\.com|yahoo\\.com|outlook\\.com|live\\.com|hotmail\\.com|gmail\\.io|yahoo\\.io|outlook\\.io|live\\.io|hotmail\\.io|gmail\\.in|yahoo\\.in|outlook\\.in|live\\.in|hotmail\\.in|gmail\\.org|yahoo\\.org|outlook\\.org|live\\.org|hotmail\\.org|test\\.com|test\\.in|test\\.co\\.in|testing\\.com|testing\\.in|testing\\.co\\.in|student\\.com|student\\.net|student\\.org|student\\.co|student\\.io|student\\.edu|student\\.info|student\\.biz|student\\.online|student\\.me|student\\.us|student\\.uk|student\\.in|student\\.co\\.uk|student\\.co\\.in)).*$/i\n//     : /^(?!.*@(?:yahoo\\.com|outlook\\.com|live\\.com|hotmail\\.com|gmail\\.io|yahoo\\.io|outlook\\.io|live\\.io|hotmail\\.io|gmail\\.in|yahoo\\.in|outlook\\.in|live\\.in|hotmail\\.in|gmail\\.org|yahoo\\.org|outlook\\.org|live\\.org|hotmail\\.org|test\\.com|test\\.in|test\\.co\\.in|testing\\.com|testing\\.in|testing\\.co\\.in|student\\.com|student\\.net|student\\.org|student\\.co|student\\.io|student\\.edu|student\\.info|student\\.biz|student\\.online|student\\.me|student\\.us|student\\.uk|student\\.in|student\\.co\\.uk|student\\.co\\.in)).*$/i\n// export const emailIsValidWithExtension = (e) => emailRegExp.test(e)\nconst initialData={name:\"\",email:\"\",password:\"\",hidePassword:true,isNameValid:true,isEmailValid:true,useBusinessEmail:true,isPasswordValid:true,restrictPersonalEmail:false};const GOOGLE_CLIENT_ID=\"556660496344-nughc01t5q2nbkakkavm23iagctb2ics.apps.googleusercontent.com\";export const useStore=createStore(initialData);const emailStyleObj={padding:\"15px 12px\",width:\"100%\",border:\"none\",fontSize:\"15px\",outline:\"none\"};export const generatePassword=(length=8)=>{const characters=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()\";let password=\"\";for(let i=0;i<length;i++){password+=characters.charAt(Math.floor(Math.random()*characters.length));}return password;};export const closeSignupForm=()=>{const form=document.querySelector(\"#signup-form-overlay\");if(form){form.style.display=\"none\";form.querySelector(\".not-allowed-domains\")?.remove();return true;}return false;};// we are opening signup form here - we open it when the user is not loggedin or loggedin as guest\nconst getCurrentUser=()=>{return new Promise((resolve,reject)=>{try{let user=localStorage.getItem(\"current_user\");user=user?JSON.parse(user):user;resolve(user?.user);}catch(error){reject(error);}});};const getLoginData=()=>{return new Promise((resolve,reject)=>{try{let loginData=localStorage.getItem(\"loginData\");loginData=loginData?JSON.parse(loginData)?.data:loginData;resolve(loginData);}catch(error){reject(error);}});};// we are opening signup form here - we open it when the user is not loggedin or loggedin as guest\nexport const openSignupFormWhenUserNotLoggedIn=async({loginData=false,signupCallback=null,signupProps={}}={})=>{const data=loginData||await getCurrentUser()// await getGuestLoginDataFromLocal()\n;if(!data||data?.is_guest){const form=document.querySelector(\"#signup-form-overlay\");if(form){const{trackSignUpPopupOpened}=USERPILOT_EVENTS;form.style.display=\"flex\";trackSignUpPopupOpened({...signupProps});window.signupProps=signupProps;window.signupCallback=signupCallback;return true;}}closeSignupForm();window.signupProps=null;window.signupCallback=null;return false;};export function withSignUpNowButton(Component){return props=>{const[store,setStore]=useStore();const{trackSignUpNowClicked}=USERPILOT_EVENTS;const onClick=async()=>{trackSignUpNowClicked();if((!store?.loginData?.data||store?.loginData?.data?.is_guest)&&await openSignupFormWhenUserNotLoggedIn({loginData:store?.loginData?.data,signupCallback:()=>openCurator({openDashboard:true}),signupProps:{main_origin:\"Signup For Free\"}})){return;}openCurator({openDashboard:true});};return /*#__PURE__*/_jsx(Component,{...props,onClick:onClick});};}export function withNameChange(Component){return props=>{const[store,setStore]=useStore();const{name,isNameValid}=store;const onNameChange=e=>{setStore(prev=>({...prev,name:e.target.value}));};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,style:{padding:\"0px\"},children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",className:\"emailInput\",style:emailStyleObj,value:name,placeholder:\"Enter your name\",maxLength:50,onChange:e=>onNameChange(e)})}),!isNameValid&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"red\"},children:\"Invalid name\"})]});};}export function withEmailIdChange(Component){return props=>{const[store,setStore]=useStore();const{email,isEmailValid,useBusinessEmail}=store;const onEmailChange=e=>{setStore(prev=>({...prev,email:e.target.value}));if(email){const isYourEmailValid=emailIsValid(e.target.value);const isBusinessEmail=emailIsValidWithExtension(e.target.value);if(isYourEmailValid||isBusinessEmail){setStore(prev=>({...prev,isEmailValid:isYourEmailValid,useBusinessEmail:isBusinessEmail}));}}};const emailChangeBlur=e=>{const isYourEmailValid=emailIsValid(e.target.value);const isBusinessEmail=emailIsValidWithExtension(e.target.value);setStore(prev=>({...prev,isEmailValid:isYourEmailValid,useBusinessEmail:isBusinessEmail}));};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,style:{padding:\"0px\"},children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",className:\"emailInput\",style:emailStyleObj,value:email,placeholder:\"Enter your email id\",onChange:e=>onEmailChange(e),onBlur:e=>emailChangeBlur(e)})}),email&&!isEmailValid&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"red\"},children:\"Invalid email\"}),!useBusinessEmail&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"red\"},children:\"Use a business email only\"})]});};}export function withPasswordChange(Component){return props=>{const[store,setStore]=useStore();const{password,isPasswordValid,hidePassword}=store;const styleObj={position:\"absolute\",right:\"10px\",cursor:\"pointer\",borderBottom:\"1px solid #8e8d8d\"};const onPasswordChange=e=>{setStore(prev=>({...prev,password:e.target.value}));};const showHidePassword=e=>{setStore(prev=>({...prev,hidePassword:!hidePassword}));};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(Component,{...props,style:{padding:\"0px\"},children:[/*#__PURE__*/_jsx(\"input\",{type:hidePassword?\"password\":\"text\",className:\"emailInput\",style:emailStyleObj,value:password,maxLength:40,placeholder:\"Enter your password\",onChange:e=>onPasswordChange(e)}),/*#__PURE__*/_jsx(\"div\",{style:styleObj,onClick:showHidePassword,children:hidePassword?\"Show\":\"Hide\"})]}),!isPasswordValid&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"red\"},children:\"Invalid password\"})]});};}const apiPostDataSignup=async(formData,token)=>{try{const response=await fetch(`${ROOT_API}${SIGNUP_CONVERT_USER}`,{method:\"POST\",headers:{Authorization:`Bearer ${token}`},body:formData});const result=await response.json();return result;}catch(error){console.error(\"An error occured\",error);return null;}};const GSI_SRC=\"https://accounts.google.com/gsi/client\";const gsiIsReady=()=>Boolean(window?.google?.accounts?.id);export function withGoogleSignup(Component){return props=>{const[store,setStore]=useStore();const[selfServeStoreVal,setSelfServeStoreVal]=useSelfServeStore();const{renderId,urlObj,cameraName}=selfServeStoreVal;const{textureStore}=getTextureStoreData();const isTexture=Boolean(textureStore?.selectedImage&&textureStore?.selectedHotspotImage);const{trackSignUpSuccessEvent}=USERPILOT_EVENTS;useEffect(()=>{// Initialize Google API client\n// window?.google?.accounts?.id?.initialize?.(\nlet cancelled=false;const googleInitConfig={client_id:GOOGLE_CLIENT_ID,callback:response=>{if(response?.credential){// const jsonData = window.jwt_decode(response.credential)\nconst jsonData=decodeJwtPayload(response.credential);if(!jsonData)return;setStore(prev=>({...prev,restrictPersonalEmail:false}));// here, we are restricting the user to register with his/her personal email\nif(!emailIsValidWithExtension(jsonData?.email)){setStore(prev=>({...prev,restrictPersonalEmail:true}));const restrictedUser={email:jsonData?.email,name:`${jsonData.given_name} ${jsonData.family_name}`,signed_up:false,b2c_attempt:true};createUserInHubspot(restrictedUser);return;}jsonData&&oauthSignIn(jsonData);}}};// )\n// GSI must finish loading before initialize() runs: calling it\n// early silently no-ops, and renderButton() then produces nothing,\n// leaving the sign-in button dead for the whole page view.\nloadScript(GSI_SRC,gsiIsReady).then(()=>{if(cancelled)return;window?.google?.accounts?.id?.initialize?.(googleInitConfig);}).catch(error=>{console.error(\"Google sign-in unavailable\",error);});return()=>{cancelled=true;setStore(prev=>({...prev,restrictPersonalEmail:false}));};},[renderId,urlObj,isTexture]);// Handle the Google OAuth response\nconst handleCredentialResponse=async(jsonData,accessToken)=>{let token=null;if(selfServeStoreVal?.loginData||// selfServeStore?.loginData\nlocalStorage.getItem(\"loginData\")){const allData=selfServeStoreVal?.loginData||JSON.parse(localStorage.getItem(\"loginData\"));token=allData?.data?.access;}if(!token){const userData=await checkAndDoGuestLogin();token=userData?.data?.access;}if(!token||!accessToken)return;const firstName=jsonData?.given_name||\"\";const lastName=jsonData?.family_name||\"\";const email=jsonData?.email||\"\";const formObj=new FormData;formObj.append(\"access_token\",accessToken);const response=await apiPostDataSignup(formObj,token);if(!response?.status&&!response?.access){alert(response?.message||\"Something went wrong. Please try again.\");return;}gtag_report_conversion?.({url:window.location.href,event_name:\"conversion\",send_to:\"AW-10868671574/PRyJCM2UpYEaENaIy74o\"});createUserInHubspot({name:`${firstName} ${lastName}`,email});let loginData=localStorage.getItem(\"loginData\");if(loginData){loginData=JSON.parse(loginData);const userDetails=JSON.parse(JSON.stringify(loginData?.data?.user));userDetails[\"email\"]=email;userDetails[\"first_name\"]=firstName;userDetails[\"last_name\"]=lastName;userDetails[\"name\"]=`${firstName} ${lastName}`;userDetails[\"is_guest\"]=false;const newLoginData={data:{...response,user:userDetails}};localStorage.setItem(\"loginData\",JSON.stringify(newLoginData));setSelfServeStoreVal(prev=>({...prev,loginData:newLoginData,urlObj:null}));}// Update current use data in locla stoage\nlocalStorage.setItem(\"current_user\",JSON.stringify(response?.info||null));setStore(initialData);const form=document.querySelector(\"#signup-form-overlay\");if(form)form.style.display=\"none\";if(urlObj){// will be triggered from pricing page\ntrackSignUpSuccessEvent({source:window.location.pathname===\"/\"?\"home-page\":\"pricing-page\",is_google_signup:\"Yes\"});openCurator({...urlObj,setStore:setSelfServeStoreVal,uploadedRenderId:renderId,cameraName,openImages:false,main_origin:window.location.pathname===\"/\"?\"Home Page\":\"Pricing Page\"});}else{// will be triggered from edit in 3d and remove watermark\nif(window?.signupCallback){trackSignUpSuccessEvent({...window?.signupProps?.main_origin?{source:window?.signupProps?.main_origin}:{},...window?.signupProps||{},is_google_signup:\"Yes\"});window?.signupCallback?.();}else{trackSignUpSuccessEvent({source:\"visitor-remove-watermark\",is_google_signup:\"Yes\"});openCurator({setStore:setSelfServeStoreVal,uploadedRenderId:renderId,cameraName,openImages:true,curatorOpenSource:isTexture?\"Texture upload\":\"Model upload\",main_origin:\"Remove Watermark Signup\",upload_type:isTexture?\"Texture\":\"Model\",model_id:textureStore?.selectedImage?.id,model_name:textureStore?.selectedImage?.name,upload_extension:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.extension:\"\",file_name:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.name:\"\",hotspot_name:isTexture&&textureStore?.selectedHotspotImage?textureStore?.selectedHotspotImage?.objectName:\"\"});}}};const createFakeGoogleWrapper=()=>{const googleLoginWrapper=document.createElement(\"div\");// Or you can simple hide it in CSS rule for custom-google-button\ngoogleLoginWrapper.style.display=\"none\";googleLoginWrapper.classList.add(\"custom-google-button\");// Add the wrapper to body\ndocument.body.appendChild(googleLoginWrapper);// Use GSI javascript api to render the button inside our wrapper\n// You can ignore the properties because this button will not appear\nwindow?.google?.accounts?.id?.renderButton?.(googleLoginWrapper,{type:\"icon\",width:\"200\"});const googleLoginWrapperButton=googleLoginWrapper.querySelector(\"div[role=button]\");return{click:()=>{googleLoginWrapperButton?.click();}};};const handleGoogleLogin=async()=>{try{await loadScript(GSI_SRC,gsiIsReady);}catch(error){console.error(\"Google sign-in unavailable\",error);return;}const googleButtonWrapper=createFakeGoogleWrapper();googleButtonWrapper?.click();setStore(prev=>({...prev,restrictPersonalEmail:false}));};const oauthSignIn=jsonData=>{const email=jsonData?.email;if(email){const client=window?.google?.accounts?.oauth2?.initTokenClient?.({client_id:GOOGLE_CLIENT_ID,scope:\"https://www.googleapis.com/auth/userinfo.profile\",hint:email,prompt:\"\",callback:response=>{if(response?.access_token){handleCredentialResponse(jsonData,response.access_token);}}});client?.requestAccessToken();}};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\"},children:[store?.restrictPersonalEmail?/*#__PURE__*/_jsx(\"div\",{className:\"not-allowed-domains\",children:/*#__PURE__*/_jsx(\"p\",{children:\"Please use your Company Email to log in. Personal emails (e.g. ending with gmail.com, outlook.com, etc.) are NOT allowed. Contact us via the chat if you have any questions.\"})}):null,/*#__PURE__*/_jsx(Component,{...props,style:{...props.style,cursor:\"pointer\"},onClick:()=>handleGoogleLogin()})]});};}export function withSignupBtnClick(Component){return props=>{const[store,setStore]=useStore();const{name,email,password,isEmailValid,useBusinessEmail}=store;const enableButton=name&&email&&password&&isEmailValid&&useBusinessEmail;const[loader,setLoader]=useState(false);const[selfServeStoreVal,setSelfServeStoreVal]=useSelfServeStore();const{renderId,urlObj,expandedType,cameraName}=selfServeStoreVal;const{textureStore}=getTextureStoreData();const selectedImage=textureStore?.selectedImage;const isTexture=Boolean(textureStore?.selectedImage&&textureStore?.selectedHotspotImage);const{trackSignUpSuccessEvent}=USERPILOT_EVENTS;useEffect(()=>{const submitBtn=document.querySelector(\".submit-btn\");if(submitBtn){if(!enableButton){submitBtn.style.backgroundColor=\"rgb(214, 209, 198)\";submitBtn.querySelector(\".framer-text\").style.color=\"rgb(171, 167, 158)\";}else{submitBtn.style.backgroundColor=\"rgb(235, 78, 10)\";submitBtn.querySelector(\".framer-text\").style.color=\"#fff\";}}},[enableButton]);const submitData=async()=>{if(!enableButton)return;let token=null;if(localStorage.getItem(\"loginData\")){const allData=JSON.parse(localStorage.getItem(\"loginData\"));token=allData?.data?.access;}setLoader(true);if(!token){const userData=await checkAndDoGuestLogin();token=userData?.data?.access;}if(!token){setLoader(false);return;}const firstName=name.split(\" \")[0];const lastName=name.split(\" \")[1];const formObj=new FormData;formObj.append(\"email\",email);formObj.append(\"first_name\",firstName);formObj.append(\"last_name\",lastName||\"\");formObj.append(\"password\",password);const response=await apiPostDataSignup(formObj,token);if(!response?.status&&!response.access){alert(response?.message||\"Something went wrong. Please try again.\");setLoader(false);return;}createUserInHubspot({name:`${firstName} ${lastName}`,email});gtag_report_conversion?.({url:window.location.href,event_name:\"conversion\",send_to:\"AW-10868671574/PRyJCM2UpYEaENaIy74o\"});const dataForSegment={User_name:response?.info?.user?.name,User_id:response?.info?.user?.id,Org_id:response?.info?.organization,widget_id:selectedImage?.id||\"\",widget_name:selectedImage?.name||\"\",Expand:\"Yes\",Upload_Type:isTexture?\"Texture\":\"Model\",Clicked_Source:expandedType===\"silo\"?\"Silo Render\":\"Vignette Render\"};callTrackEvent(\"Remove Watermark - Signup Now\",dataForSegment,true);let loginData=localStorage.getItem(\"loginData\");if(loginData){loginData=JSON.parse(loginData);const userDetails=JSON.parse(JSON.stringify(loginData?.data?.user));userDetails[\"email\"]=email;userDetails[\"first_name\"]=firstName;userDetails[\"last_name\"]=lastName;userDetails[\"name\"]=name;userDetails[\"is_guest_user\"]=false;const newLoginData={data:{...response,user:userDetails}};localStorage.setItem(\"loginData\",JSON.stringify(newLoginData));setSelfServeStoreVal(prev=>({...prev,loginData:newLoginData,urlObj:null}));}// Update current use data in locla stoage\nlocalStorage.setItem(\"current_user\",JSON.stringify(response?.info||null));setStore(initialData);const form=document.querySelector(\"#signup-form-overlay\");if(form)form.style.display=\"none\";if(urlObj){// will be triggered from pricing page\ntrackSignUpSuccessEvent({main_origin:window.location.pathname===\"/\"?\"Home Page\":\"Pricing Page\",source:window.location.pathname===\"/\"?\"home-page\":\"pricing-page\",is_google_signup:\"No\"});openCurator({...urlObj,setStore:setSelfServeStoreVal,uploadedRenderId:renderId,cameraName,openImages:false,main_origin:window.location.pathname===\"/\"?\"Home Page\":\"Pricing Page\"});}else{// will be triggered from edit in 3d and remove watermark\nif(window?.signupCallback){trackSignUpSuccessEvent({...window?.signupProps?.main_origin?{source:window?.signupProps?.main_origin}:{},...window?.signupProps||{},is_google_signup:\"No\"});window?.signupCallback?.();}else{trackSignUpSuccessEvent({source:\"visitor-remove-watermark\",is_google_signup:\"No\"});openCurator({setStore:setSelfServeStoreVal,uploadedRenderId:renderId,cameraName,openImages:true,curatorOpenSource:isTexture?\"Texture upload\":\"Model upload\",main_origin:\"Remove Watermark Signup\",upload_type:isTexture?\"Texture\":\"Model\",model_id:textureStore?.selectedImage?.id,model_name:textureStore?.selectedImage?.name,upload_extension:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.extension:\"\",file_name:isTexture&&textureStore?.files?.length>0?textureStore?.files?.[0]?.name:\"\",hotspot_name:isTexture&&textureStore?.selectedHotspotImage?textureStore?.selectedHotspotImage?.objectName:\"\"});}}setLoader(false);};if(!props?.className?.includes(\"submit-btn\")){props.className+=\" submit-btn\";}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,style:{...props.style,cursor:\"pointer\"},onClick:submitData}),loader&&/*#__PURE__*/_jsx(\"div\",{className:\"loader-container\",style:{position:\"absolute\",zIndex:\"1\",padding:\"10px\",color:\"#fff\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"},children:/*#__PURE__*/_jsx(\"div\",{className:\"loader\",style:{width:\"30px\",height:\"30px\",top:\"calc(50% - 15px)\",left:\"calc(50% - 15px)\",border:\"4px solid #ec4e0b\",borderTop:\"4px solid transparent\"}})})]});};}export function withShowHidePassword(Component){return props=>{const[store,setStore]=useStore();const{hidePassword}=store;const showHidePassword=e=>{setStore(prev=>({...prev,hidePassword:!hidePassword}));};const showHidePasswordn=e=>{setStore(prev=>({...prev,hidePassword:!hidePassword}));};return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style},onClick:showHidePassword});};}export function withMainSignupForm(Component){return props=>{const[maxWidth,setMaxWidth]=useState(920);useEffect(()=>{// const form = document.querySelector(\"#signup-form-overlay\")\n// if (form) {\n//     form.parentElement.style.zIndex = \"10\"\n// }\nwindow.addEventListener(\"resize\",handleMaxWidth);return()=>window.removeEventListener(\"resize\",handleMaxWidth);},[]);const handleMaxWidth=()=>setMaxWidth(window.innerWidth>1171?920:350);return /*#__PURE__*/_jsx(\"div\",{id:\"signup-form-overlay\",style:{position:\"fixed\",display:\"none\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",left:0,top:0,background:\"rgba(0, 0, 0, 0.5)\",zIndex:\"10\"},children:/*#__PURE__*/_jsx(Component,{...props,style:{...props.style,maxWidth:`${maxWidth}px`,zIndex:10}})});};}export function withCloseSignupPopup(Component){return props=>{const[store,setStore]=useStore();const[selfServeStoreVal,setSelfServeStoreVal]=useSelfServeStore();const closePopup=()=>{setStore(initialData);setSelfServeStoreVal(prev=>({...prev,urlObj:null}));const form=document.querySelector(\"#signup-form-overlay\");if(form){form.style.display=\"none\";setStore(prev=>({...prev,restrictPersonalEmail:false}));}};return /*#__PURE__*/_jsx(Component,{...props,onClick:closePopup,style:{...props.style,cursor:\"pointer\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withGoogleSignup\":{\"type\":\"reactHoc\",\"name\":\"withGoogleSignup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseSignupPopup\":{\"type\":\"reactHoc\",\"name\":\"withCloseSignupPopup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNameChange\":{\"type\":\"reactHoc\",\"name\":\"withNameChange\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSignupBtnClick\":{\"type\":\"reactHoc\",\"name\":\"withSignupBtnClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMainSignupForm\":{\"type\":\"reactHoc\",\"name\":\"withMainSignupForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailIdChange\":{\"type\":\"reactHoc\",\"name\":\"withEmailIdChange\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPasswordChange\":{\"type\":\"reactHoc\",\"name\":\"withPasswordChange\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"generatePassword\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"closeSignupForm\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"openSignupFormWhenUserNotLoggedIn\":{\"type\":\"function\",\"isAsync\":true,\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowHidePassword\":{\"type\":\"reactHoc\",\"name\":\"withShowHidePassword\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSignUpNowButton\":{\"type\":\"reactHoc\",\"name\":\"withSignUpNowButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"ibAAa,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,QAChB,EAWI,CADA,GAAG,CACO,yCEf0C,IAAsC,IAAqE,IAAqE,IAAyI,IAAiV,IAE5kB,IAAiH,IAA2H,EAChOA,EAAS,EAAY,CAAC,WAAW,UAAU,OAAO,CAAC,CAAC,GAAG,MAAM,KAAK,iBAAiB,UAAU,4GAA4G,UAAU,2GAA2G,QAAQ,oFAAoF,aAAa,CAAC,CAAC,GAAG,GAAG,KAAK,aAAa,WAAW,iBAAiB,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,UAAU,+GAA+G,WAAW,EAAK,EAAE,CAAC,GAAG,GAAG,KAAK,aAAa,WAAW,iBAAiB,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,UAAU,+GAA+G,WAAW,EAAI,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,KAAK,mBAAmB,UAAU,qGAAqG,UAAU,oGAAoG,QAAQ,oFAAoF,aAAa,CAAC,CAAC,GAAG,GAAG,KAAK,aAAa,WAAW,cAAc,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,UAAU,wGAAwG,WAAW,EAAI,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,KAAK,0BAA0B,UAAU,2GAA2G,UAAU,0GAA0G,QAAQ,uFAAuF,aAAa,CAAC,CAAC,GAAG,GAAG,KAAK,aAAa,WAAW,YAAY,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,UAAU,8GAA8G,WAAW,EAAI,EAAE,CAAC,GAA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