607 lines
216 KiB
JavaScript
Executable File
607 lines
216 KiB
JavaScript
Executable File
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
https://github.com/LBF38/obsidian-syncthing-integration
|
|
|
|
It is MIT-licensed:
|
|
|
|
Copyright (c) 2023 LBF38
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|
|
|
|
|
|
Other used code in this built file is licensed as follows:
|
|
|
|
This plugin uses diff2html:
|
|
https://github.com/rtfpessoa/diff2html
|
|
|
|
Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
This plugin and diff2html use jsdiff:
|
|
https://github.com/kpdecker/jsdiff
|
|
|
|
Software License Agreement (BSD License)
|
|
|
|
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
|
|
|
All rights reserved.
|
|
|
|
Redistribution and use of this software in source and binary forms, with or without modification,
|
|
are permitted provided that the following conditions are met:
|
|
|
|
* Redistributions of source code must retain the above
|
|
copyright notice, this list of conditions and the
|
|
following disclaimer.
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
copyright notice, this list of conditions and the
|
|
following disclaimer in the documentation and/or other
|
|
materials provided with the distribution.
|
|
|
|
* Neither the name of Kevin Decker nor the names of its
|
|
contributors may be used to endorse or promote products
|
|
derived from this software without specific prior
|
|
written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
diff2html uses hogan.js:
|
|
https://github.com/twitter/hogan.js
|
|
|
|
Apache License
|
|
Version 2.0, January 2004
|
|
http://www.apache.org/licenses/
|
|
|
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
|
|
1. Definitions.
|
|
|
|
"License" shall mean the terms and conditions for use, reproduction,
|
|
and distribution as defined by Sections 1 through 9 of this document.
|
|
|
|
"Licensor" shall mean the copyright owner or entity authorized by
|
|
the copyright owner that is granting the License.
|
|
|
|
"Legal Entity" shall mean the union of the acting entity and all
|
|
other entities that control, are controlled by, or are under common
|
|
control with that entity. For the purposes of this definition,
|
|
"control" means (i) the power, direct or indirect, to cause the
|
|
direction or management of such entity, whether by contract or
|
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
|
|
"You" (or "Your") shall mean an individual or Legal Entity
|
|
exercising permissions granted by this License.
|
|
|
|
"Source" form shall mean the preferred form for making modifications,
|
|
including but not limited to software source code, documentation
|
|
source, and configuration files.
|
|
|
|
"Object" form shall mean any form resulting from mechanical
|
|
transformation or translation of a Source form, including but
|
|
not limited to compiled object code, generated documentation,
|
|
and conversions to other media types.
|
|
|
|
"Work" shall mean the work of authorship, whether in Source or
|
|
Object form, made available under the License, as indicated by a
|
|
copyright notice that is included in or attached to the work
|
|
(an example is provided in the Appendix below).
|
|
|
|
"Derivative Works" shall mean any work, whether in Source or Object
|
|
form, that is based on (or derived from) the Work and for which the
|
|
editorial revisions, annotations, elaborations, or other modifications
|
|
represent, as a whole, an original work of authorship. For the purposes
|
|
of this License, Derivative Works shall not include works that remain
|
|
separable from, or merely link (or bind by name) to the interfaces of,
|
|
the Work and Derivative Works thereof.
|
|
|
|
"Contribution" shall mean any work of authorship, including
|
|
the original version of the Work and any modifications or additions
|
|
to that Work or Derivative Works thereof, that is intentionally
|
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
or by an individual or Legal Entity authorized to submit on behalf of
|
|
the copyright owner. For the purposes of this definition, "submitted"
|
|
means any form of electronic, verbal, or written communication sent
|
|
to the Licensor or its representatives, including but not limited to
|
|
communication on electronic mailing lists, source code control systems,
|
|
and issue tracking systems that are managed by, or on behalf of, the
|
|
Licensor for the purpose of discussing and improving the Work, but
|
|
excluding communication that is conspicuously marked or otherwise
|
|
designated in writing by the copyright owner as "Not a Contribution."
|
|
|
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
on behalf of whom a Contribution has been received by Licensor and
|
|
subsequently incorporated within the Work.
|
|
|
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
this License, each Contributor hereby grants to You a perpetual,
|
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
copyright license to reproduce, prepare Derivative Works of,
|
|
publicly display, publicly perform, sublicense, and distribute the
|
|
Work and such Derivative Works in Source or Object form.
|
|
|
|
3. Grant of Patent License. Subject to the terms and conditions of
|
|
this License, each Contributor hereby grants to You a perpetual,
|
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
(except as stated in this section) patent license to make, have made,
|
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
where such license applies only to those patent claims licensable
|
|
by such Contributor that are necessarily infringed by their
|
|
Contribution(s) alone or by combination of their Contribution(s)
|
|
with the Work to which such Contribution(s) was submitted. If You
|
|
institute patent litigation against any entity (including a
|
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
or a Contribution incorporated within the Work constitutes direct
|
|
or contributory patent infringement, then any patent licenses
|
|
granted to You under this License for that Work shall terminate
|
|
as of the date such litigation is filed.
|
|
|
|
4. Redistribution. You may reproduce and distribute copies of the
|
|
Work or Derivative Works thereof in any medium, with or without
|
|
modifications, and in Source or Object form, provided that You
|
|
meet the following conditions:
|
|
|
|
(a) You must give any other recipients of the Work or
|
|
Derivative Works a copy of this License; and
|
|
|
|
(b) You must cause any modified files to carry prominent notices
|
|
stating that You changed the files; and
|
|
|
|
(c) You must retain, in the Source form of any Derivative Works
|
|
that You distribute, all copyright, patent, trademark, and
|
|
attribution notices from the Source form of the Work,
|
|
excluding those notices that do not pertain to any part of
|
|
the Derivative Works; and
|
|
|
|
(d) If the Work includes a "NOTICE" text file as part of its
|
|
distribution, then any Derivative Works that You distribute must
|
|
include a readable copy of the attribution notices contained
|
|
within such NOTICE file, excluding those notices that do not
|
|
pertain to any part of the Derivative Works, in at least one
|
|
of the following places: within a NOTICE text file distributed
|
|
as part of the Derivative Works; within the Source form or
|
|
documentation, if provided along with the Derivative Works; or,
|
|
within a display generated by the Derivative Works, if and
|
|
wherever such third-party notices normally appear. The contents
|
|
of the NOTICE file are for informational purposes only and
|
|
do not modify the License. You may add Your own attribution
|
|
notices within Derivative Works that You distribute, alongside
|
|
or as an addendum to the NOTICE text from the Work, provided
|
|
that such additional attribution notices cannot be construed
|
|
as modifying the License.
|
|
|
|
You may add Your own copyright statement to Your modifications and
|
|
may provide additional or different license terms and conditions
|
|
for use, reproduction, or distribution of Your modifications, or
|
|
for any such Derivative Works as a whole, provided Your use,
|
|
reproduction, and distribution of the Work otherwise complies with
|
|
the conditions stated in this License.
|
|
|
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
any Contribution intentionally submitted for inclusion in the Work
|
|
by You to the Licensor shall be under the terms and conditions of
|
|
this License, without any additional terms or conditions.
|
|
Notwithstanding the above, nothing herein shall supersede or modify
|
|
the terms of any separate license agreement you may have executed
|
|
with Licensor regarding such Contributions.
|
|
|
|
6. Trademarks. This License does not grant permission to use the trade
|
|
names, trademarks, service marks, or product names of the Licensor,
|
|
except as required for reasonable and customary use in describing the
|
|
origin of the Work and reproducing the content of the NOTICE file.
|
|
|
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
agreed to in writing, Licensor provides the Work (and each
|
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
implied, including, without limitation, any warranties or conditions
|
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
appropriateness of using or redistributing the Work and assume any
|
|
risks associated with Your exercise of permissions under this License.
|
|
|
|
8. Limitation of Liability. In no event and under no legal theory,
|
|
whether in tort (including negligence), contract, or otherwise,
|
|
unless required by applicable law (such as deliberate and grossly
|
|
negligent acts) or agreed to in writing, shall any Contributor be
|
|
liable to You for damages, including any direct, indirect, special,
|
|
incidental, or consequential damages of any character arising as a
|
|
result of this License or out of the use or inability to use the
|
|
Work (including but not limited to damages for loss of goodwill,
|
|
work stoppage, computer failure or malfunction, or any and all
|
|
other commercial damages or losses), even if such Contributor
|
|
has been advised of the possibility of such damages.
|
|
|
|
9. Accepting Warranty or Additional Liability. While redistributing
|
|
the Work or Derivative Works thereof, You may choose to offer,
|
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
or other liability obligations and/or rights consistent with this
|
|
License. However, in accepting such obligations, You may act only
|
|
on Your own behalf and on Your sole responsibility, not on behalf
|
|
of any other Contributor, and only if You agree to indemnify,
|
|
defend, and hold each Contributor harmless for any liability
|
|
incurred by, or claims asserted against, such Contributor by reason
|
|
of your accepting any such warranty or additional liability.
|
|
|
|
END OF TERMS AND CONDITIONS
|
|
|
|
hogan.js uses nopt:
|
|
https://github.com/npm/nopt
|
|
|
|
The ISC License
|
|
|
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
nopt uses abbrev:
|
|
https://github.com/npm/abbrev-js
|
|
|
|
This software is dual-licensed under the ISC and MIT licenses.
|
|
You may use this software under EITHER of the following licenses.
|
|
|
|
----------
|
|
|
|
The ISC License
|
|
|
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
hogan.js uses mkdirp:
|
|
https://github.com/isaacs/node-mkdirp
|
|
|
|
Copyright (c) 2011-2022 James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
|
|
|
|
This project is free software released under the MIT license:
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
*/
|
|
|
|
"use strict";var la=Object.create;var Sn=Object.defineProperty;var aa=Object.getOwnPropertyDescriptor;var ca=Object.getOwnPropertyNames;var ua=Object.getPrototypeOf,fa=Object.prototype.hasOwnProperty;var da=(i,e,t)=>e in i?Sn(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var it=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),pa=(i,e)=>{for(var t in e)Sn(i,t,{get:e[t],enumerable:!0})},$o=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ca(e))!fa.call(i,r)&&r!==t&&Sn(i,r,{get:()=>e[r],enumerable:!(n=aa(e,r))||n.enumerable});return i};var ga=(i,e,t)=>(t=i!=null?la(ua(i)):{},$o(e||!i||!i.__esModule?Sn(t,"default",{value:i,enumerable:!0}):t,i)),ma=i=>$o(Sn({},"__esModule",{value:!0}),i);var K=(i,e,t)=>(da(i,typeof e!="symbol"?e+"":e,t),t),ha=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var br=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)};var ri=(i,e,t)=>(ha(i,e,"access private method"),t);var kr=it(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.FORMAT_PLAIN=At.FORMAT_HTML=At.FORMATS=void 0;var No="html";At.FORMAT_HTML=No;var Ao="plain";At.FORMAT_PLAIN=Ao;var va=[No,Ao];At.FORMATS=va});var Po=it(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.UNIT_WORDS=nt.UNIT_WORD=nt.UNIT_SENTENCES=nt.UNIT_SENTENCE=nt.UNIT_PARAGRAPHS=nt.UNIT_PARAGRAPH=nt.UNITS=void 0;var Do="words";nt.UNIT_WORDS=Do;var jo="word";nt.UNIT_WORD=jo;var Eo="sentences";nt.UNIT_SENTENCES=Eo;var Fo="sentence";nt.UNIT_SENTENCE=Fo;var zo="paragraphs";nt.UNIT_PARAGRAPHS=zo;var Oo="paragraph";nt.UNIT_PARAGRAPH=Oo;var wa=[Do,jo,Eo,Fo,zo,Oo];nt.UNITS=wa});var xr=it(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.WORDS=void 0;var ka=["ad","adipisicing","aliqua","aliquip","amet","anim","aute","cillum","commodo","consectetur","consequat","culpa","cupidatat","deserunt","do","dolor","dolore","duis","ea","eiusmod","elit","enim","esse","est","et","eu","ex","excepteur","exercitation","fugiat","id","in","incididunt","ipsum","irure","labore","laboris","laborum","Lorem","magna","minim","mollit","nisi","non","nostrud","nulla","occaecat","officia","pariatur","proident","qui","quis","reprehenderit","sint","sit","sunt","tempor","ullamco","ut","velit","veniam","voluptate"];li.WORDS=ka});var Ro=it(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.LINE_ENDINGS=void 0;var xa={POSIX:`
|
|
`,WIN32:`\r
|
|
`};ai.LINE_ENDINGS=xa});var Bo=it(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.default=void 0;var Ca=function(e){var t=e.trim();return t.charAt(0).toUpperCase()+t.slice(1)},Ia=Ca;ci.default=Ia});var Go=it((ui,Cr)=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.default=void 0;var Ma=function(){return typeof Cr!="undefined"&&!!Cr.exports},Sa=Ma;ui.default=Sa});var Zo=it(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.default=void 0;var $a=function(){var e=!1;try{e=navigator.product==="ReactNative"}catch(t){e=!1}return e},Ta=$a;fi.default=Ta});var Wo=it(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.SUPPORTED_PLATFORMS=void 0;var La={DARWIN:"darwin",LINUX:"linux",WIN32:"win32"};di.SUPPORTED_PLATFORMS=La});var Qo=it(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.default=void 0;var Na=Wo(),Aa=function(){var e=!1;try{e=process.platform===Na.SUPPORTED_PLATFORMS.WIN32}catch(t){e=!1}return e},Da=Aa;pi.default=Da});var Ir=it(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.default=void 0;var ja=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return Array.apply(null,Array(e)).map(function(t,n){return n})},Ea=ja;gi.default=Ea});var Yo=it(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.default=void 0;var Fa=za(Ir());function za(i){return i&&i.__esModule?i:{default:i}}var Oa=function(e,t){var n=(0,Fa.default)(e);return n.map(function(){return t()})},Pa=Oa;mi.default=Pa});var Mr=it(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Object.defineProperty(Dt,"capitalize",{enumerable:!0,get:function(){return Ra.default}});Object.defineProperty(Dt,"isNode",{enumerable:!0,get:function(){return Ba.default}});Object.defineProperty(Dt,"isReactNative",{enumerable:!0,get:function(){return Ga.default}});Object.defineProperty(Dt,"isWindows",{enumerable:!0,get:function(){return Za.default}});Object.defineProperty(Dt,"makeArrayOfLength",{enumerable:!0,get:function(){return Wa.default}});Object.defineProperty(Dt,"makeArrayOfStrings",{enumerable:!0,get:function(){return Qa.default}});var Ra=un(Bo()),Ba=un(Go()),Ga=un(Zo()),Za=un(Qo()),Wa=un(Ir()),Qa=un(Yo());function un(i){return i&&i.__esModule?i:{default:i}}});var Jo=it(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.default=void 0;var Ya=xr(),Sr=Mr();function Ua(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Uo(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,n.key,n)}}function Ja(i,e,t){return e&&Uo(i.prototype,e),t&&Uo(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function hi(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Ha=function(){function i(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.sentencesPerParagraph,n=t===void 0?{max:7,min:3}:t,r=e.wordsPerSentence,o=r===void 0?{max:15,min:5}:r,s=e.random,a=e.seed,l=e.words,u=l===void 0?Ya.WORDS:l;if(Ua(this,i),hi(this,"sentencesPerParagraph",void 0),hi(this,"wordsPerSentence",void 0),hi(this,"random",void 0),hi(this,"words",void 0),n.min>n.max)throw new Error("Minimum number of sentences per paragraph (".concat(n.min,") cannot exceed maximum (").concat(n.max,")."));if(o.min>o.max)throw new Error("Minimum number of words per sentence (".concat(o.min,") cannot exceed maximum (").concat(o.max,")."));this.sentencesPerParagraph=n,this.words=u,this.wordsPerSentence=o,this.random=s||Math.random}return Ja(i,[{key:"generateRandomInteger",value:function(t,n){return Math.floor(this.random()*(n-t+1)+t)}},{key:"generateRandomWords",value:function(t){var n=this,r=this.wordsPerSentence,o=r.min,s=r.max,a=t||this.generateRandomInteger(o,s);return(0,Sr.makeArrayOfLength)(a).reduce(function(l,u){return"".concat(n.pluckRandomWord()," ").concat(l)},"").trim()}},{key:"generateRandomSentence",value:function(t){return"".concat((0,Sr.capitalize)(this.generateRandomWords(t)),".")}},{key:"generateRandomParagraph",value:function(t){var n=this,r=this.sentencesPerParagraph,o=r.min,s=r.max,a=t||this.generateRandomInteger(o,s);return(0,Sr.makeArrayOfLength)(a).reduce(function(l,u){return"".concat(n.generateRandomSentence()," ").concat(l)},"").trim()}},{key:"pluckRandomWord",value:function(){var t=0,n=this.words.length-1,r=this.generateRandomInteger(t,n);return this.words[r]}}]),i}(),qa=Ha;_i.default=qa});var Vo=it(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.default=void 0;var bi=kr(),Ho=Ro(),Va=Xa(Jo()),yi=Mr();function Xa(i){return i&&i.__esModule?i:{default:i}}function Ka(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function qo(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,n.key,n)}}function ec(i,e,t){return e&&qo(i.prototype,e),t&&qo(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function tc(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var nc=function(){function i(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bi.FORMAT_PLAIN,n=arguments.length>2?arguments[2]:void 0;if(Ka(this,i),this.format=t,this.suffix=n,tc(this,"generator",void 0),bi.FORMATS.indexOf(t.toLowerCase())===-1)throw new Error("".concat(t," is an invalid format. Please use ").concat(bi.FORMATS.join(" or "),"."));this.generator=new Va.default(e)}return ec(i,[{key:"getLineEnding",value:function(){return this.suffix?this.suffix:!(0,yi.isReactNative)()&&(0,yi.isNode)()&&(0,yi.isWindows)()?Ho.LINE_ENDINGS.WIN32:Ho.LINE_ENDINGS.POSIX}},{key:"formatString",value:function(t){return this.format===bi.FORMAT_HTML?"<p>".concat(t,"</p>"):t}},{key:"formatStrings",value:function(t){var n=this;return t.map(function(r){return n.formatString(r)})}},{key:"generateWords",value:function(t){return this.formatString(this.generator.generateRandomWords(t))}},{key:"generateSentences",value:function(t){return this.formatString(this.generator.generateRandomParagraph(t))}},{key:"generateParagraphs",value:function(t){var n=this.generator.generateRandomParagraph.bind(this.generator);return this.formatStrings((0,yi.makeArrayOfStrings)(t,n)).join(this.getLineEnding())}}]),i}(),ic=nc;vi.default=ic});var Ko=it(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Object.defineProperty(Ln,"LoremIpsum",{enumerable:!0,get:function(){return Xo.default}});Ln.loremIpsum=void 0;var rc=kr(),Wt=Po(),oc=xr(),Xo=sc(Vo());function sc(i){return i&&i.__esModule?i:{default:i}}var lc=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.count,n=t===void 0?1:t,r=e.format,o=r===void 0?rc.FORMAT_PLAIN:r,s=e.paragraphLowerBound,a=s===void 0?3:s,l=e.paragraphUpperBound,u=l===void 0?7:l,f=e.random,d=e.sentenceLowerBound,m=d===void 0?5:d,g=e.sentenceUpperBound,_=g===void 0?15:g,k=e.units,x=k===void 0?Wt.UNIT_SENTENCES:k,C=e.words,w=C===void 0?oc.WORDS:C,S=e.suffix,T=S===void 0?"":S,P={random:f,sentencesPerParagraph:{max:u,min:a},words:w,wordsPerSentence:{max:_,min:m}},Z=new Xo.default(P,o,T);switch(x){case Wt.UNIT_PARAGRAPHS:case Wt.UNIT_PARAGRAPH:return Z.generateParagraphs(n);case Wt.UNIT_SENTENCES:case Wt.UNIT_SENTENCE:return Z.generateSentences(n);case Wt.UNIT_WORDS:case Wt.UNIT_WORD:return Z.generateWords(n);default:return""}};Ln.loremIpsum=lc});var jd={};pa(jd,{default:()=>fr});module.exports=ma(jd);var Ot=require("obsidian");var Tn=require("obsidian");var _e=class{constructor(e){this.message=e}},Gt=class extends _e{constructor(e){super(e||"Failed to get configuration from REST API")}},vt=class extends _e{constructor(e){super(e||"Failed to get configuration from CLI")}};var yr=require("obsidian");function vr(i,e,t){switch(e){case"recent":return new Map([...i.entries()].sort((n,r)=>Zt(n[1],r[1])));case"old":return new Map([...i.entries()].sort((n,r)=>Zt(n[1],r[1])).reverse());case"a-to-z":return new Map([...i.entries()].sort());case"z-to-a":return new Map([...i.entries()].sort().reverse())}}function Zt(i,e){if(i instanceof yr.TFile&&e instanceof yr.TFile){let r=tt(i.basename),o=tt(e.basename),s=r instanceof _e?new Date:r.dateTime;return(o instanceof _e?new Date:o.dateTime).getTime()-s.getTime()}let t=i.sort((r,o)=>Zt(r,o))[0],n=e.sort((r,o)=>Zt(r,o))[0];return Zt(t,n)}var To=/(.*).sync-conflict-(\d{8})-(\d{6})-(\w+).(\w+)/;function tt(i){let t=new RegExp(To).exec(i);return t?{filename:t[1],date:t[2],time:t[3],dateTime:new Date(`${t[2].slice(0,4)}-${t[2].slice(4,6)}-${t[2].slice(6,8)}T${t[3].slice(0,2)}:${t[3].slice(2,4)}:${t[3].slice(4,6)}`),modifiedBy:t[4],extension:t[5]}:new _e(`Error parsing conflict filename : ${i}`)}function $n(i){return!!new RegExp(To).exec(i)}function cn(i,e=2){if(i===0)return"0 Bytes";let t=1024,n=e<0?0:e,r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(i)/Math.log(t));return parseFloat((i/Math.pow(t,o)).toFixed(n))+" "+r[o]}function _a(i,e){if(!Array.isArray(i))return!1;for(let t of i)if(!e(t))return!1;return!0}function Lo(i){return _a(i,e=>typeof e=="string")}function ba(i,e,t){return typeof i=="object"&&i!==null&&e in i&&typeof i[e]===t}function lt(i,e,t){ba(i,e,t)||console.error(`Error validating JSON: ${e} is not present or is not of type ${typeof t}. Got ${JSON.stringify(i)}.`)}var oi=class{constructor(e,t,n,r){this.syncthingFromCLI=e;this.syncthingFromREST=t;this.syncthingFromAndroid=n;this.plugin=r}async isRunning(){return console.log("isRunning"),this.syncthingFromREST.ping().then(e=>(console.log(e),!0)).catch(e=>(console.log(e),!1))}getCLIStatus(){return this.syncthingFromCLI.getVersion()}async getAPIStatus(){return this.plugin.settings.api_key?this.syncthingFromREST.ping():"API key is not set."}async hasSyncthing(){return Tn.Platform.isAndroidApp?await this.syncthingFromAndroid.hasSyncthing():Tn.Platform.isIosApp?!1:await this.syncthingFromCLI.getVersion().then(e=>!0).catch(async e=>await this.syncthingFromREST.ping().then(t=>!0).catch(t=>!1))}async getConflictsWithOriginal(e){let t=this.plugin.app.vault.getFiles();if($n(e.basename)){let r=tt(e.basename);if(r instanceof _e)throw console.error(r.message),new Error("Error parsing conflict filename.");let o=t.filter(a=>a.name.contains(".sync-conflict")&&a.name.contains(r.filename)||a.basename===r.filename),s=t.find(a=>a.basename===r.filename);return s&&o.remove(s),{originalFile:s,conflicts:o}}return{conflicts:t.filter(r=>r.name.contains(".sync-conflict")&&r.name.contains(e.basename))}}async getConflicts(){let t=this.plugin.app.vault.getFiles().filter(r=>r.name.contains(".sync-conflict"));if(t.length===0)return new _e("No conflicts found.");let n=new Map;for(let r of t){let o=tt(r.name);if(o instanceof _e)return o;let s=o.filename;if(n.has(s)){n.get(s).push(r),n.set(s,n.get(s).sort((a,l)=>Zt(a,l)));continue}n.set(s,[r])}return n}async getDiffFiles(e){let t=tt(e.name);if(t instanceof _e)return{originalFile:e,conflictingFiles:t,conflictingFilesProperties:new Map().set(e,t)};let r=this.plugin.app.vault.getFiles().filter(l=>l.name.contains(".sync-conflict")&&l.name.contains(t.filename)||l.basename===t.filename),o=r.find(l=>l.basename===t.filename);o&&r.remove(o);let s=r.length>0?r:new _e("No conflicts found.");if(s instanceof _e)return{originalFile:o||e,conflictingFiles:s,conflictingFilesProperties:new Map().set(e,s)};let a=new Map;for(let l of r){let u=tt(l.name);a.set(l,u)}return{originalFile:o||e,conflictingFiles:r,conflictingFilesProperties:a}}async getAPIKey(){if(Tn.Platform.isMobileApp)return new _e("Cannot get API key on mobile. Please enter it manually.");if(!this.plugin.settings.api_key)try{let e=await this.syncthingFromCLI.getAPIkey();if(e)return this.plugin.settings.api_key=e,await this.plugin.saveSettings(),e}catch(e){return new vt("Error getting API key.")}return this.plugin.settings.api_key}async getConfiguration(){if(!await this.isRunning())return new _e("Syncthing is not running.");try{return await this.syncthingFromREST.getConfiguration()}catch(e){return Tn.Platform.isMobileApp?(console.error(e),new Gt):await this.syncthingFromCLI.getConfiguration()}}async getDevices(){return await this.syncthingFromREST.getDevices()}async getFolders(){return await this.syncthingFromREST.getAllFolders()}async startSyncthing(){return this.syncthingFromCLI.startSyncthing()}async stopSyncthing(){return this.syncthingFromCLI.stopSyncthing()}};function si(i,e){return i=isNaN(Number(i))?0:Number(i),e=isNaN(Number(e))?100:Number(e),Math.floor(Math.random()*(e-i)+i)}var ya={from:new Date(0),to:new Date((2<<29)*si(1,8046627))};function wr(i){return i=typeof i=="object"?i:ya,new Date(si(+i.from,+i.to))}var fn=ga(Ko()),rt=require("obsidian"),dn=class{constructor(e){this.plugin=e}async generateSyncthingConflicts(e=2,t=3){new rt.Notice("Creating main files..."),new rt.Notice(`Parameters: ${e} distinct files, ${t} conflicts per file.`);let n=new rt.Notice(""),r=new rt.Notice("");for(let o=0;o<e;o++){n.setMessage(`Progress (main files): ${o}/${e}`);let s=await this.plugin.app.vault.create(`${(0,fn.loremIpsum)({count:1,units:"words"})}.md`,`# ${(0,fn.loremIpsum)({count:1,units:"words"})}
|
|
|
|
${(0,fn.loremIpsum)({count:1,units:"paragraphs"})}`);console.log("In the generateSyncthingConflicts function."),new rt.Notice("Creating conflict files...");for(let a=0;a<t;a++){r.setMessage(`Progress (conflicts): ${a}/${t}`);let u=wr({from:new Date(2020,0,1),to:new Date}).toISOString().replace(/-/gm,"").replace("T","-").replace(/:|\.\d{3}Z/gm,""),f=Math.random().toString(36).substring(2,9).toUpperCase();console.log(u),await this.plugin.app.vault.create(`${s.basename}.sync-conflict-${u}-${f}.md`,`# ${(0,fn.loremIpsum)({count:1,units:"words"})}
|
|
|
|
${(0,fn.loremIpsum)({count:2,units:"paragraphs"})}`)}}}async purgeVault(){this.plugin.app.vault.getAllLoadedFiles().forEach(async e=>{await this.plugin.app.vault.delete(e)})}},Nn=class extends rt.Modal{constructor(t,n){super(t);this.pluginDevModeController=n;this.distinctFiles=2,this.conflictsPerFile=3}onOpen(){let{contentEl:t}=this;t.createEl("h2",{text:"Plugin development mode"}),t.createEl("p",{text:`Here, you can create sample files to test the Obsidian Syncthing integration plugin.
|
|
The generated files are formated as in Syncthing documentation about conflicting files.`}),t.createEl("p",{text:"File format : <filename>.sync-conflict-<date>-<deviceID>.<extension>"}),new rt.Setting(t).setName("Number of distinct files").setDesc("Number of files that will be created.").addSlider(n=>{n.setValue(this.distinctFiles).setDynamicTooltip().setLimits(1,50,1).onChange(r=>{this.distinctFiles=r})}),new rt.Setting(t).setName("Number of conflicts per file").setDesc("Number of conflicts that will be created for each file.").addSlider(n=>{n.setValue(this.conflictsPerFile).setDynamicTooltip().setLimits(1,25,1).onChange(r=>{this.conflictsPerFile=r})}),new rt.Setting(t).setName("Generate Syncthing conflicts").addButton(n=>{n.setCta().setButtonText("Generate").onClick(async()=>{await this.pluginDevModeController.generateSyncthingConflicts(this.distinctFiles,this.conflictsPerFile),this.close()})}),new rt.Setting(t).setName("Purge Vault").setDesc("Delete all files in the vault.").addButton(n=>{n.setWarning().setButtonText("Purge").onClick(async()=>{let r=new rt.Modal(this.app);r.contentEl.createEl("h1",{text:"Purge Vault"}),r.contentEl.createEl("p",{text:"This will delete all files in the vault. Please don't use it on a vault that contains important files."}),new rt.Setting(r.contentEl).setName("Are you sure?").setHeading().addButton(o=>{o.setWarning().setButtonText("Yes").onClick(async()=>{await this.pluginDevModeController.purgeVault(),r.close(),this.close()})}).addButton(o=>{o.setButtonText("No").onClick(()=>{r.close()})}),r.open()})})}onClose(){let{contentEl:t}=this;t.empty()}};var An=require("obsidian");var wi=class{constructor(e,t){this.status_bar=e;this.plugin=t;this.app=t.app,this.currentFile=this.app.workspace.getActiveFile()}onload(){this.createStatusBar(),this.plugin.registerEvent(this.plugin.app.workspace.on("file-open",e=>{this.currentFile=e,this.createStatusBar()})),this.status_bar.onClickEvent(e=>{var n,r;let t=new An.Menu;if(t.addItem(o=>{o.setTitle("Open all conflicts as splits").onClick(()=>{var s;(s=this.activeConflicts)==null||s.forEach(async a=>{await this.app.workspace.createLeafBySplit(this.app.workspace.getLeaf()).openFile(a)})}),o.setIcon("arrow-up-right")}),this.currentFile&&$n(this.currentFile.name)&&this.originalFile===void 0){let o=this.currentFile;t.addItem(s=>{s.setTitle("Rename to original").onClick(async()=>{let a=tt(o.name);if(a instanceof _e){new An.Notice("Failed to parse conflict filename"),console.error(a.message);return}new An.Notice("Not implemented yet")}),s.setIcon("pencil")})}this.originalFile!==void 0&&t.addItem(o=>{o.setTitle("Open original file").onClick(async()=>await this.app.workspace.createLeafBySplit(this.app.workspace.getLeaf()).openFile(this.originalFile)),o.setIcon("arrow-up-right")}),t.addSeparator(),(n=this.activeConflicts)==null||n.sort((o,s)=>{let a=tt(o.basename),l=tt(s.basename);return a instanceof _e||l instanceof _e?0:a.dateTime>l.dateTime?-1:a.dateTime<l.dateTime?1:0}),(r=this.activeConflicts)==null||r.forEach(o=>{t.addItem(s=>{if($n(o.basename)){let a=tt(o.basename);if(a instanceof _e)return;s.setTitle(`${a.filename} (caused by ${a.modifiedBy} on ${a.dateTime.toISOString().replace("T"," ").replace("Z","")})`)}s.setIcon("file"),s.onClick(async()=>{await this.app.workspace.createLeafBySplit(this.app.workspace.getLeaf()).openFile(o)})})}),t.showAtPosition({x:window.innerWidth-15,y:window.innerHeight-37})}),this.status_bar.addClass("mod-clickable"),this.status_bar.style.color="var(--text-warning)"}createStatusBar(){let e=this.app.workspace.getActiveFile();if(!e){this.status_bar.empty();return}this.plugin.syncthingController.getConflictsWithOriginal(e).then(t=>{if(this.activeConflicts=t.conflicts,this.activeConflicts.remove(e),this.originalFile=t.originalFile,!this.activeConflicts||this.activeConflicts.length===0){this.status_bar.empty();return}this.status_bar.setText(`${this.activeConflicts.length} conflicts`)})}onunload(){this.status_bar.empty()}};var es=require("obsidian"),ki=class{async hasSyncthing(){return console.log("Platform: ",es.Platform),console.log("Obsidian App: ",app),!0}async openSyncthing(){let t="syncthing://com.nutomic.syncthingandroid",n="https://play.google.com/store/apps/details?id=com.nutomic.syncthingandroid",r=()=>{window.location.href=t},s=setTimeout(()=>{window.location.href=n},2e3);return r(),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(console.log("Syncthing is installed"),clearTimeout(s))}),!0}};var xi=class{constructor(e,t,n,r){this.version=e;this.folders=t;this.devices=n;this.url=r}},Ci=class{constructor(e,t,n,r,o,s,a){this.id=e;this.label=t;this.path=n;this.filesystemType=r;this.type=o;this.devices=s;this.maxConflicts=a}},Ii=class{constructor(e,t,n,r,o,s){this.deviceID=e;this.introducedBy=t;this.address=n;this.paused=r;this.ignoredFolders=o;this.name=s}},Mi=class{constructor(e,t,n){this.deviceID=e;this.introducedBy=t;this.encryptionPassword=n}};var pn=class i extends xi{constructor(e,t,n,r={protocol:"http",ip_address:"localhost",port:8384}){super(e,t,n,r)}static fromJSON(e){let t=JSON.parse(e),n=[];if(!(typeof t=="object"&&t!==null))throw new Error("JSON is not an object or is null");if(lt(t,"version","string"),!("folders"in t&&Array.isArray(t.folders))||!("devices"in t&&Array.isArray(t.devices)))throw new Error("Error parsing JSON: missing fields or wrong type");for(let o of t.folders)console.log(o),n.push(Dn.fromJSON(JSON.stringify(o)));let r=[];for(let o of t.devices)r.push(jn.fromJSON(JSON.stringify(o)));return new i(t.version,n,r)}toJSON(){return JSON.stringify(this)}},Dn=class i extends Ci{static fromJSON(e){let t=JSON.parse(e),n=[];if(!(typeof t=="object"&&t!==null))throw new Error("JSON is not an object or is null");if(lt(t,"id","string"),lt(t,"label","string"),lt(t,"path","string"),lt(t,"filesystemType","string"),lt(t,"type","string"),lt(t,"maxConflicts",0),!("devices"in t&&Array.isArray(t.devices)))throw new Error("Error validating JSON: devices is not present or is not an array");for(let r of t.devices)n.push($r.fromJSON(JSON.stringify(r)));return new i(t.id,t.label,t.path,t.filesystemType,t.type,n,t.maxConflicts)}toJSON(){return JSON.stringify(this)}},jn=class i extends Ii{static fromJSON(e){var n;let t=JSON.parse(e);if(!(typeof t=="object"&&t!==null))throw new Error("JSON is not an object or is null");if(lt(t,"deviceID","string"),lt(t,"introducedBy","string"),lt(t,"paused",!0),!("addresses"in t&&Lo(t.addresses))||!("ignoredFolders"in t)||!("name"in t&&(typeof t.name=="string"||typeof t.name=="undefined")))throw new Error("Error validating JSON");return new i(t.deviceID,t.introducedBy,t.addresses,t.paused,t.ignoredFolders,(n=t.name)!=null?n:"")}toJSON(){return JSON.stringify(this)}},$r=class i extends Mi{static fromJSON(e){let t=JSON.parse(e);if(!(typeof t=="object"&&t!==null))throw new Error("Error parsing JSON");return lt(t,"deviceID","string"),lt(t,"introducedBy","string"),lt(t,"encryptionPassword","string"),new i(t.deviceID,t.introducedBy,t.encryptionPassword)}toJSON(){throw new Error("Method not implemented.")}};var Tr=require("obsidian"),Si=class{async stopSyncthing(){let t=this.runSyncthingCommand("syncthing cli operations shutdown");if(t instanceof Error)throw new vt(t.message);return!0}async startSyncthing(){let t=await this.runSyncthingCommand("syncthing");if(t instanceof Error)throw new vt(t.message);return!0}async getVersion(){let t=await this.runSyncthingCommand("syncthing --version");if(t instanceof Error)throw new vt(t.message);return t}async getConfiguration(){let t=await this.runSyncthingCommand("syncthing cli config dump-json");if(t instanceof Error)throw new vt(t.message);return pn.fromJSON(t)}async getAPIkey(){let e=await this.runSyncthingCommand("syncthing cli config gui apikey get");if(e instanceof Error)throw new vt("No API key found.");return e.trim()}async runSyncthingCommand(e){if(Tr.Platform.isMobileApp)return Error("CLI not supported on mobile.");let{promisify:t}=require("util");if(Tr.Platform.isMacOS&&e.startsWith("syncthing")){let s="/Applications/Syncthing.app/Contents/Resources/syncthing/",{stat:a}=require("fs");(await t(a)(s)).isDirectory()&&(e=s+e)}let{exec:n}=require("child_process"),o=await t(n)(e);return o.stderr?Error(o.stderr):o.stdout}};var Ti=require("obsidian");var $i=class{constructor(e){this.plugin=e}async ping(){let e=await this.requestEndpoint("/rest/system/ping");return console.log("REST - ping: ",e),e.json.ping}async getAllFolders(){let e=await this.requestEndpoint("/rest/config/folders"),t=[];console.log("REST: ",e.json);for(let n of e.json)console.log("REST: ",n),t.push(Dn.fromJSON(JSON.stringify(n)));return t}async getFoldersForDevice(e){return(await this.getAllFolders()).filter(n=>n.devices.some(r=>r.deviceID===e.deviceID))}async getDevices(){let e=await this.requestEndpoint("/rest/config/devices"),t=[];console.log("REST: ",e.json);for(let n of e.json)t.push(jn.fromJSON(JSON.stringify(n)));return t}async getConfiguration(){let e=await this.requestEndpoint("/rest/config");return pn.fromJSON(e.json)}async requestEndpoint(e){var o,s,a;console.log("requestEndpoint: Endpoint",e);let t=(o=this.plugin.settings.configuration.url)==null?void 0:o.ip_address;t==="localhost"&&Ti.Platform.isMobileApp&&(t="127.0.0.1");let n=`${(s=this.plugin.settings.configuration.url)==null?void 0:s.protocol}://${t}:${(a=this.plugin.settings.configuration.url)==null?void 0:a.port}${e}`,r=(0,Ti.requestUrl)({url:n,method:"GET",headers:{"X-API-Key":this.plugin.settings.api_key,Accept:"*/*","Content-Type":"application/json","Access-Control-Allow-Origin":"*",redirect:"follow"}});return console.log("requestEndpoint: API Key set ?",this.plugin.settings.api_key!==""),console.log("requestEndpoint: url requested ",n),r.then(l=>{if(console.log("requestEndpoint: response ",l),l.status>=400)throw new Gt(l.text);return l}).catch(l=>{throw console.error("requestEndpoint: error: ",l),new Gt(l)})}};var $l=require("obsidian");function z(){}function xt(i,e){for(let t in e)i[t]=e[t];return i}function ts(i){return!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function"}function Lr(i){return i()}function Li(){return Object.create(null)}function we(i){i.forEach(Lr)}function En(i){return typeof i=="function"}function ue(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}function ns(i){return Object.keys(i).length===0}function is(i,...e){if(i==null){for(let n of e)n(void 0);return z}let t=i.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function rs(i,e,t){i.$$.on_destroy.push(is(e,t))}function Qt(i,e,t,n){if(i){let r=os(i,e,t,n);return i[0](r)}}function os(i,e,t,n){return i[1]&&n?xt(t.ctx.slice(),i[1](n(e))):t.ctx}function Yt(i,e,t,n){if(i[2]&&n){let r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){let o=[],s=Math.max(e.dirty.length,r.length);for(let a=0;a<s;a+=1)o[a]=e.dirty[a]|r[a];return o}return e.dirty|r}return e.dirty}function Ut(i,e,t,n,r,o){if(r){let s=os(e,t,n,o);i.p(s,r)}}function Jt(i){if(i.ctx.length>32){let e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Ni(i){let e={};for(let t in i)t[0]!=="$"&&(e[t]=i[t]);return e}function gn(i,e){let t={};e=new Set(e);for(let n in i)!e.has(n)&&n[0]!=="$"&&(t[n]=i[n]);return t}var Nr=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var Ai=class i{constructor(e){K(this,"_listeners","WeakMap"in Nr?new WeakMap:void 0);K(this,"_observer");K(this,"options");this.options=e}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!=null?e:this._observer=new ResizeObserver(t=>{var n;for(let r of t)i.entries.set(r.target,r),(n=this._listeners.get(r.target))==null||n(r)})}};Ai.entries="WeakMap"in Nr?new WeakMap:void 0;var ss=!1;function ls(){ss=!0}function as(){ss=!1}function c(i,e){i.appendChild(e)}function Ie(i,e,t){let n=cs(i);if(!n.getElementById(e)){let r=p("style");r.id=e,r.textContent=t,uc(n,r)}}function cs(i){if(!i)return document;let e=i.getRootNode?i.getRootNode():i.ownerDocument;return e&&e.host?e:i.ownerDocument}function uc(i,e){return c(i.head||i,e),e.sheet}function v(i,e,t){i.insertBefore(e,t||null)}function y(i){i.parentNode&&i.parentNode.removeChild(i)}function bt(i,e){for(let t=0;t<i.length;t+=1)i[t]&&i[t].d(e)}function p(i){return document.createElement(i)}function fc(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function F(i){return document.createTextNode(i)}function b(){return F(" ")}function ot(){return F("")}function Q(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function h(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}var dc=["width","height"];function mn(i,e){let t=Object.getOwnPropertyDescriptors(i.__proto__);for(let n in e)e[n]==null?i.removeAttribute(n):n==="style"?i.style.cssText=e[n]:n==="__value"?i.value=i[n]=e[n]:t[n]&&t[n].set&&dc.indexOf(n)===-1?i[n]=e[n]:h(i,n,e[n])}function us(i){return Array.from(i.childNodes)}function oe(i,e){e=""+e,i.data!==e&&(i.data=e)}function jt(i,e){i.value=e==null?"":e}function Oe(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,n?"important":"")}function Ar(i,e,t){for(let n=0;n<i.options.length;n+=1){let r=i.options[n];if(r.__value===e){r.selected=!0;return}}(!t||e!==void 0)&&(i.selectedIndex=-1)}function gt(i,e,t){i.classList.toggle(e,!!t)}function Di(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}var Fn=class{constructor(e=!1){K(this,"is_svg",!1);K(this,"e");K(this,"n");K(this,"t");K(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=fc(t.nodeName):this.e=p(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)v(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(y)}};function fs(i){let e={};return i.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}var Et;function ft(i){Et=i}function ji(){if(!Et)throw new Error("Function called outside component initialization");return Et}function Ke(i){ji().$$.on_mount.push(i)}function Dr(){let i=ji();return(e,t,{cancelable:n=!1}={})=>{let r=i.$$.callbacks[e];if(r){let o=Di(e,t,{cancelable:n});return r.slice().forEach(s=>{s.call(i,o)}),!o.defaultPrevented}return!0}}var Ht=[];var st=[],_n=[],ds=[],bc=Promise.resolve(),Er=!1;function ps(){Er||(Er=!0,bc.then(On))}function zn(i){_n.push(i)}var jr=new Set,hn=0;function On(){if(hn!==0)return;let i=Et;do{try{for(;hn<Ht.length;){let e=Ht[hn];hn++,ft(e),yc(e.$$)}}catch(e){throw Ht.length=0,hn=0,e}for(ft(null),Ht.length=0,hn=0;st.length;)st.pop()();for(let e=0;e<_n.length;e+=1){let t=_n[e];jr.has(t)||(jr.add(t),t())}_n.length=0}while(Ht.length);for(;ds.length;)ds.pop()();Er=!1,jr.clear(),ft(i)}function yc(i){if(i.fragment!==null){i.update(),we(i.before_update);let e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(zn)}}function gs(i){let e=[],t=[];_n.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),_n=e}var Ei=new Set,qt;function Le(){qt={r:0,c:[],p:qt}}function Ne(){qt.r||we(qt.c),qt=qt.p}function I(i,e){i&&i.i&&(Ei.delete(i),i.i(e))}function M(i,e,t,n){if(i&&i.o){if(Ei.has(i))return;Ei.add(i),qt.c.push(()=>{Ei.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Pn(i,e){let t=e.token={};function n(r,o,s,a){if(e.token!==t)return;e.resolved=a;let l=e.ctx;s!==void 0&&(l=l.slice(),l[s]=a);let u=r&&(e.current=r)(l),f=!1;e.block&&(e.blocks?e.blocks.forEach((d,m)=>{m!==o&&d&&(Le(),M(d,1,1,()=>{e.blocks[m]===d&&(e.blocks[m]=null)}),Ne())}):e.block.d(1),u.c(),I(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[o]=u),f&&On()}if(ts(i)){let r=ji();if(i.then(o=>{ft(r),n(e.then,1,e.value,o),ft(null)},o=>{if(ft(r),n(e.catch,2,e.error,o),ft(null),!e.hasCatch)throw o}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,i),!0;e.resolved=i}}function Fr(i,e,t){let n=e.slice(),{resolved:r}=i;i.current===i.then&&(n[i.value]=r),i.current===i.catch&&(n[i.error]=r),i.block.p(n,t)}function Je(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Fi(i,e){let t={},n={},r={$$scope:1},o=i.length;for(;o--;){let s=i[o],a=e[o];if(a){for(let l in s)l in a||(n[l]=1);for(let l in a)r[l]||(t[l]=a[l],r[l]=1);i[o]=a}else for(let l in s)r[l]=1}for(let s in n)s in t||(t[s]=void 0);return t}var vc=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],wc=new Set([...vc]);function A(i){i&&i.c()}function L(i,e,t){let{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),zn(()=>{let o=i.$$.on_mount.map(Lr).filter(En);i.$$.on_destroy?i.$$.on_destroy.push(...o):we(o),i.$$.on_mount=[]}),r.forEach(zn)}function N(i,e){let t=i.$$;t.fragment!==null&&(gs(t.after_update),we(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function xc(i,e){i.$$.dirty[0]===-1&&(Ht.push(i),ps(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function he(i,e,t,n,r,o,s=null,a=[-1]){let l=Et;ft(i);let u=i.$$={fragment:null,ctx:[],props:o,update:z,not_equal:r,bound:Li(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Li(),dirty:a,skip_bound:!1,root:e.target||l.$$.root};s&&s(u.root);let f=!1;if(u.ctx=t?t(i,e.props||{},(d,m,...g)=>{let _=g.length?g[0]:m;return u.ctx&&r(u.ctx[d],u.ctx[d]=_)&&(!u.skip_bound&&u.bound[d]&&u.bound[d](_),f&&xc(i,d)),m}):[],u.update(),f=!0,we(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){ls();let d=us(e.target);u.fragment&&u.fragment.l(d),d.forEach(y)}else u.fragment&&u.fragment.c();e.intro&&I(i.$$.fragment),L(i,e.target,e.anchor),as(),On()}ft(l)}var Cc;typeof HTMLElement=="function"&&(Cc=class extends HTMLElement{constructor(e,t,n){super();K(this,"$$ctor");K(this,"$$s");K(this,"$$c");K(this,"$$cn",!1);K(this,"$$d",{});K(this,"$$r",!1);K(this,"$$p_d",{});K(this,"$$l",{});K(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return()=>{let s;return{c:function(){s=p("slot"),o!=="default"&&h(s,"name",o)},m:function(u,f){v(u,s,f)},d:function(u){u&&y(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},n=fs(this);for(let o of this.$$s)o in n&&(t[o]=[e(o)]);for(let o of this.attributes){let s=this.$$g_p(o.name);s in this.$$d||(this.$$d[s]=zr(s,o.value,this.$$p_d,"toProp"))}for(let o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});let r=()=>{this.$$r=!0;for(let o in this.$$p_d)if(this.$$d[o]=this.$$c.$$.ctx[this.$$c.$$.props[o]],this.$$p_d[o].reflect){let s=zr(o,this.$$d[o],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,s)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(let o in this.$$l)for(let s of this.$$l[o]){let a=this.$$c.$on(o,s);this.$$l_u.set(s,a)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=zr(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function zr(i,e,t,n){var o;let r=(o=t[i])==null?void 0:o.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var fe=class{constructor(){K(this,"$$");K(this,"$$set")}$destroy(){N(this,1),this.$destroy=z}$on(e,t){if(!En(t))return z;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!ns(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var ms="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ms);var Ml=require("obsidian");var or=require("obsidian");function He(i,e,t,n){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(f){try{u(n.next(f))}catch(d){s(d)}}function l(f){try{u(n.throw(f))}catch(d){s(d)}}function u(f){f.done?o(f.value):r(f.value).then(a,l)}u((n=n.apply(i,e||[])).next())})}var pe=require("@codemirror/view"),ie=require("@codemirror/state");var Or="\u037C",hs=typeof Symbol=="undefined"?"__"+Or:Symbol.for(Or),Pr=typeof Symbol=="undefined"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),_s=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{},zi=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,u){let f=[],d=/^@(\w+)\b/.exec(s[0]),m=d&&d[1]=="keyframes";if(d&&a==null)return l.push(s[0]+";");for(let g in a){let _=a[g];if(/&/.test(g))o(g.split(/,\s*/).map(k=>s.map(x=>k.replace(/&/,x))).reduce((k,x)=>k.concat(x)),_,l);else if(_&&typeof _=="object"){if(!d)throw new RangeError("The value of a property ("+g+") should be a primitive value.");o(r(g),_,f,m)}else _!=null&&f.push(g.replace(/_.*/,"").replace(/[A-Z]/g,k=>"-"+k.toLowerCase())+": "+_+";")}(f.length||m)&&l.push((n&&!d&&!u?s.map(n):s).join(", ")+" {"+f.join(" ")+"}")}for(let s in e)o(r(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
|
`)}static newName(){let e=_s[hs]||1;return _s[hs]=e+1,Or+e.toString(36)}static mount(e,t,n){let r=e[Pr],o=n&&n.nonce;r?o&&r.setNonce(o):r=new Rr(e,o),r.mount(Array.isArray(t)?t:[t],e)}},bs=new Map,Rr=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let o=bs.get(n);if(o)return e[Pr]=o;this.sheet=new r.CSSStyleSheet,bs.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Pr]=this}mount(e,t){let n=this.sheet,r=0,o=0;for(let s=0;s<e.length;s++){let a=e[s],l=this.modules.indexOf(a);if(l<o&&l>-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),n)for(let u=0;u<a.rules.length;u++)n.insertRule(a.rules[u],r++)}else{for(;o<l;)r+=this.modules[o++].rules.length;r+=a.rules.length,o++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
|
`;this.styleTag.textContent=s;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var Ui=require("@codemirror/language"),Es=require("@lezer/highlight"),Pe=class i{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(e,t){return new i(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}};function Xt(i,e,t,n,r,o){if(i==n)return[];let s=Yr(i,e,t,n,r,o),a=Ur(i,e+s,t,n,r+s,o);e+=s,t-=a,r+=s,o-=a;let l=t-e,u=o-r;if(!l||!u)return[new Pe(e,t,r,o)];if(l>u){let d=i.slice(e,t).indexOf(n.slice(r,o));if(d>-1)return[new Pe(e,e+d,r,r),new Pe(e+d+u,t,o,o)]}else if(u>l){let d=n.slice(r,o).indexOf(i.slice(e,t));if(d>-1)return[new Pe(e,e,r,r+d),new Pe(t,t,r+d+l,o)]}if(l==1||u==1)return[new Pe(e,t,r,o)];let f=zs(i,e,t,n,r,o);if(f){let[d,m,g]=f;return Xt(i,e,d,n,r,m).concat(Xt(i,d+g,t,n,m+g,o))}return Ic(i,e,t,n,r,o)}var Rn=1e9;function Ic(i,e,t,n,r,o){let s=t-e,a=o-r;if(Rn<1e9&&Math.min(s,a)>Rn*16)return Math.min(s,a)>Rn*64?[new Pe(e,t,r,o)]:ys(i,e,t,n,r,o);let l=Math.ceil((s+a)/2);Br.reset(l),Gr.reset(l);let u=(g,_)=>i.charCodeAt(e+g)==n.charCodeAt(r+_),f=(g,_)=>i.charCodeAt(t-g-1)==n.charCodeAt(o-_-1),d=(s-a)%2!=0?Gr:null,m=d?null:Br;for(let g=0;g<l;g++){if(g>Rn)return ys(i,e,t,n,r,o);let _=Br.advance(g,s,a,l,d,!1,u)||Gr.advance(g,s,a,l,m,!0,f);if(_)return Mc(i,e,t,e+_[0],n,r,o,r+_[1])}return[new Pe(e,t,r,o)]}var Gi=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let t=0;t<this.len;t++)this.vec[t]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,o,s,a){for(let l=-e+this.start;l<=e-this.end;l+=2){let u=r+l,f=l==-e||l!=e&&this.vec[u-1]<this.vec[u+1]?this.vec[u+1]:this.vec[u-1]+1,d=f-l;for(;f<t&&d<n&&a(f,d);)f++,d++;if(this.vec[u]=f,f>t)this.end+=2;else if(d>n)this.start+=2;else if(o){let m=r+(t-n)-l;if(m>=0&&m<this.len&&o.vec[m]!=-1)if(s){let g=o.vec[m];if(g>=t-f)return[g,r+g-m]}else{let g=t-o.vec[m];if(f>=g)return[f,d]}}}return null}},Br=new Gi,Gr=new Gi;function Mc(i,e,t,n,r,o,s,a){let l=!1;return!yn(i,n)&&++n==t&&(l=!0),!yn(r,a)&&++a==s&&(l=!0),l?[new Pe(e,t,o,s)]:Xt(i,e,n,r,o,a).concat(Xt(i,n,t,r,a,s))}function Fs(i,e){let t=1,n=Math.min(i,e);for(;t<n;)t=t<<1;return t}function Yr(i,e,t,n,r,o){if(e==t||e==o||i.charCodeAt(e)!=n.charCodeAt(r))return 0;let s=Fs(t-e,o-r);for(let a=e,l=r;;){let u=a+s,f=l+s;if(u>t||f>o||i.slice(a,u)!=n.slice(l,f)){if(s==1)return a-e-(yn(i,a)?0:1);s=s>>1}else{if(u==t||f==o)return u-e;a=u,l=f}}}function Ur(i,e,t,n,r,o){if(e==t||r==o||i.charCodeAt(t-1)!=n.charCodeAt(o-1))return 0;let s=Fs(t-e,o-r);for(let a=t,l=o;;){let u=a-s,f=l-s;if(u<e||f<r||i.slice(u,a)!=n.slice(f,l)){if(s==1)return t-a-(yn(i,a)?0:1);s=s>>1}else{if(u==e||f==r)return t-u;a=u,l=f}}}function Zr(i,e,t,n,r,o,s,a){let l=n.slice(r,o),u=null;for(;;){if(u||s<a)return u;for(let f=e+s;;){yn(i,f)||f++;let d=f+s;if(yn(i,d)||(d+=d==f+1?1:-1),d>=t)break;let m=i.slice(f,d),g=-1;for(;(g=l.indexOf(m,g+1))!=-1;){let _=Yr(i,d,t,n,r+g+m.length,o),k=Ur(i,e,f,n,r,r+g),x=m.length+_+k;(!u||u[2]<x)&&(u=[f-k,r+g-k,x])}f=d}if(a<0)return u;s=s>>1}}function zs(i,e,t,n,r,o){let s=t-e,a=o-r;if(s<a){let l=zs(n,r,o,i,e,t);return l&&[l[1],l[0],l[2]]}return s<4||a*2<s?null:Zr(i,e,t,n,r,o,Math.floor(s/4),-1)}function ys(i,e,t,n,r,o){let s=t-e,a=o-r,l;if(s<a){let m=Zr(n,r,o,i,e,t,Math.floor(s/6),50);l=m&&[m[1],m[0],m[2]]}else l=Zr(i,e,t,n,r,o,Math.floor(a/6),50);if(!l)return[new Pe(e,t,r,o)];let[u,f,d]=l;return Xt(i,e,u,n,r,f).concat(Xt(i,u+d,t,n,f+d,o))}function Os(i,e){for(let t=1;t<i.length;t++){let n=i[t-1],r=i[t];n.toA>r.fromA-e&&n.toB>r.fromB-e&&(i[t-1]=new Pe(n.fromA,r.toA,n.fromB,r.toB),i.splice(t--,1))}}function Sc(i,e,t){for(;;){Os(t,1);let n=!1;for(let r=0;r<t.length;r++){let o=t[r],s,a;(s=Yr(i,o.fromA,o.toA,e,o.fromB,o.toB))&&(o=t[r]=new Pe(o.fromA+s,o.toA,o.fromB+s,o.toB)),(a=Ur(i,o.fromA,o.toA,e,o.fromB,o.toB))&&(o=t[r]=new Pe(o.fromA,o.toA-a,o.fromB,o.toB-a));let l=o.toA-o.fromA,u=o.toB-o.fromB;if(l&&u)continue;let f=o.fromA-(r?t[r-1].toA:0),d=(r<t.length-1?t[r+1].fromA:i.length)-o.toA;if(!f||!d)continue;let m=l?i.slice(o.fromA,o.toA):e.slice(o.fromB,o.toB);f<=m.length&&i.slice(o.fromA-f,o.fromA)==m.slice(m.length-f)?(t[r]=new Pe(o.fromA-f,o.toA-f,o.fromB-f,o.toB-f),n=!0):d<=m.length&&i.slice(o.toA,o.toA+d)==m.slice(0,d)&&(t[r]=new Pe(o.fromA+d,o.toA+d,o.fromB+d,o.toB+d),n=!0)}if(!n)break}return t}function $c(i,e,t){for(let n=0,r=0;r<i.length;r++){let o=i[r],s=o.toA-o.fromA,a=o.toB-o.fromB;if(s&&a||s>3||a>3){let l=r==i.length-1?e.length:i[r+1].fromA,u=o.fromA-n,f=l-o.toA,d=ws(e,o.fromA,Math.min(u,5)),m=vs(e,o.toA,Math.min(f,5)),g=o.fromA-d,_=m-o.toA;if(!s||!a){let k=Math.max(s,a),[x,C,w]=s?[e,o.fromA,o.toA]:[t,o.fromB,o.toB],S,T;g&&_?(k>g&&e.slice(d,o.fromA)==x.slice(w-g,w)?(o=i[r]=new Pe(d,d+s,o.fromB-g,o.toB-g),d=o.fromA,m=vs(e,o.toA,Math.min(l-o.toA,5))):k>_&&e.slice(o.toA,m)==x.slice(C,C+_)&&(o=i[r]=new Pe(m-s,m,o.fromB+_,o.toB+_),m=o.toA,d=ws(e,o.fromA,Math.min(o.fromA-n,5))),g=o.fromA-d,_=m-o.toA):!g&&!_&&(T=o.fromA-(S=Tc(e,o.fromA,u)))&&e.slice(S,o.fromA)==x.slice(w-T,w)&&(o=i[r]=new Pe(S,S+s,o.fromB-T,o.toB-T))}(g||_)&&(o=i[r]=new Pe(o.fromA-g,o.toA+_,o.fromB-g,o.toB+_)),n=o.toA}}return Os(i,3),i}var Vt;try{Vt=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(i){}function Ps(i){return i>48&&i<58||i>64&&i<91||i>96&&i<123}function Rs(i,e){if(e==i.length)return 0;let t=i.charCodeAt(e);return t<192?Ps(t)?1:0:Vt?!Gs(t)||e==i.length-1?Vt.test(String.fromCharCode(t))?1:0:Vt.test(i.slice(e,e+2))?2:0:0}function Bs(i,e){if(!e)return 0;let t=i.charCodeAt(e-1);return t<192?Ps(t)?1:0:Vt?!Zs(t)||e==1?Vt.test(String.fromCharCode(t))?1:0:Vt.test(i.slice(e-2,e))?2:0:0}function vs(i,e,t){if(e==i.length||!Bs(i,e))return e;for(let n=e,r=e+t;;){let o=Rs(i,n);if(!o)return n;if(n+=o,n>r)return e}}function ws(i,e,t){if(!e||!Rs(i,e))return e;for(let n=e,r=e-t;;){let o=Bs(i,n);if(!o)return n;if(n-=o,n<r)return e}}function Tc(i,e,t){for(let n=e,r=e-t;;){let o=n?i.charCodeAt(n-1):10;if(o==10)return n;if(n--,n<r||o!=32&&o!=9)return e}}var Gs=i=>i>=55296&&i<=56319,Zs=i=>i>=56320&&i<=57343;function yn(i,e){return!e||e==i.length||!Gs(i.charCodeAt(e-1))||!Zs(i.charCodeAt(e))}function Lc(i,e,t){var n;return Rn=((n=t==null?void 0:t.scanLimit)!==null&&n!==void 0?n:1e9)>>1,Sc(i,e,Xt(i,0,i.length,e,0,e.length))}function Ws(i,e,t){return $c(Lc(i,e,t),i,e)}var mt=ie.Facet.define({combine:i=>i[0]}),Zi=ie.StateEffect.define(),dt=ie.StateField.define({create(i){return null},update(i,e){for(let t of e.effects)t.is(Zi)&&(i=t.value);return i}});var Ct=class i{constructor(e,t,n,r,o){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=o}offset(e,t){return e||t?new i(this.changes,this.fromA+e,this.toA+e,this.fromB+t,this.toB+t):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return Qs(Ws(e.toString(),t.toString(),n),e,t,0,0)}static updateA(e,t,n,r,o){return Ms(Is(e,r,!0,n.length),e,t,n,o)}static updateB(e,t,n,r,o){return Ms(Is(e,r,!1,t.length),e,t,n,o)}};function ks(i,e,t,n){let r=t.lineAt(i),o=n.lineAt(e);return r.to==i&&o.to==e&&i<t.length&&e<n.length?[i+1,e+1]:[r.from,o.from]}function xs(i,e,t,n){let r=t.lineAt(i),o=n.lineAt(e);return r.from==i&&o.from==e?[i,e]:[r.to+1,o.to+1]}function Qs(i,e,t,n,r){let o=[];for(let s=0;s<i.length;s++){let a=i[s],[l,u]=ks(a.fromA+n,a.fromB+r,e,t),[f,d]=xs(a.toA+n,a.toB+r,e,t),m=[a.offset(-l+n,-u+r)];for(;s<i.length-1;){let g=i[s+1],[_,k]=ks(g.fromA+n,g.fromB+r,e,t);if(_>f+1&&k>d+1)break;m.push(g.offset(-l+n,-u+r)),[f,d]=xs(g.toA+n,g.toB+r,e,t),s++}o.push(new Ct(m,l,Math.max(l,f),u,Math.max(u,d)))}return o}var Oi=1e3;function Cs(i,e,t,n){let r=0,o=i.length;for(;;){if(r==o){let f=0,d=0;r&&({toA:f,toB:d}=i[r-1]);let m=e-(t?f:d);return[f+m,d+m]}let s=r+o>>1,a=i[s],[l,u]=t?[a.fromA,a.toA]:[a.fromB,a.toB];if(l>e)o=s;else if(u<=e)r=s+1;else return n?[a.fromA,a.fromB]:[a.toA,a.toB]}}function Is(i,e,t,n){let r=[];return e.iterChangedRanges((o,s,a,l)=>{let u=0,f=t?e.length:n,d=0,m=t?n:e.length;o>Oi&&([u,d]=Cs(i,o-Oi,t,!0)),s<e.length-Oi&&([f,m]=Cs(i,s+Oi,t,!1));let g=l-a-(s-o),_,[k,x]=t?[g,0]:[0,g];r.length&&(_=r[r.length-1]).toA>=u?r[r.length-1]={fromA:_.fromA,fromB:_.fromB,toA:f,toB:m,diffA:_.diffA+k,diffB:_.diffB+x}:r.push({fromA:u,toA:f,fromB:d,toB:m,diffA:k,diffB:x})}),r}function Ms(i,e,t,n,r){if(!i.length)return e;let o=[];for(let s=0,a=0,l=0,u=0;;s++){let f=s==i.length?null:i[s],d=f?f.fromA+a:t.length,m=f?f.fromB+l:n.length;for(;u<e.length;){let x=e[u];if(x.toA+a>d||x.toB+l>m)break;o.push(x.offset(a,l)),u++}if(!f)break;let g=f.toA+a+f.diffA,_=f.toB+l+f.diffB,k=Ws(t.sliceString(d,g),n.sliceString(m,_),r);for(let x of Qs(k,t,n,d,m))o.push(x);for(a+=f.diffA,l+=f.diffB;u<e.length;){let x=e[u];if(x.fromA+a>g&&x.fromB+l>_)break;u++}}return o}var Ji=pe.ViewPlugin.fromClass(class{constructor(i){({deco:this.deco,gutter:this.gutter}=Ts(i))}update(i){(i.docChanged||i.viewportChanged||Nc(i.startState,i.state)||Ac(i.startState,i.state))&&({deco:this.deco,gutter:this.gutter}=Ts(i.view))}},{decorations:i=>i.deco}),Pi=ie.Prec.low((0,pe.gutter)({class:"cm-changeGutter",markers:i=>{var e;return((e=i.plugin(Ji))===null||e===void 0?void 0:e.gutter)||ie.RangeSet.empty}}));function Nc(i,e){return i.field(dt,!1)!=e.field(dt,!1)}function Ac(i,e){return i.facet(mt)!=e.facet(mt)}var Ss=pe.Decoration.line({class:"cm-changedLine"}),Dc=pe.Decoration.mark({class:"cm-changedText"}),jc=pe.Decoration.mark({tagName:"ins",class:"cm-insertedLine"}),Ec=pe.Decoration.mark({tagName:"del",class:"cm-deletedLine"}),$s=new class extends pe.GutterMarker{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Fc(i,e,t,n,r,o){let s=t?i.fromA:i.fromB,a=t?i.toA:i.toB,l=0;if(s!=a){r.add(s,s,Ss),r.add(s,a,t?Ec:jc),o&&o.add(s,s,$s);for(let u=e.iterRange(s,a-1),f=s;!u.next().done;){if(u.lineBreak){f++,r.add(f,f,Ss),o&&o.add(f,f,$s);continue}let d=f+u.value.length;if(n)for(;l<i.changes.length;){let m=i.changes[l],g=s+(t?m.fromA:m.fromB),_=s+(t?m.toA:m.toB),k=Math.max(f,g),x=Math.min(d,_);if(k<x&&r.add(k,x,Dc),_<d)l++;else break}f=d}}}function Ts(i){let e=i.state.field(dt),{side:t,highlightChanges:n,markGutter:r}=i.state.facet(mt),o=t=="a",s=new ie.RangeSetBuilder,a=r?new ie.RangeSetBuilder:null,{from:l,to:u}=i.viewport;for(let f of e){if((o?f.fromA:f.fromB)>=u)break;(o?f.toA:f.toB)>l&&Fc(f,i.state.doc,o,n,s,a)}return{deco:s.finish(),gutter:a&&a.finish()}}var bn=class extends pe.WidgetType{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},Wi=ie.StateEffect.define({map:(i,e)=>i.map(e)}),Bn=ie.StateField.define({create:()=>pe.Decoration.none,update:(i,e)=>{for(let t of e.effects)if(t.is(Wi))return t.value;return i.map(e.changes)},provide:i=>pe.EditorView.decorations.from(i)}),Ri=.01;function zc(i,e,t){let n=new ie.RangeSetBuilder,r=new ie.RangeSetBuilder,o=i.state.field(Bn).iter(),s=e.state.field(Bn).iter(),a=0,l=0,u=0,f=0;for(let _=0;;_++){let k=_<t.length?t[_]:null;if(a<(k?k.fromA:i.state.doc.length)){let x=i.lineBlockAt(a).top+u,C=e.lineBlockAt(l).top+f,w=x-C;w<-Ri?(u-=w,n.add(a,a,pe.Decoration.widget({widget:new bn(-w),block:!0,side:-1}))):w>Ri&&(f+=w,r.add(l,l,pe.Decoration.widget({widget:new bn(w),block:!0,side:-1})))}if(!k)break;for(a=k.toA,l=k.toB;o.value&&o.from<a;)u-=o.value.spec.widget.height,o.next();for(;s.value&&s.from<l;)f-=s.value.spec.widget.height,s.next()}for(;o.value;)u-=o.value.spec.widget.height,o.next();for(;s.value;)f-=s.value.spec.widget.height,s.next();let d=i.contentHeight+u-(e.contentHeight+f);d<Ri?n.add(i.state.doc.length,i.state.doc.length,pe.Decoration.widget({widget:new bn(-d),block:!0,side:1})):d>Ri&&r.add(e.state.doc.length,e.state.doc.length,pe.Decoration.widget({widget:new bn(d),block:!0,side:1}));let m=n.finish(),g=r.finish();ie.RangeSet.eq([m],[i.state.field(Bn)])||i.dispatch({effects:Wi.of(m)}),ie.RangeSet.eq([g],[e.state.field(Bn)])||e.dispatch({effects:Wi.of(g)})}var Wr=ie.StateEffect.define({map:(i,e)=>e.mapPos(i)}),Qr=class extends pe.WidgetType{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement("div");return t.className="cm-collapsedLines",t.textContent="\u299A "+e.state.phrase("$ unchanged lines",this.lines)+" \u299A",t.addEventListener("click",n=>{let r=e.posAtDOM(n.target);e.dispatch({effects:Wr.of(r)});let{side:o,sibling:s}=e.state.facet(mt);s&&s().dispatch({effects:Wr.of(Oc(r,e.state.field(dt),o=="a"))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}};function Oc(i,e,t){let n=0,r=0;for(let o=0;;o++){let s=o<e.length?e[o]:null;if(!s||(t?s.fromA:s.fromB)>=i)return r+(i-n);[n,r]=t?[s.toA,s.toB]:[s.toB,s.toA]}}var Pc=ie.StateField.define({create(i){return pe.Decoration.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)t.is(Wr)&&(i=i.update({filter:n=>n!=t.value}));return i},provide:i=>pe.EditorView.decorations.from(i)});function Ls({margin:i=3,minSize:e=4}){return Pc.init(t=>Rc(t,i,e))}function Rc(i,e,t){let n=new ie.RangeSetBuilder,r=i.facet(mt).side=="a",o=i.field(dt),s=1;for(let a=0;;a++){let l=a<o.length?o[a]:null,u=a?s+e:1,f=l?i.doc.lineAt(r?l.fromA:l.fromB).number-1-e:i.doc.lines,d=f-u+1;if(d>=t&&n.add(i.doc.line(u).from,i.doc.line(f).to,pe.Decoration.replace({widget:new Qr(d),block:!0})),!l)break;s=i.doc.lineAt(Math.min(i.doc.length,r?l.toA:l.toB)).number}return n.finish()}var Bc=pe.EditorView.styleModule.of(new zi({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),Ys=pe.EditorView.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb2266, #22bb2266) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff8866, #88ff8866) bottom/100% 2px no-repeat"},".cm-insertedLine, .cm-deletedLine":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer"},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"}}),Ns=new ie.Compartment,Bi=new ie.Compartment,Qi=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig;let t=[ie.Prec.low(Ji),Ys,Bc,Bn,pe.EditorView.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(m=>m.effects.some(g=>g.is(Wi)))&&this.measure()})],n=[mt.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(Pi);let r=ie.EditorState.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],pe.EditorView.editorAttributes.of({class:"cm-merge-a"}),Bi.of(n),t]}),o=[mt.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&o.push(Pi);let s=ie.EditorState.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],pe.EditorView.editorAttributes.of({class:"cm-merge-b"}),Bi.of(o),t]});this.chunks=Ct.build(r.doc,s.doc,this.diffConf);let a=[dt.init(()=>this.chunks),Ns.of(e.collapseUnchanged?Ls(e.collapseUnchanged):[])];r=r.update({effects:ie.StateEffect.appendConfig.of(a)}).state,s=s.update({effects:ie.StateEffect.appendConfig.of(a)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let f=document.createElement("div");f.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?u:f),this.editorDOM.appendChild(l=="a-b"?f:u),this.a=new pe.EditorView({state:r,parent:u,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new pe.EditorView({state:s,parent:f,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(n=>n.docChanged)){let n=e[e.length-1],r=e.reduce((s,a)=>s.compose(a.changes),ie.ChangeSet.empty(e[0].startState.doc.length));this.chunks=t==this.a?Ct.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):Ct.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:Zi.of(this.chunks)})]);let o=t==this.a?this.b:this.a;o.update([o.state.update({effects:Zi.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let o=e.orientation!="b-a";if(o!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,a=this.b.dom.parentNode;s.remove(),a.remove(),this.editorDOM.insertBefore(o?s:a,this.editorDOM.firstChild),this.editorDOM.appendChild(o?a:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let o=!!this.revertDOM,s=this.revertToA,a=this.renderRevert;"revertControls"in e&&(o=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(a=e.renderRevertControl),this.setupRevertControls(o,s,a)}let t="highlightChanges"in e,n="gutter"in e,r="collapseUnchanged"in e;if(t||n||r){let o=[],s=[];if(t||n){let a=this.a.state.facet(mt),l=n?e.gutter!==!1:a.markGutter,u=t?e.highlightChanges!==!1:a.highlightChanges;o.push(Bi.reconfigure([mt.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?Pi:[]])),s.push(Bi.reconfigure([mt.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?Pi:[]]))}if(r){let a=Ns.reconfigure(e.collapseUnchanged?Ls(e.collapseUnchanged):[]);o.push(a),s.push(a)}this.a.dispatch({effects:o}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",r=>this.revertClicked(r)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){zc(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let o=0;o<this.chunks.length;o++){let s=this.chunks[o];if(s.fromA>n.to||s.fromB>r.to)break;if(s.fromA<n.from||s.fromB<r.from)continue;let a=this.a.lineBlockAt(s.fromA).top+"px";for(;t&&+t.dataset.chunk<o;)t=As(t);t&&t.dataset.chunk==String(o)?(t.style.top!=a&&(t.style.top=a),t=t.nextSibling):e.insertBefore(this.renderRevertButton(a,o),t)}for(;t;)t=As(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement("button");let r=this.a.state.phrase("Revert this chunk");n.setAttribute("aria-label",r),n.setAttribute("title",r),n.textContent=this.revertToLeft?"\u21DC":"\u21DD"}return n.style.top=e,n.setAttribute("data-chunk",String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[r,o,s,a,l,u]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],f=r.state.sliceDoc(s,Math.max(s,a-1));s!=a&&u<=o.state.doc.length&&(f+=r.state.lineBreak),o.dispatch({changes:{from:l,to:Math.min(o.state.doc.length,u),insert:f},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function As(i){let e=i.nextSibling;return i.remove(),e}var Gc=new class extends pe.GutterMarker{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Zc=ie.Prec.low((0,pe.gutter)({class:"cm-changeGutter",markers:i=>{var e;return((e=i.plugin(Ji))===null||e===void 0?void 0:e.gutter)||ie.RangeSet.empty},widgetMarker:(i,e)=>e instanceof Yi?Gc:null}));function Us(i){let e=typeof i.original=="string"?ie.Text.of(i.original.split(/\r?\n/)):i.original,t=i.diffConfig;return[ie.Prec.low(Ji),Uc,Ys,pe.EditorView.editorAttributes.of({class:"cm-merge-b"}),ie.EditorState.transactionExtender.of(n=>{let r=n.effects.find(a=>a.is(Jr));if(!n.docChanged&&!r)return null;let o=n.startState.field(dt),s=r?Ct.updateA(o,r.value.doc,n.newDoc,r.value.changes,t):Ct.updateB(o,n.startState.field(Gn),n.newDoc,n.changes,t);return{effects:Zi.of(s)}}),mt.of({highlightChanges:i.highlightChanges!==!1,markGutter:i.gutter!==!1,syntaxHighlightDeletions:i.syntaxHighlightDeletions!==!1,mergeControls:i.mergeControls!==!1,side:"b"}),Gn.init(()=>e),i.gutter!==!1?Zc:[],dt.init(n=>Ct.build(e,n.doc,t))]}var Jr=ie.StateEffect.define();var Gn=ie.StateField.define({create:()=>ie.Text.empty,update(i,e){for(let t of e.effects)t.is(Jr)&&(i=t.value.doc);return i}});var Ds=new WeakMap,Yi=class extends pe.WidgetType{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}};function Wc(i,e){let t=Ds.get(e.changes);if(t)return t;let n=o=>{let{highlightChanges:s,syntaxHighlightDeletions:a,mergeControls:l}=i.facet(mt),u=o.state.field(Gn).sliceString(e.fromA,e.endA),f=a&&i.facet(Ui.language),d=document.createElement("div");if(d.className="cm-deletedChunk",l){let C=d.appendChild(document.createElement("div"));C.className="cm-chunkButtons";let w=C.appendChild(document.createElement("button"));w.name="accept",w.textContent=i.phrase("Accept"),w.onmousedown=T=>{T.preventDefault(),Qc(o,o.posAtDOM(d))};let S=C.appendChild(document.createElement("button"));S.name="reject",S.textContent=i.phrase("Reject"),S.onmousedown=T=>{T.preventDefault(),Yc(o,o.posAtDOM(d))}}let m=d.appendChild(document.createElement("del")),g=e.changes,_=0,k=!1;function x(C,w,S){for(let T=C;T<w;){let P=w,Z=S+(k?" cm-deletedText":"");if(s&&_<g.length){let O=k?g[_].toA:g[_].fromA;O<=P&&(P=O,k&&_++,k=!k)}if(P>T){let O=document.createTextNode(u.slice(T,P));if(Z){let R=d.appendChild(document.createElement("span"));R.className=Z,m.appendChild(O)}else m.appendChild(O)}T=P}}if(f){let C=f.parser.parse(u),w=0;(0,Es.highlightTree)(C,{style:S=>(0,Ui.highlightingFor)(i,S)},(S,T,P)=>{S>w&&x(w,S,""),x(S,T,P),w=T}),x(w,u.length,"")}else x(0,u.length,"");return d},r=pe.Decoration.widget({block:!0,side:-1,widget:new Yi(n)});return Ds.set(e.changes,r),r}function Qc(i,e){let{state:t}=i,n=e!=null?e:t.selection.main.head,r=i.state.field(dt).find(l=>l.fromB<=n&&l.endB>=n);if(!r)return!1;let o=i.state.sliceDoc(r.fromB,Math.max(r.fromB,r.toB-1)),s=i.state.field(Gn);r.fromB!=r.toB&&r.toA<=s.length&&(o+=i.state.lineBreak);let a=ie.ChangeSet.of({from:r.fromA,to:Math.min(s.length,r.toA),insert:o},s.length);return i.dispatch({effects:Jr.of({doc:a.apply(s),changes:a}),userEvent:"accept"}),!0}function Yc(i,e){let{state:t}=i,n=e!=null?e:t.selection.main.head,r=t.field(dt).find(a=>a.fromB<=n&&a.endB>=n);if(!r)return!1;let s=t.field(Gn).sliceString(r.fromA,Math.max(r.fromA,r.toA-1));return r.fromA!=r.toA&&r.toB<=t.doc.length&&(s+=t.lineBreak),i.dispatch({changes:{from:r.fromB,to:Math.min(t.doc.length,r.toB),insert:s},userEvent:"revert"}),!0}function js(i){let e=new ie.RangeSetBuilder;for(let t of i.field(dt))e.add(t.fromB,t.fromB,Wc(i,t));return e.finish()}var Uc=ie.StateField.define({create:i=>js(i),update(i,e){return e.state.field(dt,!1)!=e.startState.field(dt,!1)?js(e.state):i},provide:i=>pe.EditorView.decorations.from(i)});var bl=require("@codemirror/state");var Ve=require("@codemirror/view"),at=require("@codemirror/view"),Js=require("@codemirror/state"),ht=require("@codemirror/language"),vn=require("@codemirror/commands"),Hi=require("@codemirror/search"),Ft=require("@codemirror/autocomplete"),Hs=require("@codemirror/lint"),Zn=[(0,Ve.lineNumbers)(),(0,Ve.highlightActiveLineGutter)(),(0,Ve.highlightSpecialChars)(),(0,vn.history)(),(0,ht.foldGutter)(),(0,Ve.drawSelection)(),(0,Ve.dropCursor)(),Js.EditorState.allowMultipleSelections.of(!0),(0,ht.indentOnInput)(),(0,ht.syntaxHighlighting)(ht.defaultHighlightStyle,{fallback:!0}),(0,ht.bracketMatching)(),(0,Ft.closeBrackets)(),(0,Ft.autocompletion)(),(0,Ve.rectangularSelection)(),(0,Ve.crosshairCursor)(),(0,Ve.highlightActiveLine)(),(0,Hi.highlightSelectionMatches)(),Ve.keymap.of([...Ft.closeBracketsKeymap,...vn.defaultKeymap,...Hi.searchKeymap,...vn.historyKeymap,...ht.foldKeymap,...Ft.completionKeymap,...Hs.lintKeymap])];function Xr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tn=Xr();function tl(i){tn=i}var nl=/[&<>"']/,Jc=new RegExp(nl.source,"g"),il=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Hc=new RegExp(il.source,"g"),qc={"&":"&","<":"<",">":">",'"':""","'":"'"},qs=i=>qc[i];function pt(i,e){if(e){if(nl.test(i))return i.replace(Jc,qs)}else if(il.test(i))return i.replace(Hc,qs);return i}var Vc=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xc(i){return i.replace(Vc,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}var Kc=/(^|[^\[])\^/g;function Me(i,e){let t=typeof i=="string"?i:i.source;e=e||"";let n={replace:(r,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(Kc,"$1"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}function Vs(i){try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}var Qn={exec:()=>null};function Xs(i,e){let t=i.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),n=t.split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function qi(i,e,t){let n=i.length;if(n===0)return"";let r=0;for(;r<n;){let o=i.charAt(n-r-1);if(o===e&&!t)r++;else if(o!==e&&t)r++;else break}return i.slice(0,n-r)}function eu(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===e[0])t++;else if(i[n]===e[1]&&(t--,t<0))return n;return-1}function Ks(i,e,t,n){let r=e.href,o=e.title?pt(e.title):null,s=i[1].replace(/\\([\[\]])/g,"$1");if(i[0].charAt(0)!=="!"){n.state.inLink=!0;let a={type:"link",raw:t,href:r,title:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:t,href:r,title:o,text:pt(s)}}function tu(i,e){let t=i.match(/^(\s+)(?:```)/);if(t===null)return e;let n=t[1];return e.split(`
|
|
`).map(r=>{let o=r.match(/^\s+/);if(o===null)return r;let[s]=o;return s.length>=n.length?r.slice(n.length):r}).join(`
|
|
`)}var wn=class{constructor(e){K(this,"options");K(this,"rules");K(this,"lexer");this.options=e||tn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:qi(n,`
|
|
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=tu(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){let r=qi(n,"#");(this.options.pedantic||!r||/ $/.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=qi(t[0].replace(/^ *>[ \t]?/gm,""),`
|
|
`),r=this.lexer.state.top;this.lexer.state.top=!0;let o=this.lexer.blockTokens(n);return this.lexer.state.top=r,{type:"blockquote",raw:t[0],tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),a="",l="",u=!1;for(;e;){let f=!1;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let d=t[2].split(`
|
|
`,1)[0].replace(/^\t+/,C=>" ".repeat(3*C.length)),m=e.split(`
|
|
`,1)[0],g=0;this.options.pedantic?(g=2,l=d.trimStart()):(g=t[2].search(/[^ ]/),g=g>4?1:g,l=d.slice(g),g+=t[1].length);let _=!1;if(!d&&/^ *$/.test(m)&&(a+=m+`
|
|
`,e=e.substring(m.length+1),f=!0),!f){let C=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),w=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),S=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),T=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){let P=e.split(`
|
|
`,1)[0];if(m=P,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),S.test(m)||T.test(m)||C.test(m)||w.test(e))break;if(m.search(/[^ ]/)>=g||!m.trim())l+=`
|
|
`+m.slice(g);else{if(_||d.search(/[^ ]/)>=4||S.test(d)||T.test(d)||w.test(d))break;l+=`
|
|
`+m}!_&&!m.trim()&&(_=!0),a+=P+`
|
|
`,e=e.substring(P.length+1),d=m.slice(g)}}o.loose||(u?o.loose=!0:/\n *\n *$/.test(a)&&(u=!0));let k=null,x;this.options.gfm&&(k=/^\[[ xX]\] /.exec(l),k&&(x=k[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:a,task:!!k,checked:x,loose:!1,text:l,tokens:[]}),o.raw+=a}o.items[o.items.length-1].raw=a.trimEnd(),o.items[o.items.length-1].text=l.trimEnd(),o.raw=o.raw.trimEnd();for(let f=0;f<o.items.length;f++)if(this.lexer.state.top=!1,o.items[f].tokens=this.lexer.blockTokens(o.items[f].text,[]),!o.loose){let d=o.items[f].tokens.filter(g=>g.type==="space"),m=d.length>0&&d.some(g=>/\n.*\n/.test(g.raw));o.loose=m}if(o.loose)for(let f=0;f<o.items.length;f++)o.items[f].loose=!0;return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(/\s+/g," "),r=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:o}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=Xs(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
|
`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)/^ *-+: *$/.test(a)?s.align.push("right"):/^ *:-+: *$/.test(a)?s.align.push("center"):/^ *:-+ *$/.test(a)?s.align.push("left"):s.align.push(null);for(let a of n)s.header.push({text:a,tokens:this.lexer.inline(a)});for(let a of o)s.rows.push(Xs(a,s.header.length).map(l=>({text:l,tokens:this.lexer.inline(l)})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:pt(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;let s=qi(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=eu(t[2],"()");if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s&&(r=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(n)?r=r.slice(1):r=r.slice(1,-1)),Ks(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(/\s+/g," "),o=t[r.toLowerCase()];if(!o){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Ks(n,o,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,l,u=s,f=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){f+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+f);let m=[...r[0]][0].length,g=e.slice(0,s+r.index+m+l);if(Math.min(s,l)%2){let k=g.slice(1,-1);return{type:"em",raw:g,text:k,tokens:this.lexer.inlineTokens(k)}}let _=g.slice(2,-2);return{type:"strong",raw:g,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," "),r=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return r&&o&&(n=n.substring(1,n.length-1)),n=pt(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=pt(t[1]),r="mailto:"+n):(n=pt(t[1]),r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,r;let t;if(t=this.rules.inline.url.exec(e)){let o,s;if(t[2]==="@")o=pt(t[0]),s="mailto:"+o;else{let a;do a=t[0],t[0]=(r=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?r:"";while(a!==t[0]);o=pt(t[0]),t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:o,href:s,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=pt(t[0]),{type:"text",raw:t[0],text:n}}}},nu=/^(?: *(?:\n|$))+/,iu=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,ru=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Jn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ou=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rl=/(?:[*+-]|\d{1,9}[.)])/,ol=Me(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,rl).getRegex(),Kr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,su=/^[^\n]+/,eo=/(?!\s*\])(?:\\.|[^\[\]\\])+/,lu=Me(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",eo).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),au=Me(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,rl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",to=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,cu=Me("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",to).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sl=Me(Kr).replace("hr",Jn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),uu=Me(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sl).getRegex(),no={blockquote:uu,code:iu,def:lu,fences:ru,heading:ou,hr:Jn,html:cu,lheading:ol,list:au,newline:nu,paragraph:sl,table:Qn,text:su},el=Me("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Jn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),fu={...no,table:el,paragraph:Me(Kr).replace("hr",Jn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",el).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},du={...no,html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",to).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Qn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Me(Kr).replace("hr",Jn).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ol).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ll=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,al=/^( {2,}|\\)\n(?!\s*$)/,gu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hn="\\p{P}$+<=>`^|~",mu=Me(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Hn).getRegex(),hu=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,_u=Me(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Hn).getRegex(),bu=Me("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Hn).getRegex(),yu=Me("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Hn).getRegex(),vu=Me(/\\([punct])/,"gu").replace(/punct/g,Hn).getRegex(),wu=Me(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ku=Me(to).replace("(?:-->|$)","-->").getRegex(),xu=Me("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ku).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cu=Me(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Xi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cl=Me(/^!?\[(label)\]\[(ref)\]/).replace("label",Xi).replace("ref",eo).getRegex(),ul=Me(/^!?\[(ref)\](?:\[\])?/).replace("ref",eo).getRegex(),Iu=Me("reflink|nolink(?!\\()","g").replace("reflink",cl).replace("nolink",ul).getRegex(),io={_backpedal:Qn,anyPunctuation:vu,autolink:wu,blockSkip:hu,br:al,code:pu,del:Qn,emStrongLDelim:_u,emStrongRDelimAst:bu,emStrongRDelimUnd:yu,escape:ll,link:Cu,nolink:ul,punctuation:mu,reflink:cl,reflinkSearch:Iu,tag:xu,text:gu,url:Qn},Mu={...io,link:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",Xi).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xi).getRegex()},Hr={...io,escape:Me(ll).replace("])","~|])").getRegex(),url:Me(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Su={...Hr,br:Me(al).replace("{2,}","*").getRegex(),text:Me(Hr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vi={normal:no,gfm:fu,pedantic:du},Wn={normal:io,gfm:Hr,breaks:Su,pedantic:Mu},It=class i{constructor(e){K(this,"tokens");K(this,"options");K(this,"state");K(this,"tokenizer");K(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||tn,this.options.tokenizer=this.options.tokenizer||new wn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:Vi.normal,inline:Wn.normal};this.options.pedantic?(t.block=Vi.pedantic,t.inline=Wn.pedantic):this.options.gfm&&(t.block=Vi.gfm,this.options.breaks?t.inline=Wn.breaks:t.inline=Wn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vi,inline:Wn}}static lex(e,t){return new i(t).lex(e)}static lexInline(e,t){return new i(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,u)=>l+" ".repeat(u.length));let n,r,o,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|
`+n.raw,r.text+=`
|
|
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
|
|
`+n.raw,r.text+=`
|
|
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},l),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){r=t[t.length-1],s&&r.type==="paragraph"?(r.raw+=`
|
|
`+n.raw,r.text+=`
|
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&r.type==="text"?(r.raw+=`
|
|
`+n.raw,r.text+=`
|
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,s=e,a,l,u;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)f.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(f=>(n=f.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type==="text"&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,s,u)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let f=1/0,d=e.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},d),typeof m=="number"&&m>=0&&(f=Math.min(f,m))}),f<1/0&&f>=0&&(o=e.substring(0,f+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),l=!0,r=t[t.length-1],r&&r.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return t}},kn=class{constructor(e){K(this,"options");this.options=e||tn}code(e,t,n){var o;let r=(o=(t||"").match(/^\S*/))==null?void 0:o[0];return e=e.replace(/\n$/,"")+`
|
|
`,r?'<pre><code class="language-'+pt(r)+'">'+(n?e:pt(e,!0))+`</code></pre>
|
|
`:"<pre><code>"+(n?e:pt(e,!0))+`</code></pre>
|
|
`}blockquote(e){return`<blockquote>
|
|
${e}</blockquote>
|
|
`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>
|
|
`}hr(){return`<hr>
|
|
`}list(e,t,n){let r=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+r+o+`>
|
|
`+e+"</"+r+`>
|
|
`}listitem(e,t,n){return`<li>${e}</li>
|
|
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
|
|
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
|
<thead>
|
|
`+e+`</thead>
|
|
`+t+`</table>
|
|
`}tablerow(e){return`<tr>
|
|
${e}</tr>
|
|
`}tablecell(e,t){let n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){let r=Vs(e);if(r===null)return n;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){let r=Vs(e);if(r===null)return n;e=r;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}},Yn=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}},Mt=class i{constructor(e){K(this,"options");K(this,"renderer");K(this,"textRenderer");this.options=e||tn,this.options.renderer=this.options.renderer||new kn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Yn}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){let s=o,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=a||"";continue}}switch(o.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{let s=o;n+=this.renderer.heading(this.parseInline(s.tokens),s.depth,Xc(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{let s=o;n+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{let s=o,a="",l="";for(let f=0;f<s.header.length;f++)l+=this.renderer.tablecell(this.parseInline(s.header[f].tokens),{header:!0,align:s.align[f]});a+=this.renderer.tablerow(l);let u="";for(let f=0;f<s.rows.length;f++){let d=s.rows[f];l="";for(let m=0;m<d.length;m++)l+=this.renderer.tablecell(this.parseInline(d[m].tokens),{header:!1,align:s.align[m]});u+=this.renderer.tablerow(l)}n+=this.renderer.table(a,u);continue}case"blockquote":{let s=o,a=this.parse(s.tokens);n+=this.renderer.blockquote(a);continue}case"list":{let s=o,a=s.ordered,l=s.start,u=s.loose,f="";for(let d=0;d<s.items.length;d++){let m=s.items[d],g=m.checked,_=m.task,k="";if(m.task){let x=this.renderer.checkbox(!!g);u?m.tokens.length>0&&m.tokens[0].type==="paragraph"?(m.tokens[0].text=x+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&m.tokens[0].tokens[0].type==="text"&&(m.tokens[0].tokens[0].text=x+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:x+" "}):k+=x+" "}k+=this.parse(m.tokens,u),f+=this.renderer.listitem(k,_,!!g)}n+=this.renderer.list(f,a,l);continue}case"html":{let s=o;n+=this.renderer.html(s.text,s.block);continue}case"paragraph":{let s=o;n+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=o,a=s.tokens?this.parseInline(s.tokens):s.text;for(;r+1<e.length&&e[r+1].type==="text";)s=e[++r],a+=`
|
|
`+(s.tokens?this.parseInline(s.tokens):s.text);n+=t?this.renderer.paragraph(a):a;continue}default:{let s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){let s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=s||"";continue}}switch(o.type){case"escape":{let s=o;n+=t.text(s.text);break}case"html":{let s=o;n+=t.html(s.text);break}case"link":{let s=o;n+=t.link(s.href,s.title,this.parseInline(s.tokens,t));break}case"image":{let s=o;n+=t.image(s.href,s.title,s.text);break}case"strong":{let s=o;n+=t.strong(this.parseInline(s.tokens,t));break}case"em":{let s=o;n+=t.em(this.parseInline(s.tokens,t));break}case"codespan":{let s=o;n+=t.codespan(s.text);break}case"br":{n+=t.br();break}case"del":{let s=o;n+=t.del(this.parseInline(s.tokens,t));break}case"text":{let s=o;n+=t.text(s.text);break}default:{let s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},Kt=class{constructor(e){K(this,"options");this.options=e||tn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}};K(Kt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Un,Vr,Ki,fl,qr=class{constructor(...e){br(this,Un);br(this,Ki);K(this,"defaults",Xr());K(this,"options",this.setOptions);K(this,"parse",ri(this,Un,Vr).call(this,It.lex,Mt.parse));K(this,"parseInline",ri(this,Un,Vr).call(this,It.lexInline,Mt.parseInline));K(this,"Parser",Mt);K(this,"Renderer",kn);K(this,"TextRenderer",Yn);K(this,"Lexer",It);K(this,"Tokenizer",wn);K(this,"Hooks",Kt);this.use(...e)}walkTokens(e,t){var r,o;let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)n=n.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let u of l)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{let a=s;n=n.concat(this.walkTokens(a.items,t));break}default:{let a=s;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let u=a[l].flat(1/0);n=n.concat(this.walkTokens(u,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let s=t.renderers[o.name];s?t.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[o.level];s?s.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){let o=this.defaults.renderer||new kn(this.defaults);for(let s in n.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(s==="options")continue;let a=s,l=n.renderer[a],u=o[a];o[a]=(...f)=>{let d=l.apply(o,f);return d===!1&&(d=u.apply(o,f)),d||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new wn(this.defaults);for(let s in n.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=n.tokenizer[a],u=o[a];o[a]=(...f)=>{let d=l.apply(o,f);return d===!1&&(d=u.apply(o,f)),d}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new Kt;for(let s in n.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;let a=s,l=n.hooks[a],u=o[a];Kt.passThroughHooks.has(s)?o[a]=f=>{if(this.defaults.async)return Promise.resolve(l.call(o,f)).then(m=>u.call(o,m));let d=l.call(o,f);return u.call(o,d)}:o[a]=(...f)=>{let d=l.apply(o,f);return d===!1&&(d=u.apply(o,f)),d}}r.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return It.lex(e,t!=null?t:this.defaults)}parser(e,t){return Mt.parse(e,t!=null?t:this.defaults)}};Un=new WeakSet,Vr=function(e,t){return(n,r)=>{let o={...r},s={...this.defaults,...o};this.defaults.async===!0&&o.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);let a=ri(this,Ki,fl).call(this,!!s.silent,!!s.async);if(typeof n=="undefined"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(l=>e(l,s)).then(l=>s.hooks?s.hooks.processAllTokens(l):l).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>t(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=e(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let u=t(l,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(l){return a(l)}}},Ki=new WeakSet,fl=function(e,t){return n=>{if(n.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+pt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}};var en=new qr;function de(i,e){return en.parse(i,e)}de.options=de.setOptions=function(i){return en.setOptions(i),de.defaults=en.defaults,tl(de.defaults),de};de.getDefaults=Xr;de.defaults=tn;de.use=function(...i){return en.use(...i),de.defaults=en.defaults,tl(de.defaults),de};de.walkTokens=function(i,e){return en.walkTokens(i,e)};de.parseInline=en.parseInline;de.Parser=Mt;de.parser=Mt.parse;de.Renderer=kn;de.TextRenderer=Yn;de.Lexer=It;de.lexer=It.lex;de.Tokenizer=wn;de.Hooks=Kt;de.parse=de;var $m=de.options,Tm=de.setOptions,Lm=de.use,Nm=de.walkTokens,Am=de.parseInline;var Dm=Mt.parse,jm=It.lex;var St=require("obsidian");var dl=require("@codemirror/state");var _t=require("obsidian");var qn=require("obsidian"),xn=class extends qn.Modal{constructor(t,n,r){super(t);this.message=n;this.callback=r}onOpen(){this.titleEl.setText("Are you sure?"),this.contentEl.setText(this.message);let t=this.contentEl.createDiv("div");t.addClass("confirm-modal-buttons"),new qn.ButtonComponent(t).setButtonText("Yes").setCta().onClick(()=>{this.callback(),this.close()}),new qn.ButtonComponent(t).setButtonText("No").onClick(()=>{this.close()})}};function $u(i){Ie(i,"svelte-1vfpmb8",".merge.svelte-1vfpmb8{border-radius:5px;height:35%;overflow:scroll}.preview.svelte-1vfpmb8{border:1px solid var(--background-modifier-border);border-radius:5px;height:35%;overflow:scroll;padding:1%}.tools.svelte-1vfpmb8{display:flex;flex-direction:row;justify-content:end;align-items:center}")}function Tu(i){let e,t=de(i[0],{mangle:!1,headerIds:!1})+"",n;return{c(){e=new Fn(!1),n=ot(),e.a=n},m(r,o){e.m(t,r,o),v(r,n,o)},p(r,o){o&1&&t!==(t=de(r[0],{mangle:!1,headerIds:!1})+"")&&e.p(t)},d(r){r&&(y(n),e.d())}}}function Lu(i){let e,t=de(i[2].toString(),{mangle:!1,headerIds:!1})+"",n;return{c(){e=new Fn(!1),n=ot(),e.a=n},m(r,o){e.m(t,r,o),v(r,n,o)},p(r,o){o&4&&t!==(t=de(r[2].toString(),{mangle:!1,headerIds:!1})+"")&&e.p(t)},d(r){r&&(y(n),e.d())}}}function Nu(i){let e,t,n,r,o,s,a;function l(d,m){return d[2]?Lu:Tu}let u=l(i,-1),f=u(i);return{c(){e=p("div"),t=b(),n=p("h3"),n.textContent="Preview the merged file",r=b(),o=p("div"),f.c(),s=b(),a=p("div"),h(e,"class","merge svelte-1vfpmb8"),h(o,"class","preview svelte-1vfpmb8"),h(a,"class","tools svelte-1vfpmb8")},m(d,m){v(d,e,m),i[6](e),v(d,t,m),v(d,n,m),v(d,r,m),v(d,o,m),f.m(o,null),v(d,s,m),v(d,a,m),i[7](a)},p(d,[m]){u===(u=l(d,m))&&f?f.p(d,m):(f.d(1),f=u(d),f&&(f.c(),f.m(o,null)))},i:z,o:z,d(d){d&&(y(e),y(t),y(n),y(r),y(o),y(s),y(a)),i[6](null),f.d(),i[7](null)}}}function Au(i,e,t){let{originalContent:n="this is the original text"}=e,{modifiedContent:r="this is the modified text"}=e,{parentModal:o}=e,s,a,l,u,f;Ke(()=>{s=new Qi({a:{doc:n,extensions:[Zn,at.EditorView.lineWrapping,at.EditorView.darkTheme.of(!0),at.EditorView.updateListener.of(g=>{g.docChanged&&t(2,l=g.state.doc)})]},b:{doc:r,extensions:[Zn,at.EditorView.lineWrapping,at.EditorView.darkTheme.of(!0),at.EditorView.updateListener.of(g=>{g.docChanged&&(u=g.state.doc)}),at.EditorView.editable.of(!1),dl.EditorState.readOnly.of(!0)]},revertControls:"b-to-a",parent:a}),new _t.ButtonComponent(f).setButtonText("Save merged file").setCta().onClick(()=>He(void 0,void 0,void 0,function*(){if(s.chunks.length>0){new _t.Notice("There is still some merge conflicts. Please resolve them."),new xn(o.app,`Are you sure you want to save the file?
|
|
There are still some merge conflicts.
|
|
This action will save the previewed file in the original file and delete the conflicting file.`,()=>He(void 0,void 0,void 0,function*(){new _t.Notice("Saved file"),yield o.app.vault.delete(o.modifiedFile),new _t.Notice("Deleted conflicting file"),o.close()})).open();return}yield o.app.vault.modify(o.originalFile,l.toString()),new _t.Notice("Saved file"),yield o.app.vault.delete(o.modifiedFile),new _t.Notice("Deleted conflicting file"),o.close()})).buttonEl.style.margin="1%",new _t.ButtonComponent(f).setButtonText("Cancel merge").setWarning().onClick(()=>{if(s.chunks.length>0){new _t.Notice("There is still some merge conflicts. Please resolve them."),new xn(o.app,`Are you sure you want to cancel the merge?
|
|
There are still some merge conflicts.
|
|
This will keep the original file and the conflicting file.`,()=>{new _t.Notice("Closing the merge editor."),o.close()}).open();return}new xn(o.app,`Are you sure you want to cancel the merge?
|
|
You have resolved the conflicts but your modifications will not be saved.
|
|
This will keep the original file and the conflicting file.`,()=>{new _t.Notice("Closing the merge editor."),o.close()}).open()}).buttonEl.style.margin="1% 0"});function d(g){st[g?"unshift":"push"](()=>{a=g,t(1,a)})}function m(g){st[g?"unshift":"push"](()=>{f=g,t(3,f)})}return i.$$set=g=>{"originalContent"in g&&t(0,n=g.originalContent),"modifiedContent"in g&&t(4,r=g.modifiedContent),"parentModal"in g&&t(5,o=g.parentModal)},[n,a,l,f,r,o,d,m]}var ro=class extends fe{constructor(e){super(),he(this,e,Au,Nu,ue,{originalContent:0,modifiedContent:4,parentModal:5},$u)}},pl=ro;var gl=require("obsidian"),tr=class extends gl.Modal{constructor(t,n,r){super(t);this.originalFile=n;this.modifiedFile=r}async onOpen(){this.originalContent=await this.app.vault.read(this.originalFile),this.modifiedContent=await this.app.vault.read(this.modifiedFile),this.component=new pl({target:this.contentEl,props:{parentModal:this,originalContent:this.originalContent,modifiedContent:this.modifiedContent}}),this.modalEl.addClass("syncthing-merge-editor-modal"),this.contentEl.addClass("syncthing-merge-editor"),this.titleEl.setText(`Resolve conflicts - ${this.originalFile.basename}`)}onClose(){var t;(t=this.component)==null||t.$destroy()}};function Du(i){Ie(i,"svelte-8kfohb","p.svelte-8kfohb{background-color:darkred;opacity:0.6;border-radius:10px;box-shadow:black 0px 0px 10px;padding:1%}")}function ju(i){let e,t,n=i[0].message+"",r;return{c(){e=p("p"),t=F(`A failure occured :
|
|
`),r=F(n),h(e,"class","svelte-8kfohb")},m(o,s){v(o,e,s),c(e,t),c(e,r)},p(o,[s]){s&1&&n!==(n=o[0].message+"")&&oe(r,n)},i:z,o:z,d(o){o&&y(e)}}}function Eu(i,e,t){let{failure:n}=e;return i.$$set=r=>{"failure"in r&&t(0,n=r.failure)},[n]}var oo=class extends fe{constructor(e){super(),he(this,e,Eu,ju,ue,{failure:0},Du)}},nr=oo;function Fu(i){Ie(i,"svelte-kca58t",".conflict-file.svelte-kca58t{padding:0.5em;border-radius:0.5em;margin:0.5em}.conflict-file.svelte-kca58t:hover{background-color:var(--background-secondary-alt)}.conflict-file.svelte-kca58t:active{background-color:var(--background-secondary-alt)}.selected.svelte-kca58t{background-color:var(--background-secondary-alt)}")}function zu(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k,x=i[1].extension+"",C,w,S,T,P=cn(i[1].stat.size,1)+"",Z,O,R,re,te=new Date(i[1].stat.mtime).toLocaleString()+"",W,U,E,G,D=new Date(i[1].stat.ctime).toLocaleString()+"",J,be,X,$,j=i[1].path+"",ye;return{c(){e=p("div"),t=p("strong"),n=F("Conflict #"),r=F(i[0]),o=b(),s=p("em"),s.textContent=`Occured on: ${i[4].dateTime.toLocaleString()}`,a=b(),l=p("ul"),u=p("li"),u.textContent=`Conflict date: ${i[4].dateTime.toLocaleString()}`,f=b(),d=p("li"),d.textContent=`Modified by: ${i[4].modifiedBy}`,m=b(),g=p("li"),_=F("Extension: "),k=p("code"),C=F(x),w=b(),S=p("li"),T=F("Size: "),Z=F(P),O=b(),R=p("li"),re=F("Last modified at: "),W=F(te),U=b(),E=p("li"),G=F("Created at: "),J=F(D),be=b(),X=p("li"),$=F("Path: "),ye=F(j)},m(ge,q){v(ge,e,q),c(e,t),c(t,n),c(t,r),c(e,o),c(e,s),c(e,a),c(e,l),c(l,u),c(l,f),c(l,d),c(l,m),c(l,g),c(g,_),c(g,k),c(k,C),c(l,w),c(l,S),c(S,T),c(S,Z),c(l,O),c(l,R),c(R,re),c(R,W),c(l,U),c(l,E),c(E,G),c(E,J),c(l,be),c(l,X),c(X,$),c(X,ye)},p(ge,q){q&1&&oe(r,ge[0]),q&2&&x!==(x=ge[1].extension+"")&&oe(C,x),q&2&&P!==(P=cn(ge[1].stat.size,1)+"")&&oe(Z,P),q&2&&te!==(te=new Date(ge[1].stat.mtime).toLocaleString()+"")&&oe(W,te),q&2&&D!==(D=new Date(ge[1].stat.ctime).toLocaleString()+"")&&oe(J,D),q&2&&j!==(j=ge[1].path+"")&&oe(ye,j)},i:z,o:z,d(ge){ge&&y(e)}}}function Ou(i){let e,t;return e=new nr({props:{failure:i[4]}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p:z,i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Pu(i){let e,t,n,r,o,s,a=[Ou,zu],l=[];function u(f,d){return f[4]instanceof _e?0:1}return t=u(i,-1),n=l[t]=a[t](i),{c(){e=p("div"),n.c(),h(e,"class","svelte-kca58t"),gt(e,"conflict-file",i[2]),gt(e,"selected",i[3])},m(f,d){v(f,e,d),l[t].m(e,null),r=!0,o||(s=Q(e,"click",i[6]),o=!0)},p(f,[d]){n.p(f,d),(!r||d&4)&>(e,"conflict-file",f[2]),(!r||d&8)&>(e,"selected",f[3])},i(f){r||(I(n),r=!0)},o(f){M(n),r=!1},d(f){f&&y(e),l[t].d(),o=!1,s()}}}function Ru(i,e,t){let{counter:n}=e,{file:r}=e,{styled:o=!1}=e,{isClicked:s=!1}=e,a=Dr(),l=tt(r.name);function u(){a("file",{file:r})}let f=()=>{o&&u()};return i.$$set=d=>{"counter"in d&&t(0,n=d.counter),"file"in d&&t(1,r=d.file),"styled"in d&&t(2,o=d.styled),"isClicked"in d&&t(3,s=d.isClicked)},[n,r,o,s,l,u,f]}var so=class extends fe{constructor(e){super(),he(this,e,Ru,Pu,ue,{counter:0,file:1,styled:2,isClicked:3},Fu)}},ir=so;function Bu(i){let e,t,n,r,o,s=i[0].extension+"",a,l,u,f,d=cn(i[0].stat.size,1)+"",m,g,_,k,x=new Date(i[0].stat.mtime).toLocaleString()+"",C,w,S,T,P=new Date(i[0].stat.ctime).toLocaleString()+"",Z,O,R,re,te=i[0].path+"",W;return{c(){e=p("div"),t=p("ul"),n=p("li"),r=F("Extension: "),o=p("code"),a=F(s),l=b(),u=p("li"),f=F("Size: "),m=F(d),g=b(),_=p("li"),k=F("Last modified at: "),C=F(x),w=b(),S=p("li"),T=F("Created at: "),Z=F(P),O=b(),R=p("li"),re=F("Path: "),W=F(te)},m(U,E){v(U,e,E),c(e,t),c(t,n),c(n,r),c(n,o),c(o,a),c(t,l),c(t,u),c(u,f),c(u,m),c(t,g),c(t,_),c(_,k),c(_,C),c(t,w),c(t,S),c(S,T),c(S,Z),c(t,O),c(t,R),c(R,re),c(R,W)},p(U,[E]){E&1&&s!==(s=U[0].extension+"")&&oe(a,s),E&1&&d!==(d=cn(U[0].stat.size,1)+"")&&oe(m,d),E&1&&x!==(x=new Date(U[0].stat.mtime).toLocaleString()+"")&&oe(C,x),E&1&&P!==(P=new Date(U[0].stat.ctime).toLocaleString()+"")&&oe(Z,P),E&1&&te!==(te=U[0].path+"")&&oe(W,te)},i:z,o:z,d(U){U&&y(e)}}}function Gu(i,e,t){let{file:n}=e;return i.$$set=r=>{"file"in r&&t(0,n=r.file)},[n]}var lo=class extends fe{constructor(e){super(),he(this,e,Gu,Bu,ue,{file:0})}},ml=lo;function Zu(i){Ie(i,"svelte-10busrc",".column.svelte-10busrc.svelte-10busrc{display:inline-block;width:33%;min-height:fit-content;max-height:95%;vertical-align:top;overflow-y:scroll;padding:1%}.column.svelte-10busrc h1.svelte-10busrc{margin-top:0;text-align:center}.conflicts.svelte-10busrc.svelte-10busrc{max-height:650px;overflow-y:auto;padding:1%}.divider.svelte-10busrc.svelte-10busrc{margin-top:10px;margin-bottom:10px;border-bottom:2px solid var(--background-modifier-border)}.tools.svelte-10busrc.svelte-10busrc{display:flex;flex-direction:row;justify-content:space-evenly;align-items:end}.preview.svelte-10busrc.svelte-10busrc{border:1px solid var(--background-modifier-border);border-radius:5px;padding:1%}.preview-container.svelte-10busrc.svelte-10busrc{padding:1%;overflow-y:scroll;height:500px}.diff_view.svelte-10busrc.svelte-10busrc{max-height:650px;overflow-y:scroll}")}function hl(i,e,t){let n=i.slice();return n[13]=e[t],n[15]=t,n}function Wu(i){let e;return{c(){e=p("div"),h(e,"class","divider svelte-10busrc")},m(t,n){v(t,e,n)},d(t){t&&y(e)}}}function _l(i){let e,t,n,r=i[15]!==0&&Wu(i);return t=new ir({props:{file:i[13],counter:i[15],styled:!0,isClicked:i[0].conflictingFiles[i[15]]===i[2]}}),t.$on("file",i[6]),{c(){r&&r.c(),e=b(),A(t.$$.fragment)},m(o,s){r&&r.m(o,s),v(o,e,s),L(t,o,s),n=!0},p(o,s){let a={};s&1&&(a.file=o[13]),s&5&&(a.isClicked=o[0].conflictingFiles[o[15]]===o[2]),t.$set(a)},i(o){n||(I(t.$$.fragment,o),n=!0)},o(o){M(t.$$.fragment,o),n=!1},d(o){o&&y(e),r&&r.d(o),N(t,o)}}}function Qu(i){return{c:z,m:z,p:z,d:z}}function Yu(i){let e,t=de(i[12],{mangle:!1,headerIds:!1})+"";return{c(){e=p("div"),h(e,"class","preview svelte-10busrc")},m(n,r){v(n,e,r),e.innerHTML=t},p(n,r){r&1&&t!==(t=de(n[12],{mangle:!1,headerIds:!1})+"")&&(e.innerHTML=t)},d(n){n&&y(e)}}}function Uu(i){let e;return{c(){e=p("p"),e.textContent="Loading preview..."},m(t,n){v(t,e,n)},p:z,d(t){t&&y(e)}}}function Ju(i){return{c:z,m:z,p:z,d:z}}function Hu(i){let e,t=de(i[12],{mangle:!1,headerIds:!1})+"";return{c(){e=p("div"),h(e,"class","preview svelte-10busrc")},m(n,r){v(n,e,r),e.innerHTML=t},p(n,r){r&5&&t!==(t=de(n[12],{mangle:!1,headerIds:!1})+"")&&(e.innerHTML=t)},d(n){n&&y(e)}}}function qu(i){let e;return{c(){e=p("p"),e.textContent="Loading preview..."},m(t,n){v(t,e,n)},p:z,d(t){t&&y(e)}}}function Vu(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k=i[0].originalFile.basename+"",x,C,w,S,T,P,Z,O,R,re,te,W,U,E,G,D,J,be,X,$,j,ye,ge=Je(i[0].conflictingFiles),q=[];for(let H=0;H<ge.length;H+=1)q[H]=_l(hl(i,ge,H));let Se=H=>M(q[H],1,1,()=>{q[H]=null});w=new ml({props:{file:i[0].originalFile}});let ve={ctx:i,current:null,token:null,hasCatch:!1,pending:Uu,then:Yu,catch:Qu,value:12};Pn(O=i[0].app.vault.cachedRead(i[0].originalFile),ve);let me={ctx:i,current:null,token:null,hasCatch:!1,pending:qu,then:Hu,catch:Ju,value:12};return Pn(W=i[0].app.vault.cachedRead(i[2]),me),{c(){e=p("div"),t=p("h1"),t.textContent="Conflicting files",n=b(),r=p("div");for(let H=0;H<q.length;H+=1)q[H].c();o=b(),s=p("div"),a=p("h1"),a.textContent="Quick difference view",l=b(),u=p("div"),f=b(),d=p("div"),m=p("h1"),m.textContent="Original file",g=b(),_=p("h2"),x=F(k),C=b(),A(w.$$.fragment),S=b(),T=p("div"),P=p("h2"),P.textContent="Original file preview",Z=b(),ve.block.c(),R=b(),re=p("h2"),re.textContent="Conflicting file preview",te=b(),me.block.c(),U=b(),E=p("div"),G=p("button"),G.textContent="Accept conflict changes",D=b(),J=p("button"),J.textContent="Accept original",be=b(),X=p("button"),X.textContent="Open in Merge Editor",h(t,"class","svelte-10busrc"),h(r,"class","conflicts svelte-10busrc"),h(e,"class","column svelte-10busrc"),h(a,"class","svelte-10busrc"),h(u,"class","diff_view svelte-10busrc"),h(s,"class","column svelte-10busrc"),h(m,"class","svelte-10busrc"),h(T,"class","preview-container svelte-10busrc"),h(d,"class","column svelte-10busrc"),h(E,"class","tools svelte-10busrc")},m(H,V){v(H,e,V),c(e,t),c(e,n),c(e,r);for(let Ce=0;Ce<q.length;Ce+=1)q[Ce]&&q[Ce].m(r,null);v(H,o,V),v(H,s,V),c(s,a),c(s,l),c(s,u),i[7](u),v(H,f,V),v(H,d,V),c(d,m),c(d,g),c(d,_),c(_,x),c(d,C),L(w,d,null),c(d,S),c(d,T),c(T,P),c(T,Z),ve.block.m(T,ve.anchor=null),ve.mount=()=>T,ve.anchor=R,c(T,R),c(T,re),c(T,te),me.block.m(T,me.anchor=null),me.mount=()=>T,me.anchor=null,v(H,U,V),v(H,E,V),c(E,G),c(E,D),c(E,J),c(E,be),c(E,X),$=!0,j||(ye=[Q(G,"click",i[3]),Q(J,"click",i[4]),Q(X,"click",i[5])],j=!0)},p(H,[V]){if(i=H,V&69){ge=Je(i[0].conflictingFiles);let ce;for(ce=0;ce<ge.length;ce+=1){let Be=hl(i,ge,ce);q[ce]?(q[ce].p(Be,V),I(q[ce],1)):(q[ce]=_l(Be),q[ce].c(),I(q[ce],1),q[ce].m(r,null))}for(Le(),ce=ge.length;ce<q.length;ce+=1)Se(ce);Ne()}(!$||V&1)&&k!==(k=i[0].originalFile.basename+"")&&oe(x,k);let Ce={};V&1&&(Ce.file=i[0].originalFile),w.$set(Ce),ve.ctx=i,V&1&&O!==(O=i[0].app.vault.cachedRead(i[0].originalFile))&&Pn(O,ve)||Fr(ve,i,V),me.ctx=i,V&5&&W!==(W=i[0].app.vault.cachedRead(i[2]))&&Pn(W,me)||Fr(me,i,V)},i(H){if(!$){for(let V=0;V<ge.length;V+=1)I(q[V]);I(w.$$.fragment,H),$=!0}},o(H){q=q.filter(Boolean);for(let V=0;V<q.length;V+=1)M(q[V]);M(w.$$.fragment,H),$=!1},d(H){H&&(y(e),y(o),y(s),y(f),y(d),y(U),y(E)),bt(q,H),i[7](null),N(w),ve.block.d(),ve.token=null,ve=null,me.block.d(),me.token=null,me=null,j=!1,we(ye)}}}function Xu(i,e,t){let{parentModal:n}=e,r,o,s=n.conflictingFiles[0];n.titleEl.setText("Difference view"),n.titleEl.style.textAlign="center",Ke(()=>He(void 0,void 0,void 0,function*(){o=new at.EditorView({parent:r,state:bl.EditorState.create({doc:yield n.app.vault.read(s),extensions:[Zn,at.EditorView.editable.of(!1),at.EditorView.lineWrapping,at.EditorView.darkTheme.of(!0),Us({original:yield n.app.vault.read(n.originalFile),mergeControls:!1,gutter:!0,highlightChanges:!0,syntaxHighlightDeletions:!0})]})})}));function a(){return He(this,void 0,void 0,function*(){new St.Notice("Resolving conflict : Accepting left",2e3);let x=n.originalFile.path;setTimeout(()=>new St.Notice(`Deleting ${x}...`,2e3),500),yield n.app.vault.delete(n.originalFile,!0),new St.Notice("Original file deleted",2e3),setTimeout(()=>{new St.Notice(`Renaming ${s.path} to ${x}...`,2e3)},1e3),yield n.app.fileManager.renameFile(s,x),u(),new St.Notice("Conflict resolved : Accepted left",2e3),t(0,n.originalFile=s,n),f(),t(2,s=n.conflictingFiles[0])})}function l(){return He(this,void 0,void 0,function*(){new St.Notice("Resolving conflict : Accepting original",5e3),setTimeout(()=>new St.Notice(`Deleting ${s.path}...`,5e3),1e3),yield n.app.vault.delete(s),new St.Notice("Conflict resolved",5e3),u(),f(),t(2,s=n.conflictingFiles[0])})}function u(){n.conflictingFiles.remove(s),t(0,n)}function f(){n.conflictingFiles.length===0&&n.close()}function d(){new tr(n.app,n.originalFile,s).open()}function m(k){return o.state.update({changes:{from:0,to:o.state.doc.length,insert:k}})}function g(k){return He(this,void 0,void 0,function*(){t(2,s=k.detail.file),o.dispatch(m(yield n.app.vault.read(s)))})}function _(k){st[k?"unshift":"push"](()=>{r=k,t(1,r)})}return i.$$set=k=>{"parentModal"in k&&t(0,n=k.parentModal)},[n,r,s,a,l,d,g,_]}var ao=class extends fe{constructor(e){super(),he(this,e,Xu,Vu,ue,{parentModal:0},Zu)}},yl=ao;var rr=class extends or.Modal{constructor(t,n,r){super(t);this.file=n;this.syncthingController=r;this.d2hColorBlind=!1;this.conflictingFiles=[];this.conflictingFilesOrFailure=[];this.originalFile=n,this.conflictingFilesProperties=new Map}async onOpen(){if(this.modalEl.style.width="100%",this.modalEl.style.height="100%",{originalFile:this.originalFile,conflictingFiles:this.conflictingFilesOrFailure,conflictingFilesProperties:this.conflictingFilesProperties}=await this.syncthingController.getDiffFiles(this.file),this.conflictingFilesOrFailure instanceof _e){new or.Notice(this.conflictingFilesOrFailure.message),this.close();return}this.conflictingFiles=this.conflictingFilesOrFailure,this.component=new yl({target:this.contentEl,props:{parentModal:this}})}onClose(){var n;let{contentEl:t}=this;(n=this.component)==null||n.$destroy(),t.empty()}};function Ku(i){Ie(i,"svelte-x0g9xq",".divider.svelte-x0g9xq.svelte-x0g9xq{margin-top:10px;margin-bottom:10px;border-bottom:2px solid var(--background-modifier-border)}details.svelte-x0g9xq.svelte-x0g9xq{padding:1% 2%;border-radius:10px}details.svelte-x0g9xq.svelte-x0g9xq:hover{background-color:var(--background-modifier-hover)}summary.svelte-x0g9xq.svelte-x0g9xq{list-style:none;display:flex;flex-direction:row;justify-content:space-between;align-items:center}summary.svelte-x0g9xq>p.svelte-x0g9xq{display:flex;flex-direction:column}")}function vl(i,e,t){let n=i.slice();return n[5]=e[t],n[7]=t,n}function ef(i){let e=i[3].filename+"",t;return{c(){t=F(e)},m(n,r){v(n,t,r)},p:z,d(n){n&&y(t)}}}function tf(i){let e=i[3].message+"",t;return{c(){t=F(e)},m(n,r){v(n,t,r)},p:z,d(n){n&&y(t)}}}function nf(i){let e;return{c(){e=p("div"),h(e,"class","divider svelte-x0g9xq")},m(t,n){v(t,e,n)},d(t){t&&y(e)}}}function wl(i){let e,t,n,r=i[7]!==0&&nf(i);return t=new ir({props:{file:i[5],counter:i[7]}}),{c(){r&&r.c(),e=b(),A(t.$$.fragment)},m(o,s){r&&r.m(o,s),v(o,e,s),L(t,o,s),n=!0},p(o,s){let a={};s&1&&(a.file=o[5]),t.$set(a)},i(o){n||(I(t.$$.fragment,o),n=!0)},o(o){M(t.$$.fragment,o),n=!1},d(o){o&&y(e),r&&r.d(o),N(t,o)}}}function rf(i){let e,t,n,r,o,s,a,l=i[0].length+"",u,f,d=i[0].length>1?"s":"",m,g,_,k,x,C=i[0].length>1?"s":"",w,S,T,P,Z;function O(E,G){return E[3]instanceof _e?tf:ef}let re=O(i,-1)(i),te=Je(i[0]),W=[];for(let E=0;E<te.length;E+=1)W[E]=wl(vl(i,te,E));let U=E=>M(W[E],1,1,()=>{W[E]=null});return{c(){e=p("details"),t=p("summary"),n=p("p"),r=p("span"),re.c(),o=b(),s=p("span"),a=F("("),u=F(l),f=F(" conflict"),m=F(d),g=F(")"),_=b(),k=p("button"),x=F("View conflict"),w=F(C),S=b();for(let E=0;E<W.length;E+=1)W[E].c();h(n,"class","svelte-x0g9xq"),h(k,"class","mod-cta"),h(t,"class","svelte-x0g9xq"),h(e,"class","svelte-x0g9xq")},m(E,G){v(E,e,G),c(e,t),c(t,n),c(n,r),re.m(r,null),c(n,o),c(n,s),c(s,a),c(s,u),c(s,f),c(s,m),c(s,g),c(t,_),c(t,k),c(k,x),c(k,w),c(e,S);for(let D=0;D<W.length;D+=1)W[D]&&W[D].m(e,null);T=!0,P||(Z=Q(k,"click",i[4]),P=!0)},p(E,[G]){if(re.p(E,G),(!T||G&1)&&l!==(l=E[0].length+"")&&oe(u,l),(!T||G&1)&&d!==(d=E[0].length>1?"s":"")&&oe(m,d),(!T||G&1)&&C!==(C=E[0].length>1?"s":"")&&oe(w,C),G&1){te=Je(E[0]);let D;for(D=0;D<te.length;D+=1){let J=vl(E,te,D);W[D]?(W[D].p(J,G),I(W[D],1)):(W[D]=wl(J),W[D].c(),I(W[D],1),W[D].m(e,null))}for(Le(),D=te.length;D<W.length;D+=1)U(D);Ne()}},i(E){if(!T){for(let G=0;G<te.length;G+=1)I(W[G]);T=!0}},o(E){W=W.filter(Boolean);for(let G=0;G<W.length;G+=1)M(W[G]);T=!1},d(E){E&&y(e),re.d(),bt(W,E),P=!1,Z()}}}function of(i,e,t){let{conflicts:n}=e,{syncthingController:r}=e,{parentModal:o}=e,s=tt(n[0].name);s instanceof _e&&console.error(s);let a=()=>new rr(o.app,n[0],r).open();return i.$$set=l=>{"conflicts"in l&&t(0,n=l.conflicts),"syncthingController"in l&&t(1,r=l.syncthingController),"parentModal"in l&&t(2,o=l.parentModal)},[n,r,o,s,a]}var co=class extends fe{constructor(e){super(),he(this,e,of,rf,ue,{conflicts:0,syncthingController:1,parentModal:2},Ku)}},kl=co;function sf(i){Ie(i,"svelte-1drkksv",".divider.svelte-1drkksv{margin-top:10px;margin-bottom:10px;border-bottom:2px solid var(--background-modifier-border)}")}function xl(i,e,t){let n=i.slice();return n[5]=e[t],n[7]=t,n}function lf(i){let e;return{c(){e=p("div"),h(e,"class","divider svelte-1drkksv")},m(t,n){v(t,e,n)},d(t){t&&y(e)}}}function Cl(i){var o;let e,t,n,r=i[7]!==0&&lf(i);return t=new kl({props:{conflicts:(o=i[0].get(i[5]))!=null?o:[],syncthingController:i[1].syncthingController,parentModal:i[1]}}),{c(){r&&r.c(),e=b(),A(t.$$.fragment)},m(s,a){r&&r.m(s,a),v(s,e,a),L(t,s,a),n=!0},p(s,a){var u;let l={};a&1&&(l.conflicts=(u=s[0].get(s[5]))!=null?u:[]),a&2&&(l.syncthingController=s[1].syncthingController),a&2&&(l.parentModal=s[1]),t.$set(l)},i(s){n||(I(t.$$.fragment,s),n=!0)},o(s){M(t.$$.fragment,s),n=!1},d(s){s&&y(e),r&&r.d(s),N(t,s)}}}function Il(i){let e,t,n=Je(i[0].keys()),r=[];for(let s=0;s<n.length;s+=1)r[s]=Cl(xl(i,n,s));let o=s=>M(r[s],1,1,()=>{r[s]=null});return{c(){for(let s=0;s<r.length;s+=1)r[s].c();e=ot()},m(s,a){for(let l=0;l<r.length;l+=1)r[l]&&r[l].m(s,a);v(s,e,a),t=!0},p(s,a){if(a&3){n=Je(s[0].keys());let l;for(l=0;l<n.length;l+=1){let u=xl(s,n,l);r[l]?(r[l].p(u,a),I(r[l],1)):(r[l]=Cl(u),r[l].c(),I(r[l],1),r[l].m(e.parentNode,e))}for(Le(),l=n.length;l<r.length;l+=1)o(l);Ne()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)I(r[a]);t=!0}},o(s){r=r.filter(Boolean);for(let a=0;a<r.length;a+=1)M(r[a]);t=!1},d(s){s&&y(e),bt(r,s)}}}function af(i){let e,t,n=i[0],r,o,s=Il(i);return{c(){e=p("div"),t=b(),s.c(),r=ot()},m(a,l){v(a,e,l),i[3](e),v(a,t,l),s.m(a,l),v(a,r,l),o=!0},p(a,[l]){l&1&&ue(n,n=a[0])?(Le(),M(s,1,1,z),Ne(),s=Il(a),s.c(),I(s,1),s.m(r.parentNode,r)):s.p(a,l)},i(a){o||(I(s),o=!0)},o(a){M(s),o=!1},d(a){a&&(y(e),y(t),y(r)),i[3](null),s.d(a)}}}function cf(i,e,t){let{parentModal:n}=e,{conflicts:r}=e,o,s={recent:"Most recent",old:"Least recent","a-to-z":"A to Z","z-to-a":"Z to A"};Ke(()=>{new Ml.Setting(o).setName("Sort by date").addDropdown(l=>{l.addOptions(s),l.onChange(u=>{t(0,r=vr(r,u,n.syncthingController)),console.log("dropdown",r)})}),t(0,r=vr(r,"recent",n.syncthingController))}),n.titleEl.setText("Syncthing Conflicts");function a(l){st[l?"unshift":"push"](()=>{o=l,t(2,o)})}return i.$$set=l=>{"parentModal"in l&&t(1,n=l.parentModal),"conflicts"in l&&t(0,r=l.conflicts)},i.$$.update=()=>{i.$$.dirty&1&&r&&console.log("conflicts",r)},[r,n,o,a]}var uo=class extends fe{constructor(e){super(),he(this,e,cf,af,ue,{parentModal:1,conflicts:0},sf)}},Sl=uo;var sr=class extends $l.Modal{constructor(t,n){super(t);this.syncthingController=n;this.components=[]}async onOpen(){var n,r;this.titleEl.style.textAlign="center";let t=await this.syncthingController.getConflicts();if(t instanceof _e){(n=this.components)==null||n.push(new nr({target:this.contentEl,props:{failure:t}}));return}(r=this.components)==null||r.push(new Sl({target:this.contentEl,props:{parentModal:this,conflicts:t}}))}onClose(){var n;(n=this.components)==null||n.forEach(r=>{r.$destroy()});let{contentEl:t}=this;t.empty()}};var Tl=`data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIiB2aWV3Qm94PSIwIDAg
|
|
NTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCgk8cmFkaWFsR3Jh
|
|
ZGllbnQgaWQ9ImxvZ28tYm90dG9tLWxlZnQiIGN4PSIwIiBjeT0iMCIgZ3JhZGllbnRUcmFuc2Zv
|
|
cm09Im1hdHJpeCgtNTkgLTIyNSAxNTAgLTM5IDE2MS40IDQ3MCkiIGdyYWRpZW50VW5pdHM9InVz
|
|
ZXJTcGFjZU9uVXNlIiByPSIxIj4NCgkJPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZm
|
|
IiBzdG9wLW9wYWNpdHk9Ii40Ii8+DQoJCTxzdG9wIG9mZnNldD0iMSIgc3RvcC1vcGFjaXR5PSIu
|
|
MSIvPg0KCTwvcmFkaWFsR3JhZGllbnQ+DQoJPHJhZGlhbEdyYWRpZW50IGlkPSJsb2dvLXRvcC1y
|
|
aWdodCIgY3g9IjAiIGN5PSIwIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDUwIC0zNzkgMjgw
|
|
IDM3IDM2MCAzNzQuMikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiByPSIxIj4NCgkJ
|
|
PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9Ii42Ii8+DQoJ
|
|
CTxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIuMSIvPg0K
|
|
CTwvcmFkaWFsR3JhZGllbnQ+DQoJPHJhZGlhbEdyYWRpZW50IGlkPSJsb2dvLXRvcC1sZWZ0IiBj
|
|
eD0iMCIgY3k9IjAiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoNjkgLTMxOSAyMTggNDcgMTc1
|
|
LjQgMzA3KSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHI9IjEiPg0KCQk8c3RvcCBv
|
|
ZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0eT0iLjgiLz4NCgkJPHN0b3Ag
|
|
b2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9Ii40Ii8+DQoJPC9yYWRp
|
|
YWxHcmFkaWVudD4NCgk8cmFkaWFsR3JhZGllbnQgaWQ9ImxvZ28tYm90dG9tLXJpZ2h0IiBjeD0i
|
|
MCIgY3k9IjAiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLTk2IC0xNjMgMTg3IC0xMTEgMzM1
|
|
LjMgNTEyLjIpIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgcj0iMSI+DQoJCTxzdG9w
|
|
IG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIuMyIvPg0KCQk8c3Rv
|
|
cCBvZmZzZXQ9IjEiIHN0b3Atb3BhY2l0eT0iLjMiLz4NCgk8L3JhZGlhbEdyYWRpZW50Pg0KCTxy
|
|
YWRpYWxHcmFkaWVudCBpZD0ibG9nby10b3AtZWRnZSIgY3g9IjAiIGN5PSIwIiBncmFkaWVudFRy
|
|
YW5zZm9ybT0ibWF0cml4KC0zNiAxNjYgLTExMiAtMjQgMzEwIDEyOC4yKSIgZ3JhZGllbnRVbml0
|
|
cz0idXNlclNwYWNlT25Vc2UiIHI9IjEiPg0KCQk8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9
|
|
IiNmZmYiIHN0b3Atb3BhY2l0eT0iMCIvPg0KCQk8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9
|
|
IiNmZmYiIHN0b3Atb3BhY2l0eT0iLjIiLz4NCgk8L3JhZGlhbEdyYWRpZW50Pg0KCTxyYWRpYWxH
|
|
cmFkaWVudCBpZD0ibG9nby1sZWZ0LWVkZ2UiIGN4PSIwIiBjeT0iMCIgZ3JhZGllbnRUcmFuc2Zv
|
|
cm09Im1hdHJpeCg4OCA4OSAtMTkwIDE4NyAxMTEgMjIwLjIpIiBncmFkaWVudFVuaXRzPSJ1c2Vy
|
|
U3BhY2VPblVzZSIgcj0iMSI+DQoJCTxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2ZmZiIg
|
|
c3RvcC1vcGFjaXR5PSIuMiIvPg0KCQk8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmZmYi
|
|
IHN0b3Atb3BhY2l0eT0iLjQiLz4NCgk8L3JhZGlhbEdyYWRpZW50Pg0KCTxyYWRpYWxHcmFkaWVu
|
|
dCBpZD0ibG9nby1ib3R0b20tZWRnZSIgY3g9IjAiIGN5PSIwIiBncmFkaWVudFRyYW5zZm9ybT0i
|
|
bWF0cml4KDkgMTMwIC0yNzYgMjAgMjE1IDI4NCkiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9u
|
|
VXNlIiByPSIxIj4NCgkJPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9w
|
|
YWNpdHk9Ii4yIi8+DQoJCTxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1v
|
|
cGFjaXR5PSIuMyIvPg0KCTwvcmFkaWFsR3JhZGllbnQ+DQoJPHJhZGlhbEdyYWRpZW50IGlkPSJs
|
|
b2dvLW1pZGRsZS1lZGdlIiBjeD0iMCIgY3k9IjAiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgo
|
|
LTE5OCAtMTA0IDMyNyAtNjIzIDQwMCAzOTkuMikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9u
|
|
VXNlIiByPSIxIj4NCgkJPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9w
|
|
YWNpdHk9Ii4yIi8+DQoJCTxzdG9wIG9mZnNldD0iLjUiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3At
|
|
b3BhY2l0eT0iLjIiLz4NCgkJPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9w
|
|
LW9wYWNpdHk9Ii4zIi8+DQoJPC9yYWRpYWxHcmFkaWVudD4NCgk8Y2xpcFBhdGggaWQ9ImNsaXAi
|
|
Pg0KCQk8cGF0aCBkPSJNLjIuMmg1MTJ2NTEySC4yeiIvPg0KCTwvY2xpcFBhdGg+DQoJPGcgY2xp
|
|
cC1wYXRoPSJ1cmwoI2NsaXApIj4NCgkJPHBhdGggZD0iTTM4Mi4zIDQ3NS42Yy0zLjEgMjMuNC0y
|
|
NiA0MS42LTQ4LjcgMzUuMy0zMi40LTguOS02OS45LTIyLjgtMTAzLjYtMjUuNGwtNTEuNy00YTM0
|
|
IDM0IDAgMCAxLTIyLTEwLjJsLTg5LTkxLjdhMzQgMzQgMCAwIDEtNi43LTM3LjdzNTUtMTIxIDU3
|
|
LjEtMTI3LjNjMi02LjMgOS42LTYxLjIgMTQtOTAuNiAxLjItNy45IDUtMTUgMTEtMjAuM0wyNDgg
|
|
OC45YTM0LjEgMzQuMSAwIDAgMSA0OS42IDQuM0wzODYgMTI1LjZhMzcgMzcgMCAwIDEgNy42IDIy
|
|
LjRjMCAyMS4zIDEuOCA2NSAxMy42IDkzLjIgMTEuNSAyNy4zIDMyLjUgNTcgNDMuNSA3MS41YTE3
|
|
LjMgMTcuMyAwIDAgMSAxLjMgMTkuMiAxNDk0IDE0OTQgMCAwIDEtNDQuOCA3MC42Yy0xNSAyMi4z
|
|
LTIxLjkgNDkuOS0yNSA3My4xeiIgZmlsbD0iIzZjMzFlMyIvPg0KCQk8cGF0aCBkPSJNMTY1Ljkg
|
|
NDc4LjNjNDEuNC04NCA0MC4yLTE0NC4yIDIyLjYtMTg3LTE2LjItMzkuNi00Ni4zLTY0LjUtNzAt
|
|
ODAtLjYgMi4zLTEuMyA0LjQtMi4yIDYuNUw2MC42IDM0MmEzNCAzNCAwIDAgMCA2LjYgMzcuN2w4
|
|
OS4xIDkxLjdhMzQgMzQgMCAwIDAgOS42IDd6IiBmaWxsPSJ1cmwoI2xvZ28tYm90dG9tLWxlZnQp
|
|
Ii8+DQoJCTxwYXRoIGQ9Ik0yNzguNCAzMDcuOGMxMS4yIDEuMiAyMi4yIDMuNiAzMi44IDcuNiAz
|
|
NCAxMi43IDY1IDQxLjIgOTAuNSA5Ni4zIDEuOC0zLjEgMy42LTYuMiA1LjYtOS4yYTE1MzYgMTUz
|
|
NiAwIDAgMCA0NC44LTcwLjYgMTcgMTcgMCAwIDAtMS4zLTE5LjJjLTExLTE0LjYtMzItNDQuMi00
|
|
My41LTcxLjUtMTEuOC0yOC4yLTEzLjUtNzItMTMuNi05My4yIDAtOC4xLTIuNi0xNi03LjYtMjIu
|
|
NEwyOTcuNiAxMy4yYTM0IDM0IDAgMCAwLTEuNS0xLjcgOTYgOTYgMCAwIDEgMiA1NCAxOTguMyAx
|
|
OTguMyAwIDAgMS0xNy42IDQxLjNsLTcuMiAxNC4yYTE3MSAxNzEgMCAwIDAtMTkuNCA3MWMtMS4y
|
|
IDI5LjQgNC44IDY2LjQgMjQuNSAxMTUuOHoiIGZpbGw9InVybCgjbG9nby10b3AtcmlnaHQpIi8+
|
|
DQoJCTxwYXRoIGQ9Ik0yNzguNCAzMDcuOGMtMTkuNy00OS40LTI1LjgtODYuNC0yNC41LTExNS45
|
|
YTE3MSAxNzEgMCAwIDEgMTkuNC03MWMyLjMtNC44IDQuOC05LjUgNy4yLTE0LjEgNy4xLTEzLjkg
|
|
MTQtMjcgMTcuNi00MS40YTk2IDk2IDAgMCAwLTItNTRBMzQuMSAzNC4xIDAgMCAwIDI0OCA5bC0x
|
|
MDUuNCA5NC44YTM0LjEgMzQuMSAwIDAgMC0xMC45IDIwLjNsLTEyLjggODUtLjUgMi4zYzIzLjgg
|
|
MTUuNSA1NCA0MC40IDcwLjEgODBhMTQ3IDE0NyAwIDAgMSA3LjggMjQuOGMyOC02LjggNTUuNy0x
|
|
MSA4Mi4xLTguM3oiIGZpbGw9InVybCgjbG9nby10b3AtbGVmdCkiLz4NCgkJPHBhdGggZD0iTTMz
|
|
My42IDUxMWMyMi43IDYuMiA0NS42LTEyIDQ4LjctMzUuNGExODcgMTg3IDAgMCAxIDE5LjQtNjMu
|
|
OWMtMjUuNi01NS01Ni41LTgzLjYtOTAuNC05Ni4zLTM2LTEzLjQtNzUuMi05LTExNSAuNyA4Ljkg
|
|
NDAuNCAzLjYgOTMuMy0zMC40IDE2Mi4yIDQgMS44IDguMSAzIDEyLjUgMy4zIDAgMCAyNC40IDIg
|
|
NTMuNiA0LjEgMjkgMiA3Mi40IDE3LjEgMTAxLjYgMjUuMnoiIGZpbGw9InVybCgjbG9nby1ib3R0
|
|
b20tcmlnaHQpIi8+DQoJCTxnIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbC1ydWxlPSJldmVub2Rk
|
|
Ij4NCgkJCTxwYXRoIGQ9Ik0yNTQuMSAxOTBjLTEuMyAyOS4yIDIuNCA2Mi44IDIyLjEgMTEyLjFs
|
|
LTYuMi0uNWMtMTcuNy01MS41LTIxLjUtNzgtMjAuMi0xMDcuNmExNzQuNyAxNzQuNyAwIDAgMSAy
|
|
MC40LTcyYzIuNC00LjkgOC0xNC4xIDEwLjUtMTguOCA3LjEtMTMuNyAxMS45LTIxIDE2LTMzLjYg
|
|
NS43LTE3LjUgNC41LTI1LjkgMy44LTM0LjEgNC42IDI5LjktMTIuNyA1Ni0yNS43IDgyLjRhMTc3
|
|
LjEgMTc3LjEgMCAwIDAtMjAuNyA3MnoiIGZpbGw9InVybCgjbG9nby10b3AtZWRnZSkiLz4NCgkJ
|
|
CTxwYXRoIGQ9Ik0xOTQuMyAyOTMuNGMyLjQgNS40IDQuNiA5LjggNiAxNi41TDE5NSAzMTFjLTIu
|
|
MS03LjgtMy44LTEzLjQtNi44LTIwLTE3LjgtNDItNDYuMy02My42LTY5LjctNzkuNSAyOC4yIDE1
|
|
LjIgNTcuMiAzOSA3NS43IDgxLjl6IiBmaWxsPSJ1cmwoI2xvZ28tbGVmdC1lZGdlKSIvPg0KCQkJ
|
|
PHBhdGggZD0iTTIwMC42IDMxNS4xYzkuOCA0Ni0xLjIgMTA0LjItMzMuNiAxNjAuOSAyNy4xLTU2
|
|
LjIgNDAuMi0xMTAuMSAyOS4zLTE2MHoiIGZpbGw9InVybCgjbG9nby1ib3R0b20tZWRnZSkiLz4N
|
|
CgkJCTxwYXRoIGQ9Ik0zMTIuNSAzMTFjNTMuMSAxOS45IDczLjYgNjMuNiA4OC45IDEwMC0xOS0z
|
|
OC4xLTQ1LjItODAuMy05MC44LTk2LTM0LjgtMTEuOC02NC4xLTEwLjQtMTE0LjMgMWwtMS4xLTVj
|
|
NTMuMi0xMi4xIDgxLTEzLjUgMTE3LjMgMHoiIGZpbGw9InVybCgjbG9nby1taWRkbGUtZWRnZSki
|
|
Lz4NCgkJPC9nPg0KCTwvZz4NCjwvc3ZnPg0K`,Ll=`data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBB
|
|
ZG9iZSBJbGx1c3RyYXRvciAxOC4xLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9u
|
|
OiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1s
|
|
bnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53
|
|
My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA0MjkgMTE3
|
|
LjMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDQyOSAxMTcuMyIgeG1sOnNwYWNlPSJwcmVz
|
|
ZXJ2ZSI+DQo8Zz4NCgk8bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzFfIiBncmFkaWVudFVuaXRz
|
|
PSJ1c2VyU3BhY2VPblVzZSIgeDE9IjU4LjY2NiIgeTE9IjExNy4zMzIiIHgyPSI1OC42NjYiIHky
|
|
PSItOS4wOTQ5NDdlLTEzIj4NCgkJPHN0b3AgIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6
|
|
IzA4ODJDOCIvPg0KCQk8c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojMjZCNkRC
|
|
Ii8+DQoJPC9saW5lYXJHcmFkaWVudD4NCgk8Y2lyY2xlIGZpbGw9InVybCgjU1ZHSURfMV8pIiBj
|
|
eD0iNTguNyIgY3k9IjU4LjciIHI9IjU4LjciLz4NCgk8Zz4NCgkJPGNpcmNsZSBmaWxsPSJub25l
|
|
IiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iNiIgc3Ryb2tlLW1pdGVybGltaXQ9IjEw
|
|
IiBjeD0iNTguNyIgY3k9IjU4LjUiIHI9IjQzLjciLz4NCgkJPGc+DQoJCQk8cGF0aCBmaWxsPSIj
|
|
RkZGRkZGIiBkPSJNOTQuNyw0Ny44YzQuNywxLjYsOS44LTAuOSwxMS40LTUuNmMxLjYtNC43LTAu
|
|
OS05LjgtNS42LTExLjRjLTQuNy0xLjYtOS44LDAuOS0xMS40LDUuNg0KCQkJCUM4Ny41LDQxLjEs
|
|
OTAsNDYuMiw5NC43LDQ3Ljh6Ii8+DQoJCQk8bGluZSBmaWxsPSJub25lIiBzdHJva2U9IiNGRkZG
|
|
RkYiIHN0cm9rZS13aWR0aD0iNiIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiB4MT0iOTcuNiIgeTE9
|
|
IjM5LjQiIHgyPSI2Ny41IiB5Mj0iNjQuNCIvPg0KCQk8L2c+DQoJCTxnPg0KCQkJPHBhdGggZmls
|
|
bD0iI0ZGRkZGRiIgZD0iTTc3LjYsOTFjLTAuNCw0LjksMy4yLDkuMyw4LjIsOS44YzUsMC40LDku
|
|
My0zLjIsOS44LTguMmMwLjQtNC45LTMuMi05LjMtOC4yLTkuOA0KCQkJCUM4Mi40LDgyLjQsNzgs
|
|
ODYsNzcuNiw5MXoiLz4NCgkJCTxsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0ZGRkZGRiIgc3Ry
|
|
b2tlLXdpZHRoPSI2IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHgxPSI4Ni41IiB5MT0iOTEuOCIg
|
|
eDI9IjY3LjUiIHkyPSI2NC40Ii8+DQoJCTwvZz4NCgkJPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0i
|
|
TTYwLDY5LjNjMi43LDQuMiw4LjMsNS40LDEyLjQsMi43YzQuMi0yLjcsNS40LTguMywyLjctMTIu
|
|
NGMtMi43LTQuMi04LjMtNS40LTEyLjQtMi43DQoJCQlDNTguNSw1OS41LDU3LjMsNjUuMSw2MCw2
|
|
OS4zeiIvPg0KCQk8Zz4NCgkJCTxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0yMS4yLDYxLjRjLTQu
|
|
My0yLjUtOS44LTEuMS0xMi4zLDMuMWMtMi41LDQuMy0xLjEsOS44LDMuMSwxMi4zYzQuMywyLjUs
|
|
OS44LDEuMSwxMi4zLTMuMQ0KCQkJCUMyNi44LDY5LjUsMjUuNCw2NCwyMS4yLDYxLjR6Ii8+DQoJ
|
|
CQk8bGluZSBmaWxsPSJub25lIiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iNiIgc3Ry
|
|
b2tlLW1pdGVybGltaXQ9IjEwIiB4MT0iMTYuNiIgeTE9IjY5LjEiIHgyPSI2Ny41IiB5Mj0iNjQu
|
|
NCIvPg0KCQk8L2c+DQoJPC9nPg0KPC9nPg0KPGc+DQoJPHBhdGggZmlsbD0iIzA4OTFEMSIgZD0i
|
|
TTE2My44LDUwLjJjLTAuNi0wLjctNi4zLTQuMS0xMS40LTQuMWMtMy40LDAtNS4yLDEuMi01LjIs
|
|
My41YzAsMi45LDMuMiwzLjcsOC45LDUuMg0KCQljOC4yLDIuMiwxMy4zLDUsMTMuMywxMi45YzAs
|
|
OS43LTcuOCwxMy0xNiwxM2MtNi4yLDAtMTMuMS0yLTE4LjItNS4zbDQuMy04LjZjMC44LDAuOCw3
|
|
LjUsNSwxNCw1YzMuNSwwLDUuMi0xLjEsNS4yLTMuMg0KCQljMC0zLjItNC40LTQtMTAuMy01Ljhj
|
|
LTcuOS0yLjQtMTEuNS01LjMtMTEuNS0xMS44YzAtOSw3LjItMTMuOSwxNS43LTEzLjljNi4xLDAs
|
|
MTEuNiwyLjUsMTUuNCw0LjdMMTYzLjgsNTAuMnoiLz4NCgk8cGF0aCBmaWxsPSIjMDg5MUQxIiBk
|
|
PSJNMTc1LDg1LjFjMS43LDAuNSwzLjMsMC44LDQuNCwwLjhjMiwwLDMuMy0xLjUsNC4yLTUuNWwt
|
|
MTEuOS0zMS41aDkuOGw3LjQsMjMuM2w2LjMtMjMuM2g4LjlsLTEyLjEsMzYuNg0KCQljLTEuNyw1
|
|
LjMtNi4yLDguNy0xMS44LDguOGMtMS43LDAtMy41LTAuMi01LjMtMC45Vjg1LjF6Ii8+DQoJPHBh
|
|
dGggZmlsbD0iIzA4OTFEMSIgZD0iTTIzOS4zLDgwLjNoLTkuNlY2Mi42YzAtNC4xLTEuNy01Ljkt
|
|
NC4zLTUuOWMtMi42LDAtNS44LDIuMy03LDUuNnYxOC4xaC05LjZWNDguOGg4LjZ2NS4zDQoJCWMy
|
|
LjMtMy43LDYuOC01LjksMTIuMi01LjljOC4yLDAsOS41LDYuNyw5LjUsMTEuOVY4MC4zeiIvPg0K
|
|
CTxwYXRoIGZpbGw9IiMwODkxRDEiIGQ9Ik0yNjEuNiw0OC4yYzcuMiwwLDEyLjMsMy40LDE0Ljgs
|
|
OC4zbC05LjQsMi44Yy0xLjItMS45LTMuMS0zLTUuNS0zYy00LDAtNywzLjItNyw4LjJjMCw1LDMu
|
|
MSw4LjMsNyw4LjMNCgkJYzIuNCwwLDQuNi0xLjMsNS41LTMuMWw5LjQsMi45Yy0yLjMsNC45LTcu
|
|
Niw4LjMtMTQuOCw4LjNjLTEwLjYsMC0xNi45LTcuNy0xNi45LTE2LjRTMjUwLjksNDguMiwyNjEu
|
|
Niw0OC4yeiIvPg0KCTxwYXRoIGZpbGw9IiMwODkxRDEiIGQ9Ik0zMDIuMSw3OC43Yy0yLjYsMS4x
|
|
LTYuMiwyLjMtOS43LDIuM2MtNC43LDAtOC44LTIuMy04LjgtOC40VjU2LjFoLTR2LTcuM2g0di0x
|
|
MGg5LjZ2MTBoNi40djcuM2gtNi40djEzLjENCgkJYzAsMi4xLDEuMiwyLjksMi44LDIuOWMxLjQs
|
|
MCwzLTAuNiw0LjItMS4xTDMwMi4xLDc4Ljd6Ii8+DQoJPHBhdGggZmlsbD0iIzA4OTFEMSIgZD0i
|
|
TTMzNy4yLDgwLjNoLTkuNlY2Mi42YzAtNC4xLTEuOC01LjktNC42LTUuOWMtMi4zLDAtNS41LDIu
|
|
Mi02LjcsNS42djE4LjFoLTkuNlYzNi41aDkuNnYxNy42DQoJCWMyLjMtMy43LDYuMy01LjksMTAu
|
|
OS01LjljOC41LDAsOS45LDYuNSw5LjksMTEuOVY4MC4zeiIvPg0KCTxwYXRoIGZpbGw9IiMwODkx
|
|
RDEiIGQ9Ik0zNDMuNCw0NS4ydi04LjdoOS42djguN0gzNDMuNHogTTM0My40LDgwLjNWNDguOGg5
|
|
LjZ2MzEuNUgzNDMuNHoiLz4NCgk8cGF0aCBmaWxsPSIjMDg5MUQxIiBkPSJNMzg5LjksODAuM2gt
|
|
OS42VjYyLjZjMC00LjEtMS43LTUuOS00LjMtNS45Yy0yLjYsMC01LjgsMi4zLTcsNS42djE4LjFo
|
|
LTkuNlY0OC44aDguNnY1LjMNCgkJYzIuMy0zLjcsNi44LTUuOSwxMi4yLTUuOWM4LjIsMCw5LjUs
|
|
Ni43LDkuNSwxMS45VjgwLjN6Ii8+DQoJPHBhdGggZmlsbD0iIzA4OTFEMSIgZD0iTTM5NS41LDY0
|
|
LjZjMC05LjIsNi0xNi4zLDE0LjYtMTYuM2M0LjcsMCw4LjQsMi4yLDEwLjYsNS44di01LjJoOC4z
|
|
djI5LjNjMCw5LjYtNy41LDE1LjUtMTguMiwxNS41DQoJCWMtNi44LDAtMTEuNS0yLjMtMTUtNi4z
|
|
bDUuMS01LjJjMi4zLDIuNiw2LDQuMyw5LjksNC4zYzQuNiwwLDguNi0yLjQsOC42LTguM3YtMy4x
|
|
Yy0xLjksMy41LTUuOSw1LjMtMTAsNS4zDQoJCUM0MDEuMSw4MC41LDM5NS41LDczLjMsMzk1LjUs
|
|
NjQuNnogTTQxOS40LDY4LjV2LTYuNmMtMS4zLTMuMy00LjItNS41LTcuMS01LjVjLTQuMSwwLTcs
|
|
NC03LDguNGMwLDQuNiwzLjIsOCw3LjUsOA0KCQlDNDE1LjcsNzIuOCw0MTguMSw3MSw0MTkuNCw2
|
|
OC41eiIvPg0KPC9nPg0KPC9zdmc+DQo=`,Nl=`
|
|
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 117.3 117.3"
|
|
enable-background="new 0 0 117.3 117.3" xml:space="preserve">
|
|
<g>
|
|
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="58.666" y1="117.332" x2="58.666" y2="0">
|
|
<stop offset="0" style="stop-color:#0882C8"/>
|
|
<stop offset="1" style="stop-color:#26B6DB"/>
|
|
</linearGradient>
|
|
<circle fill="url(#SVGID_1_)" cx="58.7" cy="58.7" r="58.7"/>
|
|
<g>
|
|
<circle fill="none" stroke="#FFFFFF" stroke-width="6" stroke-miterlimit="10" cx="58.7" cy="58.5" r="43.7"/>
|
|
<g>
|
|
<path fill="#FFFFFF" d="M94.7,47.8c4.7,1.6,9.8-0.9,11.4-5.6c1.6-4.7-0.9-9.8-5.6-11.4c-4.7-1.6-9.8,0.9-11.4,5.6 C87.5,41.1,90,46.2,94.7,47.8z"/>
|
|
<line fill="none" stroke="#FFFFFF" stroke-width="6" stroke-miterlimit="10" x1="97.6" y1="39.4" x2="67.5" y2="64.4"/>
|
|
</g>
|
|
<g>
|
|
<path fill="#FFFFFF" d="M77.6,91c-0.4,4.9,3.2,9.3,8.2,9.8c5,0.4,9.3-3.2,9.8-8.2c0.4-4.9-3.2-9.3-8.2-9.8 C82.4,82.4,78,86,77.6,91z"/>
|
|
<line fill="none" stroke="#FFFFFF" stroke-width="6" stroke-miterlimit="10" x1="86.5" y1="91.8" x2="67.5" y2="64.4"/>
|
|
</g>
|
|
<path fill="#FFFFFF" d="M60,69.3c2.7,4.2,8.3,5.4,12.4,2.7c4.2-2.7,5.4-8.3,2.7-12.4c-2.7-4.2-8.3-5.4-12.4-2.7 C58.5,59.5,57.3,65.1,60,69.3z"/>
|
|
<g>
|
|
<path fill="#FFFFFF" d="M21.2,61.4c-4.3-2.5-9.8-1.1-12.3,3.1c-2.5,4.3-1.1,9.8,3.1,12.3c4.3,2.5,9.8,1.1,12.3-3.1 C26.8,69.5,25.4,64,21.2,61.4z"/>
|
|
<line fill="none" stroke="#FFFFFF" stroke-width="6" stroke-miterlimit="10" x1="16.6" y1="69.1" x2="67.5" y2="64.4"/>
|
|
</g>
|
|
</g>
|
|
</g>
|
|
</svg>
|
|
`;var zt=require("obsidian");var Re=require("obsidian");var Ql=require("obsidian");var nn=require("obsidian");var $t=require("obsidian");var Al=require("obsidian");function uf(i){let e,t=[i[1],{style:"display: flex;"}],n={};for(let r=0;r<t.length;r+=1)n=xt(n,t[r]);return{c(){e=p("div"),mn(e,n)},m(r,o){v(r,e,o),i[3](e)},p(r,[o]){mn(e,n=Fi(t,[o&2&&r[1],{style:"display: flex;"}]))},i:z,o:z,d(r){r&&y(e),i[3](null)}}}function ff(i,e,t){let n=["name"],r=gn(e,n),o,{name:s}=e;Ke(()=>{let l=(0,Al.getIcon)(s);l&&o.appendChild(l)});function a(l){st[l?"unshift":"push"](()=>{o=l,t(0,o)})}return i.$$set=l=>{e=xt(xt({},e),Ni(l)),t(1,r=gn(e,n)),"name"in l&&t(2,s=l.name)},[o,r,s,a]}var fo=class extends fe{constructor(e){super(),he(this,e,ff,uf,ue,{name:2})}},Y=fo;function df(i){Ie(i,"svelte-8fgumz","details.svelte-8fgumz.svelte-8fgumz{padding:1%;border-radius:var(--radius-l)}details.svelte-8fgumz.svelte-8fgumz:hover{background-color:var(--background-modifier-hover)}summary.svelte-8fgumz.svelte-8fgumz{list-style:none;display:flex;flex-direction:row;align-items:center;gap:0.5em;height:fit-content;background-color:var(--background-secondary-alt);padding:1% 2%;border-radius:var(--radius-m)}details[open].svelte-8fgumz summary.svelte-8fgumz{border-radius:0;border-top-left-radius:var(--radius-m);border-top-right-radius:var(--radius-m)}table.svelte-8fgumz.svelte-8fgumz{width:100%;background-color:var(--background-primary);border-collapse:collapse;border-spacing:0;padding:1%;border-radius:var(--radius-l)}table.svelte-8fgumz>tr:last-child td.svelte-8fgumz:first-child{border-bottom-left-radius:var(--radius-m)}table.svelte-8fgumz>tr:last-child td.svelte-8fgumz:last-child{border-bottom-right-radius:var(--radius-m)}table.svelte-8fgumz tr td.svelte-8fgumz{padding:0.5em}tr.svelte-8fgumz.svelte-8fgumz:active,td.svelte-8fgumz.svelte-8fgumz:active{position:static;background:none;width:auto;transition:none;transform:none;border-radius:0}table.svelte-8fgumz tr td div.svelte-8fgumz{vertical-align:middle;display:inline-flex;align-items:center;gap:0.5em}table.svelte-8fgumz tr td.svelte-8fgumz:first-child{text-align:start;display:table-cell}table.svelte-8fgumz tr td.svelte-8fgumz:last-child{text-align:end}table.svelte-8fgumz tr.svelte-8fgumz:nth-child(odd){background-color:var(--background-primary-alt)}table.svelte-8fgumz tr.svelte-8fgumz:nth-child(even){background-color:var(--background-secondary)}")}var pf=i=>({}),Dl=i=>({class:"footer"}),gf=i=>({}),jl=i=>({});function mf(i){var a,l,u;let e,t,n,r=((u=(a=i[1])==null?void 0:a.name)!=null?u:(l=i[1])==null?void 0:l.deviceID)+"",o,s;return e=new Y({props:{name:"hard-drive"}}),{c(){A(e.$$.fragment),t=b(),n=p("span"),o=F(r)},m(f,d){L(e,f,d),v(f,t,d),v(f,n,d),c(n,o),s=!0},p(f,d){var m,g,_;(!s||d&2)&&r!==(r=((_=(m=f[1])==null?void 0:m.name)!=null?_:(g=f[1])==null?void 0:g.deviceID)+"")&&oe(o,r)},i(f){s||(I(e.$$.fragment,f),s=!0)},o(f){M(e.$$.fragment,f),s=!1},d(f){f&&(y(t),y(n)),N(e,f)}}}function hf(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k,x,C,w,S,T,P,Z,O,R,re,te,W,U,E,G,D,J,be,X,$,j,ye,ge,q,Se,ve,me,H,V,Ce,ce,Be,De,Ge,ct,$e,et,Ze,qe,je,Qe,Ye,se,Te,Ue,ke,ut,We,xe=i[1].deviceID.slice(0,7)+"",wt,B,le,Ee,ne,Xe,kt,yt,Mn,Tt,Lt,Nt,rn;return r=new Y({props:{name:"download-cloud"}}),g=new Y({props:{name:"upload-cloud"}}),Z=new Y({props:{name:"home"}}),D=new Y({props:{name:"network"}}),Se=new Y({props:{name:"milestone"}}),Ge=new Y({props:{name:"clock-9"}}),se=new Y({props:{name:"qr-code"}}),Xe=new Y({props:{name:"tag"}}),{c(){e=p("tr"),t=p("td"),n=p("div"),A(r.$$.fragment),o=b(),s=p("span"),s.textContent="Download Rate",a=b(),l=p("td"),l.innerHTML='<a href="/" style="color: inherit;">0 B/s (0 B)</a>',u=b(),f=p("tr"),d=p("td"),m=p("div"),A(g.$$.fragment),_=b(),k=p("span"),k.textContent="Upload Rate",x=b(),C=p("td"),C.innerHTML='<a href="/" style="color: inherit;">0 B/s (0 B)</a>',w=b(),S=p("tr"),T=p("td"),P=p("div"),A(Z.$$.fragment),O=b(),R=p("span"),R.textContent="Local State (Total)",re=b(),te=p("td"),te.innerHTML="<span>Files: 100, Folders: 50, Storage: ~40 MiB</span>",W=b(),U=p("tr"),E=p("td"),G=p("div"),A(D.$$.fragment),J=b(),be=p("span"),be.textContent="Listeners",X=b(),$=p("td"),$.innerHTML="<span>3/3</span>",j=b(),ye=p("tr"),ge=p("td"),q=p("div"),A(Se.$$.fragment),ve=b(),me=p("span"),me.textContent="Discovery",H=b(),V=p("td"),V.innerHTML="<span>4/5</span>",Ce=b(),ce=p("tr"),Be=p("td"),De=p("div"),A(Ge.$$.fragment),ct=b(),$e=p("span"),$e.textContent="Uptime",et=b(),Ze=p("td"),Ze.innerHTML="<span>10h 23m</span>",qe=b(),je=p("tr"),Qe=p("td"),Ye=p("div"),A(se.$$.fragment),Te=b(),Ue=p("span"),Ue.textContent="Identification",ke=b(),ut=p("td"),We=p("a"),wt=F(xe),B=b(),le=p("tr"),Ee=p("td"),ne=p("div"),A(Xe.$$.fragment),kt=b(),yt=p("span"),yt.textContent="Version",Mn=b(),Tt=p("td"),Tt.innerHTML="<span>v1.23.7, Windows, blabla</span>",h(n,"class","svelte-8fgumz"),h(t,"class","svelte-8fgumz"),h(l,"class","svelte-8fgumz"),h(e,"class","svelte-8fgumz"),h(m,"class","svelte-8fgumz"),h(d,"class","svelte-8fgumz"),h(C,"class","svelte-8fgumz"),h(f,"class","svelte-8fgumz"),h(P,"class","svelte-8fgumz"),h(T,"class","svelte-8fgumz"),h(te,"class","svelte-8fgumz"),h(S,"class","svelte-8fgumz"),h(G,"class","svelte-8fgumz"),h(E,"class","svelte-8fgumz"),h($,"class","svelte-8fgumz"),h(U,"class","svelte-8fgumz"),h(q,"class","svelte-8fgumz"),h(ge,"class","svelte-8fgumz"),h(V,"class","svelte-8fgumz"),h(ye,"class","svelte-8fgumz"),h(De,"class","svelte-8fgumz"),h(Be,"class","svelte-8fgumz"),h(Ze,"class","svelte-8fgumz"),h(ce,"class","svelte-8fgumz"),h(Ye,"class","svelte-8fgumz"),h(Qe,"class","svelte-8fgumz"),h(We,"href","/"),h(ut,"class","svelte-8fgumz"),h(je,"class","svelte-8fgumz"),h(ne,"class","svelte-8fgumz"),h(Ee,"class","svelte-8fgumz"),h(Tt,"class","svelte-8fgumz"),h(le,"class","svelte-8fgumz")},m(ae,Fe){v(ae,e,Fe),c(e,t),c(t,n),L(r,n,null),c(n,o),c(n,s),c(e,a),c(e,l),v(ae,u,Fe),v(ae,f,Fe),c(f,d),c(d,m),L(g,m,null),c(m,_),c(m,k),c(f,x),c(f,C),v(ae,w,Fe),v(ae,S,Fe),c(S,T),c(T,P),L(Z,P,null),c(P,O),c(P,R),c(S,re),c(S,te),v(ae,W,Fe),v(ae,U,Fe),c(U,E),c(E,G),L(D,G,null),c(G,J),c(G,be),c(U,X),c(U,$),v(ae,j,Fe),v(ae,ye,Fe),c(ye,ge),c(ge,q),L(Se,q,null),c(q,ve),c(q,me),c(ye,H),c(ye,V),v(ae,Ce,Fe),v(ae,ce,Fe),c(ce,Be),c(Be,De),L(Ge,De,null),c(De,ct),c(De,$e),c(ce,et),c(ce,Ze),v(ae,qe,Fe),v(ae,je,Fe),c(je,Qe),c(Qe,Ye),L(se,Ye,null),c(Ye,Te),c(Ye,Ue),c(je,ke),c(je,ut),c(ut,We),c(We,wt),v(ae,B,Fe),v(ae,le,Fe),c(le,Ee),c(Ee,ne),L(Xe,ne,null),c(ne,kt),c(ne,yt),c(le,Mn),c(le,Tt),Lt=!0,Nt||(rn=Q(We,"click",i[6]),Nt=!0)},p(ae,Fe){(!Lt||Fe&2)&&xe!==(xe=ae[1].deviceID.slice(0,7)+"")&&oe(wt,xe)},i(ae){Lt||(I(r.$$.fragment,ae),I(g.$$.fragment,ae),I(Z.$$.fragment,ae),I(D.$$.fragment,ae),I(Se.$$.fragment,ae),I(Ge.$$.fragment,ae),I(se.$$.fragment,ae),I(Xe.$$.fragment,ae),Lt=!0)},o(ae){M(r.$$.fragment,ae),M(g.$$.fragment,ae),M(Z.$$.fragment,ae),M(D.$$.fragment,ae),M(Se.$$.fragment,ae),M(Ge.$$.fragment,ae),M(se.$$.fragment,ae),M(Xe.$$.fragment,ae),Lt=!1},d(ae){ae&&(y(e),y(u),y(f),y(w),y(S),y(W),y(U),y(j),y(ye),y(Ce),y(ce),y(qe),y(je),y(B),y(le)),N(r),N(g),N(Z),N(D),N(Se),N(Ge),N(se),N(Xe),Nt=!1,rn()}}}function _f(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k,x,C,w,S,T,P,Z,O,R,re,te,W,U,E=i[1].address.join(", ")+"",G,D,J,be,X,$,j,ye,ge,q,Se,ve=i[1].deviceID.slice(0,7)+"",me,H,V,Ce,ce,Be,De,Ge,ct,$e,et,Ze=i[1].name+"",qe,je,Qe,Ye;return r=new Y({props:{name:"eye"}}),_=new Y({props:{name:"cloud"}}),O=new Y({props:{name:"link"}}),$=new Y({props:{name:"qr-code"}}),Be=new Y({props:{name:"folder"}}),{c(){e=p("tr"),t=p("td"),n=p("div"),A(r.$$.fragment),o=b(),s=p("span"),s.textContent="Last seen",a=b(),l=p("td"),u=p("span"),u.textContent=`${new Date().toString()}`,f=b(),d=p("tr"),m=p("td"),g=p("div"),A(_.$$.fragment),k=b(),x=p("span"),x.textContent="Sync Status",C=b(),w=p("td"),w.innerHTML="<span>up to date</span>",S=b(),T=p("tr"),P=p("td"),Z=p("div"),A(O.$$.fragment),R=b(),re=p("span"),re.textContent="Addresses",te=b(),W=p("td"),U=p("span"),G=F(E),D=b(),J=p("tr"),be=p("td"),X=p("div"),A($.$$.fragment),j=b(),ye=p("span"),ye.textContent="Identification",ge=b(),q=p("td"),Se=p("a"),me=F(ve),H=b(),V=p("tr"),Ce=p("td"),ce=p("div"),A(Be.$$.fragment),De=b(),Ge=p("span"),Ge.textContent="Folders",ct=b(),$e=p("td"),et=p("span"),qe=F(Ze),h(n,"class","svelte-8fgumz"),h(t,"class","svelte-8fgumz"),h(l,"class","svelte-8fgumz"),h(e,"class","svelte-8fgumz"),h(g,"class","svelte-8fgumz"),h(m,"class","svelte-8fgumz"),h(w,"class","svelte-8fgumz"),h(d,"class","svelte-8fgumz"),h(Z,"class","svelte-8fgumz"),h(P,"class","svelte-8fgumz"),h(W,"class","svelte-8fgumz"),h(T,"class","svelte-8fgumz"),h(X,"class","svelte-8fgumz"),h(be,"class","svelte-8fgumz"),h(Se,"href","/"),h(q,"class","svelte-8fgumz"),h(J,"class","svelte-8fgumz"),h(ce,"class","svelte-8fgumz"),h(Ce,"class","svelte-8fgumz"),h($e,"class","svelte-8fgumz"),h(V,"class","svelte-8fgumz")},m(se,Te){v(se,e,Te),c(e,t),c(t,n),L(r,n,null),c(n,o),c(n,s),c(e,a),c(e,l),c(l,u),v(se,f,Te),v(se,d,Te),c(d,m),c(m,g),L(_,g,null),c(g,k),c(g,x),c(d,C),c(d,w),v(se,S,Te),v(se,T,Te),c(T,P),c(P,Z),L(O,Z,null),c(Z,R),c(Z,re),c(T,te),c(T,W),c(W,U),c(U,G),v(se,D,Te),v(se,J,Te),c(J,be),c(be,X),L($,X,null),c(X,j),c(X,ye),c(J,ge),c(J,q),c(q,Se),c(Se,me),v(se,H,Te),v(se,V,Te),c(V,Ce),c(Ce,ce),L(Be,ce,null),c(ce,De),c(ce,Ge),c(V,ct),c(V,$e),c($e,et),c(et,qe),je=!0,Qe||(Ye=Q(Se,"click",i[5]),Qe=!0)},p(se,Te){(!je||Te&2)&&E!==(E=se[1].address.join(", ")+"")&&oe(G,E),(!je||Te&2)&&ve!==(ve=se[1].deviceID.slice(0,7)+"")&&oe(me,ve),(!je||Te&2)&&Ze!==(Ze=se[1].name+"")&&oe(qe,Ze)},i(se){je||(I(r.$$.fragment,se),I(_.$$.fragment,se),I(O.$$.fragment,se),I($.$$.fragment,se),I(Be.$$.fragment,se),je=!0)},o(se){M(r.$$.fragment,se),M(_.$$.fragment,se),M(O.$$.fragment,se),M($.$$.fragment,se),M(Be.$$.fragment,se),je=!1},d(se){se&&(y(e),y(f),y(d),y(S),y(T),y(D),y(J),y(H),y(V)),N(r),N(_),N(O),N($),N(Be),Qe=!1,Ye()}}}function bf(i){let e,t,n,r,o,s,a,l,u,f=i[0].id+"",d,m,g,_,k,x,C,w,S,T,P,Z=i[0].path+"",O,R,re,te,W,U,E,G,D,J,be,X,$,j,ye,ge,q,Se,ve,me,H,V,Ce,ce,Be,De,Ge,ct,$e,et,Ze,qe,je,Qe,Ye,se,Te,Ue,ke,ut,We,xe,wt,B,le,Ee,ne,Xe,kt,yt,Mn,Tt,Lt,Nt,rn,ae=i[0].devices.map(El).join(", ")+"",Fe,dr,Pt,ei,on,sn,Co,pr,Io,ti,gr,mr,Rt,ni,ln,an,Mo,hr,So,ii,_r,Bt;return r=new Y({props:{name:"info"}}),x=new Y({props:{name:"folder"}}),U=new Y({props:{name:"globe-2"}}),ye=new Y({props:{name:"home"}}),ce=new Y({props:{name:"refresh-cw"}}),et=new Y({props:{name:"clock-9"}}),Qe=new Y({props:{name:"eye"}}),We=new Y({props:{name:"file"}}),yt=new Y({props:{name:"share-2"}}),sn=new Y({props:{name:"clock-9"}}),an=new Y({props:{name:"arrow-left-right"}}),{c(){e=p("tr"),t=p("td"),n=p("div"),A(r.$$.fragment),o=b(),s=p("span"),s.textContent="Folder ID",a=b(),l=p("td"),u=p("span"),d=F(f),m=b(),g=p("tr"),_=p("td"),k=p("div"),A(x.$$.fragment),C=b(),w=p("span"),w.textContent="Folder Path",S=b(),T=p("td"),P=p("span"),O=F(Z),R=b(),re=p("tr"),te=p("td"),W=p("div"),A(U.$$.fragment),E=b(),G=p("span"),G.textContent="Global State",D=b(),J=p("td"),J.innerHTML="<span>Files: 100, Folders: 50, Storage: ~40 MiB</span>",be=b(),X=p("tr"),$=p("td"),j=p("div"),A(ye.$$.fragment),ge=b(),q=p("span"),q.textContent="Local State",Se=b(),ve=p("td"),ve.innerHTML="<span>Files: 100, Folders: 50, Storage: ~40 MiB</span>",me=b(),H=p("tr"),V=p("td"),Ce=p("div"),A(ce.$$.fragment),Be=b(),De=p("span"),De.textContent="Rescans",Ge=b(),ct=p("td"),$e=p("div"),A(et.$$.fragment),Ze=b(),qe=p("span"),qe.textContent="1h",je=b(),A(Qe.$$.fragment),Ye=b(),se=p("span"),se.textContent="Enabled",Te=b(),Ue=p("tr"),ke=p("td"),ut=p("div"),A(We.$$.fragment),xe=b(),wt=p("span"),wt.textContent="File Versioning",B=b(),le=p("td"),le.innerHTML="<span>Staggered</span>",Ee=b(),ne=p("tr"),Xe=p("td"),kt=p("div"),A(yt.$$.fragment),Mn=b(),Tt=p("span"),Tt.textContent="Shared With",Lt=b(),Nt=p("td"),rn=p("span"),Fe=F(ae),dr=b(),Pt=p("tr"),ei=p("td"),on=p("div"),A(sn.$$.fragment),Co=b(),pr=p("span"),pr.textContent="Last Scan",Io=b(),ti=p("td"),gr=p("span"),gr.textContent=`${new Date().toISOString()}`,mr=b(),Rt=p("tr"),ni=p("td"),ln=p("div"),A(an.$$.fragment),Mo=b(),hr=p("span"),hr.textContent="Latest Change",So=b(),ii=p("td"),_r=p("span"),_r.textContent="Updated <filename>.ext",h(n,"class","svelte-8fgumz"),h(t,"class","svelte-8fgumz"),h(l,"class","svelte-8fgumz"),h(e,"class","svelte-8fgumz"),h(k,"class","svelte-8fgumz"),h(_,"class","svelte-8fgumz"),h(T,"class","svelte-8fgumz"),h(g,"class","svelte-8fgumz"),h(W,"class","svelte-8fgumz"),h(te,"class","svelte-8fgumz"),h(J,"class","svelte-8fgumz"),h(re,"class","svelte-8fgumz"),h(j,"class","svelte-8fgumz"),h($,"class","svelte-8fgumz"),h(ve,"class","svelte-8fgumz"),h(X,"class","svelte-8fgumz"),h(Ce,"class","svelte-8fgumz"),h(V,"class","svelte-8fgumz"),h($e,"class","svelte-8fgumz"),h(ct,"class","svelte-8fgumz"),h(H,"class","svelte-8fgumz"),h(ut,"class","svelte-8fgumz"),h(ke,"class","svelte-8fgumz"),h(le,"class","svelte-8fgumz"),h(Ue,"class","svelte-8fgumz"),h(kt,"class","svelte-8fgumz"),h(Xe,"class","svelte-8fgumz"),h(Nt,"class","svelte-8fgumz"),h(ne,"class","svelte-8fgumz"),h(on,"class","svelte-8fgumz"),h(ei,"class","svelte-8fgumz"),h(ti,"class","svelte-8fgumz"),h(Pt,"class","svelte-8fgumz"),h(ln,"class","svelte-8fgumz"),h(ni,"class","svelte-8fgumz"),h(ii,"class","svelte-8fgumz"),h(Rt,"class","svelte-8fgumz")},m(ee,ze){v(ee,e,ze),c(e,t),c(t,n),L(r,n,null),c(n,o),c(n,s),c(e,a),c(e,l),c(l,u),c(u,d),v(ee,m,ze),v(ee,g,ze),c(g,_),c(_,k),L(x,k,null),c(k,C),c(k,w),c(g,S),c(g,T),c(T,P),c(P,O),v(ee,R,ze),v(ee,re,ze),c(re,te),c(te,W),L(U,W,null),c(W,E),c(W,G),c(re,D),c(re,J),v(ee,be,ze),v(ee,X,ze),c(X,$),c($,j),L(ye,j,null),c(j,ge),c(j,q),c(X,Se),c(X,ve),v(ee,me,ze),v(ee,H,ze),c(H,V),c(V,Ce),L(ce,Ce,null),c(Ce,Be),c(Ce,De),c(H,Ge),c(H,ct),c(ct,$e),L(et,$e,null),c($e,Ze),c($e,qe),c($e,je),L(Qe,$e,null),c($e,Ye),c($e,se),v(ee,Te,ze),v(ee,Ue,ze),c(Ue,ke),c(ke,ut),L(We,ut,null),c(ut,xe),c(ut,wt),c(Ue,B),c(Ue,le),v(ee,Ee,ze),v(ee,ne,ze),c(ne,Xe),c(Xe,kt),L(yt,kt,null),c(kt,Mn),c(kt,Tt),c(ne,Lt),c(ne,Nt),c(Nt,rn),c(rn,Fe),v(ee,dr,ze),v(ee,Pt,ze),c(Pt,ei),c(ei,on),L(sn,on,null),c(on,Co),c(on,pr),c(Pt,Io),c(Pt,ti),c(ti,gr),v(ee,mr,ze),v(ee,Rt,ze),c(Rt,ni),c(ni,ln),L(an,ln,null),c(ln,Mo),c(ln,hr),c(Rt,So),c(Rt,ii),c(ii,_r),Bt=!0},p(ee,ze){(!Bt||ze&1)&&f!==(f=ee[0].id+"")&&oe(d,f),(!Bt||ze&1)&&Z!==(Z=ee[0].path+"")&&oe(O,Z),(!Bt||ze&1)&&ae!==(ae=ee[0].devices.map(El).join(", ")+"")&&oe(Fe,ae)},i(ee){Bt||(I(r.$$.fragment,ee),I(x.$$.fragment,ee),I(U.$$.fragment,ee),I(ye.$$.fragment,ee),I(ce.$$.fragment,ee),I(et.$$.fragment,ee),I(Qe.$$.fragment,ee),I(We.$$.fragment,ee),I(yt.$$.fragment,ee),I(sn.$$.fragment,ee),I(an.$$.fragment,ee),Bt=!0)},o(ee){M(r.$$.fragment,ee),M(x.$$.fragment,ee),M(U.$$.fragment,ee),M(ye.$$.fragment,ee),M(ce.$$.fragment,ee),M(et.$$.fragment,ee),M(Qe.$$.fragment,ee),M(We.$$.fragment,ee),M(yt.$$.fragment,ee),M(sn.$$.fragment,ee),M(an.$$.fragment,ee),Bt=!1},d(ee){ee&&(y(e),y(m),y(g),y(R),y(re),y(be),y(X),y(me),y(H),y(Te),y(Ue),y(Ee),y(ne),y(dr),y(Pt),y(mr),y(Rt)),N(r),N(x),N(U),N(ye),N(ce),N(et),N(Qe),N(We),N(yt),N(sn),N(an)}}}function yf(i){let e,t,n,r,o,s,a,l,u,f,d,m;return t=new Y({props:{name:"pause"}}),a=new Y({props:{name:"pencil"}}),{c(){e=p("button"),A(t.$$.fragment),n=b(),r=p("span"),r.textContent="Pause",o=b(),s=p("button"),A(a.$$.fragment),l=b(),u=p("span"),u.textContent="Edit"},m(g,_){v(g,e,_),L(t,e,null),c(e,n),c(e,r),v(g,o,_),v(g,s,_),L(a,s,null),c(s,l),c(s,u),f=!0,d||(m=[Q(e,"click",i[11]),Q(s,"click",i[12])],d=!0)},i(g){f||(I(t.$$.fragment,g),I(a.$$.fragment,g),f=!0)},o(g){M(t.$$.fragment,g),M(a.$$.fragment,g),f=!1},d(g){g&&(y(e),y(o),y(s)),N(t),N(a),d=!1,we(m)}}}function vf(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k,x,C,w,S,T,P,Z;return t=new Y({props:{name:"pause"}}),a=new Y({props:{name:"history"}}),m=new Y({props:{name:"refresh-cw"}}),C=new Y({props:{name:"pencil"}}),{c(){e=p("button"),A(t.$$.fragment),n=b(),r=p("span"),r.textContent="Pause",o=b(),s=p("button"),A(a.$$.fragment),l=b(),u=p("span"),u.textContent="Versions",f=b(),d=p("button"),A(m.$$.fragment),g=b(),_=p("span"),_.textContent="Rescan",k=b(),x=p("button"),A(C.$$.fragment),w=b(),S=p("span"),S.textContent="Edit"},m(O,R){v(O,e,R),L(t,e,null),c(e,n),c(e,r),v(O,o,R),v(O,s,R),L(a,s,null),c(s,l),c(s,u),v(O,f,R),v(O,d,R),L(m,d,null),c(d,g),c(d,_),v(O,k,R),v(O,x,R),L(C,x,null),c(x,w),c(x,S),T=!0,P||(Z=[Q(e,"click",i[7]),Q(s,"click",i[8]),Q(d,"click",i[9]),Q(x,"click",i[10])],P=!0)},i(O){T||(I(t.$$.fragment,O),I(a.$$.fragment,O),I(m.$$.fragment,O),I(C.$$.fragment,O),T=!0)},o(O){M(t.$$.fragment,O),M(a.$$.fragment,O),M(m.$$.fragment,O),M(C.$$.fragment,O),T=!1},d(O){O&&(y(e),y(o),y(s),y(f),y(d),y(k),y(x)),N(t),N(a),N(m),N(C),P=!1,we(Z)}}}function wf(i){let e,t,n,r,o=[vf,yf],s=[];function a(l,u){return l[0]&&!l[2]?0:l[1]&&!l[2]?1:-1}return~(e=a(i,-1))&&(t=s[e]=o[e](i)),{c(){t&&t.c(),n=ot()},m(l,u){~e&&s[e].m(l,u),v(l,n,u),r=!0},p(l,u){let f=e;e=a(l,u),e!==f&&(t&&(Le(),M(s[f],1,1,()=>{s[f]=null}),Ne()),~e?(t=s[e],t||(t=s[e]=o[e](l),t.c()),I(t,1),t.m(n.parentNode,n)):t=null)},i(l){r||(I(t),r=!0)},o(l){M(t),r=!1},d(l){l&&y(n),~e&&s[e].d(l)}}}function kf(i){let e,t,n,r,o,s,a,l,u=i[4].title,f=Qt(u,i,i[3],jl),d=f||mf(i),m=[bf,_f,hf],g=[];function _(w,S){return w[0]&&!w[2]?0:w[1]&&!w[2]?1:w[2]&&w[1]?2:-1}~(o=_(i,-1))&&(s=g[o]=m[o](i));let k=i[4].footer,x=Qt(k,i,i[3],Dl),C=x||wf(i);return{c(){e=p("details"),t=p("summary"),d&&d.c(),n=b(),r=p("table"),s&&s.c(),a=b(),C&&C.c(),h(t,"class","svelte-8fgumz"),h(r,"class","svelte-8fgumz"),h(e,"class","svelte-8fgumz")},m(w,S){v(w,e,S),c(e,t),d&&d.m(t,null),c(e,n),c(e,r),~o&&g[o].m(r,null),c(e,a),C&&C.m(e,null),l=!0},p(w,[S]){f?f.p&&(!l||S&8)&&Ut(f,u,w,w[3],l?Yt(u,w[3],S,gf):Jt(w[3]),jl):d&&d.p&&(!l||S&2)&&d.p(w,l?S:-1);let T=o;o=_(w,S),o===T?~o&&g[o].p(w,S):(s&&(Le(),M(g[T],1,1,()=>{g[T]=null}),Ne()),~o?(s=g[o],s?s.p(w,S):(s=g[o]=m[o](w),s.c()),I(s,1),s.m(r,null)):s=null),x?x.p&&(!l||S&8)&&Ut(x,k,w,w[3],l?Yt(k,w[3],S,pf):Jt(w[3]),Dl):C&&C.p&&(!l||S&7)&&C.p(w,l?S:-1)},i(w){l||(I(d,w),I(s),I(C,w),l=!0)},o(w){M(d,w),M(s),M(C,w),l=!1},d(w){w&&y(e),d&&d.d(w),~o&&g[o].d(),C&&C.d(w)}}}var El=i=>i.deviceID.slice(0,7);function xf(i,e,t){let{$$slots:n={},$$scope:r}=e,{folder:o=void 0}=e,{device:s=void 0}=e,{isThisDevice:a=!1}=e,l=()=>{new $t.Notice("Not implemented yet!")},u=()=>new $t.Notice("not implement yet !"),f=async x=>{new $t.Notice("Not implemented yet!")},d=async x=>{new $t.Notice("Not implemented yet!")},m=async x=>{new $t.Notice("Not implemented yet!")},g=async x=>{new $t.Notice("Not implemented yet!")},_=async x=>{new $t.Notice("Not implemented yet!")},k=async x=>{new $t.Notice("Not implemented yet!")};return i.$$set=x=>{"folder"in x&&t(0,o=x.folder),"device"in x&&t(1,s=x.device),"isThisDevice"in x&&t(2,a=x.isThisDevice),"$$scope"in x&&t(3,r=x.$$scope)},[o,s,a,r,n,l,u,f,d,m,g,_,k]}var po=class extends fe{constructor(e){super(),he(this,e,xf,kf,ue,{folder:0,device:1,isThisDevice:2},df)}},Cn=po;var Vn=require("obsidian");function Cf(i){Ie(i,"svelte-13pw3b3",".footer.svelte-13pw3b3.svelte-13pw3b3{display:flex;justify-content:flex-end;gap:0.5rem;margin:1em 0 0 0}.footer.svelte-13pw3b3 button.svelte-13pw3b3{gap:0.5rem}")}function If(i){let e,t,n,r=i[0].label+"",o,s,a,l;return e=new Y({props:{name:"folder"}}),{c(){A(e.$$.fragment),t=b(),n=p("span"),o=F(r),s=b(),a=p("span"),a.textContent="Unshared",Oe(a,"flex","1 0 auto"),Oe(a,"text-align","end")},m(u,f){L(e,u,f),v(u,t,f),v(u,n,f),c(n,o),v(u,s,f),v(u,a,f),l=!0},p(u,f){(!l||f&1)&&r!==(r=u[0].label+"")&&oe(o,r)},i(u){l||(I(e.$$.fragment,u),l=!0)},o(u){M(e.$$.fragment,u),l=!1},d(u){u&&(y(t),y(n),y(s),y(a)),N(e,u)}}}function Mf(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k,x,C,w,S,T,P,Z,O;return n=new Y({props:{name:"pause"}}),l=new Y({props:{name:"history"}}),g=new Y({props:{name:"refresh-cw"}}),w=new Y({props:{name:"pencil"}}),{c(){e=p("div"),t=p("button"),A(n.$$.fragment),r=b(),o=p("span"),o.textContent="Pause",s=b(),a=p("button"),A(l.$$.fragment),u=b(),f=p("span"),f.textContent="Versions",d=b(),m=p("button"),A(g.$$.fragment),_=b(),k=p("span"),k.textContent="Rescan",x=b(),C=p("button"),A(w.$$.fragment),S=b(),T=p("span"),T.textContent="Edit",h(t,"class","svelte-13pw3b3"),h(a,"class","svelte-13pw3b3"),h(m,"class","svelte-13pw3b3"),h(C,"class","svelte-13pw3b3"),h(e,"slot","footer"),h(e,"class","footer svelte-13pw3b3")},m(R,re){v(R,e,re),c(e,t),L(n,t,null),c(t,r),c(t,o),c(e,s),c(e,a),L(l,a,null),c(a,u),c(a,f),c(e,d),c(e,m),L(g,m,null),c(m,_),c(m,k),c(e,x),c(e,C),L(w,C,null),c(C,S),c(C,T),P=!0,Z||(O=[Q(t,"click",i[1]),Q(a,"click",i[2]),Q(m,"click",i[3]),Q(C,"click",i[4])],Z=!0)},p:z,i(R){P||(I(n.$$.fragment,R),I(l.$$.fragment,R),I(g.$$.fragment,R),I(w.$$.fragment,R),P=!0)},o(R){M(n.$$.fragment,R),M(l.$$.fragment,R),M(g.$$.fragment,R),M(w.$$.fragment,R),P=!1},d(R){R&&y(e),N(n),N(l),N(g),N(w),Z=!1,we(O)}}}function Sf(i){let e,t;return e=new Cn({props:{folder:i[0],device:void 0,$$slots:{footer:[Mf],title:[If]},$$scope:{ctx:i}}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p(n,[r]){let o={};r&1&&(o.folder=n[0]),r&33&&(o.$$scope={dirty:r,ctx:n}),e.$set(o)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function $f(i,e,t){let{folder:n={id:"folder ID",label:"folder label",path:"folder path",type:"sendreceive",devices:[{deviceID:"device 1",encryptionPassword:"",introducedBy:""},{deviceID:"device 2",encryptionPassword:"",introducedBy:""}],filesystemType:"filesystem type",maxConflicts:0}}=e,r=async l=>{new Vn.Notice("Not implemented yet!")},o=async l=>{new Vn.Notice("Not implemented yet!")},s=async l=>{new Vn.Notice("Not implemented yet!")},a=async l=>{new Vn.Notice("Not implemented yet!")};return i.$$set=l=>{"folder"in l&&t(0,n=l.folder)},[n,r,o,s,a]}var go=class extends fe{constructor(e){super(),he(this,e,$f,Sf,ue,{folder:0},Cf)}},Fl=go;var mo=require("obsidian");function Tf(i){Ie(i,"svelte-13pw3b3",".footer.svelte-13pw3b3.svelte-13pw3b3{display:flex;justify-content:flex-end;gap:0.5rem;margin:1em 0 0 0}.footer.svelte-13pw3b3 button.svelte-13pw3b3{gap:0.5rem}")}function Lf(i){var g;let e,t,n,r,o=((g=i[0].name)!=null?g:i[0].deviceID)+"",s,a,l,u,f,d,m;return t=new Y({props:{name:"hard-drive"}}),d=new Y({props:{name:"wifi-off"}}),{c(){e=p("div"),A(t.$$.fragment),n=b(),r=p("span"),s=F(o),a=b(),l=p("div"),u=p("span"),u.textContent="Disconnected",f=b(),A(d.$$.fragment),Oe(e,"display","flex"),Oe(e,"gap","0.5em"),Oe(l,"display","flex"),Oe(l,"gap","0.5em"),Oe(l,"flex","1 0 auto"),Oe(l,"justify-content","end")},m(_,k){v(_,e,k),L(t,e,null),c(e,n),c(e,r),c(r,s),v(_,a,k),v(_,l,k),c(l,u),c(l,f),L(d,l,null),m=!0},p(_,k){var x;(!m||k&1)&&o!==(o=((x=_[0].name)!=null?x:_[0].deviceID)+"")&&oe(s,o)},i(_){m||(I(t.$$.fragment,_),I(d.$$.fragment,_),m=!0)},o(_){M(t.$$.fragment,_),M(d.$$.fragment,_),m=!1},d(_){_&&(y(e),y(a),y(l)),N(t),N(d)}}}function Nf(i){let e,t,n,r,o,s,a,l,u,f,d,m,g;return n=new Y({props:{name:"pause"}}),l=new Y({props:{name:"pencil"}}),{c(){e=p("div"),t=p("button"),A(n.$$.fragment),r=b(),o=p("span"),o.textContent="Pause",s=b(),a=p("button"),A(l.$$.fragment),u=b(),f=p("span"),f.textContent="Edit",h(t,"class","svelte-13pw3b3"),h(a,"class","svelte-13pw3b3"),h(e,"slot","footer"),h(e,"class","footer svelte-13pw3b3")},m(_,k){v(_,e,k),c(e,t),L(n,t,null),c(t,r),c(t,o),c(e,s),c(e,a),L(l,a,null),c(a,u),c(a,f),d=!0,m||(g=[Q(t,"click",i[1]),Q(a,"click",i[2])],m=!0)},p:z,i(_){d||(I(n.$$.fragment,_),I(l.$$.fragment,_),d=!0)},o(_){M(n.$$.fragment,_),M(l.$$.fragment,_),d=!1},d(_){_&&y(e),N(n),N(l),m=!1,we(g)}}}function Af(i){let e,t;return e=new Cn({props:{device:i[0],folder:void 0,$$slots:{footer:[Nf],title:[Lf]},$$scope:{ctx:i}}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p(n,[r]){let o={};r&1&&(o.device=n[0]),r&9&&(o.$$scope={dirty:r,ctx:n}),e.$set(o)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Df(i,e,t){let{device:n={address:["dynamic"],deviceID:"device ID",introducedBy:"introduced by",name:"device name",ignoredFolders:[],paused:!1}}=e,r=async s=>{new mo.Notice("Not implemented yet!")},o=async s=>{new mo.Notice("Not implemented yet!")};return i.$$set=s=>{"device"in s&&t(0,n=s.device)},[n,r,o]}var ho=class extends fe{constructor(e){super(),he(this,e,Df,Af,ue,{device:0},Tf)}},zl=ho;function jf(i){Ie(i,"svelte-15h0slv",`.close-button.svelte-15h0slv{margin-left:auto;cursor:var(--cursor);font-size:24px;line-height:20px;padding:var(--size-2-2);border-radius:var(--radius-s);color:var(--text-muted);&:before {
|
|
font-family: Inter, sans-serif;
|
|
content: "\\D7";
|
|
font-weight: 300;
|
|
};&:hover {
|
|
background-color: var(--background-modifier-hover);
|
|
color: var(--text-normal);
|
|
}}`)}function Ol(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_;return{c(){e=p("div"),t=p("div"),n=p("div"),n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-alert-triangle"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',r=b(),o=p("div"),s=F(i[1]),a=b(),l=p("div"),u=b(),f=p("div"),d=p("p"),m=F(i[2]),h(n,"class","callout-icon"),h(o,"class","callout-title-inner"),h(l,"role","button"),h(l,"tabindex","0"),h(l,"aria-roledescription","Dismiss"),h(l,"class","close-button svelte-15h0slv"),h(t,"class","callout-title"),h(f,"class","callout-content"),h(e,"data-callout-metadata",""),h(e,"data-callout-fold",""),h(e,"data-callout","warning"),h(e,"class","callout")},m(k,x){v(k,e,x),c(e,t),c(t,n),c(t,r),c(t,o),c(o,s),c(t,a),c(t,l),c(e,u),c(e,f),c(f,d),c(d,m),g||(_=[Q(l,"keypress",i[3]),Q(l,"click",i[4])],g=!0)},p(k,x){x&2&&oe(s,k[1]),x&4&&oe(m,k[2])},d(k){k&&y(e),g=!1,we(_)}}}function Ef(i){let e,t=!i[0]&&Ol(i);return{c(){t&&t.c(),e=ot()},m(n,r){t&&t.m(n,r),v(n,e,r)},p(n,[r]){n[0]?t&&(t.d(1),t=null):t?t.p(n,r):(t=Ol(n),t.c(),t.m(e.parentNode,e))},i:z,o:z,d(n){n&&y(e),t&&t.d(n)}}}function Ff(i,e,t){let{title:n="Warning"}=e,{message:r}=e,{dismiss:o=!1}=e,s=()=>t(0,o=!o),a=()=>t(0,o=!o);return i.$$set=l=>{"title"in l&&t(1,n=l.title),"message"in l&&t(2,r=l.message),"dismiss"in l&&t(0,o=l.dismiss)},[o,n,r,s,a]}var _o=class extends fe{constructor(e){super(),he(this,e,Ff,Ef,ue,{title:1,message:2,dismiss:0},jf)}},Pl=_o;function zf(i){Ie(i,"svelte-f2narq",".left.svelte-f2narq.svelte-f2narq{float:left;width:50%}.right.svelte-f2narq.svelte-f2narq{float:right;width:50%}.folder.svelte-f2narq.svelte-f2narq,.mydevice.svelte-f2narq.svelte-f2narq,.remote.svelte-f2narq.svelte-f2narq{width:100%}.controls.svelte-f2narq.svelte-f2narq{display:flex;flex-direction:row;justify-content:flex-end;margin:1em 0}.controls.svelte-f2narq button.svelte-f2narq{gap:0.5em;margin:0 0.5em}")}function Rl(i,e,t){let n=i.slice();return n[16]=e[t],n}function Bl(i,e,t){let n=i.slice();return n[19]=e[t],n}function Gl(i){let e,t;return e=new Fl({props:{folder:i[19]}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p(n,r){let o={};r&1&&(o.folder=n[19]),e.$set(o)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Zl(i){let e,t;return e=new zl({props:{device:i[16]}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p(n,r){let o={};r&6&&(o.device=n[16]),e.$set(o)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function Of(i){let e,t,n,r,o,s,a=i[0].length+"",l,u,f,d,m,g,_,k,x,C,w,S,T,P,Z,O,R,re,te,W,U,E,G,D,J,be,X,$,j,ye=i[1].filter(i[7]).length+"",ge,q,Se,ve,me,H,V,Ce,ce,Be,De,Ge,ct,$e,et,Ze,qe,je,Qe,Ye,se,Te;e=new Pl({props:{message:"The following configuration is not fully implemented yet. Some data aren't real-time and some controls are not implemented yet. It is mainly to reproduce the Syncthing GUI and then, real-time data and controls will be added."}});let Ue=Je(i[0]),ke=[];for(let B=0;B<Ue.length;B+=1)ke[B]=Gl(Bl(i,Ue,B));let ut=B=>M(ke[B],1,1,()=>{ke[B]=null});_=new Y({props:{name:"pause"}}),S=new Y({props:{name:"refresh-cw"}}),R=new Y({props:{name:"plus"}}),J=new Cn({props:{isThisDevice:!0,device:i[2]}});let We=Je(i[1].filter(i[8])),xe=[];for(let B=0;B<We.length;B+=1)xe[B]=Zl(Rl(i,We,B));let wt=B=>M(xe[B],1,1,()=>{xe[B]=null});return V=new Y({props:{name:"pause"}}),Ge=new Y({props:{name:"info"}}),qe=new Y({props:{name:"plus"}}),{c(){A(e.$$.fragment),t=b(),n=p("div"),r=p("div"),o=p("h2"),s=F("Folders ("),l=F(a),u=F(")"),f=b();for(let B=0;B<ke.length;B+=1)ke[B].c();d=b(),m=p("div"),g=p("button"),A(_.$$.fragment),k=b(),x=p("span"),x.textContent="Pause All",C=b(),w=p("button"),A(S.$$.fragment),T=b(),P=p("span"),P.textContent="Rescan All",Z=b(),O=p("button"),A(R.$$.fragment),re=b(),te=p("span"),te.textContent="Add Folder",W=b(),U=p("div"),E=p("div"),G=p("h2"),G.textContent="This Device",D=b(),A(J.$$.fragment),be=b(),X=p("div"),$=p("h2"),j=F("Remote Devices ("),ge=F(ye),q=F(")"),Se=b();for(let B=0;B<xe.length;B+=1)xe[B].c();ve=b(),me=p("div"),H=p("button"),A(V.$$.fragment),Ce=b(),ce=p("span"),ce.textContent="Pause All",Be=b(),De=p("button"),A(Ge.$$.fragment),ct=b(),$e=p("span"),$e.textContent="Recent Changes",et=b(),Ze=p("button"),A(qe.$$.fragment),je=b(),Qe=p("span"),Qe.textContent="Add Remote Device",h(g,"class","svelte-f2narq"),h(w,"class","svelte-f2narq"),h(O,"class","svelte-f2narq"),h(m,"class","controls svelte-f2narq"),h(r,"class","folder svelte-f2narq"),h(n,"class","left svelte-f2narq"),h(E,"class","mydevice svelte-f2narq"),h(H,"class","svelte-f2narq"),h(De,"class","svelte-f2narq"),h(Ze,"class","svelte-f2narq"),h(me,"class","controls svelte-f2narq"),h(X,"class","remote svelte-f2narq"),h(U,"class","right svelte-f2narq")},m(B,le){L(e,B,le),v(B,t,le),v(B,n,le),c(n,r),c(r,o),c(o,s),c(o,l),c(o,u),c(r,f);for(let Ee=0;Ee<ke.length;Ee+=1)ke[Ee]&&ke[Ee].m(r,null);c(r,d),c(r,m),c(m,g),L(_,g,null),c(g,k),c(g,x),c(m,C),c(m,w),L(S,w,null),c(w,T),c(w,P),c(m,Z),c(m,O),L(R,O,null),c(O,re),c(O,te),v(B,W,le),v(B,U,le),c(U,E),c(E,G),c(E,D),L(J,E,null),c(U,be),c(U,X),c(X,$),c($,j),c($,ge),c($,q),c(X,Se);for(let Ee=0;Ee<xe.length;Ee+=1)xe[Ee]&&xe[Ee].m(X,null);c(X,ve),c(X,me),c(me,H),L(V,H,null),c(H,Ce),c(H,ce),c(me,Be),c(me,De),L(Ge,De,null),c(De,ct),c(De,$e),c(me,et),c(me,Ze),L(qe,Ze,null),c(Ze,je),c(Ze,Qe),Ye=!0,se||(Te=[Q(g,"click",i[4]),Q(w,"click",i[5]),Q(O,"click",i[6]),Q(H,"click",i[9]),Q(De,"click",i[10]),Q(Ze,"click",i[11])],se=!0)},p(B,[le]){if((!Ye||le&1)&&a!==(a=B[0].length+"")&&oe(l,a),le&1){Ue=Je(B[0]);let ne;for(ne=0;ne<Ue.length;ne+=1){let Xe=Bl(B,Ue,ne);ke[ne]?(ke[ne].p(Xe,le),I(ke[ne],1)):(ke[ne]=Gl(Xe),ke[ne].c(),I(ke[ne],1),ke[ne].m(r,d))}for(Le(),ne=Ue.length;ne<ke.length;ne+=1)ut(ne);Ne()}let Ee={};if(le&4&&(Ee.device=B[2]),J.$set(Ee),(!Ye||le&6)&&ye!==(ye=B[1].filter(B[7]).length+"")&&oe(ge,ye),le&6){We=Je(B[1].filter(B[8]));let ne;for(ne=0;ne<We.length;ne+=1){let Xe=Rl(B,We,ne);xe[ne]?(xe[ne].p(Xe,le),I(xe[ne],1)):(xe[ne]=Zl(Xe),xe[ne].c(),I(xe[ne],1),xe[ne].m(X,ve))}for(Le(),ne=We.length;ne<xe.length;ne+=1)wt(ne);Ne()}},i(B){if(!Ye){I(e.$$.fragment,B);for(let le=0;le<Ue.length;le+=1)I(ke[le]);I(_.$$.fragment,B),I(S.$$.fragment,B),I(R.$$.fragment,B),I(J.$$.fragment,B);for(let le=0;le<We.length;le+=1)I(xe[le]);I(V.$$.fragment,B),I(Ge.$$.fragment,B),I(qe.$$.fragment,B),Ye=!0}},o(B){M(e.$$.fragment,B),ke=ke.filter(Boolean);for(let le=0;le<ke.length;le+=1)M(ke[le]);M(_.$$.fragment,B),M(S.$$.fragment,B),M(R.$$.fragment,B),M(J.$$.fragment,B),xe=xe.filter(Boolean);for(let le=0;le<xe.length;le+=1)M(xe[le]);M(V.$$.fragment,B),M(Ge.$$.fragment,B),M(qe.$$.fragment,B),Ye=!1},d(B){B&&(y(t),y(n),y(W),y(U)),N(e,B),bt(ke,B),N(_),N(S),N(R),N(J),bt(xe,B),N(V),N(Ge),N(qe),se=!1,we(Te)}}}function Pf(i,e,t){var n,r,o;let{parent:s}=e;s.titleEl.setText("Syncthing Configuration"),s.titleEl.style.textAlign="center";let a=`${(n=s.plugin.settings.configuration.url)===null||n===void 0?void 0:n.protocol}://${(r=s.plugin.settings.configuration.url)===null||r===void 0?void 0:r.ip_address}:${(o=s.plugin.settings.configuration.url)===null||o===void 0?void 0:o.port}/`;console.log(a);let l=[],u=[],f;Ke(()=>He(void 0,void 0,void 0,function*(){t(0,l=yield s.plugin.syncthingController.getFolders()),t(1,u=yield s.plugin.syncthingController.getDevices()),t(2,f=u.first()),console.log("Folders: ",l),console.log("Devices: ",u)}));let d=async S=>{new nn.Notice("Not implemented yet!")},m=async S=>{new nn.Notice("Not implemented yet!")},g=async S=>{new nn.Notice("Not implemented yet!")},_=S=>S!==f,k=S=>S!==f,x=async S=>{new nn.Notice("Not implemented yet!")},C=async S=>{new nn.Notice("Not implemented yet!")},w=async S=>{new nn.Notice("Not implemented yet!")};return i.$$set=S=>{"parent"in S&&t(3,s=S.parent)},[l,u,f,s,d,m,g,_,k,x,C,w]}var bo=class extends fe{constructor(e){super(),he(this,e,Pf,Of,ue,{parent:3},zf)}},Wl=bo;var lr=class extends Ql.Modal{constructor(t,n){super(t);this.plugin=n;this.components=[]}async onOpen(){this.modalEl.style.width="100%",this.modalEl.style.height="100%",this.components.push(new Wl({target:this.contentEl,props:{parent:this}}))}onClose(){let{contentEl:t}=this;this.components.forEach(n=>n.$destroy()),t.empty()}};function Rf(i){Ie(i,"svelte-1iic7l7",".error.svelte-1iic7l7{color:var(--text-error)}")}var Bf=i=>({}),Yl=i=>({}),Gf=i=>({}),Ul=i=>({}),Zf=i=>({}),Jl=i=>({});function Wf(i){let e;return{c(){e=F(i[0])},m(t,n){v(t,e,n)},p(t,n){n&1&&oe(e,t[0])},d(t){t&&y(e)}}}function Qf(i){let e;return{c(){e=F(i[1])},m(t,n){v(t,e,n)},p(t,n){n&2&&oe(e,t[1])},d(t){t&&y(e)}}}function Yf(i){let e,t,n,r,o,s,a,l,u,f=i[6].name,d=Qt(f,i,i[5],Jl),m=d||Wf(i),g=i[6].description,_=Qt(g,i,i[5],Ul),k=_||Qf(i),x=i[6].control,C=Qt(x,i,i[5],Yl);return{c(){e=p("div"),t=p("div"),n=p("div"),m&&m.c(),r=b(),o=p("div"),k&&k.c(),s=b(),a=p("div"),C&&C.c(),h(n,"class","setting-item-name svelte-1iic7l7"),gt(n,"error",i[3]),h(o,"class","setting-item-description svelte-1iic7l7"),gt(o,"error",i[3]),h(t,"class","setting-item-info"),h(a,"class","setting-item-control"),h(e,"class",l="setting-item "+i[4]+" svelte-1iic7l7"),gt(e,"setting-item-heading",i[2])},m(w,S){v(w,e,S),c(e,t),c(t,n),m&&m.m(n,null),c(t,r),c(t,o),k&&k.m(o,null),c(e,s),c(e,a),C&&C.m(a,null),u=!0},p(w,[S]){d?d.p&&(!u||S&32)&&Ut(d,f,w,w[5],u?Yt(f,w[5],S,Zf):Jt(w[5]),Jl):m&&m.p&&(!u||S&1)&&m.p(w,u?S:-1),(!u||S&8)&>(n,"error",w[3]),_?_.p&&(!u||S&32)&&Ut(_,g,w,w[5],u?Yt(g,w[5],S,Gf):Jt(w[5]),Ul):k&&k.p&&(!u||S&2)&&k.p(w,u?S:-1),(!u||S&8)&>(o,"error",w[3]),C&&C.p&&(!u||S&32)&&Ut(C,x,w,w[5],u?Yt(x,w[5],S,Bf):Jt(w[5]),Yl),(!u||S&16&&l!==(l="setting-item "+w[4]+" svelte-1iic7l7"))&&h(e,"class",l),(!u||S&20)&>(e,"setting-item-heading",w[2])},i(w){u||(I(m,w),I(k,w),I(C,w),u=!0)},o(w){M(m,w),M(k,w),M(C,w),u=!1},d(w){w&&y(e),m&&m.d(w),k&&k.d(w),C&&C.d(w)}}}function Uf(i,e,t){let{$$slots:n={},$$scope:r}=e,{name:o=""}=e,{description:s=""}=e,{heading:a=!1}=e,{error:l=!1}=e,{class:u=""}=e;return i.$$set=f=>{"name"in f&&t(0,o=f.name),"description"in f&&t(1,s=f.description),"heading"in f&&t(2,a=f.heading),"error"in f&&t(3,l=f.error),"class"in f&&t(4,u=f.class),"$$scope"in f&&t(5,r=f.$$scope)},[o,s,a,l,u,r,n]}var yo=class extends fe{constructor(e){super(),he(this,e,Uf,Yf,ue,{name:0,description:1,heading:2,error:3,class:4},Rf)}},Ae=yo;var Hl=require("obsidian");function Jf(i){let e,t=[i[1]],n={};for(let r=0;r<t.length;r+=1)n=xt(n,t[r]);return{c(){e=p("div"),mn(e,n)},m(r,o){v(r,e,o),i[3](e)},p(r,[o]){mn(e,n=Fi(t,[o&2&&r[1]]))},i:z,o:z,d(r){r&&y(e),i[3](null)}}}function Hf(i,e,t){let n=["callback"],r=gn(e,n),{callback:o}=e,s;Ke(()=>{new Hl.ToggleComponent(s).onChange(o)});function a(l){st[l?"unshift":"push"](()=>{s=l,t(0,s)})}return i.$$set=l=>{e=xt(xt({},e),Ni(l)),t(1,r=gn(e,n)),"callback"in l&&t(2,o=l.callback)},[s,r,o,a]}var vo=class extends fe{constructor(e){super(),he(this,e,Hf,Jf,ue,{callback:2})}},ql=vo;var Xn=require("obsidian");var In=[];function Vl(i,e=z){let t,n=new Set;function r(a){if(ue(i,a)&&(i=a,t)){let l=!In.length;for(let u of n)u[1](),In.push(u,i);if(l){for(let u=0;u<In.length;u+=2)In[u][0](In[u+1]);In.length=0}}}function o(a){r(a(i))}function s(a,l=z){let u=[a,l];return n.add(u),n.size===1&&(t=e(r,o)||z),a(i),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:r,update:o,subscribe:s}}var Xl=require("obsidian"),ar=class extends Xl.AbstractInputSuggest{constructor(e,t){super(e,t),this.inputEl=t}getSuggestions(e){let t=this.app.vault.getAllLoadedFiles(),n=[],r=e.toLowerCase();return n=t.filter(o=>o.path.toLowerCase().includes(r)),n}renderSuggestion(e,t){t.setText(e.path)}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger("input"),this.close()}};var cr=require("obsidian");function qf(i){let e;return{c(){e=p("div"),h(e,"id","file-suggester"),h(e,"class",i[0])},m(t,n){v(t,e,n),i[4](e)},p(t,[n]){n&1&&h(e,"class",t[0])},i:z,o:z,d(t){t&&y(e),i[4](null)}}}function Vf(i,e,t){let{parent:n}=e,{onChange:r=()=>{}}=e,{class:o=""}=e,s;Ke(()=>{new cr.Setting(s).addSearch(l=>{new ar(n.app,l.inputEl),l.setPlaceholder("Type to search for a file").setValue("").onChange((0,cr.debounce)(r,750))})});function a(l){st[l?"unshift":"push"](()=>{s=l,t(1,s)})}return i.$$set=l=>{"parent"in l&&t(2,n=l.parent),"onChange"in l&&t(3,r=l.onChange),"class"in l&&t(0,o=l.class)},[o,s,n,r,a]}var wo=class extends fe{constructor(e){super(),he(this,e,Vf,qf,ue,{parent:2,onChange:3,class:0})}},Kl=wo;function Xf(i){Ie(i,"svelte-1yicc3x",".container.svelte-1yicc3x{display:grid;grid-template-columns:auto 1fr;gap:10px}")}function ea(i,e,t){let n=i.slice();return n[14]=e[t],n}function Kf(i){let e,t;return{c(){e=F("Manage the ignored files and patterns in "),t=p("code"),t.textContent=".stignore"},m(n,r){v(n,e,r),v(n,t,r)},p:z,d(n){n&&(y(e),y(t))}}}function ed(i){let e;return{c(){e=p("p"),e.innerHTML=`Please set the files you want to ignore in your vault when syncing
|
|
with Syncthing.
|
|
<br/>
|
|
See
|
|
<a href="https://docs.syncthing.net/users/ignoring.html" target="_blank">Syncthing documentation</a> for more information.`},m(t,n){v(t,e,n)},p:z,d(t){t&&y(e)}}}function td(i){let e,t,n,r,o,s,a,l,u,f,d;return r=new Kl({props:{parent:i[0],onChange:i[8]}}),{c(){e=p("div"),t=p("button"),t.textContent="Add file/folder",n=b(),A(r.$$.fragment),o=b(),s=p("button"),s.textContent="Add pattern",a=b(),l=p("input"),h(l,"type","text"),h(l,"placeholder","Enter some text..."),h(e,"class","container svelte-1yicc3x")},m(m,g){v(m,e,g),c(e,t),c(e,n),L(r,e,null),c(e,o),c(e,s),c(e,a),c(e,l),jt(l,i[2]),u=!0,f||(d=[Q(t,"click",i[7]),Q(s,"click",i[9]),Q(l,"input",i[10])],f=!0)},p(m,g){let _={};g&1&&(_.parent=m[0]),g&2&&(_.onChange=m[8]),r.$set(_),g&4&&l.value!==m[2]&&jt(l,m[2])},i(m){u||(I(r.$$.fragment,m),u=!0)},o(m){M(r.$$.fragment,m),u=!1},d(m){m&&y(e),N(r),f=!1,we(d)}}}function ta(i){let e,t,n=Je(i[3].filter(ia)),r=[];for(let s=0;s<n.length;s+=1)r[s]=na(ea(i,n,s));let o=s=>M(r[s],1,1,()=>{r[s]=null});return{c(){for(let s=0;s<r.length;s+=1)r[s].c();e=ot()},m(s,a){for(let l=0;l<r.length;l+=1)r[l]&&r[l].m(s,a);v(s,e,a),t=!0},p(s,a){if(a&40){n=Je(s[3].filter(ia));let l;for(l=0;l<n.length;l+=1){let u=ea(s,n,l);r[l]?(r[l].p(u,a),I(r[l],1)):(r[l]=na(u),r[l].c(),I(r[l],1),r[l].m(e.parentNode,e))}for(Le(),l=n.length;l<r.length;l+=1)o(l);Ne()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)I(r[a]);t=!0}},o(s){r=r.filter(Boolean);for(let a=0;a<r.length;a+=1)M(r[a]);t=!1},d(s){s&&y(e),bt(r,s)}}}function nd(i){let e,t,n,r;function o(){return i[11](i[14])}return{c(){e=p("button"),e.textContent="Remove",t=b()},m(s,a){v(s,e,a),v(s,t,a),n||(r=Q(e,"click",o),n=!0)},p(s,a){i=s},d(s){s&&(y(e),y(t)),n=!1,r()}}}function na(i){let e,t;return e=new Ae({props:{name:i[14],$$slots:{control:[nd]},$$scope:{ctx:i}}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p(n,r){let o={};r&8&&(o.name=n[14]),r&131080&&(o.$$scope={dirty:r,ctx:n}),e.$set(o)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function id(i){let e,t,n,r,o,s;e=new Ae({props:{name:"Syncthing Ignored Files",heading:!0}}),n=new Ae({props:{$$slots:{control:[td],description:[ed],name:[Kf]},$$scope:{ctx:i}}});let a=i[3].length>0&&ta(i);return{c(){A(e.$$.fragment),t=b(),A(n.$$.fragment),r=b(),a&&a.c(),o=ot()},m(l,u){L(e,l,u),v(l,t,u),L(n,l,u),v(l,r,u),a&&a.m(l,u),v(l,o,u),s=!0},p(l,[u]){let f={};u&131079&&(f.$$scope={dirty:u,ctx:l}),n.$set(f),l[3].length>0?a?(a.p(l,u),u&8&&I(a,1)):(a=ta(l),a.c(),I(a,1),a.m(o.parentNode,o)):a&&(Le(),M(a,1,1,()=>{a=null}),Ne())},i(l){s||(I(e.$$.fragment,l),I(n.$$.fragment,l),I(a),s=!0)},o(l){M(e.$$.fragment,l),M(n.$$.fragment,l),M(a),s=!1},d(l){l&&(y(t),y(r),y(o)),N(e,l),N(n,l),a&&a.d(l)}}}var ia=i=>i!=="";function rd(i,e,t){let n,{parent:r}=e,o=(0,Xn.normalizePath)(".stignore"),s="",a="";function l(){return He(this,void 0,void 0,function*(){let C="";try{C=yield r.app.vault.adapter.read(o)}catch(w){console.error("Error: ",w),new Xn.Notice("No .stignore file found.")}return C.replace(/\r|\n+$/g,"").replace(/\n+/g,`
|
|
`).split(`
|
|
`)})}function u(C){return He(this,void 0,void 0,function*(){let w=yield l();if(w.includes(C)){new Xn.Notice("This pattern is already in the .stignore file.");return}yield r.app.vault.adapter.write(o,`${C}
|
|
${w.join(`
|
|
`)}`),d.set(yield l())})}function f(C){return He(this,void 0,void 0,function*(){let w=yield l();yield r.app.vault.adapter.write(o,w.filter(S=>S!==C).join(`
|
|
`)),d.set(yield l())})}let d=Vl([]);rs(i,d,C=>t(3,n=C)),d.subscribe(C=>He(void 0,void 0,void 0,function*(){C=yield l()})),He(void 0,void 0,void 0,function*(){d.set(yield l())});let m=async()=>{console.log("selectedFile: ",s),await u(s),t(1,s="")},g=async C=>{console.log("fileSuggester: ",C),t(1,s=C)},_=async()=>{console.log("typedPattern: ",a),await u(a),t(2,a="")};function k(){a=this.value,t(2,a)}let x=async C=>f(C);return i.$$set=C=>{"parent"in C&&t(0,r=C.parent)},[r,s,a,n,u,f,d,m,g,_,k,x]}var ko=class extends fe{constructor(e){super(),he(this,e,rd,id,ue,{parent:0},Xf)}},ra=ko;function od(i){Ie(i,"svelte-13bfvu7",".banner.svelte-13bfvu7.svelte-13bfvu7{display:flex;justify-content:center;align-items:center;margin:0;padding:0}.banner.svelte-13bfvu7 a.svelte-13bfvu7{text-decoration-line:none}.banner.svelte-13bfvu7 img.svelte-13bfvu7{height:2em}.footer.svelte-13bfvu7.svelte-13bfvu7{display:flex;justify-content:space-between;width:100%}.footer.svelte-13bfvu7 button.svelte-13bfvu7{display:flex;flex-direction:row;align-items:flex-start;gap:0.5em;justify-content:space-around}")}function sd(i){let e;return{c(){e=p("p"),e.innerHTML=`This plugin allows you to sync your vault with Syncthing. It allows you
|
|
to manage the sync process from within Obsidian. You can only manage the
|
|
folder you are in. To use this plugin, you need to have Syncthing
|
|
installed on your device. You can find more information about Syncthing
|
|
here:
|
|
<a href="https://syncthing.net">https://syncthing.net</a>`,h(e,"slot","description")},m(t,n){v(t,e,n)},p:z,d(t){t&&y(e)}}}function oa(i){let e,t,n,r;return e=new Ae({props:{heading:!0,error:!0,name:"Syncthing is not found",$$slots:{description:[ld]},$$scope:{ctx:i}}}),n=new Ae({props:{name:"Retry",description:"If you want to retry connecting, after setting the API key. This might resolve the issue.",$$slots:{control:[ad]},$$scope:{ctx:i}}}),{c(){A(e.$$.fragment),t=b(),A(n.$$.fragment)},m(o,s){L(e,o,s),v(o,t,s),L(n,o,s),r=!0},i(o){r||(I(e.$$.fragment,o),I(n.$$.fragment,o),r=!0)},o(o){M(e.$$.fragment,o),M(n.$$.fragment,o),r=!1},d(o){o&&y(t),N(e,o),N(n,o)}}}function ld(i){let e,t;return{c(){e=F(`Syncthing is not installed or not found on your device. Please
|
|
install it at the following URL:
|
|
`),t=p("a"),t.textContent="https://syncthing.net/downloads",h(t,"href","https://syncthing.net/downloads"),h(t,"target","_blank")},m(n,r){v(n,e,r),v(n,t,r)},p:z,d(n){n&&(y(e),y(t))}}}function ad(i){let e;return{c(){e=p("button"),e.textContent="Connect to Syncthing via API.",h(e,"class","mod-cta")},m(t,n){v(t,e,n)},p:z,d(t){t&&y(e)}}}function cd(i){let e;return{c(){e=F("Add your Syncthing API key here for the plugin to work.")},m(t,n){v(t,e,n)},d(t){t&&y(e)}}}function ud(i){let e,t,n,r,o,s,a,l,u,f=[pd,dd],d=[];function m(g,_){return g[2]==="password"?0:1}return t=m(i,-1),n=d[t]=f[t](i),s=new Y({props:{name:"eraser"}}),{c(){e=p("button"),n.c(),r=b(),o=p("button"),A(s.$$.fragment)},m(g,_){v(g,e,_),d[t].m(e,null),v(g,r,_),v(g,o,_),L(s,o,null),a=!0,l||(u=[Q(e,"click",i[10]),Q(o,"click",i[11])],l=!0)},p(g,_){let k=t;t=m(g,_),t!==k&&(Le(),M(d[k],1,1,()=>{d[k]=null}),Ne(),n=d[t],n||(n=d[t]=f[t](g),n.c()),I(n,1),n.m(e,null))},i(g){a||(I(n),I(s.$$.fragment,g),a=!0)},o(g){M(n),M(s.$$.fragment,g),a=!1},d(g){g&&(y(e),y(r),y(o)),d[t].d(),N(s),l=!1,we(u)}}}function fd(i){let e,t,n;return{c(){e=p("button"),e.textContent="Get API key"},m(r,o){v(r,e,o),t||(n=Q(e,"click",i[5]),t=!0)},p:z,i:z,o:z,d(r){r&&y(e),t=!1,n()}}}function dd(i){let e,t;return e=new Y({props:{name:"eye-off"}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function pd(i){let e,t;return e=new Y({props:{name:"eye"}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function gd(i){let e,t,n,r,o,s,a,l,u,f=[fd,ud],d=[];function m(g,_){return g[0].plugin.settings.api_key?1:0}return r=m(i,-1),o=d[r]=f[r](i),{c(){e=p("input"),n=b(),o.c(),s=ot(),h(e,"type",i[2]),h(e,"name","apikey"),h(e,"id","apikey"),e.value=t=i[0].plugin.settings.api_key,h(e,"placeholder","Enter your API key here...")},m(g,_){v(g,e,_),v(g,n,_),d[r].m(g,_),v(g,s,_),a=!0,l||(u=Q(e,"change",i[9]),l=!0)},p(g,_){(!a||_&4)&&h(e,"type",g[2]),(!a||_&1&&t!==(t=g[0].plugin.settings.api_key)&&e.value!==t)&&(e.value=t);let k=r;r=m(g,_),r===k?d[r].p(g,_):(Le(),M(d[k],1,1,()=>{d[k]=null}),Ne(),o=d[r],o?o.p(g,_):(o=d[r]=f[r](g),o.c()),I(o,1),o.m(s.parentNode,s))},i(g){a||(I(o),a=!0)},o(g){M(o),a=!1},d(g){g&&(y(e),y(n),y(s)),d[r].d(g),l=!1,u()}}}function md(i){let e,t,n;return{c(){e=p("button"),e.textContent="Check API Status"},m(r,o){v(r,e,o),t||(n=Q(e,"click",i[12]),t=!0)},p:z,d(r){r&&y(e),t=!1,n()}}}function hd(i){let e,t;return e=new Ae({props:{name:"Syncthing CLI Status",$$slots:{control:[_d]},$$scope:{ctx:i}}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p(n,r){let o={};r&268435457&&(o.$$scope={dirty:r,ctx:n}),e.$set(o)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function _d(i){let e,t,n;return{c(){e=p("button"),e.textContent="Check CLI Status"},m(r,o){v(r,e,o),t||(n=Q(e,"click",i[13]),t=!0)},p:z,d(r){r&&y(e),t=!1,n()}}}function bd(i){let e,t;return e=new Ae({props:{name:"Warning",description:"The following settings are in beta. All plugin's features may not currently be available on mobile.",error:!0}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function yd(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k,x;return{c(){var C,w,S,T;e=p("div"),t=p("div"),n=p("select"),r=p("option"),r.textContent="http://",o=p("option"),o.textContent="https://",a=b(),l=p("input"),f=b(),d=p("input"),g=b(),_=p("input"),r.__value="http",jt(r,r.__value),o.__value="https",jt(o,o.__value),Oe(n,"border-radius","var(--input-radius) 0 0 var(--input-radius)"),h(l,"type","text"),h(l,"placeholder","Enter your Syncthing address here..."),l.value=u=(w=(C=i[0].plugin.settings.configuration.url)==null?void 0:C.ip_address)!=null?w:"",Oe(l,"border-radius","0"),h(d,"type","number"),h(d,"placeholder","Enter the port..."),d.value=m=(T=(S=i[0].plugin.settings.configuration.url)==null?void 0:S.port)!=null?T:"",Oe(d,"border-radius","0 var(--input-radius) var(--input-radius) 0"),Oe(t,"display","flex"),Oe(t,"align-items","center"),Oe(_,"margin","2% 0"),_.value=i[4],_.disabled=!0,h(e,"slot","control"),Oe(e,"display","flex"),Oe(e,"flex-direction","column"),Oe(e,"align-items","flex-start"),Oe(e,"justify-content","flex-end")},m(C,w){var S,T;v(C,e,w),c(e,t),c(t,n),c(n,r),c(n,o),Ar(n,(T=(S=i[0].plugin.settings.configuration.url)==null?void 0:S.protocol)!=null?T:""),c(t,a),c(t,l),c(t,f),c(t,d),c(e,g),c(e,_),k||(x=[Q(n,"change",i[14]),Q(l,"change",i[15]),Q(d,"change",i[16])],k=!0)},p(C,w){var S,T,P,Z,O,R,re,te;w&1&&s!==(s=(T=(S=C[0].plugin.settings.configuration.url)==null?void 0:S.protocol)!=null?T:"")&&Ar(n,(Z=(P=C[0].plugin.settings.configuration.url)==null?void 0:P.protocol)!=null?Z:""),w&1&&u!==(u=(R=(O=C[0].plugin.settings.configuration.url)==null?void 0:O.ip_address)!=null?R:"")&&l.value!==u&&(l.value=u),w&1&&m!==(m=(te=(re=C[0].plugin.settings.configuration.url)==null?void 0:re.port)!=null?te:"")&&d.value!==m&&(d.value=m),w&16&&_.value!==C[4]&&(_.value=C[4])},d(C){C&&y(e),k=!1,we(x)}}}function vd(i){let e,t;return e=new Y({props:{name:"eye-off"}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function wd(i){let e,t;return e=new Y({props:{name:"eye"}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function kd(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_=[wd,vd],k=[];function x(C,w){return C[3]==="password"?0:1}return u=x(i,-1),f=k[u]=_[u](i),{c(){var C;e=p("input"),n=b(),r=p("input"),a=b(),l=p("button"),f.c(),h(e,"type","text"),h(e,"placeholder","Enter your GUI username..."),h(e,"id","gui-username"),e.required=t=Re.Platform.isMobileApp,h(r,"type",i[3]),h(r,"placeholder","Enter your GUI password..."),h(r,"id","gui-password"),r.value=o=(C=i[0].plugin.settings.gui_password)!=null?C:"",r.required=s=Re.Platform.isMobileApp},m(C,w){v(C,e,w),jt(e,i[0].plugin.settings.gui_username),v(C,n,w),v(C,r,w),v(C,a,w),v(C,l,w),k[u].m(l,null),d=!0,m||(g=[Q(e,"input",i[17]),Q(e,"change",i[18]),Q(r,"change",i[19]),Q(l,"click",i[20])],m=!0)},p(C,w){var T;w&1&&e.value!==C[0].plugin.settings.gui_username&&jt(e,C[0].plugin.settings.gui_username),(!d||w&8)&&h(r,"type",C[3]),(!d||w&1&&o!==(o=(T=C[0].plugin.settings.gui_password)!=null?T:"")&&r.value!==o)&&(r.value=o);let S=u;u=x(C,w),u!==S&&(Le(),M(k[S],1,1,()=>{k[S]=null}),Ne(),f=k[u],f||(f=k[u]=_[u](C),f.c()),I(f,1),f.m(l,null))},i(C){d||(I(f),d=!0)},o(C){M(f),d=!1},d(C){C&&(y(e),y(n),y(r),y(a),y(l)),k[u].d(),m=!1,we(g)}}}function xd(i){let e,t,n,r,o;return t=new Y({props:{name:"link"}}),{c(){e=p("button"),A(t.$$.fragment),h(e,"slot","control"),h(e,"class","mod-cta")},m(s,a){v(s,e,a),L(t,e,null),n=!0,r||(o=Q(e,"click",i[21]),r=!0)},p:z,i(s){n||(I(t.$$.fragment,s),n=!0)},o(s){M(t.$$.fragment,s),n=!1},d(s){s&&y(e),N(t),r=!1,o()}}}function Cd(i){let e,t,n,r,o;return t=new Y({props:{name:"cog"}}),{c(){e=p("button"),A(t.$$.fragment),h(e,"slot","control")},m(s,a){v(s,e,a),L(t,e,null),n=!0,r||(o=Q(e,"click",i[22]),r=!0)},p:z,i(s){n||(I(t.$$.fragment,s),n=!0)},o(s){M(t.$$.fragment,s),n=!1},d(s){s&&y(e),N(t),r=!1,o()}}}function Id(i){let e,t,n,r;return e=new Ae({props:{name:"Plugin's Dev Mode",heading:!0}}),n=new Ae({props:{name:"Enable Plugin's Developer Mode",description:"For the moment, the developer mode contains a Syncthing conflicts generator. It allows to test the plugin's conflict resolution system.",$$slots:{control:[Sd],description:[Md]},$$scope:{ctx:i}}}),{c(){A(e.$$.fragment),t=b(),A(n.$$.fragment)},m(o,s){L(e,o,s),v(o,t,s),L(n,o,s),r=!0},p(o,s){let a={};s&268435457&&(a.$$scope={dirty:s,ctx:o}),n.$set(a)},i(o){r||(I(e.$$.fragment,o),I(n.$$.fragment,o),r=!0)},o(o){M(e.$$.fragment,o),M(n.$$.fragment,o),r=!1},d(o){o&&y(t),N(e,o),N(n,o)}}}function Md(i){let e,t,n;return{c(){e=F(`For the moment, the developer mode contains a Syncthing conflicts
|
|
generator.
|
|
`),t=p("br"),n=F(`
|
|
It allows to test the plugin's conflict resolution system.`)},m(r,o){v(r,e,o),v(r,t,o),v(r,n,o)},p:z,d(r){r&&(y(e),y(t),y(n))}}}function Sd(i){let e,t;return e=new ql({props:{callback:i[23],slot:"control"}}),{c(){A(e.$$.fragment)},m(n,r){L(e,n,r),t=!0},p(n,r){let o={};r&1&&(o.callback=n[23]),e.$set(o)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){M(e.$$.fragment,n),t=!1},d(n){N(e,n)}}}function $d(i){let e,t,n,r;return e=new Ae({props:{name:"Open Mobile app",heading:!0}}),n=new Ae({props:{name:"Open Syncthing mobile app",description:"Open the Syncthing mobile app, if not it opens the Google Play Store page.",$$slots:{control:[Td]},$$scope:{ctx:i}}}),{c(){A(e.$$.fragment),t=b(),A(n.$$.fragment)},m(o,s){L(e,o,s),v(o,t,s),L(n,o,s),r=!0},p(o,s){let a={};s&268435457&&(a.$$scope={dirty:s,ctx:o}),n.$set(a)},i(o){r||(I(e.$$.fragment,o),I(n.$$.fragment,o),r=!0)},o(o){M(e.$$.fragment,o),M(n.$$.fragment,o),r=!1},d(o){o&&y(t),N(e,o),N(n,o)}}}function Td(i){let e,t,n;return{c(){e=p("button"),e.textContent="Open Syncthing on Mobile."},m(r,o){v(r,e,o),t||(n=Q(e,"click",i[24]),t=!0)},p:z,d(r){r&&y(e),t=!1,n()}}}function Ld(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k;return n=new Y({props:{name:"heart"}}),a=new Y({props:{name:"github"}}),d=new Y({props:{name:"bug"}}),{c(){e=p("div"),t=p("button"),A(n.$$.fragment),r=F(`
|
|
Sponsor`),o=b(),s=p("button"),A(a.$$.fragment),l=F(`
|
|
GitHub repo`),u=b(),f=p("button"),A(d.$$.fragment),m=F(`
|
|
Report a bug`),h(t,"class","svelte-13bfvu7"),h(s,"class","svelte-13bfvu7"),h(f,"class","svelte-13bfvu7"),h(e,"slot","control"),h(e,"class","footer svelte-13bfvu7")},m(x,C){v(x,e,C),c(e,t),L(n,t,null),c(t,r),c(e,o),c(e,s),L(a,s,null),c(s,l),c(e,u),c(e,f),L(d,f,null),c(f,m),g=!0,_||(k=[Q(t,"click",i[25]),Q(s,"click",i[26]),Q(f,"click",i[27])],_=!0)},p:z,i(x){g||(I(n.$$.fragment,x),I(a.$$.fragment,x),I(d.$$.fragment,x),g=!0)},o(x){M(n.$$.fragment,x),M(a.$$.fragment,x),M(d.$$.fragment,x),g=!1},d(x){x&&y(e),N(n),N(a),N(d),_=!1,we(k)}}}function Nd(i){let e,t,n,r,o,s,a,l,u,f,d,m,g,_,k,x,C,w,S,T,P,Z,O,R,re,te,W,U,E;n=new Ae({props:{name:"Syncthing Integration for Obsidian",heading:!0,$$slots:{description:[sd]},$$scope:{ctx:i}}});let G=!i[1]&&oa(i);s=new Ae({props:{name:"Syncthing API Key",heading:!0,$$slots:{control:[gd],description:[cd]},$$scope:{ctx:i}}}),l=new Ae({props:{name:"Syncthing API Status",$$slots:{control:[md]},$$scope:{ctx:i}}});let D=Re.Platform.isDesktopApp&&hd(i),J=Re.Platform.isMobileApp&&bd(i);m=new Ae({props:{name:"Syncthing base URL",heading:!0}}),_=new Ae({props:{name:"Set the Syncthing base URL",description:"Please set your Syncthing base URL here. This address will be used to open the Syncthing GUI in your browser and to make API requests.",$$slots:{control:[yd]},$$scope:{ctx:i}}}),x=new Ae({props:{name:"Set GUI Credentials",description:"Please set your Syncthing GUI credentials here. These credentials will be used to open the Syncthing GUI in your browser.",$$slots:{control:[kd]},$$scope:{ctx:i}}}),w=new Ae({props:{name:"Open Syncthing GUI",description:"Open the Syncthing GUI in your browser.",$$slots:{control:[xd]},$$scope:{ctx:i}}}),T=new Ae({props:{name:"Syncthing Configuration",heading:!0}}),Z=new Ae({props:{name:"In construction",description:"This part is in construction.",$$slots:{control:[Cd]},$$scope:{ctx:i}}}),R=new ra({props:{parent:i[0]}});let be=Re.Platform.isDesktopApp&&Id(i),X=Re.Platform.isMobileApp&&$d(i);return U=new Ae({props:{heading:!0,$$slots:{control:[Ld]},$$scope:{ctx:i}}}),{c(){e=p("p"),e.innerHTML=`<a href="https://github.com/LBF38/obsidian-syncthing-integration" class="svelte-13bfvu7"><img src="${Ll}" alt="Syncthing's logo" class="svelte-13bfvu7"/> <img src="${Tl}" alt="Obsidian's logo" class="svelte-13bfvu7"/></a>`,t=b(),A(n.$$.fragment),r=b(),G&&G.c(),o=b(),A(s.$$.fragment),a=b(),A(l.$$.fragment),u=b(),D&&D.c(),f=b(),J&&J.c(),d=b(),A(m.$$.fragment),g=b(),A(_.$$.fragment),k=b(),A(x.$$.fragment),C=b(),A(w.$$.fragment),S=b(),A(T.$$.fragment),P=b(),A(Z.$$.fragment),O=b(),A(R.$$.fragment),re=b(),be&&be.c(),te=b(),X&&X.c(),W=b(),A(U.$$.fragment),h(e,"class","banner svelte-13bfvu7")},m($,j){v($,e,j),v($,t,j),L(n,$,j),v($,r,j),G&&G.m($,j),v($,o,j),L(s,$,j),v($,a,j),L(l,$,j),v($,u,j),D&&D.m($,j),v($,f,j),J&&J.m($,j),v($,d,j),L(m,$,j),v($,g,j),L(_,$,j),v($,k,j),L(x,$,j),v($,C,j),L(w,$,j),v($,S,j),L(T,$,j),v($,P,j),L(Z,$,j),v($,O,j),L(R,$,j),v($,re,j),be&&be.m($,j),v($,te,j),X&&X.m($,j),v($,W,j),L(U,$,j),E=!0},p($,[j]){let ye={};j&268435456&&(ye.$$scope={dirty:j,ctx:$}),n.$set(ye),$[1]?G&&(Le(),M(G,1,1,()=>{G=null}),Ne()):G?j&2&&I(G,1):(G=oa($),G.c(),I(G,1),G.m(o.parentNode,o));let ge={};j&268435461&&(ge.$$scope={dirty:j,ctx:$}),s.$set(ge);let q={};j&268435457&&(q.$$scope={dirty:j,ctx:$}),l.$set(q),Re.Platform.isDesktopApp&&D.p($,j);let Se={};j&268435473&&(Se.$$scope={dirty:j,ctx:$}),_.$set(Se);let ve={};j&268435465&&(ve.$$scope={dirty:j,ctx:$}),x.$set(ve);let me={};j&268435473&&(me.$$scope={dirty:j,ctx:$}),w.$set(me);let H={};j&268435457&&(H.$$scope={dirty:j,ctx:$}),Z.$set(H);let V={};j&1&&(V.parent=$[0]),R.$set(V),Re.Platform.isDesktopApp&&be.p($,j),Re.Platform.isMobileApp&&X.p($,j);let Ce={};j&268435456&&(Ce.$$scope={dirty:j,ctx:$}),U.$set(Ce)},i($){E||(I(n.$$.fragment,$),I(G),I(s.$$.fragment,$),I(l.$$.fragment,$),I(D),I(J),I(m.$$.fragment,$),I(_.$$.fragment,$),I(x.$$.fragment,$),I(w.$$.fragment,$),I(T.$$.fragment,$),I(Z.$$.fragment,$),I(R.$$.fragment,$),I(be),I(X),I(U.$$.fragment,$),E=!0)},o($){M(n.$$.fragment,$),M(G),M(s.$$.fragment,$),M(l.$$.fragment,$),M(D),M(J),M(m.$$.fragment,$),M(_.$$.fragment,$),M(x.$$.fragment,$),M(w.$$.fragment,$),M(T.$$.fragment,$),M(Z.$$.fragment,$),M(R.$$.fragment,$),M(be),M(X),M(U.$$.fragment,$),E=!1},d($){$&&(y(e),y(t),y(r),y(o),y(a),y(u),y(f),y(d),y(g),y(k),y(C),y(S),y(P),y(O),y(re),y(te),y(W)),N(n,$),G&&G.d($),N(s,$),N(l,$),D&&D.d($),J&&J.d($),N(m,$),N(_,$),N(x,$),N(w,$),N(T,$),N(Z,$),N(R,$),be&&be.d($),X&&X.d($),N(U,$)}}}function Ad(i,e,t){var n,r,o;let{parent:s}=e,a=!0,l="password",u="password",f="";Ke(()=>He(void 0,void 0,void 0,function*(){t(1,a=yield s.syncthingController.hasSyncthing())}));function d(){return He(this,void 0,void 0,function*(){s.syncthingController.getAPIKey().then(D=>{if(D instanceof _e){new Re.Notice(D.message);return}t(0,s.plugin.settings.api_key=D,s),s.plugin.saveSettings()})})}let m=async D=>{t(0,s.plugin.settings.api_key=D.currentTarget.value,s),await s.plugin.saveSettings()},g=()=>{t(2,l=l==="password"?"text":"password")},_=async()=>{t(0,s.plugin.settings.api_key="",s),await s.plugin.saveSettings()},k=async()=>{s.syncthingController.getAPIStatus().then(D=>{new Re.Notice(`Syncthing Ping : ${D}`)}).catch(D=>{console.log("settings tab error: ",D),new Re.Notice(D.message)})},x=async()=>{s.syncthingController.getCLIStatus().then(D=>{new Re.Notice(`Syncthing Ping : ${D}`)}).catch(D=>{new Re.Notice(D.message)})},C=async D=>{console.log("select change: ",D,D.currentTarget.value),s.plugin.settings.configuration.url||t(0,s.plugin.settings.configuration.url={protocol:"http",ip_address:"localhost",port:8384},s),(D.currentTarget.value==="http"||D.currentTarget.value==="https")&&t(0,s.plugin.settings.configuration.url.protocol=D.currentTarget.value,s),await s.plugin.saveSettings()},w=async D=>{console.log("ip address change: ",D,D.currentTarget.value);let J=D.currentTarget.value;s.plugin.settings.configuration.url||t(0,s.plugin.settings.configuration.url={protocol:"http",ip_address:"localhost",port:8384},s),t(0,s.plugin.settings.configuration.url.ip_address=J===""||!J?"localhost":J,s),await s.plugin.saveSettings()},S=async D=>{console.log("port change: ",D,D.currentTarget.value);let J=D.currentTarget.value;s.plugin.settings.configuration.url||t(0,s.plugin.settings.configuration.url={protocol:"http",ip_address:"localhost",port:8384},s),t(0,s.plugin.settings.configuration.url.port=isNaN(parseInt(J))||!J?8384:parseInt(J),s),await s.plugin.saveSettings()};function T(){s.plugin.settings.gui_username=this.value,t(0,s)}let P=async D=>{t(0,s.plugin.settings.gui_username=D.currentTarget.value,s),await s.plugin.saveSettings()},Z=async D=>{t(0,s.plugin.settings.gui_password=D.currentTarget.value,s),await s.plugin.saveSettings()},O=()=>{t(3,u=u==="password"?"text":"password")},R=async()=>{var J,be,X;if((!s.plugin.settings.gui_username||!s.plugin.settings.gui_password)&&Re.Platform.isMobileApp){new Re.Notice("Please set your GUI credentials first. There are needed on mobile app.");return}let D;s.plugin.settings.gui_username&&s.plugin.settings.gui_password?D=`${(J=s.plugin.settings.configuration.url)==null?void 0:J.protocol}://${s.plugin.settings.gui_username}:${s.plugin.settings.gui_password}@${(be=s.plugin.settings.configuration.url)==null?void 0:be.ip_address}:${(X=s.plugin.settings.configuration.url)==null?void 0:X.port}`:D=f,open(D)},re=async D=>{new Re.Notice("This part is in construction."),new lr(s.app,s.plugin).open()},te=async D=>{t(0,s.plugin.settings.devMode=D,s),await s.plugin.saveSettings(),s.plugin.onunload(),s.plugin.onload()},W=()=>{if(!Re.Platform.isAndroidApp){new Re.Notice("The feature is not implemented for your platform. Please open the Syncthing app for your platform. You can create an issue on GitHub if you want to request this feature.",5e3);return}s.plugin.syncthingFromAndroid.openSyncthing()},U=()=>{open("https://github.com/sponsors/LBF38")},E=()=>{open("https://github.com/LBF38/obsidian-syncthing-integration")},G=()=>{open("https://github.com/LBF38/obsidian-syncthing-integration/issues/new/choose")};return i.$$set=D=>{"parent"in D&&t(0,s=D.parent)},i.$$.update=()=>{i.$$.dirty&449&&t(4,f=`${t(6,n=s.plugin.settings.configuration.url)===null||n===void 0?void 0:n.protocol}://${t(7,r=s.plugin.settings.configuration.url)===null||r===void 0?void 0:r.ip_address}:${t(8,o=s.plugin.settings.configuration.url)===null||o===void 0?void 0:o.port}`)},[s,a,l,u,f,d,n,r,o,m,g,_,k,x,C,w,S,T,P,Z,O,R,re,te,W,U,E,G]}var xo=class extends fe{constructor(e){super(),he(this,e,Ad,Nd,ue,{parent:0},od)}},sa=xo;var ur=class extends zt.PluginSettingTab{constructor(e,t){super(e,t),this.plugin=t,this.syncthingController=t.syncthingController}async display(){let{containerEl:e}=this;e.empty(),new sa({target:e,props:{parent:this}})}syncthingConfiguration(e){new zt.Setting(e).setName("Syncthing Configuration").setHeading().setDesc("This section will show the configuration of the Syncthing instance for the vault."),new zt.Setting(e).setName("This part is not implemented yet.")}async configurationSetting(e){let t=new zt.Setting(e).setName("Get Syncthing Configuration").setDesc("This button will get the configuration of the Syncthing instance for the vault.");t.addButton(n=>{n.setIcon("sync").setCta().onClick(async()=>{let r=await this.syncthingController.getConfiguration();if(r instanceof _e){t.setName("Error").setDesc("Error getting configuration. Please try again later."),new zt.Notice("Error getting configuration. Please try again later.");return}this.plugin.settings.configuration=r})})}async initConfigTable(e,t){let n=e.createEl("table");n.appendChild(e.createEl("tbody"));let r=n.createEl("thead").createEl("tr");return r.createEl("th",{text:"Device ID"}),r.createEl("th",{text:"Device Name"}),r.createEl("th",{text:"Device Address"}),t.devices.forEach(o=>{this.addConfigRowToTable(n,o)}),n}addConfigRowToTable(e,t){let n=e.appendChild(e.createEl("tr"));n.appendChild(e.createEl("td",{text:t.deviceID.slice(0,8)})),n.appendChild(e.createEl("td",{text:t.name})),n.appendChild(e.createEl("td",{text:t.address.join(", ")}))}};var Dd={configuration:{url:{protocol:"http",ip_address:"localhost",port:8384}},devMode:!1},Kn=class Kn extends Ot.Plugin{constructor(){super(...arguments);this.pluginsElements=[];this.syncthingFromCLI=new Si;this.syncthingFromREST=new $i(this);this.syncthingFromAndroid=new ki;this.syncthingController=new oi(this.syncthingFromCLI,this.syncthingFromREST,this.syncthingFromAndroid,this);this.devModeController=new dn(this)}async onload(){Kn.loadCount++,await this.loadSettings(),(0,Ot.addIcon)("syncthing",Nl),Ot.Platform.isMobileApp||(this.statusBar=new wi(this.addStatusBarItem(),this),this.statusBar.onload(),this.pluginsElements.push(this.statusBar.status_bar));let t=new ur(this.app,this);Kn.loadCount===1&&this.addSettingTab(t);let n=this.addRibbonIcon("syncthing","Open Syncthing conflict manager modal",()=>{new sr(this.app,this.syncthingController).open()});if(this.settings.devMode){new Ot.Notice("Dev mode is enabled.");let r=this.addRibbonIcon("chevron-right-square","Generate Syncthing conflicts",async()=>{new Nn(this.app,new dn(this)).open()});this.addCommand({id:"generate-syncthing-conflicts",name:"Generate Syncthing conflicts",icon:"chevron-right-square",callback:async()=>{new Nn(this.app,new dn(this)).open()}}),this.pluginsElements.push(r)}this.pluginsElements.push(n)}onunload(){var t;(t=this.statusBar)==null||t.onunload(),this.pluginsElements.forEach(n=>n.remove())}async loadSettings(){this.settings=Object.assign({},Dd,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}};Kn.loadCount=0;var fr=Kn;
|
|
|
|
/* nosourcemap */ |