# Exact Replacement Code Blocks

## 📋 REQUEST 1: Modify useUserLogin Store

### 🔍 SEARCH FOR:
```
user:Id,setUser:s=>
```

### ✏️ REPLACE WITH:
```
user:Id,authMode:'login',setAuthMode:(mode)=>n(c=>({...c,authMode:mode})),setUser:s=>
```

---

## 📋 REQUEST 2: Add Register Case to openRendertype

### 🔍 SEARCH FOR:
```
case"login":h=r.jsx(qa,{});break;
```

### ✏️ REPLACE WITH:
```
case"register":h=r.jsx(RegisterForm,{onSwitchToLogin:()=>{sr.getState().setAuthMode('login'),jt.getState().openRendertype("login")},onRegisterSuccess:(msg)=>{N({type:"Success",message:msg,position:"top-right"}),sr.getState().setAuthMode('login'),setTimeout(()=>{jt.getState().openRendertype("login")},1500)}});break;
case"login":h=r.jsx(qa,{});break;
```

**OR if you need lazy loading, use:**
```
case"register":h=r.jsx(r.Suspense,{fallback:r.jsx(r.Fragment,{}),children:r.jsx(RegisterFormLazy,{onSwitchToLogin:()=>{sr.getState().setAuthMode('login'),jt.getState().openRendertype("login")},onRegisterSuccess:(msg)=>{N({type:"Success",message:msg,position:"top-right"}),sr.getState().setAuthMode('login'),setTimeout(()=>{jt.getState().openRendertype("login")},1500)}})});break;
case"login":h=r.jsx(qa,{});break;
```

---

## 📋 REQUEST 3: Import RegisterForm

### 🔍 FIND (near top of file, with other imports):
```
import{j as r}from
```

### ✏️ ADD THIS LINE RIGHT AFTER IT:

**Option A - Direct Import (if unbundled):**
```javascript
import RegisterForm from './src/RegisterForm.jsx';
```

**Option B - Lazy Import (if bundled, add with other lazy imports):**
```javascript
const RegisterFormLazy=r.lazy(()=>__vitePreload(()=>import(chrome.runtime.getURL("crm/src/RegisterForm.jsx")),[]));
```

**Then use `RegisterFormLazy` instead of `RegisterForm` in Request 2.**

---

## 📋 REQUEST 4: Add Sign Up Button to Login Form

### 🔍 SEARCH FOR (in login component):
```
type:"submit"
```

**OR SEARCH FOR:**
```
children:"Sign In"|children:"Entrar"|children:"Login"
```

### ✏️ FIND THIS PATTERN (the submit button):
```javascript
n.jsx("button",{type:"submit",...children:"Sign In"})
```

### ✏️ ADD THIS RIGHT AFTER THE SUBMIT BUTTON (before closing form):
```javascript
n.jsx("button",{type:"button",onClick:()=>{sr.getState().setAuthMode("register"),jt.getState().openRendertype("register")},className:"text-sm text-[var(--primaria)] hover:underline mt-4 text-center w-full",style:{background:"transparent",border:"none",cursor:"pointer"},children:["Don't have an account? ",n.jsx("span",{className:"font-semibold",children:"Sign Up"})]})
```

**OR if you find the closing form tag `</form>` or `n.jsx("form",{...})`, add the button as the last child before closing.**

---

## 🎯 Quick Reference: All Changes in Order

1. **Add import** (Request 3) - Top of file
2. **Modify store** (Request 1) - Find `user:Id,setUser`
3. **Add register case** (Request 2) - Find `case"login"`
4. **Add Sign Up button** (Request 4) - Find login submit button

---

## ⚠️ Important Notes

- Your `RegisterForm.jsx` file is already at `crm/src/RegisterForm.jsx` ✅
- The API URL is hardcoded in RegisterForm: `https://crm.suhailtech.in/function/register-user.php` ✅
- Make sure `N` (notification function) is available in scope - it should be if you're using the existing modal system
- Test after each change!

