2 lines
728 KiB
JavaScript
2 lines
728 KiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).svelte={})}(this,(function(e){"use strict";function t(e,t,r){const s=r._;let a=!1;function i(e,{next:t,state:n}){t(n)}return function e(t,o,l){if(a)return;if(!t.type)return;let c;const u={},p={path:o,state:l,next:(r=l)=>{o.push(t);for(const n in t){if("type"===n)continue;const s=t[n];if(s&&"object"==typeof s)if(Array.isArray(s)){const t={};s.forEach(((n,s)=>{if(n&&"object"==typeof n){const a=e(n,o,r);a&&(t[s]=a)}})),Object.keys(t).length>0&&(u[n]=s.map(((e,n)=>t[n]??e)))}else{const t=e(s,o,r);t&&(u[n]=t)}}if(o.pop(),Object.keys(u).length>0)return n(t,u)},stop:()=>{a=!0},visit:(n,r=l)=>{o.push(t);const s=e(n,o,r)??n;return o.pop(),s}};let d=r[t.type]??i;if(s){let e;c=s(t,{...p,next:(n=l)=>(l=n,e=d(t,{...p,state:n}),e)}),!c&&e&&(c=e)}else c=d(t,p);return c||Object.keys(u).length>0&&(c=n(t,u)),c||void 0}(e,[],t)??e}function n(e,t){const n={},r=Object.getOwnPropertyDescriptors(e);for(const e in r)Object.defineProperty(n,e,r[e]);for(const e in t)n[e]=t[e];return n}const r=/\s/,s=/\s+/,a=/^\r?\n/,i=/^\s/,o=/^[ \t\r\n]+/,l=/\s$/,c=/[ \t\r\n]+$/,u=/[^ \t\r\n]/,p=/[ \t\n\r\f]+/g,d=/^[ \t\n\r\f]+$/,h=/[^\n]/g,m=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/,f=/(^[^a-zA-Z_$]|[^a-zA-Z0-9_$])/g,y=/^[aeiou]/,v=/^h[1-6]$/,g=/(^[0-9-.])|[\^$@%&#?!|()[\]{}^*+~;]/,b=1,x=2,_=4,C=8,w=16,k=1,P=2,S="http://www.w3.org/2000/svg",E="http://www.w3.org/1998/Math/MathML";function A(e,t){if(0===t.length)return null;const n=new q(t).get(e);return n&&n[0][0]>.7?n[0][1]:null}function T(e,t){if(null===e&&null===t)throw"Trying to compare two null values";if(null===e||null===t)return 0;const n=function(e,t){const n=[];let r=0,s=0;for(let a=0;a<=t.length;a++)for(let i=0;i<=e.length;i++)s=a&&i?e.charAt(i-1)===t.charAt(a-1)?r:Math.min(n[i],n[i-1],r)+1:a+i,r=n[i],n[i]=s;return n.pop()}(e=String(e),t=String(t));return 1-n/Math.max(e.length,t.length)}const $=/[^\w, ]+/;function R(e,t=2){const n={},r=function(e,t=2){const n="-"+e.toLowerCase().replace($,"")+"-",r=t-n.length,s=[];if(r>0)for(let t=0;t<r;++t)e+="-";for(let e=0;e<n.length-t+1;++e)s.push(n.slice(e,e+t));return s}(e,t);let s=0;for(;s<r.length;++s)r[s]in n?n[r[s]]+=1:n[r[s]]=1;return n}function I(e,t){return t[0]-e[0]}class q{exact_set={};match_dict={};items={};constructor(e){for(let e=2;e<4;++e)this.items[e]=[];for(let t=0;t<e.length;++t)this.add(e[t])}add(e){if(e.toLowerCase()in this.exact_set)return!1;let t=2;for(;t<4;++t)this._add(e,t)}_add(e,t){const n=e.toLowerCase(),r=this.items[t]||[],s=r.length;r.push(0);const a=R(n,t);let i,o,l=0;for(i in a)o=a[i],l+=Math.pow(o,2),i in this.match_dict?this.match_dict[i].push([s,o]):this.match_dict[i]=[[s,o]];const c=Math.sqrt(l);r[s]=[c,n],this.items[t]=r,this.exact_set[n]=e}get(e){const t=e.toLowerCase(),n=this.exact_set[t];if(n)return[[1,n]];for(let t=3;t>=2;--t){const n=this.__get(e,t);if(n.length>0)return n}return null}__get(e,t){const n=e.toLowerCase(),r={},s=R(n,t),a=this.items[t];let i,o,l,c,u,p=0;for(i in s)if(o=s[i],p+=Math.pow(o,2),i in this.match_dict)for(l=0;l<this.match_dict[i].length;++l)c=this.match_dict[i][l][0],u=this.match_dict[i][l][1],c in r?r[c]+=o*u:r[c]=o*u;const d=Math.sqrt(p);let h,m=[];for(const e in r)h=r[e],m.push([h/(d*a[e][0]),a[e][1]]);m.sort(I);let f=[];const y=Math.min(50,m.length);for(let e=0;e<y;++e)f.push([T(m[e][1],n),m[e][1]]);m=f,m.sort(I),f=[];for(let e=0;e<m.length;++e)m[e][0]===m[0][0]&&f.push([m[e][0],this.exact_set[m[e][1]]]);return f}}function L(e,t){return e.start<=t&&t<e.end}function M(e,t={}){const{offsetLine:n=0,offsetColumn:r=0}=t;let s=0;const a=e.split("\n").map(((e,t)=>{const n=s+e.length+1,r={start:s,end:n,line:t};return s=n,r}));let i=0;return function(t,s){if("string"==typeof t&&(t=e.indexOf(t,s??0)),-1===t)return;let o=a[i];const l=t>=o.end?1:-1;for(;o;){if(L(o,t))return{line:n+o.line,column:r+t-o.start,character:t};i+=l,o=a[i]}}}let O,N,D,j,B=[],F=M("",{offsetLine:1}),V=[],H=new Map;function U(e=(()=>!0)){j=e}function z(e,t){re
|