1import{d as $,B as K,e as L,f as S,z as R,k as U,c,o as d,l as a,a as _,L as r,u as o,F as j,M as H,I as Z,w as q,a2 as J,E as Q}from"./runtime-dom.esm-bundler-DVhL8Vyv.js";import{_ as y,b as W}from"./ThankYouPage-C4ljj3w4.js";import{f as X,n as Y,m as ee,j as te}from"./widget-C6bCLy2c.js";import{L as ae,u as oe}from"./index-BILACs0e.js";import{u as se}from"./translationsStore-Crbl8s4V.js";import{_ as le}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./jquery-C7OTzgKr.js";const ie={class:"ccb-multiply-location"},ne={class:"ccb-multiply-location__input-wrapper"},ce={class:"label"},de={class:"ccb-multiply-location__description"},re={key:0},ue={key:1,class:"ccb-multiply-location__adressname"},pe={class:"ccb-location-modal"},me={class:"ccb-location-modal__body"},_e={class:"ccb-location-modal__sidebar"},ve={class:"ccb-location-modal__title"},fe={class:"ccb-location-modal__locations"},ge=["name","value","checked"],be={class:"ccb-radio-label"},ye=["id"],he={class:"ccb-location-modal__footer"},ke=$({__name:"MultiplyLocation",props:{field:{}},setup(C){const v=X(),N=Y(),i=se(),w=ee(),M=te(),x=C,{field:e}=K(x),f=L(),{getGoogleApiKey:F,mapOptions:T,generateId:B,parseLocationCoordinates:n,generateGoogleLink:V,getMeasure:I,getPickUpIconPath:h}=oe(),E=new ae({apiKey:F(),version:"weekly",libraries:["places","geometry"]});let k=B(4),g=L(!0);const z=()=>{f.value.showPopup()},u=()=>{f.value.hidePopup()};let p;const A=()=>{let t=e.value.multiplyLocations[0].coordinates;E.load().then(()=>{const l=document.getElementById(k);l&&(p=new google.maps.Map(l,{...T(),center:{...n(t)}}),P.value.forEach(s=>{let m={position:n(s.coordinates),map:p};h()&&(m.icon={url:h(),scaledSize:new google.maps.Size(40,40)}),new google.maps.Marker(m)}))})},D=()=>{let t=e.value.multiplyLocations[0].coordinates;e.value.selectedPoint={addressName:"",coordinates:t,label:""},g.value=!0,b(),u()},G=()=>{if(e.value.selectedPoint.addressName){g.value=!1;const t={addressName:e.value.selectedPoint.addressName,coordinates:n(e.value.selectedPoint.coordinates),addressLink:V(n(e.value.selectedPoint.coordinates)),measure:I()};e.value.userSelectedOptions=t,b(),u()}else u()},O=S(()=>{let t=e.value.selectedPoint.label||e.value.selectedPoint.addressName||"";return t.length>15?t.slice(0,25)+"...":t}),b=t=>{t&&t!==e.value.alias||(e.value.displayValue=O.value,v.updateField(e.value.alias,e.value),N.applyConditionForField(e.value.alias),v.getPageBreakEnabled&&v.getActivePage.action==="not_skip"&&M.checkPageFieldsConditions())};w.add("updateGeolocation",t=>{setTimeout(()=>{b(t)},100)});const P=S(()=>Array.isArray(e.value.multiplyLocations)?e.value.multiplyLocations:[]);return R(()=>e.value.selectedPoint,t=>{t&&t.coordinates&&(p.panTo(n(t.coordinates)),p.setZoom(15))},{deep:!0}),U(()=>{A()}),(t,l)=>(d(),c("div",ie,[a("div",ne,[a("button",{class:"ccb-multiply-location__action",onClick:z},[l[1]||(l[1]=a("span",{class:"icon"},[a("i",{class:"ccb-icon-location"})],-1)),a("span",ce,r(o(i).getTranslations.openMap),1)]),a("div",de,[o(e).selectedPoint.addressName?(d(),c("span",ue,r(o(e).selectedPoint.addressName),1)):(d(),c("span",re,r(o(i).getTranslations.chooseFromMap),1))])]),_(W,{ref_key:"popup",ref:f},{default:j(()=>[a("div",pe,[a("div",me,[a("div",_e,[a("div",ve,r(o(i).getTranslations.selectLocation),1),a("div",fe,[(d(!0),c(H,null,Z(P.value,s=>(d(),c("div",{key:s.addressName,class:"ccb-default-radio"},[a("label",null,[q(a("input",{"onUpdate:modelValue":l[0]||(l[0]=m=>o(e).selectedPoint=m),type:"radio",name:s.label,value:s,checked:o(e).selectedPoint.addressName===s.addressName},null,8,ge),[[J,o(e).selectedPoint]]),a("span",be,r(s.label.length?s.label:s.addressName),1)])]))),128))])]),a("div",{id:o(k),class:"ccb-location-modal__map"},null,8,ye)]),a("div",he,[_(y,{type:"light",text:o(i).getTranslations.clearLocation,class:Q(["clear",{disable:o(g)}]),onClick:D},null,8,["text","class"]),_(y,{type:"light",text:o(i).getTranslations.cancel,onClick:u},null,8,["text"]),_(y,{type:"success",text:o(i).getTranslations.saveLocation,onClick:G},null,8,["text"])])])]),_:1},512)]))}}),xe=le(ke,[["__scopeId","data-v-7454fa7b"]]);export{xe as default}; 2//# sourceMappingURL=MultiplyLocation-CGb2EzLq.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.