PageSourceSearch

https://app2.sked.life/assets/locations.page-BRXApTsf.js

js sked.life collected 2026-10-02 12:14:08 UTC 7,884 bytes, 1 lines download raw bytes

1import{e as te,r as d,R as D,u as ae,l as ne,a as G,i as ie,ad as w,ae as S,b as R,ac as K,b7 as le,c as W,j as e,G as oe,C as re,ak as de,H as U,ca as ce,P as he,bA as ue,cb as me,cc as pe,a2 as xe,n as Q,a9 as A,al as Z,af as je,f as T,a5 as Y,a6 as q,a8 as ge,aa as be,ab as fe,B as N,E as ve,ag as ye}from"./index-2k2e1F8S.js";import{E as Ce}from"./Edit-CnMlClWI.js";import{A as X}from"./Add-BvHB-VPL.js";import{c as J,t as P}from"./globals-DMMeoO0p.js";import{P as Le}from"./PageHeader.component-3dQc61hD.js";import{H as Ee}from"./HeaderTabs.component-CEAaAfJ_.js";import{T as Te,B as a}from"./TableContainer.component-DbVZvbOn.js";/* empty css                 */import{F as we}from"./FormGroup-DlXI3Nad.js";import{T as Se,a as m}from"./TableRow-B_Xdv0vT.js";import{T as ze}from"./Trash.icon-D3NE4Rsn.js";import"./InnerHeader.component-CIjmR-l0.js";import"./Card-sWLQbFU6.js";import"./KeyboardArrowDown-BHrHG3Mm.js";import"./RadioButtonUnchecked-ksLr7bc4.js";import"./PartialChecked.icon-Cg4BldBY.js";import"./Checkbox-CyLj9Qpv.js";import"./ChevronLeft-B5IBp7lf.js";import"./ChevronRight-D7JFQKUD.js";import"./SidebarFolders.component-Ckn5UdIy.js";import"./promise.hook-BeqSMSpU.js";import"./Delete-TmGf8XG4.js";import"./ListItem-Bbo2Atif.js";import"./join-l_emI_xZ.js";const x=Q(ye)({width:"100%",marginBottom:"10px"}),Ie=Q("div")({overflowX:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{height:"0px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"rgb(206, 206, 206)",borderRadius:"6px","&:hover":{backgroundColor:"gray",borderRadius:"6px"}},"&:hover":{"&::-webkit-scrollbar":{height:"3px",scrollbarWidth:"thin"}}}),V={type:"Address",street:"",street2:"",city:"",zipCode:"",state:""},_={type:"Form",id:0,name:"",phone:"",email:"",address:V},ke=({officeForm:c,officeAddressForm:l,admin:j,handleClickSave:z,edit:f=!1,removeLocation:v,business:I,businessAddress:y})=>
1{const[u,n]=d.useState(f),[i,g]=d.useState(_),[o,C]=d.useState(V);d.useEffect(()=>{u&&(g(c),C(l))},[u]);const b=s=>{g(N(i,s))},p=s=>{C(N(o,s))},k=()=>{g({...I,id:i.id,timezone:void 0}),C({...y,country:void 0,street2:""})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",justifyContent:u?"flex-end":"space-between"},children:[u?e.jsx(A,{variant:"contained",style:{marginBottom:"20px"},onClick:k,children:"Auto-fill from business page"}):e.jsx("p",{style:{marginLeft:"10px",marginBottom:"20px",color:"gray"},children:"The location name, phone number, and address are displayed in the app."}),e.jsxs("div",{className:"search",children:[!u&&e.jsx(Z,{style:{marginRight:"10px"},onClick:()=>n(!0),children:e.jsx(Ce,{})}),!u&&location&&e.jsx(Z,{style:{marginRight:"10px"},onClick:()=>{v()},children:e.jsx(ze,{})})]})]}),e.jsx(je,{style:{padding:"10px"},children:u?e.jsxs(we,{children:[e.jsx("legend",{style:{marginBottom:"10px"},children:"Edit Location Information"}),e.jsx(x,{value:i.name,onChange:s=>b({name:s.target.value}),placeholder:"Location Name",label:"Location Name"}),e.jsx(x,{value:i.email,onChange:s=>b({email:s.target.value}),placeholder:"Email",label:"Email"}),e.jsx(x,{value:i.phone,onChange:s=>b({phone:s.target.value}),placeholder:"Phone Number",label:"Phone Number"}),!T(o.country)&&e.jsxs(e.Fragment,{children:[e.jsx("label",{children:"Country:"}),e.jsx(Y,{style:{width:"100%"},value:w(S("value",o.country))(J),onChange:s=>p({country:s.target.value}),children:J.map(s=>e.jsx(q,{children:s.label},s.value))})]}),e.jsx("br",{}),j&&!T(i.timezone)&&e.jsxs("div",{children:[e.jsx("label",{children:"Timezone:"}),e.jsx(Y,{style:{zIndex:100},value:w(S("value",i.timezone))(P),onChange:s=>b({timezone:s.target.value}),children:P.filter(({country:s})=>s===o.country).map(s=>e.jsx(q,{children:s.label},s.value))}),e.jsx("br",{})]}),e.jsx(x,{onChange:s=>p({street:s.target.value}),value:o.street,placeholder:"Mailing Address",label:"Mailing Address"}),e.jsx(x,{onChange:s=>p({city:s.target.value}),value:o.city,placeholder:"City",label:"City"}),e.jsx(x,{onChange:s=>p({state:s.target.value}),value:o.state,placeholder:"State",label:"State"}),e.jsx(x,{onChange:s=>p({zipCode:s.target.value}),value:o.zipCode,placeholder:"Zip",label:"Zip"}),e.jsx("br",{}),e.jsx(ge,{}),e.jsx("br",{}),e.jsxs("div",{children:[e.jsx(A,{variant:"contained",disabled:R(N(ve("street2",o)),fe,be(W))(i),onClick:()=>{z(i,o),n(!1)},children:"Save"}),e.jsx(A,{onClick:()=>{n(!1),v&&i.id===0&&v(i.id)},variant:"outlined",style:{marginLeft:10},children:"Cancel"})]})]}):e.jsx(Te,{children:e.jsxs(Se,{children:[e.jsxs(m,{children:[e.jsx(a,{children:"Location Name"}),e.jsx(a,{children:c.name})]}),e.jsxs(m,{children:[e.jsx(a,{children:"Email"}),e.jsx(a,{children:c.email})]}),e.jsxs(m,{children:[e.jsx(a,{children:"Phone Number"}),e.jsx(a,{children:c.phone})]}),!T(l.country)&&e.jsxs(m,{children:[e.jsx(a,{children:"Country"}),e.jsx(a,{children:l.country})]}),e.jsxs(m,{children:[e.jsx(a,{children:"Mailing Address"}),e.jsx(a,{children:l.street})]}),e.jsxs(m,{children:[e.jsx(a,{children:"City"}),e.jsx(a,{children:l.city})]}),e.jsxs(m,{children:[e.jsx(a,{children:"State"}),e.jsx(a,{children:l.state})]}),e.jsxs(m,{children:[e.jsx(a,{children:"Zip"}),e.jsx(a,{children:l.zipCode})]}),!T(c.timezone)&&e.jsxs(m,{children:[e.jsx(a,{children:"Timezone"}),e.jsx(a,{children:R(w(S("value",c.timezone)),K(c.timezone,"label"))(P)})]})]})})})]})},ss=()=>{const c=te(),[l,j]=d.useState(null),[z,f]=d.useState(!1),[v,I]=d.useState(100),[y,u]=d.useState(480),n=D.useRef(null),i=ae(),{getUser:g,getOffice:o,patch:C,getLocations:b,saveLocation:p,removeLocation:k}=ne(xe,i),{office:s,officeAddress:M,admin:$,locations:r,features:F}=G(t=>({...t.login,...t.business})),ee=G(t=>t.business.busy),se=ie("Locations",F);d.useEffect(()=>{g(c),o(s.id,c),se&&b()},[]),d.useEffect(()=>{g(c),o(s.id,c)},[s]);const O=D.useMemo(()=>!!w(S("id",0),r),[r]);d.useEffect(()=>{if(z){const h=R(le,K(0,"id"))(r);j(h),f(!1)}else if(O)j(0);else if(!W(r)&&!l){const h=r[0].id||0;j(h)}let t=0;r.forEach(h=>{const E=(h.name?h.name.length:16)*7.36+14+14+2;t+=E}),I(t)},[r]),d.useEffect(()=>{l===0&&n.current&&(n.current.scrollLeft+=500)},[l]);const H=t=>{t.deltaY>0&&(n!=null&&n.current)?n.current.scrollLeft+=100:n.current.scrollLeft-=100};d.useEffect(()=>{var t;return(t=n.current)==null||t.addEventListener("wheel",H),()=>{var h;(h=n.current)==null||h.removeEventListener("wheel",H)}},[n==null?void 0:n.current]);const B=v+103+30+140+20;return e.jsxs(e.Fragment,{children:[e.jsx(Le,{title:"Locations",pageId:"locations",getW
1idth:u,leftIcons:[e.jsx(Ie,{ref:n,style:{maxWidth:y-103-30-40-45},children:e.jsx(Ee,{tabs:r.map(t=>({label:W(t.name)?"Unnamed Location":t.name,value:t.id})),value:l,setTab:j,isSmall:B>=y})},"tabs")],rightIcons:[e.jsx(oe,{display:"flex",marginRight:"5px",children:ee&&e.jsx(re,{size:18})},"loading"),O?e.jsx(de,{title:"Save or delete the new location before adding another!",placement:"bottom",arrow:!0,children:e.jsx("div",{children:e.jsx(U,{title:"New Location",Icon:X,onlyIcon:B>=y,disabled:!0})})}):e.jsx(U,{title:"New Location",Icon:X,onClick:()=>{C({locations:ce(_,r)})}})],onlyIconsWidth:B}),e.jsxs("div",{style:{padding:20,overflowY:"auto"},children:[e.jsx(he,{}),r.map((t,h)=>e.jsx("div",{hidden:l!==t.id,children:e.jsx(ke,{officeForm:t,officeAddressForm:t.address,admin:$,handleClickSave:(L,E)=>{f(L.id===0),p(h,M.country,{...L,address:E})},edit:t.id===0,removeLocation:()=>{ue("Remove location",r.length===1?"Are you sure you want to remove this location? Doing so will default all existing professionals and hours to the business page information. If you make a new location, you will need to manually add those professionals or hours to it. This action cannot be undone!":"This action cannot be undone!",()=>{k(t.id,h),f(!0),r.length===1&&me(r[0].id).then(()=>{i(pe("Professionals, office hours, and special hours updated!"))})},"danger")},business:s,businessAddress:M},t.id)},t.id))]})]})};export{ss as default};

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.