PageSourceSearch

https://safecart.eu/assets/toast-hFrg1U4a.js

js safecart.eu collected 2026-09-24 12:20:35 UTC 7,626 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"4e1a75163d68a3f7a1918ab437503cf0b36745a4"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb401a29-39ac-4f63-9d42-99e2e94bf664",e._sentryDebugIdIdentifier="sentry-dbid-eb401a29-39ac-4f63-9d42-99e2e94bf664")}catch(e){}}();import{o as e}from"./rolldown-runtime-D_ZHkzGD.js";import{m as t,t as n}from"./vendor-Bo18OkWQ.js";import{t as s}from"./createLucideIcon-oDCj2JDE.js";import{t as r}from"./circle-alert-CJwwQBa_.js";import{t as o}from"./circle-check-big-CPsQGTdr.js";import{t as i}from"./info-V9KWm4N1.js";import{t as a}from"./triangle-alert-DNscu6N4.js";import{a as c,c as l,d as u,i as d,l as f,r as m,t as p,u as h}from"./proxy-LjiqG4mw.js";import{t as g}from"./button-m1ahZzcT.js";var x=s("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),b=n(),y=e(t(),1);function w(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function v(...e){return y.useCallback(function(...e){return t=>{let n=!1;const s=e.map(e=>{const s=w(e,t);return n||"function"!=typeof s||(n=!0),s});if(n)return()=>{for(let t=0;t<s.length;t++){const n=s[t];"function"==typeof n?n():w(e[t],null)}}}}(...e),e)}var j=class extends y.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(c(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=c(e)&&e.offsetWidth||0,s=c(e)&&e.offsetHeight||0,r=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(r.height),o.width=parseFloat(r.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=n-o.width-o.left,o.bottom=s-o.height-o.top,o.direction=r.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function C({children:e,isPresent:t,anchorX:n,anchorY:s,root:r,pop:o}){const i=(0,y.useId)(),a=(0,y.useRef)(null),c=(0,y.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=(0,y.useContext)(d),u=e.props?.ref??e?.ref,f=v(a,u);return(0,y.useInsertionEffect)(()=>{const{width:e,height:u,top:d,left:f,right:m,bottom:p,direction:h}=c.current;if(t||!1===o||!a.current||!e||!u)return;const g="rtl"===h,x="left"===n?g?`right: ${m}`:`left: ${f}`:g?`left: ${f}`:`right: ${m}`,b="bottom"===s?`bottom: ${p}`:`top: ${d}`;a.current.dataset.motionPopId=i;const y=document.createElement("style");l&&(y.nonce=l);const w=r??document.head;return w.appendChild(y),y.sheet&&y.sheet.insertRule(`\n          [data-motion-pop-id="${i}"] {\n            position: absolute !important;\n            width: ${e}px !important;\n            height: ${u}px !important;\n            ${x}px !important;\n            ${b}px !important;\n          }\n        `),()=>{a.current?.removeAttribute("data-motion-pop-id"),w.contains(y)&&w.removeChild(y)}},[t]),(0,b.jsx)(j,{isPresent:t,childRef:a,sizeRef:c,pop:o,children:!1===o?e:y.cloneElement(e,{ref:f})})}var N=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:o,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=h(E),m=(0,y.useId)(),p=(0,y.useRef)(n),g=(0,y.useRef)(s);f(()=>{p.current=n,g.current=s});let x=!0,w=(0,y.useMemo)(()=>(x=!1,{id:m,initial:t,isPresent:n,custom:r,onExitComplete:e=>{d.set(e,!0);for(const t of d.values())if(!t)return;s&&s()},register:e=>(d.set(e,!1),()=>{d.delete(e),!p.current&&!d.size&&g.current?.()})}),[n,d,s]);return o&&x&&(w={...w}),(0,y.useMemo)(()=>{d.forEach((e,t)=>d.set(t,!1))},[n]),y.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),e=(0,b.jsx)(C,{pop:"popLayout"===i,isPresent:n,anchorX:a,anchorY:c,root:u,children:e}),(0,b.jsx)(l.Provider,{value:w,children:e})};function E(){return new Map}var k=e=>e.key||"";function R(e){const t=[];return y.Children.forEach(e,e=>{(0,y.isValidElement)(e)&&t.push(e)}),t}var P=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:l})=>{const[d,p]=m(i),g=(0,y.useMemo)(()=>R(e),[e]),x=i&&!d?[]:g.map(k),w=(0,y.useRef)(!0),v=(0,y.useRef)(g),j=h(()=>new Map),C=(0,y.useRef)(new Set),[E,P]=(0,y.useState)(g),[$,I]=(0,y.useState)(g);f(()=>{w.current=!1,v.current=g;for(let e=0;e<$.length;e++){const t=k($[e]);x.includes(t)?(j.delete(t),C.current.delete(t)):!0!==j.get(t)&&j.set(t,!1)}},[$,x.length,x.join("-")]);const M=[];if(g!==E){let e=[...g];for(let t=0;t<$.length;t++){const n=$[t],s=k(n);x.includes(s)||(e.splice(t,0,n),M.push(n))}return"wait"===o&&M.length&&(e=M),I(R(e)),P(g),null}const{forceRender:S}=(0,y.useContext)(u);return(0,b.jsx)(b.Fragment,{children:$.map(e=>
1{const u=k(e),f=!(i&&!d)&&(g===$||x.includes(u));return(0,b.jsx)(N,{isPresent:f,initial:!(w.current&&!n)&&void 0,custom:t,presenceAffectsLayout:r,mode:o,root:l,onExitComplete:f?void 0:()=>{if(C.current.has(u))return;if(!j.has(u))return;C.current.add(u),j.set(u,!0);let e=!0;j.forEach(t=>{t||(e=!1)}),e&&(S?.(),I(v.current),i&&p?.(),s&&s())},anchorX:a,anchorY:c,children:e},u)})})},$=(0,y.createContext)(),I=()=>{const e=(0,y.useContext)($);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},M=null,S=e=>M?.(e),T={success:{icon:o,className:"bg-success/10 border-success/30 text-success-foreground",iconClassName:"text-success"},error:{icon:r,className:"bg-danger/10 border-danger/30 text-danger-foreground",iconClassName:"text-danger"},warning:{icon:a,className:"bg-warning/10 border-warning/30 text-warning-foreground",iconClassName:"text-warning"},info:{icon:i,className:"bg-info/10 border-info/30 text-info-foreground",iconClassName:"text-info"}},z=({toast:e,onClose:t})=>{const n=T[e.type]||T.info,s=n.icon;return(0,b.jsxs)(p.div,{initial:{opacity:0,y:-50,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-50,scale:.9},transition:{duration:.3},className:`\n\t\t\t\trelative flex items-start p-4 rounded-lg border shadow-lg max-w-md w-full\n\t\t\t\t${n.className}\n\t\t\t`,children:[(0,b.jsx)(s,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 ${n.iconClassName}`}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[e.title&&(0,b.jsx)("h4",{className:"font-semibold text-sm mb-1",children:e.title}),(0,b.jsx)("p",{className:"text-sm",children:e.message}),e.action&&(0,b.jsx)("div",{className:"mt-3",children:(0,b.jsx)(g,{size:"xs",variant:"outline",onClick:e.action.onClick,className:"text-xs",children:e.action.label})})]}),(0,b.jsx)(g,{size:"iconSm",variant:"ghost",onClick:()=>t(e.id),className:"ml-2 flex-shrink-0 h-6 w-6 opacity-60 hover:opacity-100",children:(0,b.jsx)(x,{className:"h-4 w-4"})})]})},L=({children:e})=>{const[t,n]=(0,y.useState)([]),s=(0,y.useCallback)(({type:e="info",title:t,message:s,duration:o=5e3,action:i})=>{const a=Date.now()+Math.random(),c={id:a,type:e,title:t,message:s,action:i};return n(e=>[...e,c]),o>0&&setTimeout(()=>{r(a)},o),a},[]),r=(0,y.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),o=(0,y.useCallback)(()=>{n([])},[]);(0,y.useEffect)(()=>(M=s,()=>{M===s&&(M=null)}),[s]);const i=(0,y.useMemo)(()=>({success:(e,t={})=>s({type:"success",message:e,...t}),error:(e,t={})=>s({type:"error",message:e,...t}),warning:(e,t={})=>s({type:"warning",message:e,...t}),info:(e,t={})=>s({type:"info",message:e,...t}),custom:s}),[s]),a=(0,y.useMemo)(()=>({toast:i,removeToast:r,removeAllToasts:o}),[i,r,o]);return(0,b.jsxs)($.Provider,{value:a,children:[e,(0,b.jsx)("div",{className:"fixed top-4 right-4 z-50 space-y-2",children:(0,b.jsx)(P,{children:t.map(e=>(0,b.jsx)(z,{toast:e,onClose:r},e.id))})})]})};export{P as a,I as i,L as n,x as o,S as r,$ as t};

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