index.0a0d8921.js 7.5 KB

1
  1. import{d as P,b as q,P as D}from"./vendor.f8cdf923.js";var C={},R=i=>encodeURIComponent(i).replace(/[!'()*]/g,s=>`%${s.charCodeAt(0).toString(16).toUpperCase()}`),E="%[a-f0-9]{2}",A=new RegExp(E,"gi"),x=new RegExp("("+E+")+","gi");function p(i,s){try{return decodeURIComponent(i.join(""))}catch{}if(i.length===1)return i;s=s||1;var d=i.slice(0,s),l=i.slice(s);return Array.prototype.concat.call([],p(d),p(l))}function H(i){try{return decodeURIComponent(i)}catch{for(var s=i.match(A),d=1;d<s.length;d++)i=p(s,d).join(""),s=i.match(A);return i}}function L(i){for(var s={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},d=x.exec(i);d;){try{s[d[0]]=decodeURIComponent(d[0])}catch{var l=H(d[0]);l!==d[0]&&(s[d[0]]=l)}d=x.exec(i)}s["%C2"]="\uFFFD";for(var g=Object.keys(s),m=0;m<g.length;m++){var h=g[m];i=i.replace(new RegExp(h,"g"),s[h])}return i}var B=function(i){if(typeof i!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof i+"`");try{return i=i.replace(/\+/g," "),decodeURIComponent(i)}catch{return L(i)}},T=(i,s)=>{if(!(typeof i=="string"&&typeof s=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(s==="")return[i];const d=i.indexOf(s);return d===-1?[i]:[i.slice(0,d),i.slice(d+s.length)]},M=function(i,s){for(var d={},l=Object.keys(i),g=Array.isArray(s),m=0;m<l.length;m++){var h=l[m],F=i[h];(g?s.indexOf(h)!==-1:s(h,F,i))&&(d[h]=F)}return d};(function(i){const s=R,d=B,l=T,g=M,m=r=>r==null,h=Symbol("encodeFragmentIdentifier");function F(r){switch(r.arrayFormat){case"index":return e=>(n,t)=>{const a=n.length;return t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,[o(e,r),"[",a,"]"].join("")]:[...n,[o(e,r),"[",o(a,r),"]=",o(t,r)].join("")]};case"bracket":return e=>(n,t)=>t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,[o(e,r),"[]"].join("")]:[...n,[o(e,r),"[]=",o(t,r)].join("")];case"colon-list-separator":return e=>(n,t)=>t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,[o(e,r),":list="].join("")]:[...n,[o(e,r),":list=",o(t,r)].join("")];case"comma":case"separator":case"bracket-separator":{const e=r.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(t,a)=>a===void 0||r.skipNull&&a===null||r.skipEmptyString&&a===""?t:(a=a===null?"":a,t.length===0?[[o(n,r),e,o(a,r)].join("")]:[[t,o(a,r)].join(r.arrayFormatSeparator)])}default:return e=>(n,t)=>t===void 0||r.skipNull&&t===null||r.skipEmptyString&&t===""?n:t===null?[...n,o(e,r)]:[...n,[o(e,r),"=",o(t,r)].join("")]}}function U(r){let e;switch(r.arrayFormat){case"index":return(n,t,a)=>{if(e=/\[(\d*)\]$/.exec(n),n=n.replace(/\[\d*\]$/,""),!e){a[n]=t;return}a[n]===void 0&&(a[n]={}),a[n][e[1]]=t};case"bracket":return(n,t,a)=>{if(e=/(\[\])$/.exec(n),n=n.replace(/\[\]$/,""),!e){a[n]=t;return}if(a[n]===void 0){a[n]=[t];return}a[n]=[].concat(a[n],t)};case"colon-list-separator":return(n,t,a)=>{if(e=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!e){a[n]=t;return}if(a[n]===void 0){a[n]=[t];return}a[n]=[].concat(a[n],t)};case"comma":case"separator":return(n,t,a)=>{const f=typeof t=="string"&&t.includes(r.arrayFormatSeparator),c=typeof t=="string"&&!f&&y(t,r).includes(r.arrayFormatSeparator);t=c?y(t,r):t;const u=f||c?t.split(r.arrayFormatSeparator).map(V=>y(V,r)):t===null?t:y(t,r);a[n]=u};case"bracket-separator":return(n,t,a)=>{const f=/(\[\])$/.test(n);if(n=n.replace(/\[\]$/,""),!f){a[n]=t&&y(t,r);return}const c=t===null?[]:t.split(r.arrayFormatSeparator).map(u=>y(u,r));if(a[n]===void 0){a[n]=c;return}a[n]=[].concat(a[n],c)};default:return(n,t,a)=>{if(a[n]===void 0){a[n]=t;return}a[n]=[].concat(a[n],t)}}}function w(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function o(r,e){return e.encode?e.strict?s(r):encodeURIComponent(r):r}function y(r,e){return e.decode?d(r):r}function b(r){return Array.isArray(r)?r.sort():typeof r=="object"?b(Object.keys(r)).sort((e,n)=>Number(e)-Number(n)).map(e=>r[e]):r}function S(r){const e=r.indexOf("#");return e!==-1&&(r=r.slice(0,e)),r}function I(r){let e="";const n=r.indexOf("#");return n!==-1&&(e=r.slice(n)),e}function O(r){r=S(r);const e=r.indexOf("?");return e===-1?"":r.slice(e+1)}function $(r,e){return e.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?r=Number(r):e.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")&&(r=r.toLowerCase()==="true"),r}function j(r,e){e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e),w(e.arrayFormatSeparator);const n=U(e),t=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return t;for(const a of r.split("&")){if(a==="")continue;let[f,c]=l(e.decode?a.replace(/\+/g," "):a,"=");c=c===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?c:y(c,e),n(y(f,e),c,t)}for(const a of Object.keys(t)){const f=t[a];if(typeof f=="object"&&f!==null)for(const c of Object.keys(f))f[c]=$(f[c],e);else t[a]=$(f,e)}return e.sort===!1?t:(e.sort===!0?Object.keys(t).sort():Object.keys(t).sort(e.sort)).reduce((a,f)=>{const c=t[f];return Boolean(c)&&typeof c=="object"&&!Array.isArray(c)?a[f]=b(c):a[f]=c,a},Object.create(null))}i.extract=O,i.parse=j,i.stringify=(r,e)=>{if(!r)return"";e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e),w(e.arrayFormatSeparator);const n=c=>e.skipNull&&m(r[c])||e.skipEmptyString&&r[c]==="",t=F(e),a={};for(const c of Object.keys(r))n(c)||(a[c]=r[c]);const f=Object.keys(a);return e.sort!==!1&&f.sort(e.sort),f.map(c=>{const u=r[c];return u===void 0?"":u===null?o(c,e):Array.isArray(u)?u.length===0&&e.arrayFormat==="bracket-separator"?o(c,e)+"[]":u.reduce(t(c),[]).join("&"):o(c,e)+"="+o(u,e)}).filter(c=>c.length>0).join("&")},i.parseUrl=(r,e)=>{e=Object.assign({decode:!0},e);const[n,t]=l(r,"#");return Object.assign({url:n.split("?")[0]||"",query:j(O(r),e)},e&&e.parseFragmentIdentifier&&t?{fragmentIdentifier:y(t,e)}:{})},i.stringifyUrl=(r,e)=>{e=Object.assign({encode:!0,strict:!0,[h]:!0},e);const n=S(r.url).split("?")[0]||"",t=i.extract(r.url),a=i.parse(t,{sort:!1}),f=Object.assign(a,r.query);let c=i.stringify(f,e);c&&(c=`?${c}`);let u=I(r.url);return r.fragmentIdentifier&&(u=`#${e[h]?o(r.fragmentIdentifier,e):r.fragmentIdentifier}`),`${n}${c}${u}`},i.pick=(r,e,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[h]:!1},n);const{url:t,query:a,fragmentIdentifier:f}=i.parseUrl(r,n);return i.stringifyUrl({url:t,query:g(a,e),fragmentIdentifier:f},n)},i.exclude=(r,e,n)=>{const t=Array.isArray(e)?a=>!e.includes(a):(a,f)=>!e(a,f);return i.pick(r,t,n)}})(C);var N=C,_=P({name:"col-popup",props:{modelValue:{type:Boolean,default:!1}},data(){return{popupShow:!1}},watch:{modelValue(i){this.hashState()}},mounted(){window.addEventListener("hashchange",this.onHash,!1)},unmounted(){window.removeEventListener("hashchange",this.onHash,!1)},methods:{onHash(){this.$emit("update:modelValue",!1)},onPopupClose(i){this.$emit("update:modelValue",i),this.hashState()},hashState(){if(this.modelValue){const i=window.location.hash.slice(1).split("?"),s=N.parse(i[1]);let d=0;for(let m in s)d++;const l=window.location.href,g=d>0?"&cPop="+ +new Date:"?cPop="+ +new Date;history.pushState("","",`${l}${g}`)}else{const i=window.location.hash.slice(1).split("?");N.parse(i[1]).cPop&&window.history.go(-1)}this.$refs.protocolPopup&&(this.$refs.protocolPopup.scrollTop=0)}},render(){return q(D,{ref:"protocolPopup",show:this.modelValue,transitionAppear:!0,position:"bottom",style:{height:"100%"}},{default:()=>[this.$slots.default&&this.$slots.default()]})}});export{_ as C};