Files
blog/blog-admin/public/dist/plugins/artalk-plugin-auth.js
T
zqlit a74b3c7127
Deploy to Production / pre-check (push) Successful in 58s
Deploy to Production / build (push) Successful in 4m3s
Deploy to Production / deploy-edgeone (push) Successful in 3m48s
Deploy to Production / finalize (push) Successful in 26s
Deploy to Production / notify-failure (push) Skipped
归档 artalk-cf 评论后端 + rss-robot 到 blog-admin(含技术选型/模块分布 README)
2026-10-04 08:45:40 +08:00

3 lines
42 KiB
JavaScript

!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.atk-auth-plugin-dialog-wrap{display:flex;align-items:center;justify-content:center;flex-direction:column;height:100%}.atk-auth-plugin-dialog-wrap .atk-skip-btn{cursor:pointer;margin:10px auto 0;display:flex;justify-content:center;place-items:center;height:40px;padding:0 20px;font-size:16px;border-radius:50px;color:var(--at-color-font)}.atk-auth-plugin-dialog-wrap .atk-skip-btn:hover{opacity:.9}.atk-auth-plugin-dialog{overflow:hidden;transform:translateY(0) scale(1);animation:atkLoginDialogShowAnim .3s ease-in-out;will-change:transform,opacity,width,height;transition-property:transform,opacity,width,height;transition-duration:.2s;transition-timing-function:cubic-bezier(.25,.1,.25,1);display:flex;flex-direction:column;width:360px;max-height:500px;background:var(--at-color-bg);border-radius:18px}@keyframes atkLoginDialogShowAnim{0%{opacity:0;transform:translateY(15px) scale(1.02)}to{opacity:1;transform:translateY(0) scale(1)}}.atk-auth-plugin-dialog .atk-auth-dialog-title{display:flex;justify-content:space-between;place-items:center;padding:25px 25px 0;font-size:20px;font-weight:500;color:var(--at-color-font)}.atk-auth-plugin-dialog .atk-auth-dialog-title .atk-text{margin:0 10px}.atk-auth-plugin-dialog .atk-auth-dialog-title .atk-icon{display:flex;justify-content:center;place-items:center;height:40px;width:40px;border-radius:50%}.atk-auth-plugin-dialog .atk-auth-dialog-title .atk-icon:hover{background:var(--at-color-bg-grey)}.atk-auth-plugin-dialog .atk-view-wrap{max-height:calc(100% - 65px);overflow-y:auto}.atk-auth-plugin-dialog .atk-methods-page .atk-methods{padding:12px 20px 20px}.atk-auth-plugin-dialog .atk-methods-page .atk-methods .atk-method-item{display:flex;align-items:center;padding:15px 25px;cursor:pointer;border-radius:10px}.atk-auth-plugin-dialog .atk-methods-page .atk-methods .atk-method-item:hover{background:var(--at-color-bg-grey)}.atk-auth-plugin-dialog .atk-methods-page .atk-methods .atk-method-item .atk-method-icon{width:40px;height:40px;margin-right:20px;background-repeat:no-repeat;background-size:contain;background-position:center}.atk-auth-plugin-dialog .atk-methods-page .atk-methods .atk-method-item .atk-method-text{font-size:16px;font-weight:500;color:var(--at-color-font)}.atk-auth-plugin-dialog .atk-form{padding:20px 30px}.atk-auth-plugin-dialog .atk-form .atk-form-bottom{padding:5px 0;text-align:center;font-size:14px}.atk-auth-plugin-dialog .atk-form .atk-form-bottom .atk-link{cursor:pointer;text-align:center;color:var(--at-color-main)}.atk-auth-plugin-dialog .atk-form .atk-form-bottom .atk-link:hover{text-decoration:underline}.atk-auth-plugin-dialog .atk-form input{width:100%;padding:10px 20px;margin:5px 0;font-size:16px;border-radius:10px;border:1px solid var(--at-color-bg-grey);background:var(--at-color-bg-grey);color:var(--at-color-font);transition:border-color .2s;outline:none}.atk-auth-plugin-dialog .atk-form input:focus{border-color:var(--at-color-primary)}.atk-auth-plugin-dialog .atk-form button[type=submit]{width:100%;padding:10px 20px;margin:10px 0;font-size:16px;border-radius:10px;background:var(--at-color-main);color:var(--at-color-bg);cursor:pointer;transition:background .2s;border:0}.atk-auth-plugin-dialog .atk-form button[type=submit]:hover{opacity:.9}.atk-auth-plugin-dialog .atk-form .atk-input-grp{position:relative}.atk-auth-plugin-dialog .atk-form .atk-input-grp>input{padding-right:115px}.atk-auth-plugin-dialog .atk-form .atk-input-grp-btn{position:absolute;right:0;top:50%;transform:translateY(-50%);padding:10px 15px;font-size:14px;color:var(--at-color-main);cursor:pointer}.atk-auth-plugin-dialog[data-dialog-name=merge]{background-size:100% auto;background-position:center top;background-repeat:no-repeat;background-image:url(\'data:image/svg+xml,<svg fill="none" height="159" viewBox="0 0 390 159" width="390" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="195" x2="195" y1="0" y2="159"><stop offset="0" stop-color="%23f6f0fe"/><stop offset=".835" stop-color="%23f6f0fe" stop-opacity="0"/></linearGradient><clipPath id="b"><path d="m0 0h390v159h-390z"/></clipPath><g clip-path="url(%23b)"><path d="m0 0h390v159h-390z" fill="url(%23a)"/><g clip-rule="evenodd" fill="%23743fc8" fill-rule="evenodd"><path d="m76.0859 23.5c-1.5187 0-2.75 1.2312-2.75 2.75s1.2313 2.75 2.75 2.75c1.5188 0 2.75-1.2312 2.75-2.75s-1.2312-2.75-2.75-2.75zm-5.5 2.75c0-3.0376 2.4625-5.5 5.5-5.5 3.0376 0 5.5 2.4624 5.5 5.5s-2.4624 5.5-5.5 5.5c-3.0375 0-5.5-2.4624-5.5-5.5z"/><path d="m76.0859 51c-1.5187 0-2.75 1.2312-2.75 2.75s1.2313 2.75 2.75 2.75c1.5188 0 2.75-1.2312 2.75-2.75s-1.2312-2.75-2.75-2.75zm-5.5 2.75c0-3.0376 2.4625-5.5 5.5-5.5 3.0376 0 5.5 2.4624 5.5 5.5s-2.4624 5.5-5.5 5.5c-3.0375 0-5.5-2.4624-5.5-5.5z"/><path d="m76.0859 29c.7594 0 1.375.6156 1.375 1.375v19.25c0 .7594-.6156 1.375-1.375 1.375s-1.375-.6156-1.375-1.375v-19.25c0-.7594.6156-1.375 1.375-1.375z"/><path d="m98.0859 40c-1.5187 0-2.75 1.2312-2.75 2.75s1.2313 2.75 2.75 2.75c1.5188 0 2.7501-1.2312 2.7501-2.75s-1.2313-2.75-2.7501-2.75zm-5.5 2.75c0-3.0376 2.4625-5.5 5.5-5.5 3.0381 0 5.5001 2.4624 5.5001 5.5s-2.462 5.5-5.5001 5.5c-3.0375 0-5.5-2.4624-5.5-5.5z"/><path d="m76.0859 29c.7594 0 1.375.6156 1.375 1.375 0 3.4986 2.013 6.2043 5.1762 8.1022 3.1845 1.9107 7.3979 2.8978 11.3238 2.8978.7594 0 1.375.6156 1.375 1.375s-.6156 1.375-1.375 1.375c-4.324 0-9.0482-1.0754-12.7386-3.2897-3.7118-2.2271-6.5114-5.7089-6.5114-10.4603 0-.7594.6156-1.375 1.375-1.375z"/><path d="m144 13.5c-.828 0-1.5.6716-1.5 1.5s.672 1.5 1.5 1.5 1.5-.6716 1.5-1.5-.672-1.5-1.5-1.5zm-3 1.5c0-1.6569 1.343-3 3-3s3 1.3431 3 3-1.343 3-3 3-3-1.3431-3-3z" fill-opacity=".5"/><path d="m144 28.5c-.828 0-1.5.6716-1.5 1.5s.672 1.5 1.5 1.5 1.5-.6716 1.5-1.5-.672-1.5-1.5-1.5zm-3 1.5c0-1.6569 1.343-3 3-3s3 1.3431 3 3-1.343 3-3 3-3-1.3431-3-3z" fill-opacity=".5"/><path d="m144 16.5c.414 0 .75.3358.75.75v10.5c0 .4142-.336.75-.75.75s-.75-.3358-.75-.75v-10.5c0-.4142.336-.75.75-.75z" fill-opacity=".5"/><path d="m156 22.5c-.828 0-1.5.6716-1.5 1.5s.672 1.5 1.5 1.5 1.5-.6716 1.5-1.5-.672-1.5-1.5-1.5zm-3 1.5c0-1.6569 1.343-3 3-3s3 1.3431 3 3-1.343 3-3 3-3-1.3431-3-3z" fill-opacity=".5"/><path d="m144 16.5c.414 0 .75.3358.75.75 0 1.9083 1.098 3.3841 2.823 4.4194 1.737 1.0422 4.036 1.5806 6.177 1.5806.414 0 .75.3358.75.75s-.336.75-.75.75c-2.359 0-4.935-.5866-6.948-1.7944-2.025-1.2147-3.552-3.1139-3.552-5.7056 0-.4142.336-.75.75-.75z" fill-opacity=".5"/><path d="m24.5 58.2857c-.6904 0-1.25.5756-1.25 1.2857s.5596 1.2857 1.25 1.2857 1.25-.5756 1.25-1.2857-.5596-1.2857-1.25-1.2857zm-2.5 1.2857c0-1.4201 1.1193-2.5714 2.5-2.5714s2.5 1.1513 2.5 2.5714c0 1.4202-1.1193 2.5715-2.5 2.5715s-2.5-1.1513-2.5-2.5715z" fill-opacity=".3"/><path d="m24.5 71.1429c-.6904 0-1.25.5756-1.25 1.2857s.5596 1.2857 1.25 1.2857 1.25-.5756 1.25-1.2857-.5596-1.2857-1.25-1.2857zm-2.5 1.2857c0-1.4202 1.1193-2.5715 2.5-2.5715s2.5 1.1513 2.5 2.5715c0 1.4201-1.1193 2.5714-2.5 2.5714s-2.5-1.1513-2.5-2.5714z" fill-opacity=".3"/><path d="m24.5 60.8571c.3452 0 .625.2879.625.6429v9c0 .355-.2798.6429-.625.6429s-.625-.2879-.625-.6429v-9c0-.355.2798-.6429.625-.6429z" fill-opacity=".3"/><path d="m34.5 66c-.6904 0-1.25.5756-1.25 1.2857s.5596 1.2857 1.25 1.2857 1.25-.5756 1.25-1.2857-.5596-1.2857-1.25-1.2857zm-2.5 1.2857c0-1.4201 1.1193-2.5714 2.5-2.5714s2.5 1.1513 2.5 2.5714c0 1.4202-1.1193 2.5714-2.5 2.5714s-2.5-1.1512-2.5-2.5714z" fill-opacity=".3"/><path d="m24.5 60.8571c.3452 0 .625.2879.625.6429 0 1.6357.915 2.9007 2.3528 3.788 1.4475.8934 3.3627 1.3549 5.1472 1.3549.3452 0 .625.2878.625.6428 0 .3551-.2798.6429-.625.6429-1.9655 0-4.1128-.5028-5.7903-1.5381-1.6872-1.0412-2.9597-2.6691-2.9597-4.8905 0-.355.2798-.6429.625-.6429z" fill-opacity=".3"/><path d="m201.222 41.1429c-.613 0-1.111.5116-1.111 1.1428s.498 1.1429 1.111 1.1429c.614 0 1.111-.5117 1.111-1.1429s-.497-1.1428-1.111-1.1428zm-2.222 1.1428c0-1.2624.995-2.2857 2.222-2.2857 1.228 0 2.222 1.0233 2.222 2.2857s-.994 2.2857-2.222 2.2857c-1.227 0-2.222-1.0233-2.222-2.2857z" fill-opacity=".2"/><path d="m201.222 52.5714c-.613 0-1.111.5117-1.111 1.1429s.498 1.1428 1.111 1.1428c.614 0 1.111-.5116 1.111-1.1428s-.497-1.1429-1.111-1.1429zm-2.222 1.1429c0-1.2624.995-2.2857 2.222-2.2857 1.228 0 2.222 1.0233 2.222 2.2857s-.994 2.2857-2.222 2.2857c-1.227 0-2.222-1.0233-2.222-2.2857z" fill-opacity=".2"/><path d="m201.222 43.4286c.307 0 .556.2558.556.5714v8c0 .3156-.249.5714-.556.5714s-.555-.2558-.555-.5714v-8c0-.3156.248-.5714.555-.5714z" fill-opacity=".2"/><path d="m210.111 48c-.614 0-1.111.5117-1.111 1.1429 0 .6311.497 1.1428 1.111 1.1428s1.111-.5117 1.111-1.1428c0-.6312-.497-1.1429-1.111-1.1429zm-2.222 1.1429c0-1.2624.995-2.2858 2.222-2.2858s2.222 1.0234 2.222 2.2858c0 1.2623-.995 2.2857-2.222 2.2857s-2.222-1.0234-2.222-2.2857z" fill-opacity=".2"/><path d="m201.222 43.4286c.307 0 .556.2558.556.5714 0 1.454.813 2.5784 2.091 3.3671 1.287.7941 2.989 1.2043 4.575 1.2043.307 0 .556.2559.556.5715 0 .3155-.249.5714-.556.5714-1.747 0-3.655-.4469-5.146-1.3672-1.5-.9255-2.631-2.3725-2.631-4.3471 0-.3156.248-.5714.555-.5714z" fill-opacity=".2"/><path d="m254.222 24.1429c-.613 0-1.111.5116-1.111 1.1428s.498 1.1429 1.111 1.1429c.614 0 1.111-.5117 1.111-1.1429s-.497-1.1428-1.111-1.1428zm-2.222 1.1428c0-1.2624.995-2.2857 2.222-2.2857 1.228 0 2.222 1.0233 2.222 2.2857s-.994 2.2857-2.222 2.2857c-1.227 0-2.222-1.0233-2.222-2.2857z" fill-opacity=".7"/><path d="m254.222 35.5714c-.613 0-1.111.5117-1.111 1.1429s.498 1.1428 1.111 1.1428c.614 0 1.111-.5116 1.111-1.1428s-.497-1.1429-1.111-1.1429zm-2.222 1.1429c0-1.2624.995-2.2857 2.222-2.2857 1.228 0 2.222 1.0233 2.222 2.2857s-.994 2.2857-2.222 2.2857c-1.227 0-2.222-1.0233-2.222-2.2857z" fill-opacity=".7"/><path d="m254.222 26.4286c.307 0 .556.2558.556.5714v8c0 .3156-.249.5714-.556.5714s-.555-.2558-.555-.5714v-8c0-.3156.248-.5714.555-.5714z" fill-opacity=".7"/><path d="m263.111 31c-.614 0-1.111.5117-1.111 1.1429 0 .6311.497 1.1428 1.111 1.1428s1.111-.5117 1.111-1.1428c0-.6312-.497-1.1429-1.111-1.1429zm-2.222 1.1429c0-1.2624.995-2.2858 2.222-2.2858s2.222 1.0234 2.222 2.2858c0 1.2623-.995 2.2857-2.222 2.2857s-2.222-1.0234-2.222-2.2857z" fill-opacity=".7"/><path d="m254.222 26.4286c.307 0 .556.2558.556.5714 0 1.454.813 2.5784 2.091 3.3671 1.287.7941 2.989 1.2043 4.575 1.2043.307 0 .556.2559.556.5715 0 .3155-.249.5714-.556.5714-1.747 0-3.655-.4469-5.146-1.3672-1.5-.9255-2.631-2.3725-2.631-4.3471 0-.3156.248-.5714.555-.5714z" fill-opacity=".7"/><path d="m300-2.42857c-1.933 0-3.5 1.598982-3.5 3.57143 0 1.97244 1.567 3.57143 3.5 3.57143s3.5-1.59899 3.5-3.57143c0-1.972448-1.567-3.57143-3.5-3.57143zm-7 3.57143c0-3.94489 3.134-7.14286 7-7.14286s7 3.19797 7 7.14286-3.134 7.14285-7 7.14285-7-3.19796-7-7.14285z" fill-opacity=".7"/><path d="m300 33.2857c-1.933 0-3.5 1.599-3.5 3.5714 0 1.9725 1.567 3.5715 3.5 3.5715s3.5-1.599 3.5-3.5715c0-1.9724-1.567-3.5714-3.5-3.5714zm-7 3.5714c0-3.9448 3.134-7.1428 7-7.1428s7 3.198 7 7.1428c0 3.9449-3.134 7.1429-7 7.1429s-7-3.198-7-7.1429z" fill-opacity=".7"/><path d="m300 4.71429c.966 0 1.75.79949 1.75 1.78571v25c0 .9862-.784 1.7857-1.75 1.7857s-1.75-.7995-1.75-1.7857v-25c0-.98622.784-1.78571 1.75-1.78571z" fill-opacity=".7"/><path d="m328 19c-1.933 0-3.5 1.599-3.5 3.5714 0 1.9725 1.567 3.5715 3.5 3.5715s3.5-1.599 3.5-3.5715c0-1.9724-1.567-3.5714-3.5-3.5714zm-7 3.5714c0-3.9449 3.134-7.1428 7-7.1428s7 3.1979 7 7.1428-3.134 7.1429-7 7.1429-7-3.198-7-7.1429z" fill-opacity=".7"/><path d="m300 4.71429c.966 0 1.75.79949 1.75 1.78571 0 4.5436 2.562 8.0575 6.588 10.5223 4.053 2.4815 9.415 3.7634 14.412 3.7634.966 0 1.75.7995 1.75 1.7857 0 .9863-.784 1.7857-1.75 1.7857-5.503 0-11.516-1.3966-16.213-4.2723-4.724-2.8923-8.287-7.4142-8.287-13.5848 0-.98622.784-1.78571 1.75-1.78571z" fill-opacity=".7"/><path d="m360.333 34.2143c-.644 0-1.166.5436-1.166 1.2143 0 .6706.522 1.2143 1.166 1.2143.645 0 1.167-.5437 1.167-1.2143 0-.6707-.522-1.2143-1.167-1.2143zm-2.333 1.2143c0-1.3413 1.045-2.4286 2.333-2.4286 1.289 0 2.334 1.0873 2.334 2.4286 0 1.3412-1.045 2.4285-2.334 2.4285-1.288 0-2.333-1.0873-2.333-2.4285z" fill-opacity=".7"/><path d="m360.333 46.3571c-.644 0-1.166.5437-1.166 1.2143 0 .6707.522 1.2143 1.166 1.2143.645 0 1.167-.5436 1.167-1.2143 0-.6706-.522-1.2143-1.167-1.2143zm-2.333 1.2143c0-1.3412 1.045-2.4285 2.333-2.4285 1.289 0 2.334 1.0873 2.334 2.4285 0 1.3413-1.045 2.4286-2.334 2.4286-1.288 0-2.333-1.0873-2.333-2.4286z" fill-opacity=".7"/><path d="m360.333 36.6429c.322 0 .584.2718.584.6071v8.5c0 .3353-.262.6071-.584.6071s-.583-.2718-.583-.6071v-8.5c0-.3353.261-.6071.583-.6071z" fill-opacity=".7"/><path d="m369.667 41.5c-.645 0-1.167.5437-1.167 1.2143s.522 1.2143 1.167 1.2143c.644 0 1.166-.5437 1.166-1.2143s-.522-1.2143-1.166-1.2143zm-2.334 1.2143c0-1.3413 1.045-2.4286 2.334-2.4286 1.288 0 2.333 1.0873 2.333 2.4286 0 1.3412-1.045 2.4286-2.333 2.4286-1.289 0-2.334-1.0874-2.334-2.4286z" fill-opacity=".7"/><path d="m360.333 36.6429c.322 0 .584.2718.584.6071 0 1.5448.854 2.7395 2.196 3.5776 1.351.8437 3.138 1.2795 4.804 1.2795.322 0 .583.2719.583.6072s-.261.6071-.583.6071c-1.835 0-3.839-.4748-5.405-1.4526-1.574-.9833-2.762-2.5208-2.762-4.6188 0-.3353.261-.6071.583-.6071z" fill-opacity=".7"/></g></g></svg>\')}.atk-auth-plugin-dialog[data-dialog-name=merge] .atk-auth-dialog-title{padding-top:50px;color:#361e6a}.atk-auth-plugin-dialog[data-dialog-name=merge] .atk-text:first-of-type{color:#472a84}.atk-auth-plugin-dialog .atk-merge-confirm-page{padding:15px 35px 30px}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-text{font-size:16px;color:var(--at-color-font);margin-bottom:20px}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-usernames{display:flex;flex-direction:column;color:var(--at-color-font);margin-bottom:20px}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-usernames .atk-item{border-radius:10px;padding:10px 15px;margin:5px 0;display:flex;justify-content:space-between;place-items:center;cursor:pointer;border:1px solid var(--at-color-border)}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-usernames .atk-item.active{background:var(--at-color-bg-grey)}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-usernames .atk-item .atk-username{flex:auto;text-align:center}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-dialog-footer{display:flex;justify-content:space-between;place-items:center;margin-top:20px}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-dialog-footer .atk-btn{padding:10px 20px;font-size:16px;border-radius:10px;cursor:pointer}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-dialog-footer .atk-btn:hover{opacity:.9}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-dialog-footer .atk-btn.atk-btn-no{background:var(--at-color-bg-grey);color:var(--at-color-font)}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-dialog-footer .atk-btn.atk-btn-yes{background:var(--at-color-main);color:var(--at-color-bg)}.atk-auth-plugin-dialog .atk-merge-confirm-page .atk-dialog-footer .atk-btn.atk-btn-yes.disabled{opacity:.5;cursor:not-allowed}.atk-main-editor .atk-editor-user-wrap{margin-top:10px}.atk-main-editor .atk-editor-user-wrap .atk-editor-user{display:inline-flex;flex-direction:row;place-items:center;cursor:pointer;border-radius:3px;padding:0 10px}.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-user-btn{display:flex;place-items:center;justify-content:center;padding:5px;border-radius:3px}.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-user-btn:hover{background:var(--at-color-bg-grey-transl)}.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-user-btn:not(:last-child){margin-right:5px}.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-user-profile-btn{padding-left:12px;padding-right:12px}.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-name{color:var(--at-color-font)}.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-avatar{width:20px;height:20px;border-radius:50%;margin-right:15px;background-position:center;background-size:cover;background-color:#d5d5d5}.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-logout{height:100%;color:var(--at-color-font);font-size:1.3em;display:flex;place-items:center;justify-content:center}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}}();
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["artalk-plugin-auth"]=e["artalk-plugin-auth"]||{})}(this,(function(e){"use strict";var t,n=Object.defineProperty,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,i=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,s=(e,t)=>{var n={};for(var i in e)o.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&r)for(var i of r(e))t.indexOf(i)<0&&l.call(e,i)&&(n[i]=e[i]);return n},a=(e,t,n)=>new Promise(((r,o)=>{var l=e=>{try{s(n.next(e))}catch(t){o(t)}},i=e=>{try{s(n.throw(e))}catch(t){o(t)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,i);s((n=n.apply(e,t)).next())}));const c=Symbol("solid-proxy"),u=Symbol("solid-track"),d={equals:(e,t)=>e===t};let f=N;const g=1,p=2,h={owned:null,cleanups:null,context:null,owner:null},v={};var m=null;let y=null,b=null,k=null,w=null,$=0;function A(e,t){const n=b,r=m,o=0===e.length,l=void 0===t?r:t,i=o?h:{owned:null,cleanups:null,context:l?l.context:null,owner:l},s=o?e:()=>e((()=>B((()=>K(i)))));m=i,b=null;try{return M(s,!0)}finally{b=n,m=r}}function x(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},d,t):d).equals||void 0};return[_.bind(n),e=>("function"==typeof e&&(e=e(n.value)),L(n,e))]}function C(e,t,n){D(I(e,t,!0,g))}function S(e,t,n){D(I(e,t,!1,g))}function O(e,t,n){f=H;const r=I(e,t,!1,g);r.user=!0,w?w.push(r):D(r)}function P(e,t,n){n=n?Object.assign({},d,n):d;const r=I(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,D(r),_.bind(r)}function j(e,t,n){let r,o,l;2===arguments.length&&"object"==typeof t||1===arguments.length?(r=!0,o=e,l={}):(r=e,o=t,l={});let i=null,s=v,a=!1,c="initialValue"in l,u="function"==typeof r&&P(r);const d=new Set,[f,g]=(l.storage||x)(l.initialValue),[p,h]=x(void 0),[m,y]=x(void 0,{equals:!1}),[k,w]=x(c?"ready":"unresolved");function $(e,t,n,r){return i===e&&(i=null,void 0!==r&&(c=!0),e!==s&&t!==s||!l.onHydrated||queueMicrotask((()=>l.onHydrated(r,{value:t}))),s=v,function(e,t){M((()=>{void 0===t&&g((()=>e)),w(void 0!==t?"errored":c?"ready":"unresolved"),h(t);for(const e of d.keys())e.decrement();d.clear()}),!1)}(t,n)),t}function A(){const e=undefined,t=f(),n=p();if(void 0!==n&&!i)throw n;return b&&!b.user&&e&&C((()=>{m(),i&&(e.resolved||d.has(e)||(e.increment(),d.add(e)))})),t}function S(e=!0){if(!1!==e&&a)return;a=!1;const t=u?u():r;if(null==t||!1===t)return void $(i,B(f));const n=s!==v?s:B((()=>o(t,{value:f(),refetching:e})));return(l=n)&&"object"==typeof l&&"then"in l?(i=n,"value"in n?("success"===n.status?$(i,n.value,void 0,t):$(i,void 0,void 0,t),n):(a=!0,queueMicrotask((()=>a=!1)),M((()=>{w(c?"refreshing":"pending"),y()}),!1),n.then((e=>$(n,e,void 0,t)),(e=>$(n,void 0,R(e),t))))):($(i,n,void 0,t),n);var l}return Object.defineProperties(A,{state:{get:()=>k()},error:{get:()=>p()},loading:{get(){const e=k();return"pending"===e||"refreshing"===e}},latest:{get(){if(!c)return A();const e=p();if(e&&!i)throw e;return f()}}}),u?C((()=>S(!1))):S(!1),[A,{refetch:S,mutate:g}]}function B(e){if(null===b)return e();const t=b;b=null;try{return e()}finally{b=t}}function T(e){return null===m||(null===m.cleanups?m.cleanups=[e]:m.cleanups.push(e)),e}function E(){return b}function _(){if(this.sources&&this.state)if(this.state===g)D(this);else{const e=k;k=null,M((()=>V(this)),!1),k=e}if(b){const e=this.observers?this.observers.length:0;b.sources?(b.sources.push(this),b.sourceSlots.push(e)):(b.sources=[this],b.sourceSlots=[e]),this.observers?(this.observers.push(b),this.observerSlots.push(b.sources.length-1)):(this.observers=[b],this.observerSlots=[b.sources.length-1])}return this.value}function L(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&M((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=y&&y.running;r&&y.disposed.has(n),(r?n.tState:n.state)||(n.pure?k.push(n):w.push(n),n.observers&&U(n)),r||(n.state=g)}if(k.length>1e6)throw k=[],new Error}),!1)),t}function D(e){if(!e.fn)return;K(e);const t=$;!function(e,t,n){let r;const o=m,l=b;b=m=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=g,e.owned&&e.owned.forEach(K),e.owned=null),e.updatedAt=n+1,z(i)}finally{b=l,m=o}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?L(e,r):e.value=r,e.updatedAt=n)}(e,e.value,t)}function I(e,t,n,r=g,o){const l={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return null===m||m!==h&&(m.owned?m.owned.push(l):m.owned=[l]),l}function q(e){if(0===e.state)return;if(e.state===p)return V(e);if(e.suspense&&B(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<$);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===g)D(e);else if(e.state===p){const n=k;k=null,M((()=>V(e,t[0])),!1),k=n}}function M(e,t){if(k)return e();let n=!1;t||(k=[]),w?n=!0:w=[],$++;try{const t=e();return function(e){k&&(N(k),k=null);if(e)return;const t=w;w=null,t.length&&M((()=>f(t)),!1)}(n),t}catch(r){n||(w=null),k=null,z(r)}}function N(e){for(let t=0;t<e.length;t++)q(e[t])}function H(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:q(r)}for(t=0;t<n;t++)q(e[t])}function V(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===g?r!==t&&(!r.updatedAt||r.updatedAt<$)&&q(r):e===p&&V(r,t)}}}function U(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=p,n.pure?k.push(n):w.push(n),n.observers&&U(n))}}function K(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)K(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function R(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function z(e,t=m){throw R(e)}const F=Symbol("fallback");function G(e){for(let t=0;t<e.length;t++)e[t]()}function Y(e,t){return B((()=>e(t||{})))}function Z(e){const t="fallback"in e&&{fallback:()=>e.fallback};return P(function(e,t,n={}){let r=[],o=[],l=[],i=0,s=t.length>1?[]:null;return T((()=>G(l))),()=>{let a,c,d=e()||[];return d[u],B((()=>{let e,t,u,g,p,h,v,m,y,b=d.length;if(0===b)0!==i&&(G(l),l=[],r=[],o=[],i=0,s&&(s=[])),n.fallback&&(r=[F],o[0]=A((e=>(l[0]=e,n.fallback()))),i=1);else if(0===i){for(o=new Array(b),c=0;c<b;c++)r[c]=d[c],o[c]=A(f);i=b}else{for(u=new Array(b),g=new Array(b),s&&(p=new Array(b)),h=0,v=Math.min(i,b);h<v&&r[h]===d[h];h++);for(v=i-1,m=b-1;v>=h&&m>=h&&r[v]===d[m];v--,m--)u[m]=o[v],g[m]=l[v],s&&(p[m]=s[v]);for(e=new Map,t=new Array(m+1),c=m;c>=h;c--)y=d[c],a=e.get(y),t[c]=void 0===a?-1:a,e.set(y,c);for(a=h;a<=v;a++)y=r[a],c=e.get(y),void 0!==c&&-1!==c?(u[c]=o[a],g[c]=l[a],s&&(p[c]=s[a]),c=t[c],e.set(y,c)):l[a]();for(c=h;c<b;c++)c in u?(o[c]=u[c],l[c]=g[c],s&&(s[c]=p[c],s[c](c))):o[c]=A(f);o=o.slice(0,i=b),r=d.slice(0)}return o}));function f(e){if(l[c]=e,s){const[e,n]=x(c);return s[c]=n,t(d[c],e)}return t(d[c])}}}((()=>e.each),e.children,t||void 0))}function W(e){const t=e.keyed,n=P((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return P((()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?B((()=>o(t?r:()=>{if(!B(n))throw`Stale read from <${"Show"}>.`;return e.when}))):o}return e.fallback}),void 0,void 0)}const X="_$DX_DELEGATE";function J(e,t,n,r={}){let o;return A((r=>{o=r,t===document?e():re(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}function Q(e,t,n){let r;const o=()=>(r||(r=(()=>{const t=document.createElement("template");return t.innerHTML=e,t.content.firstChild})())).cloneNode(!0);return o.cloneNode=o,o}function ee(e,t=window.document){const n=t[X]||(t[X]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,oe))}}function te(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function ne(e,t,n,r){Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n}function re(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return le(e,t,r,n);S((r=>le(e,t(),r,n)),r)}function oe(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n||document});n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(void 0!==o?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function le(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const l=typeof t,i=void 0!==r;if(e=i&&n[0]&&n[0].parentNode||e,"string"===l||"number"===l)if("number"===l&&(t=t.toString()),i){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=ae(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"===l)n=ae(e,n,r);else{if("function"===l)return S((()=>{let o=t();for(;"function"==typeof o;)o=o();n=le(e,o,n,r)})),()=>n;if(Array.isArray(t)){const l=[],s=n&&Array.isArray(n);if(ie(l,t,n,o))return S((()=>n=le(e,l,n,r,!0))),()=>n;if(0===l.length){if(n=ae(e,n,r),i)return n}else s?0===n.length?se(e,l,r):function(e,t,n){let r=n.length,o=t.length,l=r,i=0,s=0,a=t[o-1].nextSibling,c=null;for(;i<o||s<l;)if(t[i]!==n[s]){for(;t[o-1]===n[l-1];)o--,l--;if(o===i){const t=l<r?s?n[s-1].nextSibling:n[l-s]:a;for(;s<l;)e.insertBefore(n[s++],t)}else if(l===s)for(;i<o;)c&&c.has(t[i])||t[i].remove(),i++;else if(t[i]===n[l-1]&&n[s]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[s++],t[i++].nextSibling),e.insertBefore(n[--l],r),t[o]=n[l]}else{if(!c){c=new Map;let e=s;for(;e<l;)c.set(n[e],e++)}const r=c.get(t[i]);if(null!=r)if(s<r&&r<l){let a,u=i,d=1;for(;++u<o&&u<l&&null!=(a=c.get(t[u]))&&a===r+d;)d++;if(d>r-s){const o=t[i];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[i++])}else i++;else t[i++].remove()}}else i++,s++}(e,n,l):(n&&ae(e),se(e,l));n=l}else if(t.nodeType){if(Array.isArray(n)){if(i)return n=ae(e,n,r,t);ae(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function ie(e,t,n,r){let o=!1;for(let l=0,i=t.length;l<i;l++){let i,s=t[l],a=n&&n[e.length];if(null==s||!0===s||!1===s);else if("object"==(i=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))o=ie(e,s,a)||o;else if("function"===i)if(r){for(;"function"==typeof s;)s=s();o=ie(e,Array.isArray(s)?s:[s],Array.isArray(a)?a:[a])||o}else e.push(s),o=!0;else{const t=String(s);a&&3===a.nodeType&&a.data===t?e.push(a):e.push(document.createTextNode(t))}}return o}function se(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ae(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let l=t.length-1;l>=0;l--){const i=t[l];if(o!==i){const t=i.parentNode===e;r||l?t&&i.remove():t?e.replaceChild(o,i):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}var ce=Q('<div class=atk-auth-dialog-title><div class=atk-text></div><div class="atk-close atk-icon-close atk-icon">'),ue=Q('<div class="atk-back-btn atk-icon atk-icon-arrow-left">');const de=e=>{const{title:t,showBackBtn:n,onBack:r,onClose:o}=e;return i=ce(),s=i.firstChild,a=s.nextSibling,re(i,(l=P((()=>!!(null==n?void 0:n()))),()=>{return l()&&(ne(e=ue(),"click",r),e);var e}),s),re(s,t),a.$$click=()=>o(),i;var l,i,s,a};ee(["click"]);var fe=Q('<div class=atk-auth-plugin-dialog-wrap><div class=atk-auth-plugin-dialog><div class="atk-view-wrap atk-slim-scrollbar">');const ge=e=>{const t=e,{showBackBtn:n,onBack:r,onClose:o,title:l}=t,i=s(t,["showBackBtn","onBack","onClose","title"]);return a=fe(),c=a.firstChild,u=c.firstChild,re(c,Y(de,{title:l,showBackBtn:n,onBack:r,onClose:o}),u),re(u,(()=>{var e;return null==(e=i.children)?void 0:e.call(i)})),re(a,(()=>{var e;return null==(e=i.extras)?void 0:e.call(i)}),null),S((()=>te(c,"data-dialog-name",e.name))),a;var a,c,u};let pe=null,he=null;const ve=()=>{pe&&clearInterval(pe),he&&window.removeEventListener("message",he)},me=(e,t)=>{const{user:n,token:r}=t;e.get("user").update({nick:n.name,email:n.email,link:n.link,isAdmin:n.is_admin,token:r})},ye=(e,t)=>{e.get("user").update({token:t}),e.getApi().user.getUser().then((t=>{const{user:n}=t.data;e.get("user").update({nick:n.name,email:n.email,link:n.link,isAdmin:n.is_admin})}))};var be=Q("<div class=atk-methods>"),ke=Q("<div class=atk-method-item><div class=atk-method-icon></div><div class=atk-method-text>"),we=Q("<div class=atk-methods-page>");const $e=e=>{const{ctx:t,methods:n}=e;e.changeTitle(t.$t("signIn"));const r=n=>{n.onClick?n.onClick():n.link&&(()=>{a(this,null,(function*(){const r=/^(http|https):\/\//.test(n.link)?n.link:`${t.getConf().server}${n.link}`,{token:o}=yield((e,t)=>{ve();const n=(window.innerWidth-1020)/2,r=(window.innerHeight-618)/2,o=window.open(t,"_blank",`width=1020,height=618,left=${n},top=${r},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);return new Promise(((e,t)=>{pe=setInterval((()=>{if(null==o?void 0:o.closed)return ve(),void t(new Error("Login canceled"));null==o||o.postMessage({type:"ATK_LOGIN"},"*")}),1e3),he=({data:t})=>{"ATK_AUTH_CALLBACK"===t.type&&t.payload&&(ve(),null==o||o.close(),e({token:t.payload}))},window.addEventListener("message",he)}))})(0,r);ye(t,o),e.onComplete()}))})()};O((()=>{var e;if(1===(null==(e=n())?void 0:e.length)){const e=n()[0];r(e)}}));const o=(re(l=be(),Y(Z,{get each(){return n()},children:e=>{return t=ke(),n=t.firstChild,o=n.nextSibling,t.$$click=()=>r(e),re(o,(()=>e.label)),S((r=>{var o=e.name,l=`url('${e.icon}')`;return o!==r.e&&te(t,"data-method",r.e=o),l!==r.t&&(null!=(r.t=l)?n.style.setProperty("background-image",l):n.style.removeProperty("background-image")),r}),{e:void 0,t:void 0}),t;var t,n,o}})),l);var l,i;return re(i=we(),o),i};ee(["click"]);const Ae=Symbol("store-raw"),xe=Symbol("store-node"),Ce=Symbol("store-has"),Se=Symbol("store-self");function Oe(e){let t=e[c];if(!t&&(Object.defineProperty(e,c,{value:t=new Proxy(e,_e)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,l=n.length;o<l;o++){const l=n[o];r[l].get&&Object.defineProperty(e,l,{enumerable:r[l].enumerable,get:r[l].get.bind(t)})}}return t}function Pe(e){let t;return null!=e&&"object"==typeof e&&(e[c]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function je(e,t=new Set){let n,r,o,l;if(n=null!=e&&e[Ae])return n;if(!Pe(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,l=e.length;n<l;n++)o=e[n],(r=je(o,t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),i=Object.getOwnPropertyDescriptors(e);for(let s=0,a=n.length;s<a;s++)l=n[s],i[l].get||(o=e[l],(r=je(o,t))!==o&&(e[l]=r))}return e}function Be(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Te(e,t,n){if(e[t])return e[t];const[r,o]=x(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ee(e){E()&&Te(Be(e,xe),Se)()}const _e={get(e,t,n){if(t===Ae)return e;if(t===c)return n;if(t===u)return Ee(e),n;const r=Be(e,xe),o=r[t];let l=o?o():e[t];if(t===xe||t===Ce||"__proto__"===t)return l;if(!o){const n=Object.getOwnPropertyDescriptor(e,t);!E()||"function"==typeof l&&!e.hasOwnProperty(t)||n&&n.get||(l=Te(r,t,l)())}return Pe(l)?Oe(l):l},has:(e,t)=>t===Ae||t===c||t===u||t===xe||t===Ce||"__proto__"===t||(E()&&Te(Be(e,Ce),t)(),t in e),set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return Ee(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==c&&t!==xe?(delete n.value,delete n.writable,n.get=()=>e[c][t],n):n}};function Le(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],l=e.length;void 0===n?(delete e[t],e[Ce]&&e[Ce][t]&&void 0!==o&&e[Ce][t].$()):(e[t]=n,e[Ce]&&e[Ce][t]&&void 0===o&&e[Ce][t].$());let i,s=Be(e,xe);if((i=Te(s,t,o))&&i.$((()=>n)),Array.isArray(e)&&e.length!==l){for(let t=e.length;t<l;t++)(i=s[t])&&i.$();(i=Te(s,"length",l))&&i.$(e.length)}(i=s[Se])&&i.$()}function De(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Le(e,o,t[o])}}function Ie(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const l=typeof r,i=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o<r.length;o++)Ie(e,[r[o]].concat(t),n);return}if(i&&"function"===l){for(let o=0;o<e.length;o++)r(e[o],o)&&Ie(e,[o].concat(t),n);return}if(i&&"object"===l){const{from:o=0,to:l=e.length-1,by:i=1}=r;for(let r=o;r<=l;r+=i)Ie(e,[r].concat(t),n);return}if(t.length>1)return void Ie(e[r],t,[r].concat(n));o=e[r],n=[r].concat(n)}let l=t[0];"function"==typeof l&&(l=l(o,n),l===o)||void 0===r&&null==l||(l=je(l),void 0===r||Pe(o)&&Pe(l)&&!Array.isArray(l)?De(o,l):Le(e,r,l))}function qe(...[e,t]){const n=je(e||{}),r=Array.isArray(n);return[Oe(n),function(...e){M((()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=je(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const r=t[n];e[n]!==r&&Le(e,n,r)}Le(e,"length",r)}else De(e,t)}(n,e[0]):Ie(n,e)}),!1)}]}var Me=Q("<div class=atk-login-page><form class=atk-form><input type=email name=email required><input type=password name=password required><button type=submit></button><div class=atk-form-bottom> <span class=atk-link>");const Ne=e=>{const{ctx:t,onRegisterNowClick:n}=e;e.changeTitle(t.$t("signIn"));const[r,o]=qe({email:"",password:""}),l=n=>{n.preventDefault(),t.getApi().auth.loginByEmail(r).then((n=>{me(t,n.data),e.onComplete()})).catch((e=>{alert(e.message)}))};return i=Me(),s=i.firstChild,a=s.firstChild,c=a.nextSibling,u=c.nextSibling,d=u.nextSibling,f=d.firstChild,g=f.nextSibling,s.addEventListener("submit",l),a.$$input=e=>o("email",e.target.value.trim()),c.$$input=e=>o("password",e.target.value.trim()),re(u,(()=>t.$t("signIn"))),re(d,(()=>t.$t("noAccountPrompt")),f),g.$$click=()=>n(),re(g,(()=>t.$t("signUp"))),S((e=>{var n=t.$t("email"),r=t.$t("password");return n!==e.e&&te(a,"placeholder",e.e=n),r!==e.t&&te(c,"placeholder",e.t=r),e}),{e:void 0,t:void 0}),i;var i,s,a,c,u,d,f,g};ee(["input","click"]);var He=Q('<div class="atk-send-verify-btn atk-input-grp-btn">');const Ve=e=>{const{ctx:t,onSend:n,getEmail:r}=e,[o,l]=x(t.$t("verifySend"));let i=!1,s=null,a=60;const c=()=>{i||(i=!0,t.getApi().auth.sendVerifyEmail({email:r()}).then((()=>{s&&clearInterval(s),s=setInterval((()=>{if(a<=0)return clearInterval(s),l(t.$t("verifyResend")),void(i=!1);a--,l(t.$t("waitSeconds",{seconds:`${a}`}))}),1e3),null==n||n()})).catch((e=>{i=!1,alert(e.message)})))};return(u=He()).$$click=c,re(u,o),u;var u};ee(["click"]);var Ue=Q("<input type=text name=username required>"),Ke=Q("<input type=password name=password required>"),Re=Q("<input type=password name=re_password required>"),ze=Q("<div class=atk-register-page><form class=atk-form><div class=atk-input-grp><input type=email name=email required></div><input type=text name=code required><button type=submit></button><div class=atk-form-bottom> <span class=atk-link></span> | <span>"),Fe=Q("<span class=atk-link>");const Ge=e=>{const{ctx:t,onLoginNowClick:n}=e,[r,o]=x("register"),[l,i]=qe({email:"",code:"",username:"",password:""});O((()=>{"register"===r()?e.changeTitle(t.$t("signUp")):e.changeTitle(t.$t("resetPassword")),i({email:"",code:"",username:"",password:""})}));const s=o=>{o.preventDefault();const i="register"===r()?{email:l.email,code:l.code,name:l.username,password:l.password}:{email:l.email,code:l.code,password:l.password};t.getApi().auth.registerByEmail(i).then((o=>{"register"===r()?(me(t,o.data),e.onComplete()):n()})).catch((e=>{alert(e.message)}))};return u=ze(),d=u.firstChild,f=d.firstChild,g=f.firstChild,p=f.nextSibling,h=p.nextSibling,v=h.nextSibling,m=v.firstChild,y=m.nextSibling,b=y.nextSibling.nextSibling,d.addEventListener("submit",s),re(d,Y(W,{get when(){return"register"===r()},get children(){return[(n=Ue(),n.$$input=e=>i("username",e.target.value.trim()),S((()=>te(n,"placeholder",t.$t("username")))),S((()=>n.value=l.username)),n),(e=Ke(),e.$$input=e=>i("password",e.target.value.trim()),S((()=>te(e,"placeholder",t.$t("password")))),S((()=>e.value=l.password)),e)];var e,n}}),f),g.$$input=e=>i("email",e.target.value.trim()),re(f,Y(Ve,{ctx:t,getEmail:()=>l.email}),null),p.$$input=e=>i("code",e.target.value.trim()),re(d,Y(W,{get when(){return"forget"===r()},get children(){var e=Re();return e.$$input=e=>i("password",e.target.value.trim()),S((()=>te(e,"placeholder",t.$t("resetPassword")))),S((()=>e.value=l.password)),e}}),h),re(h,(()=>t.$t("nextStep"))),re(v,(()=>t.$t("haveAccountPrompt")),m),y.$$click=()=>n(),re(y,(()=>t.$t("signIn"))),re(b,(a=P((()=>"register"===r())),()=>{return a()&&((e=Fe()).$$click=()=>o("forget"),re(e,(()=>t.$t("forgetPassword"))),e);var e}),null),re(b,(c=P((()=>"forget"===r())),()=>{return c()&&((e=Fe()).$$click=()=>o("register"),re(e,(()=>t.$t("signUp"))),e);var e}),null),S((e=>{var n=t.$t("email"),r=t.$t("verificationCode");return n!==e.e&&te(g,"placeholder",e.e=n),r!==e.t&&te(p,"placeholder",e.t=r),e}),{e:void 0,t:void 0}),S((()=>g.value=l.email)),S((()=>p.value=l.code)),u;var a,c,u,d,f,g,p,h,v,m,y,b};ee(["input","click"]);const Ye=e=>{const t=e.get("layerManager").create("login");return{show:e=>{const n=document.createElement("div");J((()=>e(t)),n),t.getEl().append(n.firstChild),t.show()}}};var Ze=Q('<div class=atk-dialog-footer><div class="atk-btn atk-btn-no"></div><div class="atk-btn atk-btn-yes">');const We=e=>{return t=Ze(),n=t.firstChild,r=n.nextSibling,ne(n,"click",e.onNo),re(n,(()=>e.noText)),r.$$click=()=>{var t,n;return!(null==(t=e.yesDisabled)?void 0:t.call(e))&&(null==(n=e.onYes)?void 0:n.call(e))},re(r,(()=>e.yesText)),S((()=>{var t;return r.classList.toggle("disabled",!!(null==(t=e.yesDisabled)?void 0:t.call(e)))})),t;var t,n,r};ee(["click"]);var Xe=Q("<div class=atk-merge-confirm-page><div class=atk-text></div><div class=atk-usernames></div><div class=atk-text>"),Je=Q("<div class=atk-item><div class=atk-username>");const Qe=e=>{const{usernames:t,ctx:n,onClose:r}=e,[o,l]=x("");return s=Xe(),a=s.firstChild,c=a.nextSibling,u=c.nextSibling,re(a,(()=>n.$t("accountMergeNotice"))),re(c,(()=>t.map((e=>{return t=Je(),n=t.firstChild,t.$$click=()=>(e=>{l(o()!==e?e:"")})(e),re(n,e),S((()=>t.classList.toggle("active",!(o()!==e)))),t;var t,n})))),re(u,(i=P((()=>!o())),()=>i()?n.$t("accountMergeSelectOne"):n.$t("accountMergeConfirm",{id:o()}))),re(s,Y(We,{get noText(){return n.$t("dismiss")},get yesText(){return n.$t("merge")},onNo:()=>{r()},onYes:()=>{n.getApi().auth.applyDataMerge({user_name:o()}).then((({data:e})=>{ye(n,e.user_token),r()}))},yesDisabled:()=>!o()}),null),s;var i,s,a,c,u};ee(["click"]);const et=e=>{const t=e,{ctx:n,onClose:r}=t,o=(s(t,["ctx","onClose"]),{confirm:()=>Y(Qe,{get usernames(){return e.usernames},ctx:n,onClose:r})}),[l,i]=x("confirm");return Y(ge,{name:"merge",onClose:r,title:()=>"Merge Tool",children:()=>o[l()]()})};var tt=Q("<div class=atk-skip-btn>");const nt=e=>{const t=e,{ctx:n,onClose:r,onSkip:o}=t,[l,i]=(s(t,["ctx","onClose","onSkip"]),x(!1)),[c]=j((()=>a(this,null,(function*(){const{data:e}=yield n.getApi().conf.getSocialLoginProviders();return i(e.anonymous),e.providers.map((({name:e,label:t,icon:n,path:r})=>{const o={name:e,label:t,icon:n,link:r};return"email"===e&&(o.onClick=()=>v("login")),o})).sort(((e,t)=>"email"===e.name?-1:"email"===t.name?1:e.label.localeCompare(t.label)))})))),[u,d]=x("Login"),f=()=>{r(),n.get("editor").getUI().$header.style.display="none",n.getApi().auth.checkDataMerge().then((({data:e})=>{e.need_merge&&setTimeout((()=>{Ye(n).show((t=>Y(et,{ctx:n,onClose:()=>t.destroy(),get usernames(){return e.user_names}})))}),500)}))},g={methods:()=>Y($e,{ctx:n,methods:c,changeTitle:d,onComplete:f}),login:()=>Y(Ne,{ctx:n,onRegisterNowClick:()=>v("register"),changeTitle:d,onComplete:f}),register:()=>Y(Ge,{ctx:n,onLoginNowClick:()=>v("login"),changeTitle:d,onComplete:f})},p="methods",[h,v]=x(p);return Y(ge,{showBackBtn:()=>{var e;return h()!==p&&!("login"==h()&&1===(null==(e=c())?void 0:e.length))},onBack:()=>{v(p)},onClose:r,title:u,extras:()=>Y(W,{get when(){return l()},get children(){var e=tt();return e.$$click=()=>{o(),r()},re(e,(()=>n.$t("skipNotVerify"))),e}}),children:()=>g[h()]()})};ee(["click"]);var rt=Q('<div class=atk-editor-user><div class="atk-user-profile-btn atk-user-btn"><div class=atk-name></div></div><div class="atk-logout atk-user-btn"aria-label=Logout><svg stroke=currentColor fill=currentColor height=1em width=1em stroke-width=0 viewBox="-6 -6 36 36"xmlns=http://www.w3.org/2000/svg><path d="M5 22C4.44772 22 4 21.5523 4 21V3C4 2.44772 4.44772 2 5 2H19C19.5523 2 20 2.44772 20 3V6H18V4H6V20H18V18H20V21C20 21.5523 19.5523 22 19 22H5ZM18 16V13H11V11H18V8L23 12L18 16Z">'),ot=Q("<div class=atk-editor-user-wrap>");const lt=({ctx:e})=>{const t=()=>{window.confirm(e.$t("logoutConfirm"))&&e.get("user").update({token:"",nick:"",email:"",link:"",isAdmin:!1})},n=()=>((e,t)=>{for(var n in t||(t={}))o.call(t,n)&&i(e,n,t[n]);if(r)for(var n of r(t))l.call(t,n)&&i(e,n,t[n]);return e})({},e.get("user").getData()),[s,a]=x(n()),c=e=>{a(n())};return e.on("user-changed",c),T((()=>{e.off("user-changed",c)})),re(u=ot(),Y(W,{get when(){return s().token},get children(){var e=rt(),n=e.firstChild,r=n.firstChild,o=n.nextSibling;return re(r,(()=>s().nick)),o.$$click=t,e}})),u;var u};ee(["click"]);const it=e=>{e.getApiHandlers().add("need_auth_login",(()=>{throw o(),new Error("Login required")}));let t=!1;const n=()=>{e.get("editor").getUI().$submitBtn.innerText=e.get("user").getData().token||t?e.conf.sendBtn||e.$t("send"):e.$t("signIn")};e.watchConf(["locale","sendBtn"],(()=>n())),e.on("user-changed",(()=>n())),e.on("mounted",(()=>{e.get("editor").getUI().$header.style.display="none",(e=>{const t=e.get("editor");if(!t.getEl().querySelector(".atk-editor-user-wrap")){const n=document.createElement("div");J((()=>Y(lt,{ctx:e})),n),t.getUI().$header.after(n)}})(e)}));const r=()=>{e.get("editor").getUI().$header.style.display="",e.get("editor").getUI().$nick.focus(),e.updateConf({beforeSubmit:void 0}),t=!0,n()},o=()=>{Ye(e).show((t=>Y(nt,{ctx:e,onClose:()=>t.destroy(),onSkip:r})))};e.updateConf({beforeSubmit:(t,n)=>{e.get("user").getData().token?n():o()}})};window&&(!window.ArtalkPlugins&&(window.ArtalkPlugins={}),window.ArtalkPlugins.Auth=it,null==(t=window.Artalk)||t.use(it)),e.ArtalkAuthPlugin=it,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));