1import{v as x,t as Z,r as de,c as pe,w as j,h as he,S as me,H as ve,x as ge}from"./is-svg-component.DxvC2yLX.js";import{q as $,a4 as ee,w as te,a5 as ne,a6 as ie}from"./entry.client.js";import{Fragment as we}from"https://assets.finn.no/npm/react/v19/react.production.min.js";import"https://assets.finn.no/npm/react-dom/v19/react-dom.client.production.js";import"https://assets.finn.no/npm/react-dom/v19/react-dom.production.js";import"https://assets.finn.no/pkg/@warp-ds/react/v2/warp-react-19.js";import"https://assets.finn.no/pkg/@warp-ds/elements/v2/packages/toast/index.js";import"https://assets.finn.no/pkg/@finn-no/pulse-sdk/v0/client.esm.min.js";import"https://assets.finn.no/pkg/@warp-ds/elements/v2/packages/button/index.js";import"https://assets.finn.no/npm/lit/v3/lit.min.js";function re(e,t,n,i=0,r=1){const o=Array.from(e).sort((s,c)=>s.sortNodePosition(c)).indexOf(t),l=e.size,a=(l-1)*i;return typeof n=="function"?n(o,l):r===1?o*i:a-o*i}function G(e,t,n={}){const i=x(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(Z(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:s=0,staggerChildren:c,staggerDirection:d}=r;return Ae(e,t,u,s,c,d,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[u,s]=a==="beforeChildren"?[o,l]:[l,o];return u().then(()=>s())}else return Promise.all([o(),l(n.delay)])}function Ae(e,t,n=0,i=0,r=0,o=1,l){const a=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),a.push(G(u,t,{...l,delay:n+(typeof i=="function"?0:i)+re(e.variantChildren,u,i,r,o)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(a)}function be(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(o=>G(e,o,n));i=Promise.all(r)}else if(typeof t=="string")i=G(e,t,n);else{const r=typeof t=="function"?x(e,t,n.custom):t;i=Promise.all(Z(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const ye={y:!1};function Pe(){return ye.y}function oe(e,t){const n=de(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function Ce(e){return!(e.pointerType==="touch"||Pe())}function Ve(e,t,n={}){const[i,r,o]=oe(e,n);return i.forEach(l=>{let a=!1,u=!1,s;const c=()=>{l.removeEventListener("pointerleave",w)},d=A=>{s&&(s(A),s=void 0),c()},f=A=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,d(A))},h=()=>{a=!0,window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",f,r)},w=A=>{if(A.pointerType!=="touch"){if(a){u=!0;return}d(A)}},V=A=>{if(!Ce(A))return;u=!1;const b=t(l,A);typeof b=="function"&&(s=b,l.addEventListener("pointerleave",w,r))};l.addEventListener("pointerenter",V,r),l.addEventListener("pointerdown",h,r)}),o}const se=(e,t)=>t?e===t?!0:se(e,t.parentElement):!1,Se=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,xe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Te(e){return xe.has(e.tagName)||e.isContentEditable===!0}const I=new WeakSet;function z(e){return t=>{t.key==="Enter"&&e(t)}}function H(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ee=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=z(()=>{if(I.has(n))return;H(n,"down");const r=z(()=>{H(n,"up")}),o=()=>H(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function X(e){return Se(e)&&!0}const _=new WeakSet;function Le(e,t,n={}){const[i,r,o]=oe(e,n),l=a=>{const u=a.currentTarget;if(!X(a)||_.has(a))return;I.add(u),n.stopPropagation&&_.add(a);const s=t(u,a),c=(h,w)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),I.has(u)&&I.delete(u),X(h)&&typeof s=="function"&&s(h,{success:w})},d=h=>{c(h,u===window||u===document||n.useGlobalTarget||se(u,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};
1return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",l,r),pe(a)&&(a.addEventListener("focus",s=>Ee(s,r)),!Te(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}class T{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Oe=ee.length;function ae(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ae(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Oe;n++){const i=ee[n],r=e.props[i];($(r)||r===!1)&&(t[i]=r)}return t}function ce(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const Ie=[...ne].reverse(),ke=ne.length;function Fe(e){return t=>Promise.all(t.map(({animation:n,options:i})=>be(e,n,i)))}function De(e){let t=Fe(e),n=q(),i=!0,r=!1;const o=s=>(c,d)=>{const f=x(e,d,s==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:h,transitionEnd:w,...V}=f;c={...c,...V,...w}}return c};function l(s){t=s(e)}function a(s){const{props:c}=e,d=ae(e.parent)||{},f=[],h=new Set;let w={},V=1/0;for(let b=0;b<ke;b++){const p=Ie[b],m=n[p],g=c[p]!==void 0?c[p]:d[p],k=$(g),L=p===s?m.isActive:null;L===!1&&(V=b);let O=g===d[p]&&g!==c[p]&&k;if(O&&(i||r)&&e.manuallyAnimateOnMount&&(O=!1),m.protectedKeys={...w},!m.isActive&&L===null||!g&&!m.prevProp||te(g)||typeof g=="boolean")continue;if(p==="exit"&&m.isActive&&L!==!0){m.prevResolvedValues&&(w={...w,...m.prevResolvedValues});continue}const F=He(m.prevProp,g);let D=F||p===s&&m.isActive&&!O&&k||b>V&&k,M=!1;const N=Array.isArray(g)?g:[g];let E=N.reduce(o(p),{});L===!1&&(E={});const{prevResolvedValues:B={}}=m,le={...B,...E},U=v=>{D=!0,h.has(v)&&(M=!0,h.delete(v)),m.needsAnimating[v]=!0;const y=e.getValue(v);y&&(y.liveStyle=!1)};for(const v in le){const y=E[v],P=B[v];if(w.hasOwnProperty(v))continue;let S=!1;j(y)&&j(P)?S=!ce(y,P)||F:S=y!==P,S?y!=null?U(v):h.add(v):y!==void 0&&h.has(v)?U(v):m.protectedKeys[v]=!0}m.prevProp=g,m.prevResolvedValues=E,m.isActive&&(w={...w,...E}),(i||r)&&e.blockInitialAnimation&&(D=!1);const W=O&&F;D&&(!W||M)&&f.push(...N.map(v=>{const y={type:p};if(typeof v=="string"&&(i||r)&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:P}=e,S=x(P,v);if(P.enteringChildren&&S){const{delayChildren:fe}=S.transition||{};y.delay=re(P.enteringChildren,e,fe)}}return{animation:v,options:y}}))}if(h.size){const b={};if(typeof c.initial!="boolean"){const p=x(e,Array.isArray(c.initial)?c.initial[0]:c.initial);p&&p.transition&&(b.transition=p.transition)}h.forEach(p=>{const m=e.getBaseTarget(p),g=e.getValue(p);g&&(g.liveStyle=!0),b[p]=m??null}),f.push({animation:b})}let A=!!f.length;return i&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(A=!1),i=!1,r=!1,A?t(f):Prom
1ise.resolve()}function u(s,c){if(n[s].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(s,c)),n[s].isActive=c;const d=a(s);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:a,setActive:u,setAnimateFunction:l,getState:()=>n,reset:()=>{n=q(),r=!0}}}function He(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ce(t,e):!1}function C(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function q(){return{animate:C(!0),whileInView:C(),whileHover:C(),whileTap:C(),whileDrag:C(),whileFocus:C(),exit:C()}}function J(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const Re=(e,t)=>t.isSVG??he(e)?new me(t):new ve(t,{allowProjection:e!==we});class Ge extends T{constructor(t){super(t),t.animationState||(t.animationState=De(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();te(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Ke=0;class Me extends T{constructor(){super(...arguments),this.id=Ke++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const a=x(this.node,o,l);if(a){const{transition:u,transitionEnd:s,...c}=a;for(const d in c)this.node.getValue(d)?.jump(c[d])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Ne={animation:{Feature:Ge},exit:{Feature:Me}};function ue(e){return{point:{x:e.pageX,y:e.pageY}}}function Y(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&ie.postRender(()=>o(t,ue(t)))}class Be extends T{mount(){const{current:t}=this.node;t&&(this.unmount=Ve(t,(n,i)=>(Y(this.node,i,"Start"),r=>Y(this.node,r,"End"))))}unmount(){}}class Ue extends T{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ge(J(this.node.current,"focus",()=>this.onFocus()),J(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Q(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&ie.postRender(()=>o(t,ue(t)))}class We extends T{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=Le(t,(r,o)=>(Q(this.node,o,"Start"),(l,{success:a})=>Q(this.node,l,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const K=new WeakMap,R=new WeakMap,je=e=>{const t=K.get(e.target);t&&t(e)},ze=e=>{e.forEach(je)};function Xe({root:e,...t}){const n=e||document;R.has(n)||R.set(n,{});const i=R.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(ze,{root:e,...t})),i[r]}function _e(e,t,n){const i=Xe(t);return K.set(e,n),i.observe(e),()=>{K.delete(e),i.unobserve(e)}}const qe={some:0,all:1};class Je extends T{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=t,l={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:qe[r]},a=u=>{const{isIntersecting:s}=u;if(this.isInView===s||(this.isInView=s,o&&!s&&this.hasEnteredView))return;s&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",s);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=s?c:d;f&&f(u)};this.stopObserver=_e(this.node.current,l,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ye(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Ye({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Qe={inView:{Feature:Je},tap:{Feature:We},focus:{Feature:Ue},hover:{Feature:Be}},ut={renderer:Re,...Ne,...Qe};export{ut as domAnimation};
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.