(el, rawName, prevValue, nextValue, instance = null)
| 7198 | } |
| 7199 | const veiKey = /* @__PURE__ */ Symbol("_vei"); |
| 7200 | function patchEvent(el, rawName, prevValue, nextValue, instance = null) { |
| 7201 | const invokers = el[veiKey] || (el[veiKey] = {}); |
| 7202 | const existingInvoker = invokers[rawName]; |
| 7203 | if (nextValue && existingInvoker) { |
| 7204 | existingInvoker.value = nextValue; |
| 7205 | } else { |
| 7206 | const [name, options] = parseName(rawName); |
| 7207 | if (nextValue) { |
| 7208 | const invoker = invokers[rawName] = createInvoker( |
| 7209 | nextValue, |
| 7210 | instance |
| 7211 | ); |
| 7212 | addEventListener(el, name, invoker, options); |
| 7213 | } else if (existingInvoker) { |
| 7214 | removeEventListener(el, name, existingInvoker, options); |
| 7215 | invokers[rawName] = void 0; |
| 7216 | } |
| 7217 | } |
| 7218 | } |
| 7219 | const optionsModifierRE = /(?:Once|Passive|Capture)$/; |
| 7220 | function parseName(name) { |
| 7221 | let options; |
no test coverage detected