| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/elite-events-storybook/ |
Upload File : |
"use strict";(self.webpackChunkelite_events_nextjs=self.webpackChunkelite_events_nextjs||[]).push([[1671],{"./src/components/features/product/Reviews/ReviewForm.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{H:()=>ReviewForm});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/next/dist/compiled/react/jsx-runtime.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/next/dist/compiled/react/index.js"),next_auth_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/next-auth/react.js"),_components_ui_StarRating__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/StarRating/index.tsx"),_components_ui_Button__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Button/index.tsx"),_components_ui_icons__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/icons/index.ts"),_lib_core__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/lib/core/index.ts"),react_hot_toast__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-hot-toast/dist/index.mjs"),next_link__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/next/link.js"),next_link__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_8__),_hooks_useFunnelTracking__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/hooks/useFunnelTracking.ts");function ReviewForm({productId,onSuccess,className}){const{data:session,status}=(0,next_auth_react__WEBPACK_IMPORTED_MODULE_2__.wV)(),[rating,setRating]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),[comment,setComment]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""),[submitting,setSubmitting]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[error,setError]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),{trackStep}=(0,_hooks_useFunnelTracking__WEBPACK_IMPORTED_MODULE_9__.p)();if("loading"===status)return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ReviewFormSkeleton,{});if(!session)return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_6__.cn)("bg-gray-50 dark:bg-gray-800 rounded-lg p-6 text-center",className),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_icons__WEBPACK_IMPORTED_MODULE_5__.In,{name:"user",size:32,className:"text-gray-400 mx-auto mb-3"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"Sign in to leave a review"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_8___default(),{href:"/signin",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_Button__WEBPACK_IMPORTED_MODULE_4__.$,{variant:"primary",children:"Sign In"})})]});const isValid=rating>0&&(!comment.trim()||comment.trim().length>=10);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),setError(null),0!==rating)if(comment.trim()&&comment.trim().length<10)setError("Comment must be at least 10 characters");else{setSubmitting(!0);try{const response=await fetch(`/api/products/${productId}/reviews`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating,comment:comment.trim()||void 0})}),data=await response.json();data.success?(react_hot_toast__WEBPACK_IMPORTED_MODULE_7__.Ay.success("Review submitted successfully!"),trackStep("engagement","review_submitted",{product_id:productId,rating,has_comment:!!comment.trim()}),setRating(0),setComment(""),onSuccess?.()):(setError(data.error||"Failed to submit review"),"You have already reviewed this product"===data.error&&react_hot_toast__WEBPACK_IMPORTED_MODULE_7__.Ay.error("You have already reviewed this product"))}catch{setError("Failed to submit review. Please try again.")}finally{setSubmitting(!1)}}else setError("Please select a rating")},className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_6__.cn)("bg-gray-50 dark:bg-gray-800 rounded-lg p-6",className),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3",{className:"font-semibold text-lg mb-4 dark:text-gray-100",children:"Write a Review"}),error&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-md text-red-700 dark:text-red-300 text-sm flex items-center gap-2",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_icons__WEBPACK_IMPORTED_MODULE_5__.In,{name:"alert-circle",size:16}),error]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"mb-5",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:["Your Rating ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_StarRating__WEBPACK_IMPORTED_MODULE_3__.Gk,{rating,size:"lg",showCount:!1,interactive:!0,onRatingChange:setRating}),rating>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:[1===rating&&"Poor",2===rating&&"Fair",3===rating&&"Good",4===rating&&"Very Good",5===rating&&"Excellent"]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"mb-5",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label",{htmlFor:"review-comment",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Your Review (optional)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea",{id:"review-comment",value:comment,onChange:e=>setComment(e.target.value),placeholder:"Share your experience with this product...",className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_6__.cn)("w-full border border-gray-300 dark:border-gray-600 rounded-md p-3 h-32 resize-none","bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","placeholder:text-gray-400 dark:placeholder:text-gray-500"),maxLength:2e3,disabled:submitting}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:comment.trim().length>0&&comment.trim().length<10&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span",{className:"text-amber-600 dark:text-amber-400",children:["Minimum ",10," characters required"]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[comment.length,"/",2e3]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_Button__WEBPACK_IMPORTED_MODULE_4__.$,{type:"submit",variant:"primary",disabled:submitting||!isValid,className:"w-full sm:w-auto",children:submitting?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_icons__WEBPACK_IMPORTED_MODULE_5__.In,{name:"reload",size:16,className:"animate-spin mr-2"}),"Submitting..."]}):"Submit Review"})]})}function ReviewFormSkeleton(){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-6 animate-pulse",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"h-6 w-32 bg-gray-200 dark:bg-gray-700 rounded mb-4"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"mb-5",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded mb-2"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"h-8 w-40 bg-gray-200 dark:bg-gray-700 rounded"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"mb-5",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"h-4 w-28 bg-gray-200 dark:bg-gray-700 rounded mb-2"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"h-32 w-full bg-gray-200 dark:bg-gray-700 rounded"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"h-10 w-32 bg-gray-200 dark:bg-gray-700 rounded"})]})}},"./src/components/providers/AnalyticsProvider.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{s:()=>useAnalytics});__webpack_require__("./node_modules/next/dist/compiled/react/jsx-runtime.js");var react=__webpack_require__("./node_modules/next/dist/compiled/react/index.js");__webpack_require__("./node_modules/@storybook/nextjs/dist/export-mocks/navigation/index.js"),__webpack_require__("./node_modules/js-cookie/dist/js.cookie.mjs");const AnalyticsContext=(0,react.createContext)(null);function useAnalytics(){const context=(0,react.useContext)(AnalyticsContext);if(!context)throw new Error("useAnalytics must be used within AnalyticsProvider");return context}},"./src/components/ui/StarRating/index.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gk:()=>StarRating,Hp:()=>StarRatingCompact,J5:()=>StarRatingWithCount});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/next/dist/compiled/react/jsx-runtime.js"),next_link__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/next/link.js"),next_link__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_1__),_components_ui_icons__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/icons/index.ts"),_lib_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/lib/core/index.ts"),_components_ui_Button__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Button/index.tsx"),_components_ui_Tooltip__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Tooltip/index.tsx");const sizeConfig={sm:{star:12,gap:"gap-0.5",text:"text-xs"},md:{star:14,gap:"gap-1",text:"text-custom-sm"},lg:{star:16,gap:"gap-1",text:"text-sm"}};function StarRating({rating=0,maxStars=5,reviewCount,size="md",showCount=!0,interactive=!1,onRatingChange,productId,className}){const config=sizeConfig[size],clampedRating=Math.max(0,Math.min(maxStars,rating)),fullStars=Math.floor(clampedRating),hasHalfStar=clampedRating%1>=.5,tooltipContent=`${clampedRating.toFixed(1)} out of ${maxStars}`,renderStarIcon=(isFilled,isHalf)=>isHalf?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span",{className:"relative inline-block",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_icons__WEBPACK_IMPORTED_MODULE_2__.In,{name:"star",size:config.star,className:"text-gray-300 fill-current"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:"absolute inset-0 overflow-hidden",style:{width:"50%"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_icons__WEBPACK_IMPORTED_MODULE_2__.In,{name:"star",size:config.star,className:"text-yellow-400 fill-current"})})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_icons__WEBPACK_IMPORTED_MODULE_2__.In,{name:"star",size:config.star,className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_3__.cn)("fill-current transition-colors",isFilled?"text-yellow-400":"text-gray-300",interactive&&"hover:text-yellow-500")}),starsContent=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_3__.cn)("inline-flex items-center",config.gap),role:"img","aria-label":`Rating: ${clampedRating} out of ${maxStars} stars`,children:Array.from({length:maxStars},(_,index)=>{const isFilled=index<fullStars,isHalf=index===fullStars&&hasHalfStar;return interactive?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_Button__WEBPACK_IMPORTED_MODULE_4__.$,{type:"button",onClick:()=>{return starIndex=index,void(interactive&&onRatingChange&&onRatingChange(starIndex+1));var starIndex},onMouseEnter:()=>{},variant:"ghost",size:"sm",className:"relative p-0 cursor-pointer hover:scale-110 transition-transform","aria-label":`${index+1} star${0!==index?"s":""}`,children:renderStarIcon(isFilled,isHalf)},index):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:"relative inline-flex",children:renderStarIcon(isFilled,isHalf)},index)})}),reviewLink=productId?`/product/${productId}#reviews`:null,ratingContent=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_3__.cn)("flex items-center gap-2.5",reviewLink&&"cursor-pointer hover:opacity-80 transition-opacity",className),children:[interactive?starsContent:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_ui_Tooltip__WEBPACK_IMPORTED_MODULE_5__.m,{content:reviewLink?`${tooltipContent} - Click to see reviews`:tooltipContent,position:"top",children:starsContent}),showCount&&void 0!==reviewCount&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p",{className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_3__.cn)(config.text,"text-gray-600 dark:text-gray-400"),children:["(",reviewCount,")"]})]});return reviewLink&&!interactive?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_1___default(),{href:reviewLink,className:"inline-flex",children:ratingContent}):ratingContent}function StarRatingCompact({rating=0,size="sm"}){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarRating,{rating,size,showCount:!1})}function StarRatingWithCount({rating=0,reviewCount=0,size="md"}){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarRating,{rating,reviewCount,size,showCount:!0})}},"./src/components/ui/Tooltip/index.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>Tooltip});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/next/dist/compiled/react/jsx-runtime.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/next/dist/compiled/react/index.js"),_lib_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/lib/core/index.ts");function Tooltip({children,content,position="top",className,delay=0}){const[isVisible,setIsVisible]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[timeoutId,setTimeoutId]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),showTooltip=()=>{if(delay>0){const id=setTimeout(()=>setIsVisible(!0),delay);setTimeoutId(id)}else setIsVisible(!0)},hideTooltip=()=>{timeoutId&&(clearTimeout(timeoutId),setTimeoutId(null)),setIsVisible(!1)};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"relative inline-flex",onMouseEnter:showTooltip,onMouseLeave:hideTooltip,onFocus:showTooltip,onBlur:hideTooltip,children:[children,isVisible&&content&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{role:"tooltip",className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_2__.cn)("absolute z-[100] px-2 py-1 text-xs font-medium text-white bg-gray-900 dark:bg-gray-700 rounded shadow-lg whitespace-nowrap",{top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"}[position],className),children:[content,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:(0,_lib_core__WEBPACK_IMPORTED_MODULE_2__.cn)("absolute w-0 h-0 border-4",{top:"top-full left-1/2 -translate-x-1/2 border-t-gray-900 dark:border-t-gray-700 border-x-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-b-gray-900 dark:border-b-gray-700 border-x-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-l-gray-900 dark:border-l-gray-700 border-y-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-r-gray-900 dark:border-r-gray-700 border-y-transparent border-l-transparent"}[position])})]})]})}},"./src/hooks/useFunnelTracking.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{p:()=>useFunnelSteps});var react=__webpack_require__("./node_modules/next/dist/compiled/react/index.js"),AnalyticsProvider=__webpack_require__("./src/components/providers/AnalyticsProvider.tsx");const funnels_FUNNELS={checkout:{name:"E-commerce Checkout",description:"Track users from product view to purchase completion",steps:[{id:"view_item",name:"View Product",description:"User views a product page"},{id:"add_to_cart",name:"Add to Cart",description:"User adds item to cart"},{id:"view_cart",name:"View Cart",description:"User views their cart"},{id:"begin_checkout",name:"Begin Checkout",description:"User starts checkout process"},{id:"add_shipping_info",name:"Add Shipping Info",description:"User enters shipping address"},{id:"add_payment_info",name:"Add Payment Info",description:"User enters payment details"},{id:"purchase",name:"Purchase",description:"Order completed successfully"}]},signup:{name:"User Registration",description:"Track new user registration flow",steps:[{id:"signup_started",name:"Started Signup",description:"User initiates registration"},{id:"email_entered",name:"Email Entered",description:"User enters email address"},{id:"password_entered",name:"Password Created",description:"User creates password"},{id:"signup_completed",name:"Signup Complete",description:"Account created successfully"},{id:"email_verified",name:"Email Verified",description:"User verifies email address"}]},productDiscovery:{name:"Product Discovery",description:"Track how users discover and explore products",steps:[{id:"homepage_view",name:"Homepage View",description:"User lands on homepage"},{id:"category_view",name:"Category View",description:"User browses a category"},{id:"search",name:"Search",description:"User performs a search"},{id:"view_item_list",name:"View Product List",description:"User views search/filter results"},{id:"view_item",name:"View Product",description:"User views product details"}]},engagement:{name:"User Engagement",description:"Track user engagement actions",steps:[{id:"login_completed",name:"Login",description:"User logs in"},{id:"add_to_wishlist",name:"Add to Wishlist",description:"User saves item to wishlist"},{id:"review_submitted",name:"Review Submitted",description:"User submits a review"},{id:"share",name:"Share",description:"User shares product/content"}]}};function useFunnelSteps(){const{trackEvent,isReady}=(0,AnalyticsProvider.s)();return{trackStep:(0,react.useCallback)((funnelId,stepId,properties)=>{if(!isReady)return;const funnel=funnels_FUNNELS[funnelId];if(!funnel)return;const stepIndex=funnel.steps.findIndex(s=>s.id===stepId);if(-1===stepIndex)return;const step=funnel.steps[stepIndex];trackEvent("funnel","funnel_step",{funnel_id:funnelId,funnel_name:funnel.name,step_id:stepId,step_name:step.name,step_index:stepIndex,total_steps:funnel.steps.length,...properties})},[isReady,trackEvent]),trackFunnelComplete:(0,react.useCallback)((funnelId,properties)=>{if(!isReady)return;const funnel=funnels_FUNNELS[funnelId];funnel&&trackEvent("funnel","funnel_complete",{funnel_id:funnelId,funnel_name:funnel.name,total_steps:funnel.steps.length,...properties})},[isReady,trackEvent]),trackFunnelAbandoned:(0,react.useCallback)((funnelId,lastStepId,properties)=>{if(!isReady)return;const funnel=funnels_FUNNELS[funnelId];if(!funnel)return;const stepIndex=funnel.steps.findIndex(s=>s.id===lastStepId);trackEvent("funnel","funnel_abandoned",{funnel_id:funnelId,funnel_name:funnel.name,last_step_id:lastStepId,last_step_index:stepIndex,total_steps:funnel.steps.length,...properties})},[isReady,trackEvent])}}}}]);