PageSourceSearch

https://wab-booking-dev.pages.dev/assets/CustomerLinkedEmailDisplay-Dc421k9r.js

js wab-booking-dev.pages.dev collected 2026-10-03 05:47:30 UTC 49,534 bytes, 51 lines download raw bytes

vendor: 5,944 bytes, lines 1-11
1import{c as Le,k as Q,bm as kt,bn as jt,bo as Nt,bp as Ct,r as u,bq as ve,aG as de,j as r,aE as fe,aA as wt,bg as Et,aB as St,aH as K,bh as We,aC as ze,aD as Pt,bi as De,aF as At,aI as Rt,aJ as Tt,bj as Mt,bk as Ot,g as Be,f as Ke,h as Ue,e as R,az as qe,S as ie,C as le,P as He,br as It,z,ac as me,aw as Ge,d as ge,bl as _t,X as Ft,aj as be,ax as ye,ah as ke,aq as je}from"./index-Cn3juDuU.js";import{a as Lt}from"./Badge-BD4P7wqJ.js";import{T as Wt}from"./trending-up-BrHOyMNh.js";import{E as zt}from"./external-link-CvRWOjxF.js";import{b as Dt,E as Bt}from"./ConfirmDialog-B8KhezE6.js";import{S as Kt}from"./Sheet-C5pC30t9.js";import{T as Ne,t as Ut}from"./pipelineData-8q42zPBf.js";import{i as ce}from"./validation-CAl8HSYE.js";import{S as $e}from"./search-BJPO7duS.js";import{S as qt}from"./star-CLy70-M3.js";import{I as Ht}from"./info-CgE71yrd.js";/**
2 * @license lucide-react v0.487.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Gt=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],$t=Le("calendar-days",Gt);/**
7 * @license lucide-react v0.487.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Yt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],Zt=Le("user-check",Yt),Ce={list:e=>Q.get("/bunds",jt,{params:{limit:200,...e?{q:e}:{}}}),create:e=>Q.post("/bunds",kt,{name:e})},we={list:e=>Q.get("/countries",Ct,{params:{limit:200,...e?{q:e}:{}}}),create:e=>Q.post("/countries",Nt,{name:e})};var ee=0;function Vt(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ee()),document.body.insertAdjacentElement("beforeend",e[1]??Ee()),ee++,()=>{ee===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),ee--}},[])}function Ee(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var te="focusScope.autoFocusOnMount",ne="focusScope.autoFocusOnUnmount",Se={bubbles:!1,cancelable:!0},Xt="FocusScope",Ye=u.forwardRef((e,n)=>{const{loop:t=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...c}=e,[i,y]=u.useState(null),p=ve(s),v=ve(o),m=u.useRef(null),k=de(n,l=>y(l)),f=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(a){let l=function(x){if(f.paused||!i)return;const C=x.target;i.contains(C)?m.current=C:I(m.current,{select:!0})},h=function(x){if(f.paused||!i)return;const C=x.relatedTarget;C!==null&&(i.contains(C)||I(m.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&I(i)};document.addEventListener("focusin",l),document.addEventListener("focusout",h);const N=new MutationObserver(b);return i&&N.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",h),N.disconnect()}}},[a,i,f.paused]),u.useEffect(()=>{if(i){Ae.add(f);const l=document.activeElement;if(!i.contains(l)){const b=new CustomEvent(te,Se);i.addEventListener(te,p),i.dispatchEvent(b),b.defaultPrevented||(Qt(rn(Ze(i)),{select:!0}),document.activeElement===l&&I(i))}return()=>{i.removeEventListener(te,p),setTimeout(()=>{const b=new CustomEvent(ne,Se);i.addEventListener(ne,v),i.dispatchEvent(b),b.defaultPrevented||I(l??document.body,{select:!0}),i.removeEventListener(ne,v),Ae.remove(f)},0)}}},[i,p,v,f]);const g=u.useCallback(l=>{if(!t&&!a||f.paused)return;const h=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,b=document.activeElement;if(h&&b){const N=l.currentTarget,[x,C]=Jt(N);x&&C?!l.shiftKey&&b===C?(l.preventDefault(),t&&I(x,{select:!0})):l.shiftKey&&b===x&&(l.preventDefault(),t&&I(C,{select:!0})):b===N&&l.preventDefault()}},[t,a,f.paused]);return r.jsx(fe.div,{tabIndex:-1,...c,ref:k,onKeyDown:g})});Ye.displayName=Xt;function Qt(e,{select:n=!1}={}){const t=document.activeElement;for(const a of e)if(I(a,{select:n}),document.activeElement!==t)return}function Jt(e){const n=Ze(e),t=Pe(n,e),a=Pe(n.reverse(),e);return[t,a]}function Ze(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function Pe(e,n){for(const t of e)if(!en(t,{upTo:n}))return t}function en(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function tn(e){return e instanceof HTMLInputElement&&"select"in e}function I(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&tn(e)&&n&&e.select()}}var Ae=nn();function nn(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=Re(e,n),e.unshift(n)},remove(n){var t;e=Re(e,n),(t=e[0])==null||t.resume()}}}function Re(e,n){const t=[...e],a=t.indexOf(n);return a!==-1&&t.splice(a,1),t}function rn(e){return e.filter(n=>n.tagName!=="A")}var an=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},F=new WeakMap,q=new WeakMap,H={}
vendor: 6,899 bytes, lines 11-26
11,re=0,Ve=function(e){return e&&(e.host||Ve(e.parentNode))},sn=function(e,n){return n.map(function(t){if(e.contains(t))return t;var a=Ve(t);return a&&e.contains(a)?a:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},on=function(e,n,t,a){var s=sn(n,Array.isArray(e)?e:[e]);H[t]||(H[t]=new WeakMap);var o=H[t],c=[],i=new Set,y=new Set(s),p=function(m){!m||i.has(m)||(i.add(m),p(m.parentNode))};s.forEach(p);var v=function(m){!m||y.has(m)||Array.prototype.forEach.call(m.children,function(k){if(i.has(k))v(k);else try{var f=k.getAttribute(a),g=f!==null&&f!=="false",l=(F.get(k)||0)+1,h=(o.get(k)||0)+1;F.set(k,l),o.set(k,h),c.push(k),l===1&&g&&q.set(k,!0),h===1&&k.setAttribute(t,"true"),g||k.setAttribute(a,"true")}catch(b){console.error("aria-hidden: cannot operate on ",k,b)}})};return v(n),i.clear(),re++,function(){c.forEach(function(m){var k=F.get(m)-1,f=o.get(m)-1;F.set(m,k),o.set(m,f),k||(q.has(m)||m.removeAttribute(a),q.delete(m)),f||m.removeAttribute(t)}),re--,re||(F=new WeakMap,F=new WeakMap,q=new WeakMap,H={})}},ln=function(e,n,t){t===void 0&&(t="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),s=an(e);return s?(a.push.apply(a,Array.from(s.querySelectorAll("[aria-live], script"))),on(a,s,t,"aria-hidden")):function(){return null}},M=function(){return M=Object.assign||function(n){for(var t,a=1,s=arguments.length;a<s;a++){t=arguments[a];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},M.apply(this,arguments)};function Xe(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(t[a[s]]=e[a[s]]);return t}function cn(e,n,t){if(t||arguments.length===2)for(var a=0,s=n.length,o;a<s;a++)(o||!(a in n))&&(o||(o=Array.prototype.slice.call(n,0,a)),o[a]=n[a]);return e.concat(o||Array.prototype.slice.call(n))}var V="right-scroll-bar-position",X="width-before-scroll-bar",un="with-scroll-bars-hidden",dn="--removed-body-scroll-bar-size";function ae(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function fn(e,n){var t=u.useState(function(){return{value:e,callback:n,facade:{get current(){return t.value},set current(a){var s=t.value;s!==a&&(t.value=a,t.callback(a,s))}}}})[0];return t.callback=n,t.facade}var mn=typeof window<"u"?u.useLayoutEffect:u.useEffect,Te=new WeakMap;function hn(e,n){var t=fn(null,function(a){return e.forEach(function(s){return ae(s,a)})});return mn(function(){var a=Te.get(t);if(a){var s=new Set(a),o=new Set(e),c=t.current;s.forEach(function(i){o.has(i)||ae(i,null)}),o.forEach(function(i){s.has(i)||ae(i,c)})}Te.set(t,e)},[e]),t}function pn(e){return e}function xn(e,n){n===void 0&&(n=pn);var t=[],a=!1,s={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(o){var c=n(o,a);return t.push(c),function(){t=t.filter(function(i){return i!==c})}},assignSyncMedium:function(o){for(a=!0;t.length;){var c=t;t=[],c.forEach(o)}t={push:function(i){return o(i)},filter:function(){return t}}},assignMedium:function(o){a=!0;var c=[];if(t.length){var i=t;t=[],i.forEach(o),c=t}var y=function(){var v=c;c=[],v.forEach(o)},p=function(){return Promise.resolve().then(y)};p(),t={push:function(v){c.push(v),p()},filter:function(v){return c=c.filter(v),t}}}};return s}function vn(e){e===void 0&&(e={});var n=xn(null);return n.options=M({async:!0,ssr:!1},e),n}var Qe=function(e){var n=e.sideCar,t=Xe(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=n.read();if(!a)throw new Error("Sidecar medium not found");return u.createElement(a,M({},t))};Qe.isSideCarExport=!0;function gn(e,n){return e.useMedium(n),Qe}var Je=vn(),se=function(){},J=u.forwardRef(function(e,n){var t=u.useRef(null),a=u.useState({onScrollCapture:se,onWheelCapture:se,onTouchMoveCapture:se}),s=a[0],o=a[1],c=e.forwardProps,i=e.children,y=e.className,p=e.removeScrollBar,v=e.enabled,m=e.shards,k=e.sideCar,f=e.noRelative,g=e.noIsolation,l=e.inert,h=e.allowPinchZoom,b=e.as,N=b===void 0?"div":b,x=e.gapMode,C=Xe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=k,A=hn([t,n]),d=M(M({},C),s);return u.createElement(u.Fragment,null,v&&u.createElement(S,{sideCar:Je,removeScrollBar:p,shards:m,noRelative:f,noIsolation:g,inert:l,setCallbacks:o,allowPinchZoom:!!h,lockRef:t,gapMode:x}),c?u.cloneElement(u.Children.only(i),M(M({},d),{ref:A})):u.createElement(N,M({},d,{className:y,ref:A}),i))});J.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};J.classNames={fullWidth:X,zeroRight:V};var bn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=bn();return n&&e.setAttribute("nonce",n),e}function kn(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function jn(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var Nn=function(){var e=0,n=null;return{add:function(t){e==0&&(n=yn())&&(kn(n,t),jn(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},Cn=function(){var e=Nn();return function(n,t){u.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},et=function(){var e=Cn(),n=function(t){var a=t.styles,s=t.dynamic;return e(a,s),null};return n},wn={left:0,top:0,right:0,gap:0},oe=function(e){return parseInt(e||"",10)||0},En=function(e){var n=window.getComputedStyle(document.body),t=n[e==="padding"?"paddingLeft":"marginLeft"],a=n[e==="padding"?"paddingTop":"marginTop"],s=n[e==="padding"?"paddingRight":"marginRight"];return[oe(t),oe(a),oe(s)]},Sn=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wn;var n=En(e),t=document.documentElement.clientWidth,a=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,a-t+n[2]-n[0])}},Pn=et(),D="data-scroll-locked",An=function(e,n,t,a){var s=e.left,o=e.top,c=e.right,i=e.gap;return t===void 0&&(t="margin"),`
12  .`.concat(un,` {
13   overflow: hidden `).concat(a,`;
14   padding-right: `).concat(i,"px ").concat(a,`;
15  }
16  body[`).concat(D,`] {
17    overflow: hidden `).concat(a,`;
18    overscroll-behavior: contain;
19    `).concat([n&&"position: relative ".concat(a,";"),t==="margin"&&`
20    padding-left: `.concat(s,`px;
21    padding-top: `).concat(o,`px;
22    padding-right: `).concat(c,`px;
23    margin-left:0;
24    margin-top:0;
25    margin-right: `).concat(i,"px ").concat(a,`;
26    `),t==="padding"&&"padding-right: ".concat(i,"px ").concat(a,";
26")].filter(Boolean).join(""),`
27  }
28  
29  .`).concat(V,` {
30    right: `).concat(i,"px ").concat(a,`;
31  }
32  
33  .`).concat(X,` {
34    margin-right: `).concat(i,"px ").concat(a,`;
35  }
36  
37  .`).concat(V," .").concat(V,` {
38    right: 0 `).concat(a,`;
39  }
40  
41  .`).concat(X," .").concat(X,` {
42    margin-right: 0 `).concat(a,`;
43  }
44  
45  body[`).concat(D,`] {
46    `).concat(dn,": ").concat(i,`px;
47  }
48`)},Me=function(){var e=parseInt(document.body.getAttribute(D)||"0",10);return isFinite(e)?e:0},Rn=function(){u.useEffect(function(){return document.body.setAttribute(D,(Me()+1).toString()),function(){var e=Me()-1;e<=0?document.body.removeAttribute(D):document.body.setAttribute(D,e.toString())}},[])},Tn=function(e){var n=e.noRelative,t=e.noImportant,a=e.gapMode,s=a===void 0?"margin":a;Rn();var o=u.useMemo(function(){return Sn(s)},[s]);return u.createElement(Pn,{styles:An(o,!n,s,t?"":"!important")})},ue=!1;if(typeof window<"u")try{var G=Object.defineProperty({},"passive",{get:function(){return ue=!0,!0}});window.addEventListener("test",G,G),window.removeEventListener("test",G,G)}catch{ue=!1}var L=ue?{passive:!1}:!1,Mn=function(e){return e.tagName==="TEXTAREA"},tt=function(e,n){if(!(e instanceof Element))return!1;var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!Mn(e)&&t[n]==="visible")},On=function(e){return tt(e,"overflowY")},In=function(e){return tt(e,"overflowX")},Oe=function(e,n){var t=n.ownerDocument,a=n;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var s=nt(e,a);if(s){var o=rt(e,a),c=o[1],i=o[2];if(c>i)return!0}a=a.parentNode}while(a&&a!==t.body);return!1},_n=function(e){var n=e.scrollTop,t=e.scrollHeight,a=e.clientHeight;return[n,t,a]},Fn=function(e){var n=e.scrollLeft,t=e.scrollWidth,a=e.clientWidth;return[n,t,a]},nt=function(e,n){return e==="v"?On(n):In(n)},rt=function(e,n){return e==="v"?_n(n):Fn(n)},Ln=function(e,n){return e==="h"&&n==="rtl"?-1:1},Wn=function(e,n,t,a,s){var o=Ln(e,window.getComputedStyle(n).direction),c=o*a,i=t.target,y=n.contains(i),p=!1,v=c>0,m=0,k=0;do{if(!i)break;var f=rt(e,i),g=f[0],l=f[1],h=f[2],b=l-h-o*g;(g||b)&&nt(e,i)&&(m+=b,k+=g);var N=i.parentNode;i=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!y&&i!==document.body||y&&(n.contains(i)||n===i));return(v&&Math.abs(m)<1||!v&&Math.abs(k)<1)&&(p=!0),p},$=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ie=function(e){return[e.deltaX,e.deltaY]},_e=function(e){return e&&"current"in e?e.current:e},zn=function(e,n){return e[0]===n[0]&&e[1]===n[1]},Dn=function(e){return`
49  .block-interactivity-`.concat(e,` {pointer-events: none;}
50  .allow-interactivity-`).concat(e,` {pointer-events: all;}
51`)},Bn=0,W=[];function Kn(e){var n=u.useRef([]),t=u.useRef([0,0]),a=u.useRef(),s=u.useState(Bn++)[0],o=u.useState(et)[0],c=u.useRef(e);u.useEffect(function(){c.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var l=cn([e.lockRef.current],(e.shards||[]).map(_e),!0).filter(Boolean);return l.forEach(function(h){return h.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),l.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(l,h){if("touches"in l&&l.touches.length===2||l.type==="wheel"&&l.ctrlKey)return!c.current.allowPinchZoom;var b=$(l),N=t.current,x="deltaX"in l?l.deltaX:N[0]-b[0],C="deltaY"in l?l.deltaY:N[1]-b[1],S,A=l.target,d=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in l&&d==="h"&&A.type==="range")return!1;var j=window.getSelection(),E=j&&j.anchorNode,P=E?E===A||E.contains(A):!1;if(P)return!1;var w=Oe(d,A);if(!w)return!0;if(w?S=d:(S=d==="v"?"h":"v",w=Oe(d,A)),!w)return!1;if(!a.current&&"changedTouches"in l&&(x||C)&&(a.current=S),!S)return!0;var T=a.current||S;return Wn(T,h,l,T==="h"?x:C)},[]),y=u.useCallback(function(l){var h=l;if(!(!W.length||W[W.length-1]!==o)){var b="deltaY"in h?Ie(h):$(h),N=n.current.filter(function(S){return S.name===h.type&&(S.target===h.target||h.target===S.shadowParent)&&zn(S.delta,b)})[0];if(N&&N.should){h.cancelable&&h.preventDefault();return}
vendor: 4,530 bytes, line 51
51if(!N){var x=(c.current.shards||[]).map(_e).filter(Boolean).filter(function(S){return S.contains(h.target)}),C=x.length>0?i(h,x[0]):!c.current.noIsolation;C&&h.cancelable&&h.preventDefault()}}},[]),p=u.useCallback(function(l,h,b,N){var x={name:l,delta:h,target:b,should:N,shadowParent:Un(b)};n.current.push(x),setTimeout(function(){n.current=n.current.filter(function(C){return C!==x})},1)},[]),v=u.useCallback(function(l){t.current=$(l),a.current=void 0},[]),m=u.useCallback(function(l){p(l.type,Ie(l),l.target,i(l,e.lockRef.current))},[]),k=u.useCallback(function(l){p(l.type,$(l),l.target,i(l,e.lockRef.current))},[]);u.useEffect(function(){return W.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:k}),document.addEventListener("wheel",y,L),document.addEventListener("touchmove",y,L),document.addEventListener("touchstart",v,L),function(){W=W.filter(function(l){return l!==o}),document.removeEventListener("wheel",y,L),document.removeEventListener("touchmove",y,L),document.removeEventListener("touchstart",v,L)}},[]);var f=e.removeScrollBar,g=e.inert;return u.createElement(u.Fragment,null,g?u.createElement(o,{styles:Dn(s)}):null,f?u.createElement(Tn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Un(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const qn=gn(Je,Kn);var at=u.forwardRef(function(e,n){return u.createElement(J,M({},e,{ref:n,sideCar:qn}))});at.classNames=J.classNames;var he="Popover",[st]=Rt(he,[De]),U=De(),[Hn,_]=st(he),ot=e=>{const{__scopePopover:n,children:t,open:a,defaultOpen:s,onOpenChange:o,modal:c=!1}=e,i=U(n),y=u.useRef(null),[p,v]=u.useState(!1),[m=!1,k]=wt({prop:a,defaultProp:s,onChange:o});return r.jsx(Et,{...i,children:r.jsx(Hn,{scope:n,contentId:St(),triggerRef:y,open:m,onOpenChange:k,onOpenToggle:u.useCallback(()=>k(f=>!f),[k]),hasCustomAnchor:p,onCustomAnchorAdd:u.useCallback(()=>v(!0),[]),onCustomAnchorRemove:u.useCallback(()=>v(!1),[]),modal:c,children:t})})};ot.displayName=he;var it="PopoverAnchor",Gn=u.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,s=_(it,t),o=U(t),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=s;return u.useEffect(()=>(c(),()=>i()),[c,i]),r.jsx(We,{...o,...a,ref:n})});Gn.displayName=it;var lt="PopoverTrigger",ct=u.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,s=_(lt,t),o=U(t),c=de(n,s.triggerRef),i=r.jsx(fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ht(s.open),...a,ref:c,onClick:K(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:r.jsx(We,{asChild:!0,...o,children:i})});ct.displayName=lt;var pe="PopoverPortal",[$n,Yn]=st(pe,{forceMount:void 0}),ut=e=>{const{__scopePopover:n,forceMount:t,children:a,container:s}=e,o=_(pe,n);return r.jsx($n,{scope:n,forceMount:t,children:r.jsx(ze,{present:t||o.open,children:r.jsx(Pt,{asChild:!0,container:s,children:a})})})};ut.displayName=pe;var B="PopoverContent",dt=u.forwardRef((e,n)=>{const t=Yn(B,e.__scopePopover),{forceMount:a=t.forceMount,...s}=e,o=_(B,e.__scopePopover);return r.jsx(ze,{present:a||o.open,children:o.modal?r.jsx(Zn,{...s,ref:n}):r.jsx(Vn,{...s,ref:n})})});dt.displayName=B;var Zn=u.forwardRef((e,n)=>{const t=_(B,e.__scopePopover),a=u.useRef(null),s=de(n,a),o=u.useRef(!1);return u.useEffect(()=>{const c=a.current;if(c)return ln(c)},[]),r.jsx(at,{as:At,allowPinchZoom:!0,children:r.jsx(ft,{...e,ref:s,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),o.current||(i=t.triggerRef.current)==null||i.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,y=i.button===0&&i.ctrlKey===!0,p=i.button===2||y;o.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:K(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),Vn=u.forwardRef((e,n)=>{const t=_(B,e.__scopePopover),a=u.useRef(!1),s=u.useRef(!1);return r.jsx(ft,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(i=t.triggerRef.current)==null||i.focus(),o.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:o=>{var y,p;(y=e.onInteractOutside)==null||y.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=o.target;((p=t.triggerRef.current)==null?void 0:p.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}
51),ft=u.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:y,onFocusOutside:p,onInteractOutside:v,...m}=e,k=_(B,t),f=U(t);return Vt(),r.jsx(Ye,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:o,children:r.jsx(Tt,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:v,onEscapeKeyDown:i,onPointerDownOutside:y,onFocusOutside:p,onDismiss:()=>k.onOpenChange(!1),children:r.jsx(Mt,{"data-state":ht(k.open),role:"dialog",id:k.contentId,...f,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),mt="PopoverClose",Xn=u.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,s=_(mt,t);return r.jsx(fe.button,{type:"button",...a,ref:n,onClick:K(e.onClick,()=>s.onOpenChange(!1))})});Xn.displayName=mt;var Qn="PopoverArrow",Jn=u.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,s=U(t);return r.jsx(Ot,{...s,...a,ref:n})});Jn.displayName=Qn;function ht(e){return e?"open":"closed"}var pt=ot,xt=ct,vt=ut,gt=dt;function bt({selectedId:e,displayName:n,onChange:t,queryKey:a,fetchFn:s,createFn:o,staleTime:c=3e4,placeholder:i="Suchen…",disabled:y=!1,invalid:p=!1,size:v="default",defaultOpen:m=!1}){const[k,f]=u.useState(m),[g,l]=u.useState(""),h=u.useRef(null),b=Be();u.useEffect(()=>{if(m){const w=setTimeout(()=>{var T;return(T=h.current)==null?void 0:T.focus()},0);return()=>clearTimeout(w)}},[]);const{data:N,isLoading:x}=Ke({queryKey:["combobox",a,g],queryFn:()=>s(g||void 0),enabled:k,staleTime:c}),C=Ue({mutationFn:w=>o(w),onSuccess:w=>{b.invalidateQueries({queryKey:["combobox",a]}),b.invalidateQueries({queryKey:[a]}),t(w.id,w.name),f(!1),l("")}}),S=(N==null?void 0:N.items)??[],A=g.trim(),d=S.some(w=>w.name.toLowerCase()===A.toLowerCase()),j=!!o&&A.length>0&&!d;function E(w,T){t(w,T),f(!1),l("")}const P=n||"";return r.jsxs(pt,{open:k,onOpenChange:w=>{f(w),w?setTimeout(()=>{var T;return(T=h.current)==null?void 0:T.focus()},0):l("")},children:[r.jsx(xt,{asChild:!0,children:r.jsxs("button",{type:"button",disabled:y,className:R("flex w-full items-center justify-between gap-2 rounded-md border bg-white text-sm transition-colors",v==="sm"?"h-8 px-2.5":"h-9 px-3","disabled:cursor-not-allowed disabled:opacity-50",p?"border-red-300 text-red-700 focus-visible:ring-2 focus-visible:ring-red-500/20":"border-ink-200 text-ink-900 hover:border-ink-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-700/10"),children:[r.jsx("span",{className:R("min-w-0",P?"truncate":"truncate text-ink-400"),children:P||i}),r.jsx(qe,{size:13,strokeWidth:1.75,className:"shrink-0 text-ink-400"})]})}),r.jsx(vt,{children:r.jsxs(gt,{sideOffset:4,align:"start",className:"z-[150] w-[var(--radix-popover-trigger-width)] min-w-[220px] rounded-md border border-ink-200 bg-white shadow-lg",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-ink-100 px-3 py-2",children:[r.jsx($e,{size:13,strokeWidth:1.75,className:"shrink-0 text-ink-400"}),r.jsx("input",{ref:h,value:g,onChange:w=>l(w.target.value),placeholder:"Suchen…",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-ink-400"})]}),r.jsxs("ul",{className:"max-h-52 overflow-y-scroll py-1",onWheel:w=>w.stopPropagation(),children:[x&&r.jsx("li",{className:"flex items-center justify-center py-4",children:r.jsx(ie,{size:14})}),!x&&S.length===0&&!j&&r.jsx("li",{className:"px-3 py-2 text-xs text-ink-400",children:"Keine Einträge gefunden"}),!x&&S.map(w=>r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>E(w.id,w.name),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm hover:bg-ink-50",children:[r.jsx(le,{size:12,strokeWidth:2,className:R("shrink-0",e===w.id?"text-brand-700":"text-transparent")}),r.jsx("span",{className:"truncate",children:w.name}),w.hint&&r.jsx("span",{className:"ml-auto shrink-0 pl-3 text-xs tabular-nums text-ink-400",children:w.hint})]})},w.id)),j&&r.jsx("li",{children:r.jsxs("button",{type:"button",disabled:C.isPending,onClick:()=>C.mutate(A),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm text-brand-700 hover:bg-brand-50 disabled:opacity-50",children:[r.jsx(He,{size:12,strokeWidth:2,className:"shrink-0"}),r.jsxs("span",{children:[r.jsxs("span",{className:"font-medium",children:["“",A,"”"]})," erstellen"]}),C.isPending&&r.jsx(ie,{size:14,className:"ml-auto"})]})})]}),(e!=null||n)&&r.jsx("div",{className:"border-t border-ink-100 px-3 py-1.5",children:r.jsx("button",{type:"button",onClick:()=>t(null,""),className:"text-xs text-ink-400 hover:text-ink-700",children:"Auswahl aufheben"})})]})})]})}
51function er({bundId:e,displayName:n,onChange:t,...a}){return r.jsx(bt,{selectedId:e,displayName:n,onChange:t,queryKey:"bunds",fetchFn:s=>Ce.list(s),createFn:s=>Ce.create(s),staleTime:3e4,placeholder:"Bund / Firma suchen…",...a})}function tr({countryId:e,displayName:n,onChange:t,...a}){return r.jsx(bt,{selectedId:e,displayName:n,onChange:t,queryKey:"countries",fetchFn:s=>we.list(s),createFn:s=>we.create(s),staleTime:6e4,placeholder:"Land suchen…",...a})}const nr=["Dipl.-Ing.","Dr.","Ing.","Mag.","MMMag.","MBA","MSc","Prim.","Prof.","Univ.Prof."];function rr({value:e,onChange:n,placeholder:t="Titel wählen…",disabled:a=!1,invalid:s=!1}){const[o,c]=u.useState(!1),[i,y]=u.useState(""),p=u.useRef(null),{data:v,isLoading:m}=Ke({queryKey:["titles"],queryFn:()=>It.list(),enabled:o,staleTime:6e4}),k=(v==null?void 0:v.items)??[],f=Array.from(new Set([...nr,...k])).sort(),g=i.trim(),l=g?f.filter(x=>x.toLowerCase().includes(g.toLowerCase())):f,h=f.some(x=>x.toLowerCase()===g.toLowerCase()),b=g.length>0&&!h;function N(x){n(x),c(!1),y("")}return r.jsxs(pt,{open:o,onOpenChange:x=>{c(x),x?setTimeout(()=>{var C;return(C=p.current)==null?void 0:C.focus()},0):y("")},children:[r.jsx(xt,{asChild:!0,children:r.jsxs("button",{type:"button",disabled:a,className:R("flex h-9 w-full items-center justify-between gap-2 rounded-md border bg-white px-3 text-sm transition-colors","disabled:cursor-not-allowed disabled:opacity-50",s?"border-red-300 text-red-700 focus-visible:ring-2 focus-visible:ring-red-500/20":"border-ink-200 text-ink-900 hover:border-ink-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-700/10"),children:[r.jsx("span",{className:e?"truncate":"text-ink-400",children:e||t}),r.jsx(qe,{size:13,strokeWidth:1.75,className:"shrink-0 text-ink-400"})]})}),r.jsx(vt,{children:r.jsxs(gt,{sideOffset:4,align:"start",className:"z-[150] w-[var(--radix-popover-trigger-width)] min-w-[180px] rounded-md border border-ink-200 bg-white shadow-lg",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-ink-100 px-3 py-2",children:[r.jsx($e,{size:13,strokeWidth:1.75,className:"shrink-0 text-ink-400"}),r.jsx("input",{ref:p,value:i,onChange:x=>y(x.target.value),placeholder:"Suchen…",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-ink-400"})]}),r.jsxs("ul",{className:"max-h-52 overflow-y-scroll py-1",onWheel:x=>x.stopPropagation(),children:[m&&r.jsx("li",{className:"flex items-center justify-center py-4",children:r.jsx(ie,{size:14})}),!m&&l.length===0&&!b&&r.jsx("li",{className:"px-3 py-2 text-xs text-ink-400",children:"Kein Titel gefunden"}),!m&&l.map(x=>r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>N(x),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm hover:bg-ink-50",children:[r.jsx(le,{size:12,strokeWidth:2,className:R("shrink-0",e===x?"text-brand-700":"text-transparent")}),r.jsx("span",{className:"truncate",children:x})]})},x)),b&&r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>N(g),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm text-brand-700 hover:bg-brand-50",children:[r.jsx(le,{size:12,strokeWidth:2,className:"shrink-0 text-transparent"}),r.jsxs("span",{children:[r.jsxs("span",{className:"font-medium",children:["“",g,"”"]})," verwenden"]})]})})]}),e&&r.jsx("div",{className:"border-t border-ink-100 px-3 py-1.5",children:r.jsx("button",{type:"button",onClick:()=>n(""),className:"text-xs text-ink-400 hover:text-ink-700",children:"Auswahl aufheben"})})]})})]})}const yt=1100;function ar(e,n=yt){return e>0&&e<n}function Pr(e=yt){const[n,t]=u.useState(null),[a,s]=u.useState(!1),o=u.useCallback(c=>t(c),[]);return u.useEffect(()=>{if(!n)return;const c=()=>s(ar(n.clientWidth,e));c();const i=new ResizeObserver(c);return i.observe(n),()=>i.disconnect()},[n,e]),{ref:o,compact:a}}function xe({children:e}){return r.jsx("span",{className:"block text-[11px] font-semibold uppercase tracking-wider text-ink-500",children:e})}function O({label:e,required:n,error:t,children:a}){return r.jsxs("label",{className:"flex flex-col gap-1.5",children:[r.jsxs(xe,{children:[e,n&&r.jsx("span",{className:"ml-0.5 text-status-rejected-text",children:"*"})]}),a,t&&r.jsx("span",{className:"text-[11px] text-status-rejected-text",children:t})]})}function sr({title:e,bundId:n,company:t,onTitleChange:a,onBundChange:s,disabled:o=!1}){return r.jsxs("div",{className:"grid grid-cols-2 gap-x-4",children:[r.jsx(O,{label:"Titel",children:r.jsx(rr,{value:e,onCh
51ange:a,disabled:o})}),r.jsx(O,{label:"Bund / Firma",children:r.jsx(er,{bundId:n,displayName:t,onChange:s,disabled:o})})]})}function or({firstName:e,lastName:n,onFirstNameChange:t,onLastNameChange:a,disabled:s=!1,firstNameInvalid:o=!1,lastNameInvalid:c=!1,firstNameError:i,lastNameError:y}){return r.jsxs("div",{className:"grid grid-cols-2 gap-x-4",children:[r.jsx(O,{label:"Vorname",required:!0,error:i,children:r.jsx(z,{value:e,onChange:p=>t(p.target.value),invalid:o,"aria-invalid":o,disabled:s,maxLength:255})}),r.jsx(O,{label:"Nachname",required:!0,error:y,children:r.jsx(z,{value:n,onChange:p=>a(p.target.value),invalid:c,"aria-invalid":c,disabled:s,maxLength:255})})]})}function ir({address:e,addressZip:n,addressCity:t,addressCountry:a,countryId:s,onAddressChange:o,onZipChange:c,onCityChange:i,onCountryChange:y,disabled:p=!1}){return r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(O,{label:"Adresse",children:r.jsx(z,{value:e,onChange:v=>o(v.target.value),placeholder:"Straße und Hausnummer",disabled:p,maxLength:255})}),r.jsxs("div",{className:"grid grid-cols-[88px_1fr_1fr] gap-2",children:[r.jsx(O,{label:"PLZ",children:r.jsx(z,{value:n,onChange:v=>c(v.target.value),disabled:p,maxLength:20})}),r.jsx(O,{label:"Ort",children:r.jsx(z,{value:t,onChange:v=>i(v.target.value),disabled:p,maxLength:100})}),r.jsx(O,{label:"Land",children:r.jsx(tr,{countryId:s,displayName:a,onChange:y,disabled:p})})]})]})}function Ar({customer:e}){var s;const n=u.useMemo(()=>new Set(e.attendance.map(o=>o.year)).size,[e.attendance]),t=u.useMemo(()=>{const o=new Map;for(const c of e.attendance){const i=o.get(c.year)??[];i.push(c),o.set(c.year,i)}return Array.from(o.entries()).sort(([c],[i])=>i-c).map(([c,i])=>({year:c,records:i}))},[e.attendance]),a=(s=t[0])==null?void 0:s.year;return r.jsxs(r.Fragment,{children:[r.jsx(ur,{label:"Ticket-Historie"}),r.jsxs("div",{className:"mb-3.5 grid grid-cols-4 gap-2.5",children:[r.jsx(Y,{icon:r.jsx($t,{size:12,strokeWidth:1.75}),label:"Erste Teilnahme",value:n>0?String(e.firstYear):"—",sub:n===0?"Noch kein Event":n>1?`${n} Jahre Gast`:"Neu dabei"}),r.jsx(Y,{icon:r.jsx(Zt,{size:12,strokeWidth:1.75}),label:"Besuche",value:String(n),sub:n>0?`inkl. ${new Date().getFullYear()}`:"Noch kein Event"}),r.jsx(Y,{icon:r.jsx(Wt,{size:12,strokeWidth:1.75}),label:"Gesamtumsatz",value:me(e.totalSpend),sub:e.attendance.length===0?"Keine Bestellungen":`${e.attendance.length} ${e.attendance.length===1?"Bestellung":"Bestellungen"}`}),r.jsx(Y,{icon:r.jsx(Ge,{size:12,strokeWidth:1.75}),label:"Plätze",value:e.totalSeats>0?String(e.totalSeats):"—",sub:e.totalTickets>0?`${e.totalTickets} Tickets`:"—"})]}),t.length===0?r.jsx("div",{className:"rounded-lg border border-dashed border-ink-200 bg-ink-50/50 px-4 py-8 text-center text-sm text-ink-500",children:"Noch keine Teilnahmen aufgezeichnet."}):r.jsx("div",{className:"flex flex-col gap-3",children:t.map(({year:o,records:c})=>r.jsx(lr,{year:o,records:c,isLatest:o===a},o))})]})}function lr({year:e,records:n,isLatest:t}){const a=n.reduce((s,o)=>s+o.totalRaw,0);return r.jsxs("div",{className:R("overflow-hidden rounded-lg border",t?"border-brand-200":"border-ink-200"),children:[r.jsxs("div",{className:R("flex items-center justify-between border-b border-ink-100 px-3.5 py-2",t?"bg-brand-50":"bg-ink-50"),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:R("text-sm font-semibold",t?"text-brand-700":"text-ink-900"),children:e}),t&&r.jsx("span",{className:"rounded-full bg-brand-200 px-1.5 py-px text-[10px] font-medium text-brand-700",children:"Neueste"}),n.length>1&&r.jsxs("span",{className:"rounded-full bg-ink-100 px-1.5 py-px text-[10px] text-ink-500",children:[n.length," Bestellungen"]})]}),r.jsx("span",{className:"text-sm font-semibold text-ink-900",children:me(a)})]}),r.jsx("div",{className:R("divide-y",t?"divide-brand-100":"divide-ink-100"),children:n.map((s,o)=>r.jsx(cr,{record:s},s.reservationId??`${e}-${o}`))})]})}function cr({record:e}){return r.jsxs("div",{className:"px-3.5 py-2.5",children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.reservationId&&r.jsx(ge,{content:"Zur Reservierung wechseln",side:"top",children:r.jsxs(_t,{to:`/reservations?r=${e.reservationId}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded bg-ink-100 px-1.5 py-0.5 text-[11px] font-semibold text-ink-700 hover:bg-ink-200 hover:text-ink-900 transition-colors",children:["ID ",e.reservationId,r.jsx(zt,{size:9,strokeWidth:2})]})}),e.reservationNumber!=null&&e.reservationNumber>0&&r.jsxs("span",{className:"text-[11px] text-ink-400",children:["Bestellung"," ",r.jsxs("span",{className:"font-semibold text-ink-700",children:["#",e.reservationNumber]})]}),e.reservationStatus?r.jsx(Lt,{status:e.reservationStatus}):null]}),r.jsx("span",{className:"shrink-0 text-sm font-semibold text-ink-900",children:me(e.totalRaw)})]}),r.jsxs("div",{className:"flex flex-col gap-1 text-xs text-ink-600",children:[e.tables.length>0&&r.jsx("div",{className:"flex flex-col gap-0.5",children:e.tables.map((n,t)=>r.jsxs("div",{className:"flex items-center gap-1.5",children:[n.table&&r.jsxs("span",{className:"font-medium text-ink-900",children:["Tisch ",n.table]}),n.table&&n.hall&&r.jsx("span",{className:"text-ink-400",children:"·"}),n.hall&&r.jsx("span",{children:n.hall})]},t))}),e.tickets&&r.jsx("div",{children:e.tickets}),e.neighbors.length>0&&r.jsx(ge,{content:"Sitzplatznachbarn — andere Gäste am selben Tisch oder in unmittelbarer Nähe",side:"bottom",children:r.jsxs("div",{className:"flex cursor-default items-baseline gap-1.5 text-ink-500",children:[r.jsx(Ge,{size:10,strokeWidth:1.75,className:"mt-px shrink-0"}),r.jsx("span",{className:"underline decoration-dotted underline-offset-2",children:e.neighbors.join(", ")})]})})]})]})}function ur({label:e}){return r.jsxs("div",{className:"my-5 flex items-center gap-2.5",children:[r.jsx("div",{className:"h-px flex-1 bg-ink-200"}),r.jsx("span",{className:"whitespace-nowrap text-[10px] font-bold uppercase tracking-wider text-ink-400",children:e}),r.jsx("div",{className:"h-px flex-1 bg-ink-200"})]})}function Y({icon:e,label:n,value:t,sub:a}){return r.jsxs("div",{className:"flex flex-col gap-1 rounded-md border border-ink-200 bg-white px-3 py-2.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wider text-ink-500",children:[e,r.jsx("span",{children:n})]}),r.jsx("div",{className:"text-lg font-bold tabular-nums tracking-tight text-ink-900",children:t}),a&&r.jsx("div",{className:"text-[11px] text-ink-400",children:a})]})}function dr({active:e,onActiveChange:n,label:t="E-Mail",required:a=!1,error:s,children:o,hasRealEmail:c=!1}){const i=e||!c,y=u.useRef(null),p=u.useRef(e);return u.useEffect(()=>{var v;if(p.current&&!e){const m=(v=y.current)==null?void 0:v.querySelector("input, textarea");m==null||m.focus()}p.current=e},[e]),r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs(xe,{children:[t,a&&!e&&r.jsx("span",{className:"ml-0.5 text-status-rejected-text",children:"*"})]}),i&&r.jsx("button",{type:"button","aria-pressed":e,onClick:()=>n(!e),className:"relative text-[11.5px] font-medium text-brand-700 transition-colors after:absolute after:-inset-3 after:content-[''] hover:text-brand-800 hover:underline",children:e?"E-Mail-Adresse doch erfassen":"Kunde hat keine E-Mail-Adresse"})]}),e?r.jsx("div",{className:"rounded-md border border-ink-200 bg-ink-50 px-3 py-2.5",children:r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(Ht,{size:13,strokeWidth:1.75,className:"mt-0.5 shrink-0 text-ink-400"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("p",{className:"m-0 text-[13px] font-semibold text-ink-700",children:"Keine E-Mail-Adresse hinterlegt"}),r.jsx("p",{className:"m-0 text-[13px] leading-snug text-ink-500",children:"Für diesen Kunden werden keine E-Mails versendet (Rechnung, Tickets, Zahlungserinnerungen)."})]})]})}):r.jsxs("div",{ref:y,className:"flex flex-col gap-1.5",children:[o,s&&r.jsx("span",{className:"text-[11px] text-status-rejected-text",children:s})]})]})}const Fe=4;function fr(){return`_new_${Math.random().toString(36).slice(2)}`}function mr({emails:e,onChange:n,showPrimaryRequired:t,serverError:a,highlightEmail:s,highlightVariant:o="anfrage",disabled:c=!1}){const i=u.useId(),y=s?s.trim().toLowerCase():null;function p(f,g){n(e.map((l,h)=>h===f?{...l,email:g}:l))}function v(f){n(e.map((g,l)=>({...g,isPrimary:l===f})))}function m(f){const g=e.filter((l,h)=>h!==f);!g.some(l=>l.isPrimary)&&g.length>0&&(g[0]={...g[0],isPrimary:!0}),n(g)}function k(){e.length>=Fe||n([...e,{id:fr(),email:"",isPrimary:!1}])}return r.jsxs("div",{className:"flex flex-col gap-1",children:[e.map((f,g)=>{const l=f.email!==""&&!ce(f.email),b=f.email.trim()===""&&f.isPrimary&&t,N=l||!!b,x=!N&&y!=null&&f.email.trim().toLowerCase()===y,C=x&&o==="match",S=x&&o==="anfrage";return r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsxs("div",{className:R("flex items-center gap-1.5 rounded-md border px-2 py-1.5 transition-colors",N?"border-red-300 bg-red-50/40":C?"border-[#22c55e66] bg-[#22c55e0a] hover:border-[#22c55eaa]":S?"border-[#f59e0b66] bg-[#f59e0b0a] hover:border-[#f59e0baa]":"border-ink-200 bg-white hover:border-ink-300"),children:[!c&&r.jsxs("button",{type:"button",onClick:()=>v(g),disabled:f.isPrimary,"aria-label":f.isPrimary?"Primäre E-Mail":"Als primäre E-Mail setzen",className:R("group/star relative flex shrink-0 items-center justify-center rounded p-0.5 transition-colors",f.isPrimary?"cursor-default text-brand-500":"cursor-pointer text-ink-300 hover:text-brand-400"),children:[!f.isPrimary&&r.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-ink-800 px-1.5 py-0.5 text-[10px] leading-tight text-white opacity-0 transition-opacity group-hover/star:opacity-100",children:"Als primäre E-Mail setzen"}),r.jsx(qt,{size:12,strokeWidth:1.75,className:R(f.isPrimary&&"fill-brand-400 text-brand-500")})]}),r.jsx("input",{id:`${i}-email-${g}`,type:"email",value:f.email,onChange:A=>p(g,A.target.value),placeholder:"[email protected]","aria-invalid":N,disabled:c,
51className:"min-w-0 flex-1 bg-transparent text-[13px] text-ink-900 placeholder:text-ink-400 outline-none disabled:cursor-not-allowed disabled:text-ink-400"}),S&&r.jsx("span",{className:"flex-shrink-0 rounded-full bg-[#f59e0b1a] px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-[0.04em] text-[#b45309]",children:"Anfrage"}),!c&&r.jsx("button",{type:"button",onClick:()=>m(g),disabled:e.length<=1,"aria-label":"E-Mail entfernen",className:R("flex shrink-0 items-center justify-center rounded p-0.5 transition-colors",e.length<=1?"cursor-not-allowed text-ink-200":"cursor-pointer text-ink-400 hover:bg-red-50 hover:text-red-500"),children:r.jsx(Ft,{size:12,strokeWidth:1.75})})]}),N&&r.jsx("span",{role:"alert",className:"ml-[22px] text-[11px] text-status-rejected-text",children:b?"Primäre E-Mail ist erforderlich.":"Ungültige E-Mail-Adresse."})]},f.id)}),a&&r.jsx("span",{role:"alert",className:"text-[11px] text-status-rejected-text",children:a}),!c&&e.length<Fe&&r.jsxs("button",{type:"button",onClick:k,className:"mt-0.5 flex cursor-pointer items-center gap-1 self-start rounded px-1 py-0.5 text-[11px] font-medium text-brand-700 transition-colors hover:bg-brand-50",children:[r.jsx(He,{size:11,strokeWidth:2}),"E-Mail hinzufügen"]})]})}const Z="Kein E-Mail";function hr(){return{id:`_new_${Math.random().toString(36).slice(2)}`,email:"",isPrimary:!0}}const pr={title:"",bundId:null,company:"",firstName:"",lastName:"",emails:[hr()],phone:"",address:"",addressZip:"",addressCity:"",addressCountry:"",countryId:null,notes:"",tags:[],noEmail:!1};function xr(e){const n={};e.firstName.trim()||(n.firstName="Vorname ist erforderlich."),e.lastName.trim()||(n.lastName="Nachname ist erforderlich.");const t=e.emails.find(a=>a.isPrimary);t!=null&&t.email.trim()?ce(t.email)||(n._emails="Ungültige E-Mail-Adresse."):n._emails="E-Mail ist erforderlich.";for(const a of e.emails)a.email&&!ce(a.email)&&(n._emails="Eine oder mehrere E-Mail-Adressen sind ungültig.");return n}function Rr({onClose:e,onCreated:n}){const[t,a]=u.useState(pr),[s,o]=u.useState(new Set),[c,i]=u.useState(!1),[y,p]=u.useState({}),[v,m]=u.useState(null),k=Be(),f=xr(t),g=Ue({mutationFn:async d=>{const{tags:j,...E}=d,P=await ye.create(E);if(j.length>0)try{await ye.update(P.id,{tags:j})}catch{}return P},onSuccess:d=>{k.invalidateQueries({queryKey:["customers"]}),n(d)},onError:d=>{d instanceof be&&d.code==="EMAIL_TAKEN"?p({_emails:"Ein Kunde mit dieser E-Mail-Adresse existiert bereits."}):d instanceof be&&d.code==="VALIDATION"?m("Bitte Eingaben überprüfen."):m("Anlegen fehlgeschlagen. Bitte erneut versuchen.")}});function l(d,j){a(E=>({...E,[d]:j})),p(E=>{const P={...E};return delete P[d],P}),m(null)}function h(d){o(j=>new Set(j).add(d))}function b(d){return y[d]??(c||s.has(d)?f[d]:void 0)}function N(d){l("emails",d),h("_emails")}u.useEffect(()=>{if(!t.noEmail)return;const d=Dt(t.firstName,t.lastName);a(j=>{if(!j.noEmail)return j;const E=j.emails.find(P=>P.isPrimary);return(E==null?void 0:E.email)===d&&j.tags.includes(Z)?j:{...j,emails:[{id:(E==null?void 0:E.id)??"_no_email",email:d,isPrimary:!0}],tags:j.tags.includes(Z)?j.tags:[...j.tags,Z]}})},[t.noEmail,t.firstName,t.lastName]);function x(d){d?(l("noEmail",!0),h("_emails")):a(j=>({...j,noEmail:!1,emails:[{id:"_new_reset",email:"",isPrimary:!0}],tags:j.tags.filter(E=>E!==Z)}))}function C(d){const j=new Set(t.tags);j.has(d)?j.delete(d):j.add(d),l("tags",Array.from(j))}function S(d){var E;if(d.preventDefault(),i(!0),Object.keys(f).length>0)return;const j=((E=t.emails.find(P=>P.isPrimary))==null?void 0:E.email)??"";g.mutate({firstName:t.firstName.trim(),lastName:t.lastName.trim(),title:t.title.trim()||void 0,bundId:t.bundId,company:t.company||void 0,countryId:t.countryId,email:j,emails:t.emails.filter(P=>P.email.trim()!=="").map(P=>({email:P.email.trim(),isPrimary:P.isPrimary})),phone:t.phone.trim()||void 0,address:t.address.trim()||void 0,addressZip:t.addressZip.trim()||void 0,addressCity:t.addressCity.trim()||void 0,addressCountry:t.addressCountry.trim()||void 0,notes:t.notes.trim()||void 0,tags:t.tags})}const A=new Set(t.tags);return r.jsx(Kt,{open:!0,onClose:e,title:"Neuer Kunde",width:900,footer:r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[v&&r.jsx("span",{className:"mr-auto text-xs text-status-rejected-text",children:v}),r.jsx(ke,{variant:"ghost",size:"md",onClick:e,disabled:g.isPending,children:"Abbrechen"}),r.jsx(ke,{variant:"primary",size:"md",type:"submit",form:"add-customer-form",disabled:g.isPending,children:g.isPending?"Anlegen…"
51:"Kunden anlegen"})]}),children:r.jsxs("form",{id:"add-customer-form",onSubmit:S,className:"flex flex-col gap-y-3 px-7 py-6",children:[r.jsx(sr,{title:t.title,bundId:t.bundId,company:t.company,onTitleChange:d=>{l("title",d),h("title")},onBundChange:(d,j)=>{l("bundId",d),l("company",j)}}),r.jsx(or,{firstName:t.firstName,lastName:t.lastName,onFirstNameChange:d=>{l("firstName",d),h("firstName")},onLastNameChange:d=>{l("lastName",d),h("lastName")},firstNameInvalid:!!b("firstName"),lastNameInvalid:!!b("lastName"),firstNameError:b("firstName"),lastNameError:b("lastName")}),r.jsx(dr,{active:t.noEmail,onActiveChange:x,required:!0,children:r.jsx(mr,{emails:t.emails,onChange:N,showPrimaryRequired:c||s.has("_emails"),serverError:b("_emails")})}),r.jsx(O,{label:"Telefon",children:r.jsx(z,{value:t.phone,onChange:d=>l("phone",d.target.value),onBlur:()=>h("phone"),placeholder:"+43 …"})}),r.jsx(ir,{address:t.address,addressZip:t.addressZip,addressCity:t.addressCity,addressCountry:t.addressCountry,countryId:t.countryId,onAddressChange:d=>l("address",d),onZipChange:d=>l("addressZip",d),onCityChange:d=>l("addressCity",d),onCountryChange:(d,j)=>{l("countryId",d),l("addressCountry",j)}}),r.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:Object.keys(Ne).map(d=>{const j=Ne[d],E=A.has(d);return r.jsxs("button",{type:"button",onClick:()=>C(d),className:R("inline-flex cursor-pointer items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[11px] font-semibold transition-colors",E?"border-transparent":"border-ink-200 bg-white text-ink-400 hover:border-ink-300 hover:text-ink-600"),style:E?{backgroundColor:j.bg,color:j.color}:void 0,children:[r.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full",style:{backgroundColor:E?j.color:"#d1d5db"}}),Ut(d)]},d)})}),r.jsxs("label",{className:"mt-0.5 flex flex-col gap-1.5",children:[r.jsx(xe,{children:"Notizen"}),r.jsx("textarea",{value:t.notes,onChange:d=>l("notes",d.target.value),placeholder:"Notizen, Wünsche, Hinweise…",className:"min-h-[88px] w-full resize-y rounded-md border border-ink-200 bg-white px-3 py-2.5 text-sm text-ink-900 outline-none transition-colors focus-visible:border-brand-700 focus-visible:ring-[3px] focus-visible:ring-brand-700/8"})]})]})})}const Tr=u.forwardRef(function({emails:n},t){return n.length===0?r.jsxs("div",{ref:t,className:"flex h-[34px] items-center gap-1.5 rounded-[5px] border border-ink-200 bg-ink-50 px-[10px] text-[13px] cursor-default select-none",children:[r.jsx("span",{className:"flex-1 text-ink-300",children:"—"}),r.jsx(je,{size:11,strokeWidth:1.75,className:"shrink-0 text-ink-300"})]}):r.jsx("div",{ref:t,className:"flex flex-col gap-1",children:n.map(({id:a,email:s,isPrimary:o})=>r.jsxs("div",{className:"flex h-[34px] items-center gap-1.5 rounded-[5px] border border-ink-200 bg-ink-50 px-[10px] text-[13px] text-ink-700 cursor-default select-none",children:[r.jsx("span",{className:"flex-1 truncate",children:r.jsx(Bt,{email:s})}),o&&n.length>1&&r.jsx("span",{className:"shrink-0 rounded-[3px] border border-brand-200 bg-brand-50 px-[5px] py-px text-[9px] font-bold uppercase tracking-wide text-brand-700",children:"Primär"}),r.jsx(je,{size:11,strokeWidth:1.75,className:"shrink-0 text-ink-300"})]},a))})});export{Rr as A,er as B,sr as C,mr as E,Ye as F,dr as N,vt as P,pt as R,xt as T,Zt as U,or as a,O as b,Tr as c,ir as d,gt as e,xe as f,Ar as g,at as h,ln as i,Vt as j,bt as k,rr as l,tr as m,Ce as n,Pr as u};

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.