@1interface/widgets 0.2.0-pipecat.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{jsxs as o,jsx as e}from"react/jsx-runtime";import{l as r,c as t,a as n}from"./index-DvAx4AnX.js";import{useState as a,useCallback as i}from"react";function l(o){return o.long??o.lng??0}function c({title:r,subtitle:t,directionsUrl:a,actions:i,children:l}){const{tokens:c}=n();return o("div",{style:{width:300,padding:"8px 16px 8px 16px",boxSizing:"border-box"},children:[e("strong",{style:{display:"block",marginBottom:4,fontSize:13,color:c.color.text,fontFamily:c.font.family},children:r}),l,t&&e("span",{style:{display:"block",fontSize:12,color:c.color.textMuted,marginTop:2,fontFamily:c.font.family},children:t}),a&&e("a",{href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"block",marginTop:6,color:c.color.primary.solid,fontSize:13,textDecoration:"none",fontFamily:c.font.family},children:"Get Directions →"}),i?.map((o,r)=>{const t="danger"===o.color;return e("button",{onClick:o.onClick,style:{marginTop:0===r?8:4,whiteSpace:"normal",height:"auto",minHeight:26,paddingBlock:6,paddingInline:8,width:"100%",border:"none",borderRadius:6,cursor:"pointer",fontSize:13,fontWeight:500,background:t?c.color.danger.solid:c.color.primary.solid,color:t?c.color.danger.text:c.color.primary.text,fontFamily:c.font.family},children:o.label},r)})]})}function s({label:o,lat:n,lng:a,replyAction:i}){const l=function(o,e,n){const a=r();return t().getDirectionsUrl({lat:o,lng:e},n,a??void 0)}(n,a,o),s=i?[{label:i.buttonLabel,onClick:i.onReply}]:void 0;return e(c,{title:o||`${n.toFixed(4)}, ${a.toFixed(4)}`,subtitle:o?`${n.toFixed(4)}, ${a.toFixed(4)}`:void 0,directionsUrl:l,actions:s})}function d({name:o,description:r}){return e(c,{title:o,subtitle:r})}function p({adapter:o}){const[e,r]=a(!1),[t,n]=a(null),l=i((e,r)=>{o.flyTo(e,r,13)},[o]);return{isSearching:e,searchMarker:t,handleSearch:i(async e=>{r(!0);try{return await o.search(e)}finally{r(!1)}},[o]),handleSearchSelect:i(async e=>{const r=await o.resolveSearchResult(e);r&&(n(r),l(r.lat,r.lng))},[o,l]),focusMarker:l}}function m(o){const e=[],r=[],t=[],n=[];for(const a of o)switch(a.type){case"MapMarker":e.push(a);break;case"MapPolyline":r.push(a);break;case"MapCircle":t.push(a);break;case"MapPolygon":n.push(a)}return{markers:e,polylines:r,circles:t,polygons:n}}const u={primary:{name:"blue",hex:"#4285F4",border:"#1a73e8"},search:{name:"violet",hex:"#A142F4",border:"#8430ce"}},f="https://unpkg.com/leaflet@1.9.4/dist/images",h={defaultIcon:`${f}/marker-icon.png`,defaultIcon2x:`${f}/marker-icon-2x.png`,shadow:`${f}/marker-shadow.png`,colored:o=>`https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-${o}.png`};export{s as D,h as L,u as M,c as P,d as S,l as g,m as p,p as u};
1
+ import{jsxs as o,jsx as e}from"react/jsx-runtime";import{l as r,c as t,a as n}from"./index-D7tB4pMK.js";import{useState as a,useCallback as i}from"react";function l(o){return o.long??o.lng??0}function c({title:r,subtitle:t,directionsUrl:a,actions:i,children:l}){const{tokens:c}=n();return o("div",{style:{width:300,padding:"8px 16px 8px 16px",boxSizing:"border-box"},children:[e("strong",{style:{display:"block",marginBottom:4,fontSize:13,color:c.color.text,fontFamily:c.font.family},children:r}),l,t&&e("span",{style:{display:"block",fontSize:12,color:c.color.textMuted,marginTop:2,fontFamily:c.font.family},children:t}),a&&e("a",{href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"block",marginTop:6,color:c.color.primary.solid,fontSize:13,textDecoration:"none",fontFamily:c.font.family},children:"Get Directions →"}),i?.map((o,r)=>{const t="danger"===o.color;return e("button",{onClick:o.onClick,style:{marginTop:0===r?8:4,whiteSpace:"normal",height:"auto",minHeight:26,paddingBlock:6,paddingInline:8,width:"100%",border:"none",borderRadius:6,cursor:"pointer",fontSize:13,fontWeight:500,background:t?c.color.danger.solid:c.color.primary.solid,color:t?c.color.danger.text:c.color.primary.text,fontFamily:c.font.family},children:o.label},r)})]})}function s({label:o,lat:n,lng:a,replyAction:i}){const l=function(o,e,n){const a=r();return t().getDirectionsUrl({lat:o,lng:e},n,a??void 0)}(n,a,o),s=i?[{label:i.buttonLabel,onClick:i.onReply}]:void 0;return e(c,{title:o||`${n.toFixed(4)}, ${a.toFixed(4)}`,subtitle:o?`${n.toFixed(4)}, ${a.toFixed(4)}`:void 0,directionsUrl:l,actions:s})}function d({name:o,description:r}){return e(c,{title:o,subtitle:r})}function p({adapter:o}){const[e,r]=a(!1),[t,n]=a(null),l=i((e,r)=>{o.flyTo(e,r,13)},[o]);return{isSearching:e,searchMarker:t,handleSearch:i(async e=>{r(!0);try{return await o.search(e)}finally{r(!1)}},[o]),handleSearchSelect:i(async e=>{const r=await o.resolveSearchResult(e);r&&(n(r),l(r.lat,r.lng))},[o,l]),focusMarker:l}}function m(o){const e=[],r=[],t=[],n=[];for(const a of o)switch(a.type){case"MapMarker":e.push(a);break;case"MapPolyline":r.push(a);break;case"MapCircle":t.push(a);break;case"MapPolygon":n.push(a)}return{markers:e,polylines:r,circles:t,polygons:n}}const u={primary:{name:"blue",hex:"#4285F4",border:"#1a73e8"},search:{name:"violet",hex:"#A142F4",border:"#8430ce"}},f="https://unpkg.com/leaflet@1.9.4/dist/images",h={defaultIcon:`${f}/marker-icon.png`,defaultIcon2x:`${f}/marker-icon-2x.png`,shadow:`${f}/marker-shadow.png`,colored:o=>`https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-${o}.png`};export{s as D,h as L,u as M,c as P,d as S,l as g,m as p,p as u};