1import{u as U,a as L}from"./index-Ip1PKFAA.js";import{n as y}from"./web-B2OvdsLH.js";import{l as R,e as E,z as b,C as P,g as m,h as x,o as O,D as k,k as F,v as D,S as A}from"./solid-BpgdPW70.js";import{r as S}from"./env-BM-k_jh9.js";import{C as N,p as q}from"./CompanyStylePresenter-BcJsWUZL.js";import{S as g}from"./SiteRoute-DQTWylGy.js";import{M as f}from"./magicUseCase-DJ1GqzWv.js";import{G as $,R as M,N as G}from"./magicRequest-DNGtzWi1.js";import{f as z,F as H}from"./fileGateway-B12TXxxV.js";import{f as K}from"./fullStackNetworkManager-Dsg3GDU7.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n.SENTRY_RELEASE={id:"882b069bf3d395a597ad23b0dfc21031695d97ee"};var t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="0805e38d-35c6-4625-a481-ff618c0800ae",n._sentryDebugIdIdentifier="sentry-dbid-0805e38d-35c6-4625-a481-ff618c0800ae")}catch{}})();function Y(n,t){let e,a=()=>!e||e.state==="unresolved"?void 0:e.latest;[e]=R(()=>V(n,E(()=>P(a),()=>{})),c=>c);const o=()=>e();return Object.defineProperty(o,"latest",{get(){return e.latest}}),o}class i{static all(){return new i}static allSettled(){return new i}static any(){return new i}static race(){return new i}static reject(){return new i}static resolve(){return new i}catch(){return new i}then(){return new i}finally(){return new i}}function V(n,t){if(!b.context)return n(t);const e=fetch,a=Promise;try{return window.fetch=()=>new i,Promise=i,n(t)}finally{window.fetch=e,Promise=a}}const I=x(),Z=["title","meta"],C=[],w=["name","http-equiv","content","charset","media"].concat(["property"]),v=(n,t)=>{const e=Object.fromEntries(Object.entries(n.props).filter(([a])=>t.includes(a)).sort());return(Object.hasOwn(e,"name")||Object.hasOwn(e,"property"))&&(e.name=e.name||e.property,delete e.property),n.tag+JSON.stringify(e)};function B(){if(!b.context){const e=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(e,a=>a.parentNode.removeChild(a))}const n=new Map;function t(e){if(e.ref)return e.ref;let a=document.querySelector(`[data-sm="${e.id}"]`);return a?(a.tagName.toLowerCase()!==e.tag&&(a.parentNode&&a.parentNode.removeChild(a),a=document.createElement(e.tag)),a.removeAttribute("data-sm")):a=document.createElement(e.tag),a}return{addTag(e){if(Z.indexOf(e.tag)!==-1){const c=e.tag==="title"?C:w,s=v(e,c);n.has(s)||n.set(s,[]);let r=n.get(s),l=r.length;r=[...r,e],n.set(s,r);let u=t(e);e.ref=u,y(u,e.props);let d=null;for(var a=l-1;a>=0;a--)if(r[a]!=null){d=r[a];break}return u.parentNode!=document.head&&document.head.appendChild(u),d&&d.ref&&d.ref.parentNode&&document.head.removeChild(d.ref),l}let o=t(e);return e.ref=o,y(o,e.props),o.parentNode!=document.head&&document.head.appendChild(o),-1},removeTag(e,a){const o=e.tag==="title"?C:w,c=v(e,o);if(e.ref){const s=n.get(c);if(s){if(e.ref.parentNode){e.ref.parentNode.removeChild(e.ref);for(let r=a-1;r>=0;r--)s[r]!=null&&document.head.appendChild(s[r].ref)}s[a]=null,n.set(c,s)}else e.ref.parentNode&&e.ref.parentNode.removeChild(e.ref)}}}}const ye=n=>{const t=B();return m(I.Provider,{value:t,get children(){return n.children}})},h=(n,t,e)=>(J({tag:n,props:t,setting:e,id:O(),get name(){return t.name||t.property}}),null);function J(n){const t=k(I);if(!t)throw new Error("<MetaProvider /> should be in the tree");F(()=>{const e=t.addTag(n);D(()=>t.removeTag(n,e))})}const Q=n=>h("style",n,{close:!0}),ge=n=>h("meta",n),Ce=n=>h("link",n),W="/api/companies/info",X=new Set(Object.values(N));class _ extends ${async getCompanyInfo(t){const e={url:`${W}?domain=${encodeURIComponent(t)}`,method:M.GET,headers:this.createCommonHeaders()},o=await(await this.sendRequest(e)).json();return this.toCompanyInfo(o)}toCompanyInfo(t){const e=t.settings;return{id:t.id,name:t.name,email:t.email,url:t.subUrl,language:t.language,phoneNumber:t.phoneNumber,timeZone:t.timeZoneInfo,theme:this.toTheme(e?.metadata?.theme),logo:this.toImageUrl(e?.logoPublicUrl),coverUrl:this.toImageUrl(e?.coverPublicUrl),iconUrl:this.toImageUrl(e?.iconPublicUrl),customDomain:t.customDomain,facebook:e?.socialLinks?.facebook,instagram:e?.socialLinks?.instagram,linkedIn:e?.socialLinks?.linkedIn,twitter:e?.socialLinks?.twitter,youtube:e?.socialLinks?.youTube,tikTok:e?.socialLinks?.tikTok,metadataTitle:e?.metadata?.title,metadataDescription:e?.metadata?.description,metadataThemeColor:e?.metadata?.themeColor,metadataTitleTemplate:e?.metadata?.titleTemplate,canReceiveRentalApplications:t.canReceiveRentalApplications,translationLanguages:e?.translationLanguages,leasingPhoneNumber:e?.contact?.phone,features:t.features,approvedLegalNames:t.approvedLegalNames}}toTheme(t){return t&&X.has(t)?t:N.Blue}toImageUrl(t){return t?z.getFileService().buildUrlFromDescriptor(t,H.Original):void 0}}const j=new _(K);var T=(n=>(n.CentralizedPayments="centralizedPayments",n))(T||{}),p=(n=>(n.Portal="portal",n.Pay="pay",n))(p||{});class ee extends f{async runLogic(){const t=this.getState().user.companyInfo?.features??[];
1this.getState().user.paymentMode=t.includes(T.CentralizedPayments)?p.Pay:p.Portal}}class te extends f{async runLogic(t){const e=this.getState().user;if(!(e.domain===t.hostname&&(e.companyInfo||e.isCompanyNotFound))){this.getState().user.domain=t.hostname;try{const a=await j.getCompanyInfo(t.hostname);this.getState().user.companyInfo=a,this.getState().user.isCompanyNotFound=!1}catch(a){if(!(a instanceof G))throw a;this.getState().user.companyInfo=void 0,this.getState().user.isCompanyNotFound=!0}await new ee().execute()}}}class ne extends f{async runLogic({host:t,pageUrl:e,isDev:a}){await new te().execute(t);const{domain:o,companyInfo:c,isCompanyNotFound:s}=this.getState().user,r=e?new URL(e):void 0;if(s){r?.pathname!==g.CompanyNotFound&&this.navigate(g.CompanyNotFound);return}const l=c?.customDomain;a||!r||!l||o===l||(r.hostname=l,r.protocol="https:",r.port="",this.navigate(r.toString()))}}const ae=()=>{},re=()=>{const n=ae();if(n)return{hostname:n.hostname,path:n.pathname};const t=new URL(S.pageUrl()??"");return{hostname:t.hostname,path:t.pathname}},oe=()=>{const{model:n}=U(q);return{companyStyling:n}},we=n=>{const{execute:t}=L(ne),e=Y(()=>t({host:re(),pageUrl:S.pageUrl(),isDev:!1}).then(()=>!0)),{companyStyling:a}=oe();return[m(Q,{get children(){return` 2 :root { 3 --primary-color: ${a()?.primaryColor}; 4 --hover-color: ${a()?.hoverColor}; 5 --active-color: ${a()?.activeColor}; 6 --gradient-color-start: ${a()?.gradientStartColor}; 7 --gradient-color-end: ${a()?.gradientEndColor}; 8 } 9 `}}),m(A,{get when(){return e()},get children(){return n.children}})]};export{we as C,Ce as L,ge as M,te as a,ye as b,Y as c,ae as d,re as g,oe as u}; 10//# sourceMappingURL=CompanyStyling-bkQ_lFd1.js.map
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.