28 lines
72 KiB
JavaScript
28 lines
72 KiB
JavaScript
/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD see https://github.com/BambusControl/obsidian-unicode-search for the source */
|
||
"use strict";var er=Object.create;var ge=Object.defineProperty,tr=Object.defineProperties,rr=Object.getOwnPropertyDescriptor,ar=Object.getOwnPropertyDescriptors,nr=Object.getOwnPropertyNames,dt=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty,ir=Object.prototype.propertyIsEnumerable,or=Reflect.get;var pt=(t,e,r)=>e in t?ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,h=(t,e)=>{for(var r in e||(e={}))ut.call(e,r)&&pt(t,r,e[r]);if(dt)for(var r of dt(e))ir.call(e,r)&&pt(t,r,e[r]);return t},D=(t,e)=>tr(t,ar(e));var sr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lr=(t,e)=>{for(var r in e)ge(t,r,{get:e[r],enumerable:!0})},ht=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nr(e))!ut.call(t,o)&&o!==r&&ge(t,o,{get:()=>e[o],enumerable:!(a=rr(e,o))||a.enumerable});return t};var cr=(t,e,r)=>(r=t!=null?er(mt(t)):{},ht(e||!t||!t.__esModule?ge(r,"default",{value:t,enumerable:!0}):r,t)),dr=t=>ht(ge({},"__esModule",{value:!0}),t);var ft=(t,e,r)=>or(mt(t),r,e);var c=(t,e,r)=>new Promise((a,o)=>{var s=g=>{try{d(r.next(g))}catch(K){o(K)}},p=g=>{try{d(r.throw(g))}catch(K){o(K)}},d=g=>g.done?a(g.value):Promise.resolve(g.value).then(s,p);d((r=r.apply(t,e)).next())});var vt=sr((rt,at)=>{((t,e)=>{typeof define=="function"&&define.amd?define([],e):typeof at=="object"&&typeof rt!="undefined"?at.exports=e():t.Papa=e()})(rt,function t(){var e=typeof self!="undefined"?self:typeof window!="undefined"?window:e!==void 0?e:{},r,a=!e.document&&!!e.postMessage,o=e.IS_PAPA_WORKER||!1,s={},p=0,d={};function g(n){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(i){var l=tt(i);l.chunkSize=parseInt(l.chunkSize),i.step||i.chunk||(l.chunkSize=null),this._handle=new ne(l),(this._handle.streamer=this)._config=l}.call(this,n),this.parseChunk=function(i,l){var u=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<u){let C=this._config.newline;C||(m=this._config.quoteChar||'"',C=this._handle.guessLineEndings(i,m)),i=[...i.split(C).slice(u)].join(C)}this.isFirstChunk&&M(this._config.beforeFirstChunk)&&(m=this._config.beforeFirstChunk(i))!==void 0&&(i=m),this.isFirstChunk=!1,this._halted=!1;var u=this._partialLine+i,m=(this._partialLine="",this._handle.parse(u,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(i=m.meta.cursor,u=(this._finished||(this._partialLine=u.substring(i-this._baseIndex),this._baseIndex=i),m&&m.data&&(this._rowCount+=m.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)e.postMessage({results:m,workerId:d.WORKER_ID,finished:u});else if(M(this._config.chunk)&&!l){if(this._config.chunk(m,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=m=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(m.data),this._completeResults.errors=this._completeResults.errors.concat(m.errors),this._completeResults.meta=m.meta),this._completed||!u||!M(this._config.complete)||m&&m.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),u||m&&m.meta.paused||this._nextChunk(),m}this._halted=!0},this._sendError=function(i){M(this._config.error)?this._config.error(i):o&&this._config.error&&e.postMessage({workerId:d.WORKER_ID,error:i,finished:!1})}}function K(n){var i;(n=n||{}).chunkSize||(n.chunkSize=d.RemoteChunkSize),g.call(this,n),this._nextChunk=a?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(l){this._input=l,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(i=new XMLHttpRequest,this._config.withCredentials&&(i.withCredentials=this._config.withCredentials),a||(i.onload=ie(this._chunkLoaded,this),i.onerror=ie(this._chunkError,this)),i.open(this._config.downloadRequestBody?"POST":"GET",this._input,!a),this._config.downloadRequestHeaders){var l,u=this._config.downloadRequestHeaders;for(l in u)i.setRequestHeader(l,u[l])}var m;this._config.chunkSize&&(m=this._start+this._config.chunkSize-1,i.setRequestHeader("Range","bytes="+this._start+"-"+m));try{i.send(this._config.downloadRequestBody)}catch(C){this._chunkError(C.message)}a&&i.status===0&&this._chunkError()}},this._chunkLoaded=function(){i.readyState===4&&(i.status<200||400<=i.status?this._chunkError():(this._start+=this._config.chunkSize||i.responseText.length,this._finished=!this._config.chunkSize||this._start>=(l=>(l=l.getResponseHeader("Content-Range"))!==null?parseInt(l.substring(l.lastIndexOf("/")+1)):-1)(i),this.parseChunk(i.responseText)))},this._chunkError=function(l){l=i.statusText||l,this._sendError(new Error(l))}}function z(n){(n=n||{}).chunkSize||(n.chunkSize=d.LocalChunkSize),g.call(this,n);var i,l,u=typeof FileReader!="undefined";this.stream=function(m){this._input=m,l=m.slice||m.webkitSlice||m.mozSlice,u?((i=new FileReader).onload=ie(this._chunkLoaded,this),i.onerror=ie(this._chunkError,this)):i=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var m=this._input,C=(this._config.chunkSize&&(C=Math.min(this._start+this._config.chunkSize,this._input.size),m=l.call(m,this._start,C)),i.readAsText(m,this._config.encoding));u||this._chunkLoaded({target:{result:C}})},this._chunkLoaded=function(m){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(m.target.result)},this._chunkError=function(){this._sendError(i.error)}}function W(n){var i;g.call(this,n=n||{}),this.stream=function(l){return i=l,this._nextChunk()},this._nextChunk=function(){var l,u;if(!this._finished)return l=this._config.chunkSize,i=l?(u=i.substring(0,l),i.substring(l)):(u=i,""),this._finished=!i,this.parseChunk(u)}}function X(n){g.call(this,n=n||{});var i=[],l=!0,u=!1;this.pause=function(){g.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){g.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(m){this._input=m,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){u&&i.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),i.length?this.parseChunk(i.shift()):l=!0},this._streamData=ie(function(m){try{i.push(typeof m=="string"?m:m.toString(this._config.encoding)),l&&(l=!1,this._checkIsFinished(),this.parseChunk(i.shift()))}catch(C){this._streamError(C)}},this),this._streamError=ie(function(m){this._streamCleanUp(),this._sendError(m)},this),this._streamEnd=ie(function(){this._streamCleanUp(),u=!0,this._streamData("")},this),this._streamCleanUp=ie(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ne(n){var i,l,u,m,C=Math.pow(2,53),L=-C,Q=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,_=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,w=this,v=0,J=0,F=!1,oe=!1,S=[],f={data:[],errors:[],meta:{}};function B(x){return n.skipEmptyLines==="greedy"?x.join("").trim()==="":x.length===1&&x[0].length===0}function R(){if(f&&u&&($("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),u=!1),n.skipEmptyLines&&(f.data=f.data.filter(function(P){return!B(P)})),V()){let P=function(O,E){M(n.transformHeader)&&(O=n.transformHeader(O,E)),S.push(O)};var U=P;if(f)if(Array.isArray(f.data[0])){for(var x=0;V()&&x<f.data.length;x++)f.data[x].forEach(P);f.data.splice(0,1)}else f.data.forEach(P)}function k(P,O){for(var E=n.header?{}:[],A=0;A<P.length;A++){var I=A,y=P[A],y=((Y,T)=>(H=>(n.dynamicTypingFunction&&n.dynamicTyping[H]===void 0&&(n.dynamicTyping[H]=n.dynamicTypingFunction(H)),(n.dynamicTyping[H]||n.dynamicTyping)===!0))(Y)?T==="true"||T==="TRUE"||T!=="false"&&T!=="FALSE"&&((H=>{if(Q.test(H)&&(H=parseFloat(H),L<H&&H<C))return 1})(T)?parseFloat(T):_.test(T)?new Date(T):T===""?null:T):T)(I=n.header?A>=S.length?"__parsed_extra":S[A]:I,y=n.transform?n.transform(y,I):y);I==="__parsed_extra"?(E[I]=E[I]||[],E[I].push(y)):E[I]=y}return n.header&&(A>S.length?$("FieldMismatch","TooManyFields","Too many fields: expected "+S.length+" fields but parsed "+A,J+O):A<S.length&&$("FieldMismatch","TooFewFields","Too few fields: expected "+S.length+" fields but parsed "+A,J+O)),E}var b;f&&(n.header||n.dynamicTyping||n.transform)&&(b=1,!f.data.length||Array.isArray(f.data[0])?(f.data=f.data.map(k),b=f.data.length):f.data=k(f.data,0),n.header&&f.meta&&(f.meta.fields=S),J+=b)}function V(){return n.header&&S.length===0}function $(x,k,b,U){x={type:x,code:k,message:b},U!==void 0&&(x.row=U),f.errors.push(x)}M(n.step)&&(m=n.step,n.step=function(x){f=x,V()?R():(R(),f.data.length!==0&&(v+=x.data.length,n.preview&&v>n.preview?l.abort():(f.data=f.data[0],m(f,w))))}),this.parse=function(x,k,b){var U=n.quoteChar||'"',U=(n.newline||(n.newline=this.guessLineEndings(x,U)),u=!1,n.delimiter?M(n.delimiter)&&(n.delimiter=n.delimiter(x),f.meta.delimiter=n.delimiter):((U=((P,O,E,A,I)=>{var y,Y,T,H;I=I||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var pe=0;pe<I.length;pe++){for(var ae,q=I[pe],se=0,N=0,j=0,ee=(T=void 0,new ue({comments:A,delimiter:q,newline:O,preview:10}).parse(P)),le=0;le<ee.data.length;le++)E&&B(ee.data[le])?j++:(ae=ee.data[le].length,N+=ae,T===void 0?T=ae:0<ae&&(se+=Math.abs(ae-T),T=ae));0<ee.data.length&&(N/=ee.data.length-j),(Y===void 0||se<=Y)&&(H===void 0||H<N)&&1.99<N&&(Y=se,y=q,H=N)}return{successful:!!(n.delimiter=y),bestDelimiter:y}})(x,n.newline,n.skipEmptyLines,n.comments,n.delimitersToGuess)).successful?n.delimiter=U.bestDelimiter:(u=!0,n.delimiter=d.DefaultDelimiter),f.meta.delimiter=n.delimiter),tt(n));return n.preview&&n.header&&U.preview++,i=x,l=new ue(U),f=l.parse(i,k,b),R(),F?{meta:{paused:!0}}:f||{meta:{paused:!1}}},this.paused=function(){return F},this.pause=function(){F=!0,l.abort(),i=M(n.chunk)?"":i.substring(l.getCharIndex())},this.resume=function(){w.streamer._halted?(F=!1,w.streamer.parseChunk(i,!0)):setTimeout(w.resume,3)},this.aborted=function(){return oe},this.abort=function(){oe=!0,l.abort(),f.meta.aborted=!0,M(n.complete)&&n.complete(f),i=""},this.guessLineEndings=function(P,U){P=P.substring(0,1048576);var U=new RegExp(re(U)+"([^]*?)"+re(U),"gm"),b=(P=P.replace(U,"")).split("\r"),U=P.split(`
|
||
`),P=1<U.length&&U[0].length<b[0].length;if(b.length===1||P)return`
|
||
`;for(var O=0,E=0;E<b.length;E++)b[E][0]===`
|
||
`&&O++;return O>=b.length/2?`\r
|
||
`:"\r"}}function re(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ue(n){var i=(n=n||{}).delimiter,l=n.newline,u=n.comments,m=n.step,C=n.preview,L=n.fastMode,Q=null,_=n.quoteChar==null?'"':n.quoteChar,w=_;if(n.escapeChar!==void 0&&(w=n.escapeChar),(typeof i!="string"||-1<d.BAD_DELIMITERS.indexOf(i))&&(i=","),u===i)throw new Error("Comment character same as delimiter");u===!0?u="#":(typeof u!="string"||-1<d.BAD_DELIMITERS.indexOf(u))&&(u=!1),l!==`
|
||
`&&l!=="\r"&&l!==`\r
|
||
`&&(l=`
|
||
`);var v=0,J=!1;this.parse=function(F,oe,S){if(typeof F!="string")throw new Error("Input must be a string");var f=F.length,B=i.length,R=l.length,V=u.length,$=M(m),x=[],k=[],b=[],U=v=0;if(!F)return q();if(L||L!==!1&&F.indexOf(_)===-1){for(var P=F.split(l),O=0;O<P.length;O++){if(b=P[O],v+=b.length,O!==P.length-1)v+=l.length;else if(S)return q();if(!u||b.substring(0,V)!==u){if($){if(x=[],T(b.split(i)),se(),J)return q()}else T(b.split(i));if(C&&C<=O)return x=x.slice(0,C),q(!0)}}return q()}for(var E=F.indexOf(i,v),A=F.indexOf(l,v),I=new RegExp(re(w)+re(_),"g"),y=F.indexOf(_,v);;)if(F[v]===_)for(y=v,v++;;){if((y=F.indexOf(_,y+1))===-1)return S||k.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:x.length,index:v}),pe();if(y===f-1)return pe(F.substring(v,y).replace(I,_));if(_===w&&F[y+1]===w)y++;else if(_===w||y===0||F[y-1]!==w){E!==-1&&E<y+1&&(E=F.indexOf(i,y+1));var Y=H((A=A!==-1&&A<y+1?F.indexOf(l,y+1):A)===-1?E:Math.min(E,A));if(F.substr(y+1+Y,B)===i){b.push(F.substring(v,y).replace(I,_)),F[v=y+1+Y+B]!==_&&(y=F.indexOf(_,v)),E=F.indexOf(i,v),A=F.indexOf(l,v);break}if(Y=H(A),F.substring(y+1+Y,y+1+Y+R)===l){if(b.push(F.substring(v,y).replace(I,_)),ae(y+1+Y+R),E=F.indexOf(i,v),y=F.indexOf(_,v),$&&(se(),J))return q();if(C&&x.length>=C)return q(!0);break}k.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:x.length,index:v}),y++}}else if(u&&b.length===0&&F.substring(v,v+V)===u){if(A===-1)return q();v=A+R,A=F.indexOf(l,v),E=F.indexOf(i,v)}else if(E!==-1&&(E<A||A===-1))b.push(F.substring(v,E)),v=E+B,E=F.indexOf(i,v);else{if(A===-1)break;if(b.push(F.substring(v,A)),ae(A+R),$&&(se(),J))return q();if(C&&x.length>=C)return q(!0)}return pe();function T(N){x.push(N),U=v}function H(N){var j=0;return j=N!==-1&&(N=F.substring(y+1,N))&&N.trim()===""?N.length:j}function pe(N){return S||(N===void 0&&(N=F.substring(v)),b.push(N),v=f,T(b),$&&se()),q()}function ae(N){v=N,T(b),b=[],A=F.indexOf(l,v)}function q(N){if(n.header&&!oe&&x.length){var j=x[0],ee={},le=new Set(j);let lt=!1;for(let he=0;he<j.length;he++){let te=j[he];if(ee[te=M(n.transformHeader)?n.transformHeader(te,he):te]){let xe,ct=ee[te];for(;xe=te+"_"+ct,ct++,le.has(xe););le.add(xe),j[he]=xe,ee[te]++,lt=!0,(Q=Q===null?{}:Q)[xe]=te}else ee[te]=1,j[he]=te;le.add(te)}}return{data:x,errors:k,meta:{delimiter:i,linebreak:l,aborted:J,truncated:!!N,cursor:U+(oe||0),renamedHeaders:Q}}}function se(){m(q()),x=[],k=[]}},this.abort=function(){J=!0},this.getCharIndex=function(){return v}}function be(n){var i=n.data,l=s[i.workerId],u=!1;if(i.error)l.userError(i.error,i.file);else if(i.results&&i.results.data){var m={abort:function(){u=!0,Ee(i.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:st,resume:st};if(M(l.userStep)){for(var C=0;C<i.results.data.length&&(l.userStep({data:i.results.data[C],errors:i.results.errors,meta:i.results.meta},m),!u);C++);delete i.results}else M(l.userChunk)&&(l.userChunk(i.results,m,i.file),delete i.results)}i.finished&&!u&&Ee(i.workerId,i.results)}function Ee(n,i){var l=s[n];M(l.userComplete)&&l.userComplete(i),l.terminate(),delete s[n]}function st(){throw new Error("Not implemented.")}function tt(n){if(typeof n!="object"||n===null)return n;var i,l=Array.isArray(n)?[]:{};for(i in n)l[i]=tt(n[i]);return l}function ie(n,i){return function(){n.apply(i,arguments)}}function M(n){return typeof n=="function"}return d.parse=function(n,i){var l=(i=i||{}).dynamicTyping||!1;if(M(l)&&(i.dynamicTypingFunction=l,l={}),i.dynamicTyping=l,i.transform=!!M(i.transform)&&i.transform,!i.worker||!d.WORKERS_SUPPORTED)return l=null,d.NODE_STREAM_INPUT,typeof n=="string"?(n=(u=>u.charCodeAt(0)!==65279?u:u.slice(1))(n),l=new(i.download?K:W)(i)):n.readable===!0&&M(n.read)&&M(n.on)?l=new X(i):(e.File&&n instanceof File||n instanceof Object)&&(l=new z(i)),l.stream(n);(l=(()=>{var u;return!!d.WORKERS_SUPPORTED&&(u=(()=>{var m=e.URL||e.webkitURL||null,C=t.toString();return d.BLOB_URL||(d.BLOB_URL=m.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",C,")();"],{type:"text/javascript"})))})(),(u=new e.Worker(u)).onmessage=be,u.id=p++,s[u.id]=u)})()).userStep=i.step,l.userChunk=i.chunk,l.userComplete=i.complete,l.userError=i.error,i.step=M(i.step),i.chunk=M(i.chunk),i.complete=M(i.complete),i.error=M(i.error),delete i.worker,l.postMessage({input:n,config:i,workerId:l.id})},d.unparse=function(n,i){var l=!1,u=!0,m=",",C=`\r
|
||
`,L='"',Q=L+L,_=!1,w=null,v=!1,J=((()=>{if(typeof i=="object"){if(typeof i.delimiter!="string"||d.BAD_DELIMITERS.filter(function(S){return i.delimiter.indexOf(S)!==-1}).length||(m=i.delimiter),typeof i.quotes!="boolean"&&typeof i.quotes!="function"&&!Array.isArray(i.quotes)||(l=i.quotes),typeof i.skipEmptyLines!="boolean"&&typeof i.skipEmptyLines!="string"||(_=i.skipEmptyLines),typeof i.newline=="string"&&(C=i.newline),typeof i.quoteChar=="string"&&(L=i.quoteChar),typeof i.header=="boolean"&&(u=i.header),Array.isArray(i.columns)){if(i.columns.length===0)throw new Error("Option columns is empty");w=i.columns}i.escapeChar!==void 0&&(Q=i.escapeChar+L),i.escapeFormulae instanceof RegExp?v=i.escapeFormulae:typeof i.escapeFormulae=="boolean"&&i.escapeFormulae&&(v=/^[=+\-@\t\r].*$/)}})(),new RegExp(re(L),"g"));if(typeof n=="string"&&(n=JSON.parse(n)),Array.isArray(n)){if(!n.length||Array.isArray(n[0]))return F(null,n,_);if(typeof n[0]=="object")return F(w||Object.keys(n[0]),n,_)}else if(typeof n=="object")return typeof n.data=="string"&&(n.data=JSON.parse(n.data)),Array.isArray(n.data)&&(n.fields||(n.fields=n.meta&&n.meta.fields||w),n.fields||(n.fields=Array.isArray(n.data[0])?n.fields:typeof n.data[0]=="object"?Object.keys(n.data[0]):[]),Array.isArray(n.data[0])||typeof n.data[0]=="object"||(n.data=[n.data])),F(n.fields||[],n.data||[],_);throw new Error("Unable to serialize unrecognized input");function F(S,f,B){var R="",V=(typeof S=="string"&&(S=JSON.parse(S)),typeof f=="string"&&(f=JSON.parse(f)),Array.isArray(S)&&0<S.length),$=!Array.isArray(f[0]);if(V&&u){for(var x=0;x<S.length;x++)0<x&&(R+=m),R+=oe(S[x],x);0<f.length&&(R+=C)}for(var k=0;k<f.length;k++){var b=(V?S:f[k]).length,U=!1,P=V?Object.keys(f[k]).length===0:f[k].length===0;if(B&&!V&&(U=B==="greedy"?f[k].join("").trim()==="":f[k].length===1&&f[k][0].length===0),B==="greedy"&&V){for(var O=[],E=0;E<b;E++){var A=$?S[E]:E;O.push(f[k][A])}U=O.join("").trim()===""}if(!U){for(var I=0;I<b;I++){0<I&&!P&&(R+=m);var y=V&&$?S[I]:I;R+=oe(f[k][y],I)}k<f.length-1&&(!B||0<b&&!P)&&(R+=C)}}return R}function oe(S,f){var B,R;return S==null?"":S.constructor===Date?JSON.stringify(S).slice(1,25):(R=!1,v&&typeof S=="string"&&v.test(S)&&(S="'"+S,R=!0),B=S.toString().replace(J,Q),(R=R||l===!0||typeof l=="function"&&l(S,f)||Array.isArray(l)&&l[f]||((V,$)=>{for(var x=0;x<$.length;x++)if(-1<V.indexOf($[x]))return!0;return!1})(B,d.BAD_DELIMITERS)||-1<B.indexOf(m)||B.charAt(0)===" "||B.charAt(B.length-1)===" ")?L+B+L:B)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
|
||
`,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!a&&!!e.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=ue,d.ParserHandle=ne,d.NetworkStreamer=K,d.FileStreamer=z,d.StringStreamer=W,d.ReadableStreamStreamer=X,e.jQuery&&((r=e.jQuery).fn.parse=function(n){var i=n.config||{},l=[];return this.each(function(C){if(!(r(this).prop("tagName").toUpperCase()==="INPUT"&&r(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var L=0;L<this.files.length;L++)l.push({file:this.files[L],inputElem:this,instanceConfig:r.extend({},i)})}),u(),this;function u(){if(l.length===0)M(n.complete)&&n.complete();else{var C,L,Q,_,w=l[0];if(M(n.before)){var v=n.before(w.file,w.inputElem);if(typeof v=="object"){if(v.action==="abort")return C="AbortError",L=w.file,Q=w.inputElem,_=v.reason,void(M(n.error)&&n.error({name:C},L,Q,_));if(v.action==="skip")return void m();typeof v.config=="object"&&(w.instanceConfig=r.extend(w.instanceConfig,v.config))}else if(v==="skip")return void m()}var J=w.instanceConfig.complete;w.instanceConfig.complete=function(F){M(J)&&J(F,w.file,w.inputElem),m()},d.parse(w.file,w.instanceConfig)}}function m(){l.splice(0,1),u()}}),o&&(e.onmessage=function(n){n=n.data,d.WORKER_ID===void 0&&n&&(d.WORKER_ID=n.workerId),typeof n.input=="string"?e.postMessage({workerId:d.WORKER_ID,results:d.parse(n.input,n.config),finished:!0}):(e.File&&n.input instanceof File||n.input instanceof Object)&&(n=d.parse(n.input,n.config))&&e.postMessage({workerId:d.WORKER_ID,results:n,finished:!0})}),(K.prototype=Object.create(g.prototype)).constructor=K,(z.prototype=Object.create(g.prototype)).constructor=z,(W.prototype=Object.create(W.prototype)).constructor=W,(X.prototype=Object.create(g.prototype)).constructor=X,d})});var _r={};lr(_r,{default:()=>et});module.exports=dr(_r);var Xt=require("obsidian");var Ce=require("obsidian"),gt=cr(vt());var G=class extends Error{constructor(e){super(e)}};function Ft(t){let e=Array.from(t);e.sort((a,o)=>a.start-o.start);let r=0;for(let a=1;a<e.length;a++){let o=e[r],s=e[a];o.end>=s.start?o.end=Math.max(o.end,s.end):(r++,e[r]=s)}return e.slice(0,r+1)}function xt(t,e){return t>=e.start&&t<=e.end}var Ae=class{constructor(e){this.filterStore=e;this.config={delimiter:";",header:!1,transformHeader:void 0,dynamicTyping:!1,fastMode:!0}}download(){return c(this,null,function*(){let e="14.0.0",r="Unicode Search: Character Database Update";r+=`
|
||
UCD version ${e}`;let a=new Ce.Notice(r,0),o="https://www.unicode.org",s="https://raw.githubusercontent.com/BambusControl/obsidian-unicode-search/refs/heads/ucd-mirror",p=`Public/${e}/ucd/UnicodeData.txt`,d=yield(0,Ce.requestUrl)({url:`${o}/${p}`,throw:!1});if(d.status!=200&&(r+=`
|
||
\u2717 Failed to download from Unicode: HTTP ${d.status}`,a.setMessage(r),d=yield(0,Ce.requestUrl)({url:`${s}/${p}`,throw:!1}),d.status!=200))return r+=`
|
||
\u2717 Failed to download from GIT: HTTP ${d.status}`,a.setMessage(r),[];r=r+`
|
||
\u2713 Successfully downloaded characters`;let g=yield this.transformToCharacters(d.text),z=(yield this.filterCharacters(g)).map(hr);return r+=`
|
||
\u2731 Filtered ${z.length} out of ${g.length} total characters`,a.setMessage(r),setTimeout(()=>a.hide(),6*1e3),z})}filterCharacters(e){return c(this,null,function*(){let r=yield this.filterStore.getFilter(),a=Ft(r.planes.flatMap(s=>s.blocks).filter(s=>s.included)),o=r.categoryGroups.flatMap(s=>s.categories).filter(s=>s.included).map(s=>s.abbreviation);return e.filter(s=>!pr(s)&&mr(s,a)&&ur(s,o))})}transformToCharacters(e){return new Promise((r,a)=>{let o=p=>{p.errors.length!==0&&a(new G("Error while parsing data from Unicode Character Database"));let d=p.data.map(g=>({codepoint:parseInt(g[0],16),name:g[1],category:g[2]}));r(d)},s=D(h({},this.config),{worker:!0,complete:p=>o(p)});(0,gt.parse)(e,s)})}};function pr(t){return t==null||t.name==null||t.codepoint==null||t.category==null}function mr(t,e){return e.some(r=>xt(t.codepoint,r))}function ur(t,e){return e.some(r=>t.category===r)}function hr(t){return{codepoint:String.fromCodePoint(t.codepoint),name:t.name.toLowerCase(),category:t.category}}var Z=require("obsidian");var fr={planeNumber:0,description:"Basic Multilingual Plane",abbreviation:"BMP",interval:{start:0,end:65535},blocks:[{interval:{start:0,end:127},description:"Basic Latin",plane:0},{interval:{start:128,end:255},description:"Latin-1 Supplement",plane:0},{interval:{start:256,end:383},description:"Latin Extended-A",plane:0},{interval:{start:384,end:591},description:"Latin Extended-B",plane:0},{interval:{start:592,end:687},description:"IPA Extensions",plane:0},{interval:{start:688,end:767},description:"Spacing Modifier Letters",plane:0},{interval:{start:768,end:879},description:"Combining Diacritical Marks",plane:0},{interval:{start:880,end:1023},description:"Greek and Coptic",plane:0},{interval:{start:1024,end:1279},description:"Cyrillic",plane:0},{interval:{start:1280,end:1327},description:"Cyrillic Supplement",plane:0},{interval:{start:1328,end:1423},description:"Armenian",plane:0},{interval:{start:1424,end:1535},description:"Hebrew",plane:0},{interval:{start:1536,end:1791},description:"Arabic",plane:0},{interval:{start:1792,end:1871},description:"Syriac",plane:0},{interval:{start:1872,end:1919},description:"Arabic Supplement",plane:0},{interval:{start:1920,end:1983},description:"Thaana",plane:0},{interval:{start:1984,end:2047},description:"NKo",plane:0},{interval:{start:2048,end:2111},description:"Samaritan",plane:0},{interval:{start:2112,end:2143},description:"Mandaic",plane:0},{interval:{start:2144,end:2159},description:"Syriac Supplement",plane:0},{interval:{start:2160,end:2207},description:"Arabic Extended-B",plane:0},{interval:{start:2208,end:2303},description:"Arabic Extended-A",plane:0},{interval:{start:2304,end:2431},description:"Devanagari",plane:0},{interval:{start:2432,end:2559},description:"Bengali",plane:0},{interval:{start:2560,end:2687},description:"Gurmukhi",plane:0},{interval:{start:2688,end:2815},description:"Gujarati",plane:0},{interval:{start:2816,end:2943},description:"Oriya",plane:0},{interval:{start:2944,end:3071},description:"Tamil",plane:0},{interval:{start:3072,end:3199},description:"Telugu",plane:0},{interval:{start:3200,end:3327},description:"Kannada",plane:0},{interval:{start:3328,end:3455},description:"Malayalam",plane:0},{interval:{start:3456,end:3583},description:"Sinhala",plane:0},{interval:{start:3584,end:3711},description:"Thai",plane:0},{interval:{start:3712,end:3839},description:"Lao",plane:0},{interval:{start:3840,end:4095},description:"Tibetan",plane:0},{interval:{start:4096,end:4255},description:"Myanmar",plane:0},{interval:{start:4256,end:4351},description:"Georgian",plane:0},{interval:{start:4352,end:4607},description:"Hangul Jamo",plane:0},{interval:{start:4608,end:4991},description:"Ethiopic",plane:0},{interval:{start:4992,end:5023},description:"Ethiopic Supplement",plane:0},{interval:{start:5024,end:5119},description:"Cherokee",plane:0},{interval:{start:5120,end:5759},description:"Unified Canadian Aboriginal Syllabics",plane:0},{interval:{start:5760,end:5791},description:"Ogham",plane:0},{interval:{start:5792,end:5887},description:"Runic",plane:0},{interval:{start:5888,end:5919},description:"Tagalog",plane:0},{interval:{start:5920,end:5951},description:"Hanunoo",plane:0},{interval:{start:5952,end:5983},description:"Buhid",plane:0},{interval:{start:5984,end:6015},description:"Tagbanwa",plane:0},{interval:{start:6016,end:6143},description:"Khmer",plane:0},{interval:{start:6144,end:6319},description:"Mongolian",plane:0},{interval:{start:6320,end:6399},description:"Unified Canadian Aboriginal Syllabics Extended",plane:0},{interval:{start:6400,end:6479},description:"Limbu",plane:0},{interval:{start:6480,end:6527},description:"Tai Le",plane:0},{interval:{start:6528,end:6623},description:"New Tai Lue",plane:0},{interval:{start:6624,end:6655},description:"Khmer Symbols",plane:0},{interval:{start:6656,end:6687},description:"Buginese",plane:0},{interval:{start:6688,end:6831},description:"Tai Tham",plane:0},{interval:{start:6832,end:6911},description:"Combining Diacritical Marks Extended",plane:0},{interval:{start:6912,end:7039},description:"Balinese",plane:0},{interval:{start:7040,end:7103},description:"Sundanese",plane:0},{interval:{start:7104,end:7167},description:"Batak",plane:0},{interval:{start:7168,end:7247},description:"Lepcha",plane:0},{interval:{start:7248,end:7295},description:"Ol Chiki",plane:0},{interval:{start:7296,end:7311},description:"Cyrillic Extended-C",plane:0},{interval:{start:7312,end:7359},description:"Georgian Extended",plane:0},{interval:{start:7360,end:7375},description:"Sundanese Supplement",plane:0},{interval:{start:7376,end:7423},description:"Vedic Extensions",plane:0},{interval:{start:7424,end:7551},description:"Phonetic Extensions",plane:0},{interval:{start:7552,end:7615},description:"Phonetic Extensions Supplement",plane:0},{interval:{start:7616,end:7679},description:"Combining Diacritical Marks Supplement",plane:0},{interval:{start:7680,end:7935},description:"Latin Extended Additional",plane:0},{interval:{start:7936,end:8191},description:"Greek Extended",plane:0},{interval:{start:8192,end:8303},description:"General Punctuation",plane:0},{interval:{start:8304,end:8351},description:"Superscripts and Subscripts",plane:0},{interval:{start:8352,end:8399},description:"Currency Symbols",plane:0},{interval:{start:8400,end:8447},description:"Combining Diacritical Marks for Symbols",plane:0},{interval:{start:8448,end:8527},description:"Letterlike Symbols",plane:0},{interval:{start:8528,end:8591},description:"Number Forms",plane:0},{interval:{start:8592,end:8703},description:"Arrows",plane:0},{interval:{start:8704,end:8959},description:"Mathematical Operators",plane:0},{interval:{start:8960,end:9215},description:"Miscellaneous Technical",plane:0},{interval:{start:9216,end:9279},description:"Control Pictures",plane:0},{interval:{start:9280,end:9311},description:"Optical Character Recognition",plane:0},{interval:{start:9312,end:9471},description:"Enclosed Alphanumerics",plane:0},{interval:{start:9472,end:9599},description:"Box Drawing",plane:0},{interval:{start:9600,end:9631},description:"Block Elements",plane:0},{interval:{start:9632,end:9727},description:"Geometric Shapes",plane:0},{interval:{start:9728,end:9983},description:"Miscellaneous Symbols",plane:0},{interval:{start:9984,end:10175},description:"Dingbats",plane:0},{interval:{start:10176,end:10223},description:"Miscellaneous Mathematical Symbols-A",plane:0},{interval:{start:10224,end:10239},description:"Supplemental Arrows-A",plane:0},{interval:{start:10240,end:10495},description:"Braille Patterns",plane:0},{interval:{start:10496,end:10623},description:"Supplemental Arrows-B",plane:0},{interval:{start:10624,end:10751},description:"Miscellaneous Mathematical Symbols-B",plane:0},{interval:{start:10752,end:11007},description:"Supplemental Mathematical Operators",plane:0},{interval:{start:11008,end:11263},description:"Miscellaneous Symbols and Arrows",plane:0},{interval:{start:11264,end:11359},description:"Glagolitic",plane:0},{interval:{start:11360,end:11391},description:"Latin Extended-C",plane:0},{interval:{start:11392,end:11519},description:"Coptic",plane:0},{interval:{start:11520,end:11567},description:"Georgian Supplement",plane:0},{interval:{start:11568,end:11647},description:"Tifinagh",plane:0},{interval:{start:11648,end:11743},description:"Ethiopic Extended",plane:0},{interval:{start:11744,end:11775},description:"Cyrillic Extended-A",plane:0},{interval:{start:11776,end:11903},description:"Supplemental Punctuation",plane:0},{interval:{start:11904,end:12031},description:"CJK Radicals Supplement",plane:0},{interval:{start:12032,end:12255},description:"Kangxi Radicals",plane:0},{interval:{start:12272,end:12287},description:"Ideographic Description Characters",plane:0},{interval:{start:12288,end:12351},description:"CJK Symbols and Punctuation",plane:0},{interval:{start:12352,end:12447},description:"Hiragana",plane:0},{interval:{start:12448,end:12543},description:"Katakana",plane:0},{interval:{start:12544,end:12591},description:"Bopomofo",plane:0},{interval:{start:12592,end:12687},description:"Hangul Compatibility Jamo",plane:0},{interval:{start:12688,end:12703},description:"Kanbun",plane:0},{interval:{start:12704,end:12735},description:"Bopomofo Extended",plane:0},{interval:{start:12736,end:12783},description:"CJK Strokes",plane:0},{interval:{start:12784,end:12799},description:"Katakana Phonetic Extensions",plane:0},{interval:{start:12800,end:13055},description:"Enclosed CJK Letters and Months",plane:0},{interval:{start:13056,end:13311},description:"CJK Compatibility",plane:0},{interval:{start:13312,end:19903},description:"CJK Unified Ideographs Extension A",plane:0},{interval:{start:19904,end:19967},description:"Yijing Hexagram Symbols",plane:0},{interval:{start:19968,end:40959},description:"CJK Unified Ideographs",plane:0},{interval:{start:40960,end:42127},description:"Yi Syllables",plane:0},{interval:{start:42128,end:42191},description:"Yi Radicals",plane:0},{interval:{start:42192,end:42239},description:"Lisu",plane:0},{interval:{start:42240,end:42559},description:"Vai",plane:0},{interval:{start:42560,end:42655},description:"Cyrillic Extended-B",plane:0},{interval:{start:42656,end:42751},description:"Bamum",plane:0},{interval:{start:42752,end:42783},description:"Modifier Tone Letters",plane:0},{interval:{start:42784,end:43007},description:"Latin Extended-D",plane:0},{interval:{start:43008,end:43055},description:"Syloti Nagri",plane:0},{interval:{start:43056,end:43071},description:"Common Indic Number Forms",plane:0},{interval:{start:43072,end:43135},description:"Phags-pa",plane:0},{interval:{start:43136,end:43231},description:"Saurashtra",plane:0},{interval:{start:43232,end:43263},description:"Devanagari Extended",plane:0},{interval:{start:43264,end:43311},description:"Kayah Li",plane:0},{interval:{start:43312,end:43359},description:"Rejang",plane:0},{interval:{start:43360,end:43391},description:"Hangul Jamo Extended-A",plane:0},{interval:{start:43392,end:43487},description:"Javanese",plane:0},{interval:{start:43488,end:43519},description:"Myanmar Extended-B",plane:0},{interval:{start:43520,end:43615},description:"Cham",plane:0},{interval:{start:43616,end:43647},description:"Myanmar Extended-A",plane:0},{interval:{start:43648,end:43743},description:"Tai Viet",plane:0},{interval:{start:43744,end:43775},description:"Meetei Mayek Extensions",plane:0},{interval:{start:43776,end:43823},description:"Ethiopic Extended-A",plane:0},{interval:{start:43824,end:43887},description:"Latin Extended-E",plane:0},{interval:{start:43888,end:43967},description:"Cherokee Supplement",plane:0},{interval:{start:43968,end:44031},description:"Meetei Mayek",plane:0},{interval:{start:44032,end:55215},description:"Hangul Syllables",plane:0},{interval:{start:55216,end:55295},description:"Hangul Jamo Extended-B",plane:0},{interval:{start:55296,end:56191},description:"High Surrogates",plane:0},{interval:{start:56192,end:56319},description:"High Private Use Surrogates",plane:0},{interval:{start:56320,end:57343},description:"Low Surrogates",plane:0},{interval:{start:57344,end:63743},description:"Private Use Area",plane:0},{interval:{start:63744,end:64255},description:"CJK Compatibility Ideographs",plane:0},{interval:{start:64256,end:64335},description:"Alphabetic Presentation Forms",plane:0},{interval:{start:64336,end:65023},description:"Arabic Presentation Forms-A",plane:0},{interval:{start:65024,end:65039},description:"Variation Selectors",plane:0},{interval:{start:65040,end:65055},description:"Vertical Forms",plane:0},{interval:{start:65056,end:65071},description:"Combining Half Marks",plane:0},{interval:{start:65072,end:65103},description:"CJK Compatibility Forms",plane:0},{interval:{start:65104,end:65135},description:"Small Form Variants",plane:0},{interval:{start:65136,end:65279},description:"Arabic Presentation Forms-B",plane:0},{interval:{start:65280,end:65519},description:"Halfwidth and Fullwidth Forms",plane:0},{interval:{start:65520,end:65535},description:"Specials",plane:0}]},vr={planeNumber:1,description:"Supplementary Multilingual Plane",abbreviation:"SMP",interval:{start:65536,end:131071},blocks:[{interval:{start:65536,end:65663},description:"Linear B Syllabary",plane:1},{interval:{start:65664,end:65791},description:"Linear B Ideograms",plane:1},{interval:{start:65792,end:65855},description:"Aegean Numbers",plane:1},{interval:{start:65856,end:65935},description:"Ancient Greek Numbers",plane:1},{interval:{start:65936,end:65999},description:"Ancient Symbols",plane:1},{interval:{start:66e3,end:66047},description:"Phaistos Disc",plane:1},{interval:{start:66176,end:66207},description:"Lycian",plane:1},{interval:{start:66208,end:66271},description:"Carian",plane:1},{interval:{start:66272,end:66303},description:"Coptic Epact Numbers",plane:1},{interval:{start:66304,end:66351},description:"Old Italic",plane:1},{interval:{start:66352,end:66383},description:"Gothic",plane:1},{interval:{start:66384,end:66431},description:"Old Permic",plane:1},{interval:{start:66432,end:66463},description:"Ugaritic",plane:1},{interval:{start:66464,end:66527},description:"Old Persian",plane:1},{interval:{start:66560,end:66639},description:"Deseret",plane:1},{interval:{start:66640,end:66687},description:"Shavian",plane:1},{interval:{start:66688,end:66735},description:"Osmanya",plane:1},{interval:{start:66736,end:66815},description:"Osage",plane:1},{interval:{start:66816,end:66863},description:"Elbasan",plane:1},{interval:{start:66864,end:66927},description:"Caucasian Albanian",plane:1},{interval:{start:66928,end:67007},description:"Vithkuqi",plane:1},{interval:{start:67072,end:67455},description:"Linear A",plane:1},{interval:{start:67456,end:67519},description:"Latin Extended-F",plane:1},{interval:{start:67584,end:67647},description:"Cypriot Syllabary",plane:1},{interval:{start:67648,end:67679},description:"Imperial Aramaic",plane:1},{interval:{start:67680,end:67711},description:"Palmyrene",plane:1},{interval:{start:67712,end:67759},description:"Nabataean",plane:1},{interval:{start:67808,end:67839},description:"Hatran",plane:1},{interval:{start:67840,end:67871},description:"Phoenician",plane:1},{interval:{start:67872,end:67903},description:"Lydian",plane:1},{interval:{start:67968,end:67999},description:"Meroitic Hieroglyphs",plane:1},{interval:{start:68e3,end:68095},description:"Meroitic Cursive",plane:1},{interval:{start:68096,end:68191},description:"Kharoshthi",plane:1},{interval:{start:68192,end:68223},description:"Old South Arabian",plane:1},{interval:{start:68224,end:68255},description:"Old North Arabian",plane:1},{interval:{start:68288,end:68351},description:"Manichaean",plane:1},{interval:{start:68352,end:68415},description:"Avestan",plane:1},{interval:{start:68416,end:68447},description:"Inscriptional Parthian",plane:1},{interval:{start:68448,end:68479},description:"Inscriptional Pahlavi",plane:1},{interval:{start:68480,end:68527},description:"Psalter Pahlavi",plane:1},{interval:{start:68608,end:68687},description:"Old Turkic",plane:1},{interval:{start:68736,end:68863},description:"Old Hungarian",plane:1},{interval:{start:68864,end:68927},description:"Hanifi Rohingya",plane:1},{interval:{start:69216,end:69247},description:"Rumi Numeral Symbols",plane:1},{interval:{start:69248,end:69311},description:"Yezidi",plane:1},{interval:{start:69312,end:69375},description:"Arabic Extended-C",plane:1},{interval:{start:69376,end:69423},description:"Old Sogdian",plane:1},{interval:{start:69424,end:69487},description:"Sogdian",plane:1},{interval:{start:69488,end:69551},description:"Old Uyghur",plane:1},{interval:{start:69552,end:69599},description:"Chorasmian",plane:1},{interval:{start:69600,end:69631},description:"Elymaic",plane:1},{interval:{start:69632,end:69759},description:"Brahmi",plane:1},{interval:{start:69760,end:69839},description:"Kaithi",plane:1},{interval:{start:69840,end:69887},description:"Sora Sompeng",plane:1},{interval:{start:69888,end:69967},description:"Chakma",plane:1},{interval:{start:69968,end:70015},description:"Mahajani",plane:1},{interval:{start:70016,end:70111},description:"Sharada",plane:1},{interval:{start:70112,end:70143},description:"Sinhala Archaic Numbers",plane:1},{interval:{start:70144,end:70223},description:"Khojki",plane:1},{interval:{start:70272,end:70319},description:"Multani",plane:1},{interval:{start:70320,end:70399},description:"Khudawadi",plane:1},{interval:{start:70400,end:70527},description:"Grantha",plane:1},{interval:{start:70656,end:70783},description:"Newa",plane:1},{interval:{start:70784,end:70879},description:"Tirhuta",plane:1},{interval:{start:71040,end:71167},description:"Siddham",plane:1},{interval:{start:71168,end:71263},description:"Modi",plane:1},{interval:{start:71264,end:71295},description:"Mongolian Supplement",plane:1},{interval:{start:71296,end:71375},description:"Takri",plane:1},{interval:{start:71424,end:71503},description:"Ahom",plane:1},{interval:{start:71680,end:71759},description:"Dogra",plane:1},{interval:{start:71840,end:71935},description:"Warang Citi",plane:1},{interval:{start:71936,end:72031},description:"Dives Akuru",plane:1},{interval:{start:72096,end:72191},description:"Nandinagari",plane:1},{interval:{start:72192,end:72271},description:"Zanabazar Square",plane:1},{interval:{start:72272,end:72367},description:"Soyombo",plane:1},{interval:{start:72368,end:72383},description:"Unified Canadian Aboriginal Syllabics Extended-A",plane:1},{interval:{start:72384,end:72447},description:"Pau Cin Hau",plane:1},{interval:{start:72448,end:72543},description:"Devanagari Extended-A",plane:1},{interval:{start:72704,end:72815},description:"Bhaiksuki",plane:1},{interval:{start:72816,end:72895},description:"Marchen",plane:1},{interval:{start:72960,end:73055},description:"Masaram Gondi",plane:1},{interval:{start:73056,end:73135},description:"Gunjala Gondi",plane:1},{interval:{start:73440,end:73471},description:"Makasar",plane:1},{interval:{start:73472,end:73567},description:"Kawi",plane:1},{interval:{start:73648,end:73663},description:"Lisu Supplement",plane:1},{interval:{start:73664,end:73727},description:"Tamil Supplement",plane:1},{interval:{start:73728,end:74751},description:"Cuneiform",plane:1},{interval:{start:74752,end:74879},description:"Cuneiform Numbers and Punctuation",plane:1},{interval:{start:74880,end:75087},description:"Early Dynastic Cuneiform",plane:1},{interval:{start:77712,end:77823},description:"Cypro-Minoan",plane:1},{interval:{start:77824,end:78895},description:"Egyptian Hieroglyphs",plane:1},{interval:{start:78896,end:78943},description:"Egyptian Hieroglyph Format Controls",plane:1},{interval:{start:82944,end:83583},description:"Anatolian Hieroglyphs",plane:1},{interval:{start:92160,end:92735},description:"Bamum Supplement",plane:1},{interval:{start:92736,end:92783},description:"Mro",plane:1},{interval:{start:92784,end:92879},description:"Tangsa",plane:1},{interval:{start:92880,end:92927},description:"Bassa Vah",plane:1},{interval:{start:92928,end:93071},description:"Pahawh Hmong",plane:1},{interval:{start:93760,end:93855},description:"Medefaidrin",plane:1},{interval:{start:93952,end:94111},description:"Miao",plane:1},{interval:{start:94176,end:94207},description:"Ideographic Symbols and Punctuation",plane:1},{interval:{start:94208,end:100351},description:"Tangut",plane:1},{interval:{start:100352,end:101119},description:"Tangut Components",plane:1},{interval:{start:101120,end:101631},description:"Khitan Small Script",plane:1},{interval:{start:101632,end:101759},description:"Tangut Supplement",plane:1},{interval:{start:110576,end:110591},description:"Kana Extended-B",plane:1},{interval:{start:110592,end:110847},description:"Kana Supplement",plane:1},{interval:{start:110848,end:110895},description:"Kana Extended-A",plane:1},{interval:{start:110896,end:110959},description:"Small Kana Extension",plane:1},{interval:{start:110960,end:111359},description:"Nushu",plane:1},{interval:{start:113664,end:113823},description:"Duployan",plane:1},{interval:{start:113824,end:113839},description:"Shorthand Format Controls",plane:1},{interval:{start:118528,end:118735},description:"Znamenny Musical Notation",plane:1},{interval:{start:118784,end:119039},description:"Byzantine Musical Symbols",plane:1},{interval:{start:119040,end:119295},description:"Musical Symbols",plane:1},{interval:{start:119296,end:119375},description:"Ancient Greek Musical Notation",plane:1},{interval:{start:119488,end:119519},description:"Kaktovik Numerals",plane:1},{interval:{start:119520,end:119551},description:"Mayan Numerals",plane:1},{interval:{start:119552,end:119647},description:"Tai Xuan Jing Symbols",plane:1},{interval:{start:119648,end:119679},description:"Counting Rod Numerals",plane:1},{interval:{start:119808,end:120831},description:"Mathematical Alphanumeric Symbols",plane:1},{interval:{start:120832,end:121519},description:"Sutton SignWriting",plane:1},{interval:{start:122624,end:122879},description:"Latin Extended-G",plane:1},{interval:{start:122880,end:122927},description:"Glagolitic Supplement",plane:1},{interval:{start:122928,end:123023},description:"Cyrillic Extended-D",plane:1},{interval:{start:123136,end:123215},description:"Nyiakeng Puachue Hmong",plane:1},{interval:{start:123536,end:123583},description:"Toto",plane:1},{interval:{start:123584,end:123647},description:"Wancho",plane:1},{interval:{start:124112,end:124159},description:"Nag Mundari",plane:1},{interval:{start:124896,end:124927},description:"Ethiopic Extended-B",plane:1},{interval:{start:124928,end:125151},description:"Mende Kikakui",plane:1},{interval:{start:125184,end:125279},description:"Adlam",plane:1},{interval:{start:126064,end:126143},description:"Indic Siyaq Numbers",plane:1},{interval:{start:126208,end:126287},description:"Ottoman Siyaq Numbers",plane:1},{interval:{start:126464,end:126719},description:"Arabic Mathematical Alphabetic Symbols",plane:1},{interval:{start:126976,end:127023},description:"Mahjong Tiles",plane:1},{interval:{start:127024,end:127135},description:"Domino Tiles",plane:1},{interval:{start:127136,end:127231},description:"Playing Cards",plane:1},{interval:{start:127232,end:127487},description:"Enclosed Alphanumeric Supplement",plane:1},{interval:{start:127488,end:127743},description:"Enclosed Ideographic Supplement",plane:1},{interval:{start:127744,end:128511},description:"Miscellaneous Symbols and Pictographs",plane:1},{interval:{start:128512,end:128591},description:"Emoticons",plane:1},{interval:{start:128592,end:128639},description:"Ornamental Dingbats",plane:1},{interval:{start:128640,end:128767},description:"Transport and Map Symbols",plane:1},{interval:{start:128768,end:128895},description:"Alchemical Symbols",plane:1},{interval:{start:128896,end:129023},description:"Geometric Shapes Extended",plane:1},{interval:{start:129024,end:129279},description:"Supplemental Arrows-C",plane:1},{interval:{start:129280,end:129535},description:"Supplemental Symbols and Pictographs",plane:1},{interval:{start:129536,end:129647},description:"Chess Symbols",plane:1},{interval:{start:129648,end:129791},description:"Symbols and Pictographs Extended-A",plane:1},{interval:{start:129792,end:130047},description:"Symbols for Legacy Computing",plane:1}]},Fr={planeNumber:2,description:"Supplementary Ideographic Plane",abbreviation:"SIP",interval:{start:131072,end:196607},blocks:[{interval:{start:131072,end:173791},description:"CJK Unified Ideographs Extension B",plane:2},{interval:{start:173824,end:177983},description:"CJK Unified Ideographs Extension C",plane:2},{interval:{start:177984,end:178207},description:"CJK Unified Ideographs Extension D",plane:2},{interval:{start:178208,end:183983},description:"CJK Unified Ideographs Extension E",plane:2},{interval:{start:183984,end:191471},description:"CJK Unified Ideographs Extension F",plane:2},{interval:{start:191472,end:192095},description:"CJK Unified Ideographs Extension I",plane:2},{interval:{start:194560,end:195103},description:"CJK Compatibility Ideographs Supplement",plane:2}]},xr={planeNumber:3,description:"Tertiary Ideographic Plane",abbreviation:"TIP",interval:{start:196608,end:262143},blocks:[{interval:{start:196608,end:201551},description:"CJK Unified Ideographs Extension G",plane:3},{interval:{start:201552,end:205743},description:"CJK Unified Ideographs Extension H",plane:3}]},gr={planeNumber:14,description:"Supplementary Special-purpose Plane",abbreviation:"SSP",interval:{start:917504,end:983039},blocks:[{interval:{start:917504,end:917631},description:"Tags",plane:14},{interval:{start:917760,end:917999},description:"Variation Selectors Supplement",plane:14}]},Cr={planeNumber:15,description:"Supplementary Private Use Area-A",abbreviation:"SPUA-A",interval:{start:983040,end:1048575},blocks:[{interval:{start:983040,end:1048575},description:"Supplementary Private Use Area-A",plane:15}]},yr={planeNumber:16,description:"Supplementary Private Use Area-B",abbreviation:"SPUA-B",interval:{start:1048576,end:1114111},blocks:[{interval:{start:1048576,end:1114111},description:"Supplementary Private Use Area-B",plane:16}]},we=[fr,vr,Fr,xr,gr,Cr,yr];function ye(t){return t.toString(16).padStart(4,"0")}var Me=[{abbreviation:"L",name:"Letter",categories:[{abbreviation:"Lu",name:"Uppercase Letter",description:"an uppercase letter"},{abbreviation:"Ll",name:"Lowercase Letter",description:"a lowercase letter"},{abbreviation:"Lt",name:"Titlecase Letter",description:"a digraph encoded as a single character, with first part uppercase"},{abbreviation:"Lm",name:"Modifier Letter",description:"a modifier letter"},{abbreviation:"Lo",name:"Other Letter",description:"other letters, including syllables and ideographs"}]},{abbreviation:"M",name:"Mark",categories:[{abbreviation:"Mn",name:"Nonspacing Mark",description:"a nonspacing combining mark (zero advance width)"},{abbreviation:"Mc",name:"Spacing Mark",description:"a spacing combining mark (positive advance width)"},{abbreviation:"Me",name:"Enclosing Mark",description:"an enclosing combining mark"}]},{abbreviation:"N",name:"Number",categories:[{abbreviation:"Nd",name:"Decimal Number",description:"a decimal digit"},{abbreviation:"Nl",name:"Letter Number",description:"a letterlike numeric character"},{abbreviation:"No",name:"Other Number",description:"a numeric character of other type"}]},{abbreviation:"P",name:"Punctuation",categories:[{abbreviation:"Pc",name:"Connector Punctuation",description:"a connecting punctuation mark, like a tie"},{abbreviation:"Pd",name:"Dash Punctuation",description:"a dash or hyphen punctuation mark"},{abbreviation:"Ps",name:"Open Punctuation",description:"an opening punctuation mark (of a pair)"},{abbreviation:"Pe",name:"Close Punctuation",description:"a closing punctuation mark (of a pair)"},{abbreviation:"Pi",name:"Initial Punctuation",description:"an initial quotation mark"},{abbreviation:"Pf",name:"Final Punctuation",description:"a final quotation mark"},{abbreviation:"Po",name:"Other Punctuation",description:"a punctuation mark of other type"}]},{abbreviation:"S",name:"Symbol",categories:[{abbreviation:"Sm",name:"Math Symbol",description:"a symbol of mathematical use"},{abbreviation:"Sc",name:"Currency Symbol",description:"a currency sign"},{abbreviation:"Sk",name:"Modifier Symbol",description:"a non-letterlike modifier symbol"},{abbreviation:"So",name:"Other Symbol",description:"a symbol of other type"}]},{abbreviation:"Z",name:"Separator",categories:[{abbreviation:"Zs",name:"Space Separator",description:"a space character (of various non-zero widths)"},{abbreviation:"Zl",name:"Line Separator",description:"U+2028 LINE SEPARATOR only"},{abbreviation:"Zp",name:"Paragraph Separator",description:"U+2029 PARAGRAPH SEPARATOR only"}]},{abbreviation:"C",name:"Other",categories:[{abbreviation:"Cc",name:"Control",description:"a C0 or C1 control code"},{abbreviation:"Cf",name:"Format",description:"a format control character"},{abbreviation:"Cs",name:"Surrogate",description:"a surrogate code point"},{abbreviation:"Co",name:"Private Use",description:"a private-use character"},{abbreviation:"Cn",name:"Unassigned",description:"a reserved unassigned code point or a noncharacter"}]}];function ce(t){return ye(t.codepoint.codePointAt(0))}var De=require("obsidian");var Ct={command:"\u2B81",purpose:"to navigate"},Ue={command:"\u21B5",purpose:"to insert selected character"},yt={command:"esc",purpose:"to dismiss"},St={cls:"icon inline-description recent",text:"\u21A9",title:"used recently"},Dt={cls:"icon inline-description frequent",text:"\u21BA",title:"used frequently"},bt={cls:"icon inline-description favorite",text:"\u2606",title:"favorite"};function Et(t){if(t.length<1)throw new G("Cannot get a random item from an empty array");return t[Math.floor(Math.random()*t.length)]}var nt={score:0,matches:[]};function Se(t){var e,r;return{name:(e=t.name)!=null?e:nt,codepoint:(r=t.codepoint)!=null?r:nt}}function At(t){return D(h({},t),{match:Se(t.match)})}function wt(t,e){let r=e.codepoint.score-t.codepoint.score,a=e.name.score-t.name.score,o=r+a;return o/Math.abs(o)}function de(t,e,r){return t==null&&e==null?0:t!=null&&e!=null?r(t,e):t==null?1:-1}function Mt(t,e){let r=t.codepoint==null&&t.name==null,a=e.codepoint==null&&e.name==null;return de(r?null:Se(t),a?null:Se(e),(o,s)=>wt(o,s))}function Pe(t){return t!=null&&"added"in t&&"hotkey"in t}function me(t){switch(t){case-1:return 1;case 1:return-1;default:return 0}}function ve(t,e){return t<e?-1:t>e?1:0}function Ut(t,e){return me(ve(t.added,e.added))}function Pt(t){return Pe(t)?t:null}function _t(t,e){return de(Pt(t),Pt(e),(r,a)=>Ut(r,a))}function _e(t,e){return t===e?0:t<e?-1:1}function It(t,e,r){let a=de(t.lastUsed<r?null:t.lastUsed,e.lastUsed<r?null:e.lastUsed,(o,s)=>me(ve(o,s)));return a!==0?a:me(_e(t.useCount,e.useCount))}function kt(t){return t!=null&&"useCount"in t&&"firstUsed"in t&&"lastUsed"in t}function Tt(t){return kt(t)?t:null}function Rt(t,e,r){return de(Tt(t),Tt(e),(a,o)=>It(a,o,r))}function Nt(t,e){return _e(t.codepoint.codePointAt(0),e.codepoint.codePointAt(0))}function Bt(t,e,r){let a=Rt(t,e,r);if(a!==0)return a;let o=_t(t,e);return o!==0?o:Nt(t,e)}function Ot(t,e,r){let a=Mt(t.match,e.match);return a!==0?a:Bt(t.character,e.character,r)}var Ie=class{constructor(e,r){this.getCallback=e;this.value=r}get(){return c(this,null,function*(){return this.value==null&&(this.value=yield this.getCallback()),this.value})}};function Lt(t){return t.slice().map(e=>e.lastUsed).sort((e,r)=>me(ve(e,r)))}function Kt(t){let e=t.reduce((o,s)=>({totalUses:o.totalUses+s.useCount,itemCount:o.itemCount+1}),{totalUses:0,itemCount:0}),{totalUses:r,itemCount:a}=e;return a===0?0:r/a}function zt(t){return{character:t,match:{codepoint:null,name:null}}}var ke=require("obsidian");function Ht(t){let r=t.length<=4&&!t.contains(" ")?(0,ke.prepareSimpleSearch)(t):o=>null,a=(0,ke.prepareFuzzySearch)(t);return o=>({character:o,match:{codepoint:r(ce(o)),name:a(o.name)}})}function Gt(t){return t.match.name!=null||t.match.codepoint!=null}var Fe=class t extends De.SuggestModal{constructor(r,a,o){super(r);this.characterService=a;super.setInstructions([Ct,o,yt]),this.setRandomPlaceholder().then(),this.usageStatistics=new Ie(()=>c(this,null,function*(){var p;let s=yield a.getUsed();return{topThirdRecentlyUsed:(p=Lt(s).slice(0,3).last())!=null?p:new Date(0),averageUseCount:Kt(s)}}))}getSuggestions(r){return c(this,null,function*(){let a=yield this.characterService.getAll(),s=r==null||r.length<1?a.map(zt):a.map(Ht(r)).filter(Gt),p=(yield this.usageStatistics.get()).topThirdRecentlyUsed;return s.sort((d,g)=>Ot(d,g,p)).slice(0,this.limit).map(At)})}renderSuggestion(r,a){return c(this,null,function*(){let o=r.character;a.addClass("plugin","unicode-search","result-item"),a.createDiv({cls:"character-preview"}).createSpan({text:o.codepoint});let s=a.createDiv({cls:"character-match"}),p=s.createDiv({cls:"character-name"});(0,De.renderMatches)(p,o.name,r.match.name.matches);let d=s.createDiv({cls:"character-codepoint"});(0,De.renderMatches)(d,ce(o),r.match.codepoint.matches);let K=a.createDiv({cls:"detail"}).createDiv({cls:"attributes"});if(Pe(o))K.createDiv(bt);else{let z=yield this.usageStatistics.get(),W=o,X=W.lastUsed!=null&&W.lastUsed>=z.topThirdRecentlyUsed,ne=W.useCount!=null&&W.useCount>=z.averageUseCount;X&&K.createDiv(St),ne&&K.createDiv(Dt)}})}onNoSuggestion(){return c(this,null,function*(){yield this.setRandomPlaceholder()})}setRandomPlaceholder(){return c(this,null,function*(){let r=Et(yield this.characterService.getAllCharacters()).name;ft(t.prototype,this,"setPlaceholder").call(this,`Unicode search: ${r}`)})}};var Te=class t extends Fe{constructor(r,a,o){super(r,a,Ue);this.resolve=o}static open(r,a){return new Promise(o=>{new t(r,a,o).open()})}onChooseSuggestion(r,a){}onClose(){this.resolve(null)}selectSuggestion(r,a){this.resolve(r.character),super.selectSuggestion(r,a)}};var Re=class t extends Z.PluginSettingTab{constructor(r,a,o,s,p,d){super(r,a);this.plugin=a;this.characterService=o;this.favoritesStore=s;this.settingsStore=p;this.initializer=d;this.rendered=!1;this.containerEl.addClass("plugin","unicode-search","setting-tab")}display(){return c(this,null,function*(){this.rendered||(yield this.displayFilterSettings(this.containerEl),yield this.displayFavoritesSettings(this.containerEl),this.rendered=!0)})}hide(){return c(this,null,function*(){yield this.initializer.initializeData(),this.containerEl.empty(),this.rendered=!1})}displayFavoritesSettings(r){return c(this,null,function*(){new Z.Setting(r).setHeading().setName("Favorite Characters").setDesc("Manage your favorite characters which will be displayed in the plugin's search results. You can also enable them as a hotkey, making them available as a command in Obsidian.").setClass("group-control").addToggle(g=>g.setValue(!1).onChange(K=>o.toggleClass("hidden",!K)));let a=yield this.characterService.getFavorites(),o=r.createDiv({cls:["group-container","hidden"]}),s=o.createDiv({cls:["item-container"]}),p=s.createDiv({cls:["character-list","new"]}),d=s.createDiv({cls:["character-list","no-first"]});new Z.Setting(p).setName("").setDesc("Add a new favorite character").addButton(g=>{g.setIcon("plus"),g.onClick(K=>c(this,null,function*(){let z=yield Te.open(this.plugin.app,this.characterService);if(z==null||a.some(re=>re.codepoint===z.codepoint))return;let X=yield this.favoritesStore.addFavorite(z.codepoint),ne=h(h({},X),z);this.displayFavoriteChar(p,ne)}))});for(let g of a)this.displayFavoriteChar(d,g)})}displayFavoriteChar(r,a){let o=new Z.Setting(r);o.setClass("favorite-control").setName(a.codepoint).setDesc(a.name).addToggle(s=>s.setTooltip("Add insert command to Obsidian").setValue(a.hotkey).onChange(p=>this.toggleHotkeyCommand(a,p))).addButton(s=>s.setIcon("trash").setTooltip("Remove from favorites").onClick(()=>(o.settingEl.hide(),this.favoritesStore.removeFavorite(a.codepoint))))}toggleHotkeyCommand(r,a){return c(this,null,function*(){let o=`insert-${ce(r)}`;a?this.plugin.addCommand({id:o,name:`Insert '${r.codepoint}'`,editorCallback:s=>(s.replaceSelection(r.codepoint),!0)}):this.plugin.removeCommand(o),yield this.favoritesStore.update(r.codepoint,()=>({hotkey:a}))})}displayFilterSettings(r){return c(this,null,function*(){new Z.Setting(r).setHeading().setName("Unicode Character Filters").setDesc("Here you can set which characters would you like to be included or excluded from the plugins search results. Toggle the headings to display the options."),new Z.Setting(r).setName("General Categories").setClass("group-control").addToggle(s=>s.setValue(!1).onChange(p=>a.toggleClass("hidden",!p)));let a=r.createDiv({cls:["group-container","hidden"]});for(let s of Me)yield this.addCharacterCategoryFilter(a,s);new Z.Setting(r).setName("Planes and Blocks").setClass("group-control").addToggle(s=>s.setValue(!1).onChange(p=>o.toggleClass("hidden",!p)));let o=r.createDiv({cls:["group-container","hidden"]});for(let s of we)yield this.addCharacterPlaneFilters(o,s)})}addCharacterCategoryFilter(r,a){return c(this,null,function*(){let o=r.createDiv({cls:"item-container"});new Z.Setting(o).setHeading().setName(a.name);let s=o.createDiv({cls:"items-list"});for(let p of a.categories)yield t.addCharacterCategoryFilterToggle(s,this.settingsStore,p)})}addCharacterPlaneFilters(r,a){return c(this,null,function*(){let o=r.createDiv({cls:"item-container"});new Z.Setting(o).setHeading().setClass("codepoint-interval").setName(createFragment(p=>{p.createSpan().appendText(a.description),t.codepointFragment(p,a.interval)}));let s=o.createDiv({cls:"blocks-list"});for(let p of a.blocks)yield t.addCharacterBlockFilterToggle(s,this.settingsStore,p)})}static addCharacterBlockFilterToggle(r,a,o){return c(this,null,function*(){let s=yield a.getCharacterBlock(o.interval);new Z.Setting(r).setName(o.description).setDesc(createFragment(p=>t.codepointFragment(p,o.interval))).addToggle(p=>p.setValue(s).onChange(d=>a.setCharacterBlock(o.interval,d)))})}static addCharacterCategoryFilterToggle(r,a,o){return c(this,null,function*(){let s=yield a.getCharacterCategory(o.abbreviation);new Z.Setting(r).setName(o.name).setDesc(o.description).addToggle(p=>p.setValue(s).onChange(d=>a.setCharacterCategory(o.abbreviation,d)))})}static codepointFragment(r,a){return r.createSpan({cls:["character-codepoint","monospace"]}).setText(`${ye(a.start)}\uFF0D${ye(a.end)}`),r}};var Ne=class{constructor(e,r,a){this.codepointStore=e;this.usageStore=r;this.favoritesStore=a}getOne(e){return c(this,null,function*(){let a=(yield this.getAllCharacters()).find(o=>o.codepoint===e);if(a==null)throw new G(`No character '${e}' exists.`);return a})}getAllCharacters(){return this.codepointStore.getCodepoints()}getUsed(){return c(this,null,function*(){let e=yield this.getAllCharacters(),r=yield this.usageStore.getUsed(),a=r.map(o=>o.codepoint);return e.filter(o=>a.contains(o.codepoint)).map(o=>h(h({},r.find(s=>s.codepoint===o.codepoint)),o))})}getFavorites(){return c(this,null,function*(){let e=yield this.getAllCharacters(),r=yield this.favoritesStore.getFavorites(),a=r.map(o=>o.codepoint);return e.filter(o=>a.contains(o.codepoint)).map(o=>h(h({},r.find(s=>s.codepoint===o.codepoint)),o))})}getAll(){return c(this,null,function*(){let e=yield this.getAllCharacters(),r=yield this.favoritesStore.getFavorites(),a=yield this.usageStore.getUsed();return e.map(o=>h(h(h({},r.find(s=>s.codepoint===o.codepoint)),a.find(s=>s.codepoint===o.codepoint)),o))})}recordUsage(e){let r=new Date;return this.usageStore.upsert(e,a=>{var o,s;return D(h({},a),{firstUsed:(o=a==null?void 0:a.firstUsed)!=null?o:r,lastUsed:r,useCount:((s=a==null?void 0:a.useCount)!=null?s:0)+1})})}};var Be=class extends Fe{constructor(r,a,o){super(r,a,Ue);this.editor=o}onChooseSuggestion(r,a){return c(this,null,function*(){this.editor.replaceSelection(r.character.codepoint);try{yield this.characterService.recordUsage(r.character.codepoint)}catch(o){}})}};var Oe=class{constructor(e){this.plugin=e}addModal(e){this.plugin.addCommand({id:"search-unicode-chars",name:"Search Unicode characters",editorCallback:r=>(new Be(this.plugin.app,e,r).open(),!0)})}addFavorites(e){return c(this,null,function*(){let r=(yield e.getFavorites()).filter(a=>a.hotkey);for(let a of r)this.addCommandFor(a)})}addCommandFor(e){this.plugin.addCommand({id:`insert-${ce(e)}`,name:`Insert '${e.codepoint}'`,repeatable:!0,editorCallback:r=>{r.replaceSelection(e.codepoint)}})}};function Vt(t){return t!=null&&"initialized"in t&&"version"in t}function Le(t){return t!=null&&"codepoint"in t&&Sr(t.codepoint)}function Sr(t){return t!=null&&typeof t=="string"&&t.length===1}var qt="0.7.1",Jt="0.7.0";function $t(t){return t!=null&&"initialized"in t&&"version"in t&&"settings"in t&&t.settings!=null&&"initialized"in t.settings&&"modified"in t.settings&&"filter"in t.settings&&"unicode"in t&&t.unicode!=null&&"initialized"in t.unicode&&"codepoints"in t.unicode&&"usage"in t&&t.usage!=null&&"initialized"in t.usage&&"codepoints"in t.usage}var Ke=class t{constructor(e,r,a,o,s,p){this.storedData=e;this.metaDm=r;this.filterDm=a;this.unicodeDm=o;this.usageDm=s;this.favoritesDm=p}initializeData(){return c(this,null,function*(){var d;let e=(d=yield this.storedData.get())!=null?d:{},r=t.initialMigration(e),a=t.shapeLoadedData(r),o=yield this.initMeta(a),s=this.initData(o);this.storedData.set(s);let p=yield this.updateData(s);this.storedData.set(p),yield this.storedData.persist()})}initMeta(e){return c(this,null,function*(){let r=this.metaDm.initData(e.meta),a=yield this.metaDm.updateData(r,new Set([]));return D(h({},e),{meta:a})})}initData(e){let r=this.filterDm.initData(e.filter),a=this.unicodeDm.initData(e.characters),o=this.usageDm.initData(e.usage),s=this.favoritesDm.initData(e.favorites);return D(h({},e),{filter:r,characters:a,usage:o,favorites:s})}updateData(e){return c(this,null,function*(){let r=yield this.metaDm.updateData(e.meta,new Set([])),a=new Set(r.events),o=yield this.filterDm.updateData(e.filter,a),s=yield this.unicodeDm.updateData(e.characters,a),p=yield this.usageDm.updateData(e.usage,a),d=yield this.favoritesDm.updateData(e.favorites,a);return r.events=Array.from(a),{meta:r,filter:o,characters:s,usage:p,favorites:d}})}static shapeLoadedData(e){return{meta:t.createFragment(e.meta),filter:t.createFragment(e.filter),usage:t.createFragment(e.usage),characters:t.createFragment(e.characters),favorites:t.createFragment(e.favorites)}}static createFragment(e){return Vt(e)?e:{initialized:!1,version:Jt}}static initialMigration(e){return $t(e)&&e.initialized&&e.version==="0.6.0"?{filter:D(h({version:e.version},e.settings),{unicode:e.settings.filter}),usage:h({version:e.version},e.usage),characters:h({version:e.version},e.unicode)}:e}};var ze=class{initData(e){return e.initialized&&Dr(e)?e:D(h({},e),{initialized:!0,unicode:{planes:we.map(r=>D(h({},r.interval),{blocks:r.blocks.map(a=>D(h({},a.interval),{included:Wt.planes.includes(r.planeNumber)}))})),categoryGroups:Me.map(r=>({abbreviation:r.abbreviation,categories:r.categories.map(a=>({abbreviation:a.abbreviation,included:Wt.categories.includes(r.abbreviation)}))}))}})}updateData(e,r){return c(this,null,function*(){return e})}},Wt={planes:[0],categories:["L","N","P","S"]};function Dr(t){return"unicode"in t&&br(t.unicode)}function br(t){return"planes"in t&&Array.isArray(t.planes)&&"categoryGroups"in t&&Array.isArray(t.categoryGroups)}var He=(e=>(e.DownloadCharacters="download_characters",e))(He||{});function Zt(t){return Object.values(He).includes(t)}var Ge=class{constructor(e){this.ucdService=e}initData(e){return e.initialized&&Er(e)?e:D(h({},e),{initialized:!0,codepoints:[]})}updateData(e,r){return c(this,null,function*(){let a=this.updateByVersion(e),o=r.has("download_characters"),s=e.codepoints.length<1;if(!(o||s))return a;let p=yield this.ucdService.download();return r.delete("download_characters"),D(h({},a),{codepoints:p})})}updateByVersion(e){return e}};function Er(t){return"codepoints"in t&&t.codepoints!=null&&Array.isArray(t.codepoints)&&t.codepoints.every(Ar)}function Ar(t){return Le(t)&&"name"in t&&t.name!=null&&typeof t.name=="string"&&"category"in t&&t.category!=null&&typeof t.category=="string"}var Ve=class{initData(e){return e.initialized&&wr(e)?e:D(h({},e),{initialized:!0,codepoints:[]})}updateData(e,r){return c(this,null,function*(){return e})}};function wr(t){return"codepoints"in t&&t.codepoints!=null&&Array.isArray(t.codepoints)&&t.codepoints.every(Mr)}function Mr(t){return Le(t)&&"firstUsed"in t&&t.firstUsed!=null&&typeof t.firstUsed=="string"&&"lastUsed"in t&&t.lastUsed!=null&&typeof t.lastUsed=="string"&&"useCount"in t&&t.useCount!=null&&typeof t.useCount=="number"}var qe=class{initData(e){return e.initialized&&Ur(e)?e:D(h({},e),{initialized:!0,codepoints:[]})}updateData(e,r){return c(this,null,function*(){return e})}};function Ur(t){return"codepoints"in t&&Array.isArray(t.codepoints)}var Je=class{constructor(e,r,a){this.getCallback=e;this.persistCallback=r;this.value=a}get(){return c(this,null,function*(){return this.value==null&&(this.value=yield this.getCallback()),this.value})}set(e){this.value=e}persist(){return c(this,null,function*(){if(this.value==null)throw new G("Refuse to persist a null value");return yield this.persistCallback(this.value),this.value})}};var $e=class{constructor(e){this.storedData=e}getMeta(){return c(this,null,function*(){return(yield this.storedData.get()).meta})}overwriteMeta(e){return c(this,null,function*(){return(yield this.mergeData({meta:e})).meta})}getUnicode(){return c(this,null,function*(){return(yield this.storedData.get()).characters})}overwriteUnicode(e){return c(this,null,function*(){return(yield this.mergeData({characters:e})).characters})}getFilter(){return c(this,null,function*(){return(yield this.storedData.get()).filter})}overwriteFilter(e){return c(this,null,function*(){return(yield this.mergeData({filter:e})).filter})}getUsage(){return c(this,null,function*(){return(yield this.storedData.get()).usage})}overwriteUsage(e){return c(this,null,function*(){return(yield this.mergeData({usage:e})).usage})}getFavorites(){return c(this,null,function*(){return(yield this.storedData.get()).favorites})}overwriteFavorites(e){return c(this,null,function*(){return(yield this.mergeData({favorites:e})).favorites})}mergeData(e){return c(this,null,function*(){let r=yield this.storedData.get(),a=h(h({},r),e);return this.storedData.set(a),yield this.storedData.persist()})}};var We=class{constructor(e){this.store=e}getCodepoints(){return c(this,null,function*(){return(yield this.store.getUnicode()).codepoints})}};function it(t){return D(h({},t),{lastUsed:new Date(t.lastUsed),firstUsed:new Date(t.firstUsed)})}function Qt(t){return D(h({},t),{lastUsed:t.lastUsed.toJSON(),firstUsed:t.firstUsed.toJSON()})}var Ze=class{constructor(e){this.store=e}upsert(e,r){return c(this,null,function*(){let a=yield this.getUsed(),o=a.findIndex(g=>g.codepoint===e),s=o>=0,p=s?o:0,d=D(h({},r(s?h({},a[p]):void 0)),{codepoint:e});return s?a[o]=d:a.unshift(d),yield this.overwriteUsageData(a),a[p]})}getUsed(){return c(this,null,function*(){return(yield this.store.getUsage()).codepoints.map(it)})}overwriteUsageData(e){return c(this,null,function*(){return(yield this.mergeUsage({codepoints:e.map(Qt)})).codepoints.map(it)})}mergeUsage(e){return c(this,null,function*(){let r=yield this.store.getUsage(),a=h(h({},r),e);return yield this.store.overwriteUsage(a)})}};function Yt(t){return D(h({},t),{added:t.added.toJSON()})}var Qe=class{constructor(e){this.store=e}upsert(e,r){return c(this,null,function*(){let a=yield this.getFavorites(),o=a.findIndex(g=>g.codepoint===e),s=o>=0,p=s?o:0,d=D(h({},r(s?h({},a[p]):void 0)),{codepoint:e});return s?a[o]=d:a.unshift(d),yield this.overwriteFavoritesData(a),a[p]})}update(e,r){return c(this,null,function*(){let a=yield this.getFavorites(),o=a.findIndex(s=>s.codepoint===e);if(o<0)throw new G(`No character '${e}' exists in favorites.`);return a[o]=D(h(h({},a[o]),r(h({},a[o]))),{codepoint:e}),yield this.overwriteFavoritesData(a),a[o]})}addFavorite(e){return c(this,null,function*(){let r=yield this.getFavorites(),a=r.find(s=>s.codepoint===e);if(a!=null)return a;let o={codepoint:e,added:new Date,hotkey:!1};return r.unshift(o),yield this.overwriteFavoritesData(r),o})}removeFavorite(e){return c(this,null,function*(){let r=yield this.getFavorites();r=r.filter(a=>a.codepoint!==e),yield this.overwriteFavoritesData(r)})}getFavorites(){return c(this,null,function*(){return(yield this.store.getFavorites()).codepoints.map(e=>D(h({},e),{added:new Date(e.added)}))})}overwriteFavoritesData(e){return c(this,null,function*(){let r=yield this.mergeFavorites({codepoints:e.map(Yt)});yield this.store.overwriteFavorites(r)})}mergeFavorites(e){return c(this,null,function*(){let r=yield this.store.getFavorites(),a=h(h({},r),e);return yield this.store.overwriteFavorites(a)})}};function ot(t,e){return t.start===e.start&&t.end===e.end}function jt(t,e){return t.start<=e.start&&t.end>=e.end}var Ye=class{constructor(e,r){this.store=e;this.meta=r}getFilter(){return c(this,null,function*(){return(yield this.store.getFilter()).unicode})}getCharacterBlock(e){return c(this,null,function*(){return(yield this.getBlockFilters()).some(r=>ot(r,e)&&r.included)})}setCharacterBlock(e,r){return c(this,null,function*(){let a=yield this.store.getFilter(),o=a.unicode.planes.findIndex(p=>jt(p,e));if(o<0)throw new G(`Block doesn't belong to any codepoint plane. ${e}`);let s=a.unicode.planes[o].blocks.findIndex(p=>ot(p,e));if(s<0)throw new G(`Block doesn't exist within a plane. ${e}`);a.unicode.planes[o].blocks[s].included=r,yield this.meta.request("download_characters"),yield this.store.overwriteFilter(a)})}getCharacterCategory(e){return c(this,null,function*(){return(yield this.getCategoryFilters()).some(r=>r.abbreviation===e&&r.included)})}setCharacterCategory(e,r){return c(this,null,function*(){let a=yield this.store.getFilter(),o=a.unicode.categoryGroups.findIndex(p=>p.abbreviation===e[0]);if(o<0)throw new G(`Codepoint category group doesn't exist. ${e}: ${e[0]}`);let s=a.unicode.categoryGroups[o].categories.findIndex(p=>p.abbreviation===e);if(s<0)throw new G(`Block doesn't exist within a plane. ${e}`);a.unicode.categoryGroups[o].categories[s].included=r,yield this.meta.request("download_characters"),yield this.store.overwriteFilter(a)})}getBlockFilters(){return c(this,null,function*(){return(yield this.getFilter()).planes.flatMap(e=>e.blocks)})}getCategoryFilters(){return c(this,null,function*(){return(yield this.getFilter()).categoryGroups.flatMap(e=>e.categories)})}};var je=class{initData(e){return e.initialized&&Pr(e)?e:D(h({},e),{pluginVersion:qt,initialized:!0,events:[]})}updateData(e,r){return c(this,null,function*(){return e})}};function Pr(t){return"events"in t&&t.events!=null&&Array.isArray(t.events)&&t.events.every(e=>Zt(e))}var Xe=class{constructor(e){this.store=e}request(e){return c(this,null,function*(){let r=yield this.store.getMeta();r.events.push(e),yield this.store.overwriteMeta(r)})}};var et=class extends Xt.Plugin{constructor(e,r){super(e,r)}onload(){return c(this,null,function*(){let e=new Je(()=>this.loadData(),Ee=>this.saveData(Ee)),r=new $e(e),a=new Xe(r),o=new We(r),s=new Ze(r),p=new Qe(r),d=new Ne(o,s,p),g=new Ye(r,a),K=new Ae(g),z=new je,W=new ze,X=new Ge(K),ne=new Ve,re=new qe,ue=new Ke(e,z,W,X,ne,re);yield ue.initializeData();let be=new Oe(this);be.addModal(d),yield be.addFavorites(p),this.addSettingTab(new Re(this.app,this,d,p,g,ue))})}};
|
||
/*! Bundled license information:
|
||
|
||
papaparse/papaparse.min.js:
|
||
(* @license
|
||
Papa Parse
|
||
v5.5.1
|
||
https://github.com/mholt/PapaParse
|
||
License: MIT
|
||
*)
|
||
*/
|
||
|
||
/* nosourcemap */ |