Sid Gifari File Manager
🏠 Root
/
home2
/
meumer25
/
www
/
wp-content
/
plugins
/
all-in-one-seo-pack
/
dist
/
Lite
/
assets
/
locationmap
/
Editing: main.fb15c115.js
import{h as J,m as N,r as K}from"../js/utils.6d965f64.js";import{c as U}from"../js/runtime-dom.esm-bundler.dc49ee3e.js";import{o as $}from"../js/helpers.633a054c.js";import{l as D}from"../js/index.20093c86.js";import{u as Z,a as A,e as X}from"../js/index.317ad629.js";import{B as Y}from"../js/Input.f04bee4d.js";import{B as ee}from"../js/Select.69906a74.js";import{B as te}from"../js/Toggle.11571651.js";import{C as oe}from"../js/ImageUploader.81dc4a47.js";import"../js/translations.e71e2202.js";import{_ as ne}from"../js/_plugin-vue_export-helper.eefbdd86.js";import{_ as l,a as I}from"../js/default-i18n.65d58dd6.js";import{a6 as k,o as B,c as V,_ as u,$ as b,l as S,a4 as x,a2 as z,a7 as W,h as q}from"../js/runtime-core.esm-bundler.ce5add0b.js";import"../js/Index.2a391835.js";import"../js/Close.ccd53ef3.js";import"../js/Pencil.d82df6a1.js";import"../js/Trash.87a7d946.js";import"../js/Caret.cd869c5d.js";import"../js/Button.9a301412.js";import"../js/Img.4d5c45cc.js";import"../js/Plus.c9b03af8.js";const se=J` <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M11 11.14L9.83 5.2C9.04 4.77 8.5 3.95 8.5 3C8.5 1.62 9.62 0.499999 11 0.499999C12.38 0.499999 13.5 1.62 13.5 3C13.5 3.95 12.96 4.77 12.17 5.2L11 11.14ZM11 1.5C10.17 1.5 9.5 2.17 9.5 3C9.5 3.83 10.17 4.5 11 4.5C11.83 4.5 12.5 3.83 12.5 3C12.5 2.17 11.83 1.5 11 1.5ZM12.72 6.3L11 13.68L9.27 6.38L5 4.97L2.98023e-08 6.97V15.97L5 13.97L11.12 16L16 13.97V4.97L12.72 6.3Z" fill="black"/> </svg> `,ae="https://schemas.wp.org/wp/5.8/block.json",ie="aioseo/locationmap",le="AIOSEO Local - Map",re="Displays a location map.",ce="aioseo",ue="all-in-one-seo-pack",de={locationId:{type:"number",default:0},showLabel:{type:"boolean",default:!0},showIcon:{type:"boolean",default:!0},customMarker:{type:"string",default:null},width:{type:"string",default:"100%"},height:{type:"string",default:"450px"},label:{type:"string",default:null},dataObject:{type:"string",default:null},updated:{type:"string",default:null}},pe={html:!1},me={$schema:ae,name:ie,title:le,description:re,category:ce,textdomain:ue,attributes:de,supports:pe};function fe(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function ge(e){let t="";const n=Object.entries(e);let r;for(;r=n.shift();){let[s,a]=r;if(Array.isArray(a)||a&&a.constructor===Object){const p=Object.entries(a).reverse();for(const[d,w]of p)n.unshift([`${s}[${d}]`,w])}else a!==void 0&&(a===null&&(a=""),t+="&"+[s,a].map(encodeURIComponent).join("="))}return t.substr(1)}function he(e){try{return decodeURIComponent(e)}catch{return e}}function be(e,t,n){const r=t.length,s=r-1;for(let a=0;a<r;a++){let o=t[a];!o&&Array.isArray(e)&&(o=e.length.toString()),o=["__proto__","constructor","prototype"].includes(o)?o.toUpperCase():o;const p=!isNaN(Number(t[a+1]));e[o]=a===s?n:e[o]||(p?[]:{}),Array.isArray(e[o])&&!p&&(e[o]={...e[o]}),e=e[o]}}function ye(e){return(fe(e)||"").replace(/\+/g,"%20").split("&").reduce((t,n)=>{const[r,s=""]=n.split("=").filter(Boolean).map(he);if(r){const a=r.replace(/\]/g,"").split("[");be(t,a,s)}return t},Object.create(null))}function we(e="",t){if(!t||!Object.keys(t).length)return e;let n=e;const r=e.indexOf("?");return r!==-1&&(t=Object.assign(ye(e),t),n=n.substr(0,r)),n+"?"+ge(t)}const f="all-in-one-seo-pack",ve={setup(){return{postEditorStore:Z(),rootStore:A()}},components:{BaseInput:Y,BaseSelect:ee,BaseToggle:te,CoreImageUploader:oe},data(){return{locationsList:[],strings:{selectLocation:this.rootStore.aioseo.localBusiness.postTypeSingleLabel,showLabel:l("Show label",f),showIcon:l("Show icon",f),businessInfo:l("Business Info",f),mapDisplay:l("Map Display",f),width:l("Width",f),height:l("Height",f),customMarker:l("Custom Marker",f),minimumSize:I(l("%1$sThe custom marker should be: 100x100 px.%2$s If the image exceeds those dimensions it could (partially) cover the info popup.",f),"<strong>","</strong>"),label:l("Label",f)}}},methods:{getLocationOptions(e){let t=this.locationsList.find(n=>n.value===e);return!t&&!this.isLocationPostType()&&(t=this.locationsList.find(n=>!!n),t&&(this.$root.$data.locationId=t.value)),t},isLocationPostType(){return this.postEditorStore.currentPost.postType===this.rootStore.aioseo.localBusiness.postTypeName}},created(){this.$root.$data.locations&&this.$root.$data.locations.forEach(e=>{this.locationsList.push({value:e.id,label:e.title.rendered})})}},Se={class:"aioseo-location-map-sidebar"},$e={key:0,class:"sidebar-row"},_e={class:"title"},Le={class:"sidebar-row"},ke={class:"sidebar-row"},Ee={class:"sidebar-row"},Ie={class:"title"},Re={class:"sidebar-row"},Be={class:"title"},Ve={class:"sidebar-row dimensions"},Ce={key:1,class:"sidebar-row labels"},Oe={class:"title"};function Ae(e,t,n,r,s,a){const o=k("base-select"),p=k("base-toggle"),d=k("core-image-uploader"),w=k("base-input");return B(),V("div",Se,[s.locationsList.length&&!a.isLocationPostType()?(B(),V("div",$e,[u("p",_e,b(s.strings.selectLocation),1),S(o,{size:"medium",options:s.locationsList,modelValue:a.getLocationOptions(e.$root.$data.locationId),"onUpdate:modelValue":t[0]||(t[0]=c=>e.$root.$data.locationId=c.value),"track-by":"value"},null,8,["options","modelValue"])])):x("",!0),u("div",Le,[S(p,{modelValue:e.$root.$data.showLabel,"onUpdate:modelValue":t[1]||(t[1]=c=>e.$root.$data.showLabel=c)},{default:z(()=>[W(b(s.strings.showLabel),1)]),_:1},8,["modelValue"])]),u("div",ke,[S(p,{modelValue:e.$root.$data.showIcon,"onUpdate:modelValue":t[2]||(t[2]=c=>e.$root.$data.showIcon=c)},{default:z(()=>[W(b(s.strings.showIcon),1)]),_:1},8,["modelValue"])]),u("div",Ee,[u("p",Ie,b(s.strings.customMarker),1),S(d,{class:"aioseo-image-uploader--no-icon","img-preview-max-width":"100px","img-preview-max-height":"100px","base-size":"small",description:s.strings.minimumSize,modelValue:e.$root.$data.customMarker,"onUpdate:modelValue":t[3]||(t[3]=c=>e.$root.$data.customMarker=c)},null,8,["description","modelValue"])]),u("div",Re,[u("p",Be,b(s.strings.mapDisplay),1)]),u("div",Ve,[u("div",null,[u("label",null,b(s.strings.width)+":",1),S(w,{size:"small",modelValue:e.$root.$data.width,"onUpdate:modelValue":t[4]||(t[4]=c=>e.$root.$data.width=c)},null,8,["modelValue"])]),u("div",null,[u("div",null,[u("label",null,b(s.strings.height)+":",1),S(w,{size:"small",modelValue:e.$root.$data.height,"onUpdate:modelValue":t[5]||(t[5]=c=>e.$root.$data.height=c)},null,8,["modelValue"])])])]),e.$root.$data.showLabel?(B(),V("div",Ce,[u("p",Oe,b(s.strings.label),1),S(w,{size:"small",modelValue:e.$root.$data.label,"onUpdate:modelValue":t[6]||(t[6]=c=>e.$root.$data.label=c)},null,8,["modelValue"])])):x("",!0)])}const Me=ne(ve,[["render",Ae]]),g="all-in-one-seo-pack",{name:H,title:Te,description:Pe,category:Ne,supports:Ue,attributes:De}=me,y=window.wp,xe=y.serverSideRender||y.components.ServerSideRender;var F;const C=((F=y.blockEditor)==null?void 0:F.InspectorControls)||y.editor.InspectorControls,O=y.components.PanelBody,ze=y.components.Disabled,We=y.data.withSelect,E={},j=[],Q=[],qe={title:Te,description:Pe,category:Ne,supports:Ue,attributes:De,icon:se,edit:We(function(e){const t=A();return{locations:e("core").getEntityRecords("postType",t.aioseo.localBusiness.postTypeName,{per_page:100})}})(function(e){var P;const t=A(),n=Z(),r=X(),s=(P=r.options.localBusiness)==null?void 0:P.locations.general.multiple,{setAttributes:a,attributes:o,className:p,clientId:d,isSelected:w,toggleSelection:c}=e;let{locations:v}=e;const h="aioseo-location-map-"+d,_=n.currentPost.postType===t.aioseo.localBusiness.postTypeName;if(o.label=o.label||l("Our location:",g),o.updated=o.updated||Date.now(),o.dataObject=o.dataObject||_?JSON.stringify(n.currentPost.local_seo.maps):null,s&&v===null)return React.createElement("div",null,l("Loading...",g));if(v=v===null?[]:v,!s&&o.locationId)return React.createElement("div",null,l("Please enable multiple locations before using this block.",g));if(s&&v.length===0)return React.createElement("div",null,I(l("No %1$s found",g),t.aioseo.localBusiness.postTypePluralLabel));o.locationId=!o.locationId&&_?n.currentPost.id:o.locationId;const R=v.find(i=>i.id===o.locationId),M=_?n.currentPost.local_seo.maps:R?R.maps:null,L={id:h,parent:document.querySelector(".block-editor"),subtree:!0,loop:!1,done:function(i){N(d,j);let m=U({name:"Blocks/LocationMap",data:function(){return E[d]},watch:{$data:{handler:function(G){a(G)},deep:!0}},render:()=>q(Me)});m=D(m),m.mount(i),j.push({id:d,app:m})}};if(w&&(E[d]={},Object.keys(o).forEach(function(i){E[d][i]=o[i]}),E[d].locations=v,$(L)),y.data.useSelect(i=>i("core/edit-post").getActiveGeneralSidebarName())==="edit-post/block"&&(typeof c!="function"||c(!0)),_&&$({id:h+"-watcher",parent:document.querySelector(".block-editor"),subtree:!0,done:function(i){N(d,Q);let m=U({name:"Blocks/LocationMapWatcher",data:function(){return n.currentPost.local_seo.maps},watch:{$data:{handler:function(){a({updated:Date.now()})},deep:!0}},render:()=>q("div")});m=D(m),m.mount(i),Q.push({id:d,app:m})}}),s){if(!o.locationId)return React.createElement(React.Fragment,null,React.createElement(C,null,React.createElement(O,{title:l("Block Settings",g),initialOpen:!0,onToggle:$(L)},React.createElement("div",{className:p,id:h}))),React.createElement("div",null,I(l("Select a %1$s",g),t.aioseo.localBusiness.postTypeSingleLabel)));if(!M){const i=we("post.php",{post:o.locationId,action:"edit"});return React.createElement(React.Fragment,null,React.createElement(C,null,React.createElement(O,{title:l("Block Settings",g),initialOpen:!0,onToggle:$(L)},React.createElement("div",{className:p,id:h}))),React.createElement("div",{dangerouslySetInnerHTML:{__html:I(l("Please configure the map for this location: %1$s",g),'<a href="'+i+'" target="_blank">'+R.title.rendered+"</a>")}}))}}const T="#"+h+"-preview .aioseo-local-map";return $({selector:T,parent:document.querySelector(".block-editor"),subtree:!0,done:function(){const i=M||r.options.localBusiness.maps;setTimeout(function(){document.dispatchEvent(new CustomEvent(t.aioseo.localBusiness.mapLoadEvent,{detail:{element:T,mapOptions:i.mapOptions,customMarker:o.customMarker||i.customMarker||r.options.localBusiness.maps.customMarker,instance:o,placeId:r.options.localBusiness.maps.mapsEmbedApiEnabled?i.placeId:null,infoWindowContent:i.infoWindowContent?i.infoWindowContent:null}}))},2e3)}}),React.createElement(React.Fragment,null,React.createElement(C,null,React.createElement(O,{title:l("Block Settings",g),initialOpen:!0,onToggle:$(L)},React.createElement("div",{className:p,id:h}))),React.createElement("div",null,React.createElement("div",{className:p,id:`${h}-preview`},React.createElement(ze,null,React.createElement(xe,{block:H,attributes:{...o}}))),React.createElement("div",{id:`${h}-watcher`})))}),save:function(){return null}};K({name:H,settings:qe});
Save
Cancel