You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.1 KiB

const t=new Map,e="#05c9ac";function n(n){const i=function(t){if(!t||"string"!=typeof t)return e;let n=t.trim();if(n.startsWith("#")||(n=`#${n}`),/^#[0-9A-Fa-f]{6}$/.test(n))return n;if(/^#[0-9A-Fa-f]{3}$/.test(n)){const t=n[1],e=n[2],i=n[3];return`#${t}${t}${e}${e}${i}${i}`}return e}(n||"");if(t.has(i))return t.get(i);if("undefined"==typeof document)return t.set(i,""),"";const r=document.createElement("canvas");r.width=48,r.height=56;const s=r.getContext("2d");if(!s)return t.set(i,""),"";const a=24;s.clearRect(0,0,48,56),s.beginPath(),s.arc(a,18,14,0,2*Math.PI),s.fillStyle="#ffffff",s.fill(),s.beginPath(),s.arc(a,18,12,0,2*Math.PI),s.fillStyle=i,s.fill(),s.beginPath(),s.moveTo(16,28),s.lineTo(a,50),s.lineTo(32,28),s.closePath(),s.fillStyle=i,s.fill(),s.beginPath(),s.arc(21,15,3,0,2*Math.PI),s.fillStyle="rgba(255,255,255,0.35)",s.fill();const o=r.toDataURL("image/png");return t.set(i,o),o}const i={width:18,height:Math.round(3240/119)},r={width:36,height:Math.round(9072/246)},s="#df3c12",a="#027fb8";function o(t){var e;if(!t)return t;if(/^https?:\/\//i.test(t))return t;if("undefined"!=typeof window&&(null==(e=window.location)?void 0:e.origin)){const e=t.startsWith("/")?t:`/${t}`;return`${window.location.origin}${e}`}return t}function f(t){if(!t||"string"!=typeof t)return null;let e=t.trim();e.startsWith("#")||(e=`#${e}`);const n=e.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!n)return null;let i=n[1];return 3===i.length&&(i=`${i[0]}${i[0]}${i[1]}${i[1]}${i[2]}${i[2]}`),i.toLowerCase()}const l={"32a04f":"/h5/assets/map_sel_32a04f-BbLt51ij.png","2d7eee":"/h5/assets/map_sel_2d7eee-BCkL_m7Y.png",efab0e:"/h5/assets/map_sel_efab0e-B25DGhbB.png","8450e7":"/h5/assets/map_sel_8450e7-CoEr-QsC.png",eb5137:"/h5/assets/map_sel_eb5137-BGgN2gfO.png"};function c(){return o("/h5/assets/map_cur-l874x3m8.png")}function u(t,e){const n=t.venue_type_color;return n&&"string"==typeof n&&f(n.trim())?n.trim():e()}function h(t){const e=f(t??"");if(e){const t=function(t){const e=l[t];return e?o(e):null}(e);if(t)return t}const i=n(t);return i||c()}function g(t){return"paid"===t?s:a}export{r as M,i as a,c as b,g as c,h as m,u as t};