@jant/core 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/{app-Gt7_skt6.js → app-CKQ9PqAr.js} +791 -89
  2. package/dist/client/.vite/manifest.json +115 -75
  3. package/dist/client/_assets/chunks/{confirm-D7GrwsCN.js → confirm-CMe01lne.js} +1 -1
  4. package/dist/client/_assets/chunks/{create-editor-5Y49x7h5.js → create-editor-BQkrw8Ax.js} +4 -4
  5. package/dist/client/_assets/chunks/footnote-rail-B08scyhW.js +2 -0
  6. package/dist/client/_assets/chunks/{jant-locale-picker-DL6mIOT5.js → jant-locale-picker-2L4rkDaz.js} +1 -1
  7. package/dist/client/_assets/chunks/lit-Bw_voPoW.js +2 -0
  8. package/dist/client/_assets/chunks/preload-helper-Czpn1I53.js +1 -0
  9. package/dist/client/_assets/chunks/runtime-paths-y0_gHowM.js +1 -0
  10. package/dist/client/_assets/chunks/{settings-paths-h6RjIe3C.js → settings-paths-B0bNUaih.js} +1 -1
  11. package/dist/client/_assets/chunks/slug-format-CYmQE5ln.js +1 -0
  12. package/dist/client/_assets/chunks/{sortable-list-DWNKv782.js → sortable-list-t11Ma1Ek.js} +1 -1
  13. package/dist/client/_assets/chunks/{unsafe-html-B5ZEXaxg.js → unsafe-html-CWos3v6N.js} +1 -1
  14. package/dist/client/_assets/chunks/unsafe-svg-DZl-yjas.js +1 -0
  15. package/dist/client/_assets/client-B0-s9sqx.css +2 -0
  16. package/dist/client/_assets/client-Dp46QSht.js +354 -0
  17. package/dist/client/_assets/client-auth-CG55rWb5.js +859 -0
  18. package/dist/client/_assets/{client-compose-oxzPb3SS.js → client-compose-DkUTuavR.js} +261 -261
  19. package/dist/client/_assets/{client-manage-C1eDB1Rc.js → client-manage-DnYdQAhf.js} +176 -176
  20. package/dist/client/_assets/{client-settings-DIM44Zqh.js → client-settings-CHgsIqXJ.js} +166 -166
  21. package/dist/client/_assets/client-share-0DICJjAc.css +1 -0
  22. package/dist/client/_assets/client-share-C59mOLJ1.js +149 -0
  23. package/dist/index.js +1 -1
  24. package/dist/node.js +2 -2
  25. package/package.json +2 -1
  26. package/src/client/components/jant-post-menu.ts +80 -13
  27. package/src/client/components/jant-share-dialog.ts +422 -0
  28. package/src/client/components/jant-share-menu.ts +188 -0
  29. package/src/client/lazy-entries.ts +21 -1
  30. package/src/client/post-menu-shared.ts +100 -0
  31. package/src/client/share-capture.ts +443 -0
  32. package/src/client/share-launch.ts +133 -0
  33. package/src/client-share.ts +8 -0
  34. package/src/client.ts +1 -0
  35. package/src/lib/discover.ts +31 -0
  36. package/src/lib/share-card.ts +653 -0
  37. package/src/lib/version.ts +2 -0
  38. package/src/routes/auth/setup.tsx +37 -1
  39. package/src/routes/pages/partials.tsx +23 -0
  40. package/src/style-share.css +16 -0
  41. package/src/styles/components.css +14 -0
  42. package/src/styles/share.css +1103 -0
  43. package/src/styles/ui.css +6 -0
  44. package/src/ui/layouts/BaseLayout.tsx +7 -0
  45. package/src/ui/layouts/SiteLayout.tsx +1 -0
  46. package/src/ui/share/ShareCard.tsx +298 -0
  47. package/src/ui/shared/Icon.tsx +23 -3
  48. package/src/ui/shared/MediaGallery.tsx +12 -1
  49. package/src/ui/shared/PostFooter.tsx +20 -4
  50. package/src/ui/shared/icon-collector.ts +28 -0
  51. package/src/ui/shared/post-article-attributes.ts +3 -0
  52. package/dist/client/_assets/chunks/footnote-rail-BJwswtVQ.js +0 -1
  53. package/dist/client/_assets/chunks/lit-DW8VmJAT.js +0 -2
  54. package/dist/client/_assets/chunks/slug-format-Dsi0e9Xn.js +0 -1
  55. package/dist/client/_assets/chunks/unsafe-svg-DTZZEvLU.js +0 -2
  56. package/dist/client/_assets/client-BaqmpPQ-.css +0 -2
  57. package/dist/client/_assets/client-C6melOtG.js +0 -296
  58. package/dist/client/_assets/client-auth-Ccq8kSqq.js +0 -828
@@ -0,0 +1 @@
1
+ function e(e){if(e===`/`||e===``)return``;let t=e.replace(/\/+$/,``);return t.startsWith(`/`)?t:`/${t}`}function t(t){return e(t)}function n(e){return e.trim().toLowerCase().replace(/^\/+|\/+$/g,``).replace(/\/+/g,`/`)}function r(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}function i(e,t){if(!t||!r(e))return null;let n,i;try{n=new URL(e),i=new URL(t)}catch{return null}return n.hostname===i.hostname?`${n.pathname}${n.search}${n.hash}`||`/`:null}var a=/^[a-z][a-z0-9+.-]*:/i;function o(e){let t=e.trim();return t.startsWith(`/`)||r(t)}function s(e,n={}){let o=e.trim();if(!o)return null;let{siteOrigins:s=[],sitePathPrefix:l=``,languagePrefixes:u=[],keepQuery:d=!1}=n,f=r(o),p=null;if(f){for(let e of s){let t=i(o,e);if(t!==null){p=t;break}}if(p===null)return null}else if(o.startsWith(`//`)||a.test(o)||o.startsWith(`#`))return null;else p=o;let m;try{m=new URL(p,`https://jant.invalid`)}catch{return null}let h=_(m.pathname,t(l));if(h===null&&f)return null;let g=c(h??m.pathname,u),v=g.length>1?g.replace(/\/+$/,``)||`/`:g;return d?`${v}${m.search}${m.hash}`:v}function c(e,t){if(t.length===0)return e;let n=e.startsWith(`/`)?e.slice(1):e,r=n.indexOf(`/`),i=(r===-1?n:n.slice(0,r)).toLowerCase();return!i||!t.some(e=>e.toLowerCase()===i)?e:r===-1?`/`:n.slice(r)}var l=new Set([`http:`,`https:`,`mailto:`]),u=new Set([...l,`tel:`,`sms:`]);function d(e,t){try{let n=new URL(e,`https://placeholder.invalid`);return t.has(n.protocol)?e:``}catch{return``}}function f(e){let t=e.trim();if(!t)return!1;try{let e=new URL(t);return l.has(e.protocol)}catch{return!1}}function p(e){return d(e,l)}function m(e){return d(e,u)}function h(e,t=``){if(!e)return t||`/`;let n=e.startsWith(`/`)?e:`/${e}`;return!t||n===t||n.startsWith(`${t}/`)?n:n===`/`?t:`${t}${n}`}function g(e,t=``){return e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)||e.startsWith(`mailto:`)||e.startsWith(`tel:`)||e.startsWith(`#`)?e:h(e,t)}function _(e,t){return t?e===t?`/`:e.startsWith(`${t}/`)?e.slice(t.length)||`/`:null:e||`/`}var v=`/_assets`;function y(e){let t=e.trim().replace(/\/+$/,``);return t?t.startsWith(`http://`)||t.startsWith(`https://`)||t.startsWith(`/`)?t:`/${t}`:v}function b(e,t=v){let n=y(t),r=e.replace(/^\/+/,``);return r?`${n}/${r}`:n}function x(e,t=v){let n=y(t);return e===n||e.startsWith(`${n}/`)}function S(e,t){if(t.startsWith(`http://`)||t.startsWith(`https://`)){if(!x(e))return e;let n=e.slice(v.length).replace(/^\/+/,``),r=t.replace(/\/+$/,``);return n?`${r}/${n}`:r}return x(e,t)||!x(e)?e:b(e.slice(v.length).replace(/^\/+/,``),t)}var C=new Set([`/`,`/feed`,`/latest`,`/featured`,`/archive`,`/search`,`/subscribe`,`/collections`]),w=[`/latest/`,`/featured/`,`/archive/`],T=`/collections/`;function E(e){let t=e.slice(13);if(!t)return!1;let n=t.split(`/`);return n[0]===``?!1:n.length===1||n.length===2&&n[1]===`feed`}function D(e){let t=e.split(/[?#]/,1)[0]??e;return C.has(t)?!0:t.startsWith(T)?E(t):w.some(e=>t.startsWith(e))}function O(){return document.documentElement.dataset.sitePathPrefix||``}function k(){return document.documentElement.dataset.assetBasePath||v}function A(){let e=document.documentElement.dataset.viewBasePath;return e===void 0?O():e}function j(){return document.documentElement.dataset.viewLang||void 0}function M(e){return x(e)?S(e,k()):g(e,O())}function N(e){return x(e)?S(e,k()):g(e,A())}function P(e){return D(e)?N(e):M(e)}function F(e){if(typeof e==`string`){if(/^https?:\/\//.test(e)){let t=new URL(e);return t.origin===window.location.origin?(t.pathname=M(t.pathname),t.toString()):e}return M(e)}if(e instanceof URL){if(e.origin!==window.location.origin)return e;let t=new URL(e.toString());return t.pathname=M(t.pathname),t}let t=new URL(e.url);return t.origin===window.location.origin?(t.pathname=M(t.pathname),new Request(t.toString(),e)):e}function I(){let e=globalThis.fetch;if(e.__jantPrefixed)return;let t=(t,n)=>e(F(t),n);t.__jantPrefixed=!0,globalThis.fetch=t}export{j as a,f as c,m as d,p as f,O as i,o as l,P as n,N as o,s as p,M as r,r as s,I as t,n as u};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/chunks/slugify-DlHLyUHS.js","_assets/chunks/rolldown-runtime-hePW80VL.js"])))=>i.map(i=>d[i]);
2
- import{h as e,i as t,n,t as r}from"./lit-DW8VmJAT.js";import{i,n as a,t as o}from"./slug-format-Dsi0e9Xn.js";import"./types-D5iF3H1a.js";var s=`/collections`;function c(e){return e.includes(`+`)}function l(){return s}function u(e){return`/${e}`}function d(e){return c(e)?`${s}/${e}`:u(e)}var f,p;function m(){return f?Promise.resolve(f):(p||=i(()=>import(`./slugify-DlHLyUHS.js`).then(e=>(f=e.slugify,e.slugify)),__vite__mapDeps([0,1])),p)}async function h(e){return(await m())(e)}var g=class extends r{static properties={labels:{type:Object},initial:{type:Object},action:{type:String},_title:{state:!0},_slug:{state:!0},_showSlugEditor:{state:!0},_slugEdited:{state:!0},_suggestedSlug:{state:!0},_loading:{state:!0}};#e=!1;#t=null;createRenderRoot(){return this.innerHTML=``,this}constructor(){super(),this.labels={},this.initial={title:``,slug:``},this.action=``,this._title=``,this._slug=``,this._showSlugEditor=!1,this._slugEdited=!1,this._suggestedSlug=``,this._loading=!1}connectedCallback(){super.connectedCallback(),this.#t=e=>{e.isComposing||e.keyCode===229||(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),this.#d(e))},this.addEventListener(`keydown`,this.#t)}disconnectedCallback(){this.#t&&=(this.removeEventListener(`keydown`,this.#t),null),super.disconnectedCallback()}update(e){(!this.#e||e.has(`initial`))&&this.#n(),super.update(e)}set loading(e){this._loading=e}get loading(){return this._loading}#n(){this.initial&&(this.#e=!0,this._title=this.initial.title??``,this._slug=this.initial.slug??``,this._suggestedSlug=this.initial.slug??``,this._slugEdited=!!this._slug.trim(),this._showSlugEditor=!1)}async#r(e){let t=e.target;if(this._title=t.value,this._slugEdited)return;let n=t.value,r=a(await h(n),200);this._title===n&&(this._suggestedSlug=r,this._slugEdited||(this._slug=r))}#i(e){let t=e.target;this._slug=t.value.toLowerCase(),this._slugEdited=!0}#a(){let e=o(this._slug,{maxLength:200});return e===`too_long`?this.labels.slugTooLongHelp??`Keep this link under 200 characters.`:e===`invalid`?this.labels.slugInvalidHelp:e===`reserved`?this.labels.slugReservedHelp:null}#o(){this._showSlugEditor||(this._showSlugEditor=!0,this.updateComplete.then(()=>{let e=this.querySelector(`[data-collection-slug-input]`);e?.focus(),e?.select()}))}#s(){this._suggestedSlug&&(this._slug=this._suggestedSlug,this._slugEdited=!1,this._showSlugEditor=!1)}#c(){let t=this._slug.trim(),n=e(u(t||`example`)),r=globalThis.location?.origin&&globalThis.location.origin!==`null`?globalThis.location.origin:`http://localhost`;return new URL(n,`${r}/`).toString()}#l(){let e=this.#a();return e?t`<p
2
+ import{r as e}from"./runtime-paths-y0_gHowM.js";import{i as t,n,t as r}from"./lit-Bw_voPoW.js";import{t as i}from"./preload-helper-Czpn1I53.js";import"./types-D5iF3H1a.js";import{n as a,t as o}from"./slug-format-CYmQE5ln.js";var s=`/collections`;function c(e){return e.includes(`+`)}function l(){return s}function u(e){return`/${e}`}function d(e){return c(e)?`${s}/${e}`:u(e)}var f,p;function m(){return f?Promise.resolve(f):(p||=i(()=>import(`./slugify-DlHLyUHS.js`).then(e=>(f=e.slugify,e.slugify)),__vite__mapDeps([0,1])),p)}async function h(e){return(await m())(e)}var g=class extends r{static properties={labels:{type:Object},initial:{type:Object},action:{type:String},_title:{state:!0},_slug:{state:!0},_showSlugEditor:{state:!0},_slugEdited:{state:!0},_suggestedSlug:{state:!0},_loading:{state:!0}};#e=!1;#t=null;createRenderRoot(){return this.innerHTML=``,this}constructor(){super(),this.labels={},this.initial={title:``,slug:``},this.action=``,this._title=``,this._slug=``,this._showSlugEditor=!1,this._slugEdited=!1,this._suggestedSlug=``,this._loading=!1}connectedCallback(){super.connectedCallback(),this.#t=e=>{e.isComposing||e.keyCode===229||(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),this.#d(e))},this.addEventListener(`keydown`,this.#t)}disconnectedCallback(){this.#t&&=(this.removeEventListener(`keydown`,this.#t),null),super.disconnectedCallback()}update(e){(!this.#e||e.has(`initial`))&&this.#n(),super.update(e)}set loading(e){this._loading=e}get loading(){return this._loading}#n(){this.initial&&(this.#e=!0,this._title=this.initial.title??``,this._slug=this.initial.slug??``,this._suggestedSlug=this.initial.slug??``,this._slugEdited=!!this._slug.trim(),this._showSlugEditor=!1)}async#r(e){let t=e.target;if(this._title=t.value,this._slugEdited)return;let n=t.value,r=a(await h(n),200);this._title===n&&(this._suggestedSlug=r,this._slugEdited||(this._slug=r))}#i(e){let t=e.target;this._slug=t.value.toLowerCase(),this._slugEdited=!0}#a(){let e=o(this._slug,{maxLength:200});return e===`too_long`?this.labels.slugTooLongHelp??`Keep this link under 200 characters.`:e===`invalid`?this.labels.slugInvalidHelp:e===`reserved`?this.labels.slugReservedHelp:null}#o(){this._showSlugEditor||(this._showSlugEditor=!0,this.updateComplete.then(()=>{let e=this.querySelector(`[data-collection-slug-input]`);e?.focus(),e?.select()}))}#s(){this._suggestedSlug&&(this._slug=this._suggestedSlug,this._slugEdited=!1,this._showSlugEditor=!1)}#c(){let t=this._slug.trim(),n=e(u(t||`example`)),r=globalThis.location?.origin&&globalThis.location.origin!==`null`?globalThis.location.origin:`http://localhost`;return new URL(n,`${r}/`).toString()}#l(){let e=this.#a();return e?t`<p
3
3
  class="text-xs text-destructive mt-1"
4
4
  data-collection-slug-error
5
5
  >
@@ -0,0 +1 @@
1
+ import{r as e}from"./lit-Bw_voPoW.js";import{a as t,i as n,r}from"./unsafe-html-CWos3v6N.js";import{t as i}from"./types-D5iF3H1a.js";var a=r(class extends n{constructor(e){if(super(e),e.type!==t.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(t,[n]){if(this.st===void 0){this.st=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in n)n[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(n)}let r=t.element.classList;for(let e of this.st)e in n||(r.remove(e),this.st.delete(e));for(let e in n){let t=!!n[e];t===this.st.has(e)||this.nt?.has(e)||(t?(r.add(e),this.st.add(e)):(r.remove(e),this.st.delete(e)))}return e}}),o=`featured,latest,signin,signout,setup,settings,dash,api,feed,search,subscribe,archive,media,pages,reset,collections,compose,preview,new,static,assets,_assets,healthz,readyz,skill.md,robots.txt,manifest.webmanifest,favicon.ico,apple-touch-icon.png,sites`.split(`,`),s=/^sitemap(?:-[a-z0-9-]+)?\.xml$/;function c(e,t=[]){let n=e.split(`/`)[0]?.toLowerCase();return n?/^[_.]/.test(n)||o.includes(n)||s.test(n)?!0:t.includes(n):!1}Object.fromEntries(Object.entries(i).filter(([,e])=>!e.envOnly||`internal`in e).map(([e])=>[e,e]));var l=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function u(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,`-`).replace(/-{2,}/g,`-`).replace(/^-|-$/g,``)}function d(e,t){return u(e.slice(0,t))}function f(e,t={}){let n=e.trim();return n?t.maxLength&&n.length>t.maxLength?`too_long`:l.test(n)?c(n)||t.additionalReservedValues?.some(e=>e.toLowerCase()===n.toLowerCase())?`reserved`:null:`invalid`:null}export{d as n,a as r,f as t};
@@ -1,2 +1,2 @@
1
- import{C as e,a as t,r as n,w as r}from"./lit-DW8VmJAT.js";import{a as i,i as a,r as o}from"./unsafe-html-B5ZEXaxg.js";import{C as s,S as c,b as l,v as u,x as d,y as f}from"./create-editor-5Y49x7h5.js";var{I:p}=t,m=e=>e,h=()=>document.createComment(``),g=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new p(r.insertBefore(h(),i),r.insertBefore(h(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=m(e).nextSibling;m(r).insertBefore(e,i),e=t}}}return n},_=(e,t,n=e)=>(e._$AI(t,n),e),ee={},v=(e,t=ee)=>e._$AH=t,te=e=>e._$AH,y=e=>{e._$AR(),e._$AA.remove()},b=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},ne=o(class extends a{constructor(e){if(super(e),e.type!==i.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,r,i]){let a=te(e),{values:o,keys:s}=this.dt(t,r,i);if(!Array.isArray(a))return this.ut=s,o;let c=this.ut??=[],l=[],u,d,f=0,p=a.length-1,m=0,h=o.length-1;for(;f<=p&&m<=h;)if(a[f]===null)f++;else if(a[p]===null)p--;else if(c[f]===s[m])l[m]=_(a[f],o[m]),f++,m++;else if(c[p]===s[h])l[h]=_(a[p],o[h]),p--,h--;else if(c[f]===s[h])l[h]=_(a[f],o[h]),g(e,l[h+1],a[f]),f++,h--;else if(c[p]===s[m])l[m]=_(a[p],o[m]),g(e,a[f],a[p]),p--,m++;else if(u===void 0&&(u=b(s,m,h),d=b(c,f,p)),u.has(c[f])){if(u.has(c[p])){let t=d.get(s[m]),n=t===void 0?null:a[t];if(n===null){let t=g(e,a[f]);_(t,o[m]),l[m]=t}else l[m]=_(n,o[m]),g(e,a[f],n),a[t]=null;m++}else y(a[p]),p--}else y(a[f]),f++;for(;m<=h;){let t=g(e,l[h+1]);_(t,o[m]),l[m++]=t}for(;f<=p;){let e=a[f++];e!==null&&y(e)}return this.ut=s,v(e,l),n}});function x(e){return typeof e==`string`?e:``}function S(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function C(e){let t=l(r(e.src));if(!t)return``;let n=` sandbox="${l(e.sandbox)}"`,i=e.allow?` allow="${l(e.allow)}"`:``;return`<iframe src="${t}"${` title="${l(e.providerName)} embed"`}${n}${i} loading="lazy" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>`}function re(e){let t=e.orientation===`portrait`?`portrait`:e.orientation===`square`?`square`:e.orientation===`auto`?`auto`:`landscape`,n=[];e.heightPx&&e.heightPx>0&&n.push(`--tiptap-embed-height:${Math.round(e.heightPx)}px`);let r=n.length>0?` style="${l(n.join(`;`))}"`:``;return` data-orientation="${l(t)}"${r}`}function w(e,t){let n=C(e);if(!n)return``;let i=l(r(e.url||e.src)),a=l(e.providerName),o=i?`<a class="tiptap-embed-fallback" href="${i}" target="_blank" rel="noopener noreferrer">${a} →</a>`:``,s=l(e.provider),c=t?.trim()?`<figcaption>${l(t.trim())}</figcaption>`:``;return`<figure class="tiptap-embed-figure" data-provider="${s}"${re(e)}><div class="tiptap-embed-frame">${n}</div>`+o+c+`</figure>`}function ie(e){let t=e??{},n=x(t.url),i=x(t.src),a=null;if(i){let e=r(i);e&&(a={provider:x(t.provider)||`iframe`,providerName:x(t.providerName)||`Embed`,src:e,url:n||e,orientation:x(t.orientation)||`landscape`,heightPx:S(t.heightPx)??void 0,sandbox:x(t.sandbox)||`allow-scripts allow-same-origin allow-popups`,allow:x(t.allow)||void 0,cspFrameSrc:[],cspScriptSrc:[]})}if(!a&&n&&(a=f(n)),!a){if(!n)return``;let e=l(r(n));return e?`<p class="tiptap-embed-fallback"><a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a></p>`:``}return w(a,x(t.caption))}function T(e,t){let n=e?.[t];return typeof n==`string`?n:``}function E(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:null}function ae(e){switch(e.type){case`text`:return l(e.text??``);case`hardBreak`:return`
1
+ import{d as e,f as t}from"./runtime-paths-y0_gHowM.js";import{a as n,r}from"./lit-Bw_voPoW.js";import{a as i,i as a,r as o}from"./unsafe-html-CWos3v6N.js";import{C as s,S as c,b as l,v as u,x as d,y as f}from"./create-editor-BQkrw8Ax.js";var{I:p}=n,m=e=>e,h=()=>document.createComment(``),g=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new p(r.insertBefore(h(),i),r.insertBefore(h(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=m(e).nextSibling;m(r).insertBefore(e,i),e=t}}}return n},_=(e,t,n=e)=>(e._$AI(t,n),e),ee={},v=(e,t=ee)=>e._$AH=t,te=e=>e._$AH,y=e=>{e._$AR(),e._$AA.remove()},b=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},ne=o(class extends a{constructor(e){if(super(e),e.type!==i.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,i]){let a=te(e),{values:o,keys:s}=this.dt(t,n,i);if(!Array.isArray(a))return this.ut=s,o;let c=this.ut??=[],l=[],u,d,f=0,p=a.length-1,m=0,h=o.length-1;for(;f<=p&&m<=h;)if(a[f]===null)f++;else if(a[p]===null)p--;else if(c[f]===s[m])l[m]=_(a[f],o[m]),f++,m++;else if(c[p]===s[h])l[h]=_(a[p],o[h]),p--,h--;else if(c[f]===s[h])l[h]=_(a[f],o[h]),g(e,l[h+1],a[f]),f++,h--;else if(c[p]===s[m])l[m]=_(a[p],o[m]),g(e,a[f],a[p]),p--,m++;else if(u===void 0&&(u=b(s,m,h),d=b(c,f,p)),u.has(c[f])){if(u.has(c[p])){let t=d.get(s[m]),n=t===void 0?null:a[t];if(n===null){let t=g(e,a[f]);_(t,o[m]),l[m]=t}else l[m]=_(n,o[m]),g(e,a[f],n),a[t]=null;m++}else y(a[p]),p--}else y(a[f]),f++;for(;m<=h;){let t=g(e,l[h+1]);_(t,o[m]),l[m++]=t}for(;f<=p;){let e=a[f++];e!==null&&y(e)}return this.ut=s,v(e,l),r}});function x(e){return typeof e==`string`?e:``}function S(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function C(e){let n=l(t(e.src));if(!n)return``;let r=` sandbox="${l(e.sandbox)}"`,i=e.allow?` allow="${l(e.allow)}"`:``;return`<iframe src="${n}"${` title="${l(e.providerName)} embed"`}${r}${i} loading="lazy" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>`}function re(e){let t=e.orientation===`portrait`?`portrait`:e.orientation===`square`?`square`:e.orientation===`auto`?`auto`:`landscape`,n=[];e.heightPx&&e.heightPx>0&&n.push(`--tiptap-embed-height:${Math.round(e.heightPx)}px`);let r=n.length>0?` style="${l(n.join(`;`))}"`:``;return` data-orientation="${l(t)}"${r}`}function w(e,n){let r=C(e);if(!r)return``;let i=l(t(e.url||e.src)),a=l(e.providerName),o=i?`<a class="tiptap-embed-fallback" href="${i}" target="_blank" rel="noopener noreferrer">${a} →</a>`:``,s=l(e.provider),c=n?.trim()?`<figcaption>${l(n.trim())}</figcaption>`:``;return`<figure class="tiptap-embed-figure" data-provider="${s}"${re(e)}><div class="tiptap-embed-frame">${r}</div>`+o+c+`</figure>`}function ie(e){let n=e??{},r=x(n.url),i=x(n.src),a=null;if(i){let e=t(i);e&&(a={provider:x(n.provider)||`iframe`,providerName:x(n.providerName)||`Embed`,src:e,url:r||e,orientation:x(n.orientation)||`landscape`,heightPx:S(n.heightPx)??void 0,sandbox:x(n.sandbox)||`allow-scripts allow-same-origin allow-popups`,allow:x(n.allow)||void 0,cspFrameSrc:[],cspScriptSrc:[]})}if(!a&&r&&(a=f(r)),!a){if(!r)return``;let e=l(t(r));return e?`<p class="tiptap-embed-fallback"><a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a></p>`:``}return w(a,x(n.caption))}function T(e,t){let n=e?.[t];return typeof n==`string`?n:``}function E(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:null}function ae(e){switch(e.type){case`text`:return l(e.text??``);case`hardBreak`:return`
2
2
  `;default:return(e.content??[]).map(ae).join(``)}}function oe(e,t,n){let r=E(t.attrs,`colspan`),i=E(t.attrs,`rowspan`);return`<${e}${r!==null&&r!==1?` colspan="${r}"`:``}${i!==null&&i!==1?` rowspan="${i}"`:``}>${n.renderChildren(t.content)}</${e}>`}var se=14695981039346656037n,ce=1099511628211n,le=18446744073709551615n;function ue(e){let t=(e??``).trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``);if(!t)return``;let n=se;for(let e=0;e<t.length;e+=1)n^=BigInt(t.charCodeAt(e)),n=n*ce&le;return n.toString(36).padStart(13,`0`)}function de(e,t){if(e.type===`footnoteReference`){t(e);return}for(let n of e.content??[])de(n,t)}function fe(e,t){let n=new Map,r=(e.content??[]).filter(e=>e.type!==`footnoteDefinition`);for(let t of e.content??[]){if(t.type!==`footnoteDefinition`)continue;let e=d(T(t.attrs,`label`));e&&!n.has(e)&&n.set(e,t)}let i=ue(t.namespace),a=i?`${i}-`:``,o=new Map,c=[],l=new WeakMap;for(let e of r)de(e,e=>{let t=s(T(e.attrs,`label`))||`footnote`,r=d(t),i=o.get(r);if(!i){let e=o.size+1;i={definitionId:`fn-${a}${e}`,number:e,label:t,definition:n.get(r)??null,references:[]},o.set(r,i),c.push(i)}let u=i.references.length+1,f={definitionId:i.definitionId,referenceId:`fnref-${a}${i.number}-${u}`,number:i.number,occurrence:u,label:i.label,hasDefinition:i.definition!==null};i.references.push(f),l.set(e,f)});return{groups:c,referencesByNode:l}}function pe(e,t){let n=t.footnotes.referencesByNode.get(e),r=s(T(e.attrs,`label`))||`footnote`,i=n?.label??r,a=n?.number??i;return n?.hasDefinition?`<sup class="footnote-ref"><a id="${l(n.referenceId)}" href="#${l(n.definitionId)}" role="doc-noteref">${n.number}</a></sup>`:`<sup class="footnote-ref">${l(String(a))}</sup>`}function me(e,t,n){if(!e.definition)return``;let r=e.definition.content??[],i=e.references.map(t=>{let n=e.references.length>1?String(t.occurrence):``;return`<a href="#${l(t.referenceId)}" class="footnote-backref" role="doc-backlink">↩︎${n}</a>`}).join(` `),a=`<span class="footnote-backlinks">${i}</span>`,o=r.at(-1),s;if(o?.type===`paragraph`){let e=r.slice(0,-1),n=t.renderChildren(o.content),i=n?` `:``;s=t.renderChildren(e)+`<p>${n}${i}${a}</p>`}else s=t.renderChildren(r)+`<p class="footnote-backlinks">${i}</p>`;let c=n?` value="${e.number}"`:``;return`<li id="${l(e.definitionId)}" class="footnote"${c}>`+s+`</li>`}function he(e){let t=e.footnotes.groups.filter(e=>e.definition!==null);if(t.length===0)return``;let n=t[0]?.number??1,r=n,i=t.map(t=>{let n=t.number!==r;return r=t.number+1,me(t,e,n)}).join(``);return`<section class="footnote-endnotes" role="doc-endnotes"><ol class="footnote-list"${n===1?``:` start="${n}"`}>${i}</ol></section>`}function ge(e,t){return(e.content??[]).filter(e=>e.type!==`footnoteDefinition`).map(e=>t.renderNode(e)).join(``)+he(t)}var _e={bold:e=>`<strong>${e}</strong>`,italic:e=>`<em>${e}</em>`,strike:e=>`<s>${e}</s>`,code:e=>`<code>${e}</code>`,link:(t,n)=>{let r=l(e(T(n.attrs,`href`))),i=T(n.attrs,`target`);return`<a href="${r}"${i?` target="${l(i)}"`:``}${i?` rel="noopener noreferrer"`:``}>${t}</a>`}},ve={doc:(e,t)=>ge(e,t),paragraph:(e,t)=>`<p>${t.renderChildren(e.content)}</p>`,heading:(e,t)=>{let n=Math.min(Math.max(E(e.attrs,`level`)??1,1),6);return`<h${n}>${t.renderChildren(e.content)}</h${n}>`},text:(e,t)=>t.renderText(e.text??``,e.marks),bulletList:(e,t)=>`<ul>${t.renderChildren(e.content)}</ul>`,orderedList:(e,t)=>{let n=E(e.attrs,`start`);return`<ol${n!==null&&n!==1?` start="${n}"`:``}>${t.renderChildren(e.content)}</ol>`},listItem:(e,t)=>`<li>${t.renderChildren(e.content)}</li>`,blockquote:(e,t)=>`<blockquote>${t.renderChildren(e.content)}</blockquote>`,codeBlock:e=>{let t=T(e.attrs,`language`);return`<pre><code${t?` class="language-${l(t)}"`:``}>${ae(e)}</code></pre>`},table:(e,t)=>`<table>${t.renderChildren(e.content)}</table>`,tableRow:(e,t)=>`<tr>${t.renderChildren(e.content)}</tr>`,tableCell:(e,t)=>oe(`td`,e,t),tableHeader:(e,t)=>oe(`th`,e,t),horizontalRule:()=>`<hr>`,hardBreak:()=>`<br>`,image:e=>u(e.attrs??{}),embed:e=>ie(e.attrs),htmlBlock:e=>{let t=T(e.attrs,`html`);return t?`<div class="tiptap-html-block">${t}</div>`:``},moreBreak:()=>`<!--more-->`,footnoteReference:(e,t)=>pe(e,t),footnoteDefinition:()=>``};function ye(e,t=[]){let n=l(e);for(let e of t){let t=_e[e.type];t&&(n=t(n,e))}return n}function be(e,t){return e.content?t.renderChildren(e.content):``}function xe(e){let t={footnotes:e,renderChildren(e=[]){return e.map(e=>t.renderNode(e)).join(``)},renderNode(e){return(ve[e.type]??be)(e,t)},renderText:ye};return t}function Se(e,t={}){if(e.type!==`doc`)return``;let n=c(e);return xe(fe(n,t)).renderNode(n)}var Ce=new Set([`doc`,`paragraph`,`heading`,`codeBlock`,`bulletList`,`orderedList`,`listItem`,`blockquote`,`table`,`tableRow`,`tableCell`,`tableHeader`,`footnoteDefinition`,`text`,`hardBreak`]);function we(e,t={}){let n;try{n=JSON.parse(e)}catch{return null}if(n.type!==`doc`||!n.content)return null;let r=t.includeLinkHrefs===!0;function i(e){if(!Ce.has(e.type))return``;if(e.type===`text`){let t=e.text??``;if(!r||!e.marks||e.marks.length===0)return t;let n=[];for(let t of e.marks){if(t.type!==`link`)continue;let e=t.attrs?.href;typeof e==`string`&&e.trim()&&n.push(e)}return n.length>0?`${t} ${n.join(` `)}`:t}return e.type===`hardBreak`?` `:e.content?e.content.map(i).join(` `):``}let a=[];for(let e of n.content){let t=i(e).trim();t&&a.push(t)}return a.length>0?a.join(` `):null}var Te={site:`sit`,siteDomain:`sdm`,post:`pst`,translationGroup:`tgr`,media:`med`,uploadSession:`upl`,collection:`col`,smartCollection:`smc`,path:`pth`,collectionDirectoryItem:`cdi`,navItem:`nav`,apiToken:`api`,user:`usr`,session:`ses`,account:`acc`,verification:`vrf`,telegramBinding:`tgb`,telegramBindingCode:`tgc`,telegramMediaGroupItem:`tmg`,storagePurge:`spg`};Te.user,Te.session,Te.account,Te.verification;var Ee=/^(?:[a-z](?:[a-z_]{0,61}[a-z])?)?$/,De=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/;function Oe(e,t){let n=e.lastIndexOf(`_`);if(n===0)return!1;let r=n===-1?``:e.slice(0,n);return t!==void 0&&r!==t?!1:Ee.test(r)&&De.test(e.slice(n+1))}function ke(e,t,n){return(t=Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(null,arguments)}function Ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ae(Object(n),!0).forEach(function(t){ke(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ae(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function je(e,t){if(e==null)return{};var n,r,i=Me(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Me(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ne(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pe(e){var t=Ne(e,`string`);return typeof t==`symbol`?t:t+``}function Fe(e){"@babel/helpers - typeof";return Fe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Fe(e)}var Ie=`1.15.7`;function k(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var A=k(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Le=k(/Edge/i),Re=k(/firefox/i),ze=k(/safari/i)&&!k(/chrome/i)&&!k(/android/i),Be=k(/iP(ad|od|hone)/i),Ve=k(/chrome/i)&&k(/android/i),He={capture:!1,passive:!1};function j(e,t,n){e.addEventListener(t,n,!A&&He)}function M(e,t,n){e.removeEventListener(t,n,!A&&He)}function Ue(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function We(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function N(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&Ue(e,t):Ue(e,t))||r&&e===n)return e;if(e===n)break}while(e=We(e))}return null}var Ge=/\s+/g;function P(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(Ge,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(Ge,` `))}function F(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function Ke(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=F(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function qe(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function I(){return document.scrollingElement||document.documentElement}function L(e,t,n,r,i){if(e.getBoundingClientRect||e===window){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==I()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!A))do if(i&&i.getBoundingClientRect&&(F(i,`transform`)!==`none`||n&&F(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(F(i,`border-top-width`)),s-=f.left+parseInt(F(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=Ke(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function Je(e,t,n){for(var r=z(e,!0),i=L(e)[t];r;){var a=L(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===I())break;r=z(r,!1)}return!1}function Ye(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==Q.ghost&&(r||o[a]!==Q.dragged)&&N(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function Xe(e,t){for(var n=e.lastElementChild;n&&(n===Q.ghost||F(n,`display`)===`none`||t&&!Ue(n,t));)n=n.previousElementSibling;return n||null}function R(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==Q.clone&&(!t||Ue(e,t))&&n++;return n}function Ze(e){var t=0,n=0,r=I();if(e)do{var i=Ke(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function Qe(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function z(e,t){if(!e||!e.getBoundingClientRect)return I();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=F(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return I();if(r||t)return n;r=!0}}while(n=n.parentNode);return I()}function $e(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function et(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var tt;function nt(e,t){return function(){if(!tt){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),tt=setTimeout(function(){tt=void 0},t)}}}function rt(){clearTimeout(tt),tt=void 0}function it(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function at(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function ot(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(N(i,t.draggable,e,!1)&&!i.animated&&i!==n){var a=L(i);r.left=Math.min(r.left??1/0,a.left),r.top=Math.min(r.top??1/0,a.top),r.right=Math.max(r.right??-1/0,a.right),r.bottom=Math.max(r.bottom??-1/0,a.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var B=`Sortable`+new Date().getTime();function st(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(F(t,`display`)!==`none`&&t!==Q.ghost){e.push({target:t,rect:L(t)});var n=O({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=Ke(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(Qe(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=L(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=Ke(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&et(c,s)&&!et(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=lt(u,c,l,r.options)),et(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){F(e,`transition`,``),F(e,`transform`,``);var i=Ke(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,F(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=ct(e),F(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),F(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){F(e,`transition`,``),F(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function ct(e){return e.offsetWidth}function lt(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var ut=[],dt={initializeByDefault:!0},ft={mount:function(e){for(var t in dt)dt.hasOwnProperty(t)&&!(t in e)&&(e[t]=dt[t]);ut.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),ut.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;ut.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](O({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](O({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in ut.forEach(function(r){var i=r.pluginName;if(e.options[i]||r.initializeByDefault){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,D(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return ut.forEach(function(r){typeof r.eventProperties==`function`&&D(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return ut.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function pt(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[B],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!A&&!Le?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var ee=O(O({},m),ft.getEventProperties(r,t));for(var v in ee)h[v]=ee[v];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var mt=[`evt`],V=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=je(n,mt);ft.pluginEvent.bind(Q)(e,t,O({dragEl:U,parentEl:W,ghostEl:G,rootEl:K,nextEl:ht,lastDownEl:gt,cloneEl:q,cloneHidden:_t,dragStarted:At,putSortable:Y,activeSortable:Q.active,originalEvent:r,oldIndex:vt,oldDraggableIndex:yt,newIndex:J,newDraggableIndex:bt,hideGhostForTarget:Jt,unhideGhostForTarget:Yt,cloneNowHidden:function(){_t=!0},cloneNowShown:function(){_t=!1},dispatchSortableEvent:function(e){H({sortable:t,name:e,originalEvent:r})}},i))};function H(e){pt(O({putSortable:Y,cloneEl:q,targetEl:U,rootEl:K,oldIndex:vt,oldDraggableIndex:yt,newIndex:J,newDraggableIndex:bt},e))}var U,W,G,K,ht,gt,q,_t,vt,J,yt,bt,xt,Y,St=!1,Ct=!1,wt=[],Tt,X,Et,Dt,Ot,kt,At,jt,Mt,Nt=!1,Pt=!1,Ft,Z,It=[],Lt=!1,Rt=[],zt=typeof document<`u`,Bt=Be,Vt=Le||A?`cssFloat`:`float`,Ht=zt&&!Ve&&!Be&&`draggable`in document.createElement(`div`),Ut=function(){if(zt){if(A)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),Wt=function(e,t){var n=F(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ye(e,0,t),a=Ye(e,1,t),o=i&&F(i),s=a&&F(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+L(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+L(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[Vt]===`none`||a&&n[Vt]===`none`&&c+l>r)?`vertical`:`horizontal`},Gt=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},Kt=function(e,t){var n;return wt.some(function(r){var i=r[B].options.emptyInsertThreshold;if(i&&!Xe(r)){var a=L(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},qt=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||Fe(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Jt=function(){!Ut&&G&&F(G,`display`,`none`)},Yt=function(){!Ut&&G&&F(G,`display`,``)};zt&&!Ve&&document.addEventListener(`click`,function(e){if(Ct)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ct=!1,!1},!0);var Xt=function(e){if(U){e=e.touches?e.touches[0]:e;var t=Kt(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[B]._onDragOver(n)}}},Zt=function(e){U&&U.parentNode[B]._isOutsideThisEl(e.target)};function Q(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=D({},t),e[B]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Wt(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Q.supportPointer!==!1&&`PointerEvent`in window&&(!ze||Be),emptyInsertThreshold:5};for(var r in ft.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in qt(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&Ht,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?j(e,`pointerdown`,this._onTapStart):(j(e,`mousedown`,this._onTapStart),j(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(j(e,`dragover`,this),j(e,`dragenter`,this)),wt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),D(this,st())}Q.prototype={constructor:Q,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(jt=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,U):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(cn(n),!U&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&ze&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=N(s,r.draggable,n,!1),!(s&&s.animated)&&gt!==s)){if(vt=R(s),yt=R(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){H({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),V(`filter`,t,{evt:e}),i&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=N(c,r.trim(),n,!1),r)return H({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),V(`filter`,t,{evt:e}),!0}),l)){i&&e.preventDefault();return}(!r.handle||N(c,r.handle,n,!1))&&this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!U&&n.parentNode===i){var c=L(n);if(K=i,U=n,W=U.parentNode,ht=U.nextSibling,gt=n,xt=a.group,Q.dragged=U,Tt={target:U,clientX:(t||e).clientX,clientY:(t||e).clientY},Ot=Tt.clientX-c.left,kt=Tt.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,U.style[`will-change`]=`all`,s=function(){if(V(`delayEnded`,r,{evt:e}),Q.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Re&&r.nativeDraggable&&(U.draggable=!0),r._triggerDragStart(e,t),H({sortable:r,name:`choose`,originalEvent:e}),P(U,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){qe(U,e.trim(),en)}),j(o,`dragover`,Xt),j(o,`mousemove`,Xt),j(o,`touchmove`,Xt),a.supportPointer?(j(o,`pointerup`,r._onDrop),!this.nativeDraggable&&j(o,`pointercancel`,r._onDrop)):(j(o,`mouseup`,r._onDrop),j(o,`touchend`,r._onDrop),j(o,`touchcancel`,r._onDrop)),Re&&this.nativeDraggable&&(this.options.touchStartThreshold=4,U.draggable=!0),V(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Le||A))){if(Q.eventCanceled){this._onDrop();return}a.supportPointer?(j(o,`pointerup`,r._disableDelayedDrag),j(o,`pointercancel`,r._disableDelayedDrag)):(j(o,`mouseup`,r._disableDelayedDrag),j(o,`touchend`,r._disableDelayedDrag),j(o,`touchcancel`,r._disableDelayedDrag)),j(o,`mousemove`,r._delayedDragTouchMoveHandler),j(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&j(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){U&&en(U),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;M(e,`mouseup`,this._disableDelayedDrag),M(e,`touchend`,this._disableDelayedDrag),M(e,`touchcancel`,this._disableDelayedDrag),M(e,`pointerup`,this._disableDelayedDrag),M(e,`pointercancel`,this._disableDelayedDrag),M(e,`mousemove`,this._delayedDragTouchMoveHandler),M(e,`touchmove`,this._delayedDragTouchMoveHandler),M(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?j(document,`pointermove`,this._onTouchMove):t?j(document,`touchmove`,this._onTouchMove):j(document,`mousemove`,this._onTouchMove):(j(U,`dragend`,this),j(K,`dragstart`,this._onDragStart));try{document.selection?ln(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(St=!1,K&&U){V(`dragStarted`,this,{evt:t}),this.nativeDraggable&&j(document,`dragover`,Zt);var n=this.options;!e&&P(U,n.dragClass,!1),P(U,n.ghostClass,!0),Q.active=this,e&&this._appendGhost(),H({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,Jt();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(U.parentNode[B]._isOutsideThisEl(e),t)do{if(t[B]){var n=void 0;if(n=t[B]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=We(t));Yt()}},_onTouchMove:function(e){if(Tt){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=G&&Ke(G,!0),o=G&&a&&a.a,s=G&&a&&a.d,c=Bt&&Z&&Ze(Z),l=(i.clientX-Tt.clientX+r.x)/(o||1)+(c?c[0]-It[0]:0)/(o||1),u=(i.clientY-Tt.clientY+r.y)/(s||1)+(c?c[1]-It[1]:0)/(s||1);if(!Q.active&&!St){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(G){a?(a.e+=l-(Et||0),a.f+=u-(Dt||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;F(G,`webkitTransform`,d),F(G,`mozTransform`,d),F(G,`msTransform`,d),F(G,`transform`,d),Et=l,Dt=u,X=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!G){var e=this.options.fallbackOnBody?document.body:K,t=L(U,!0,Bt,!0,e),n=this.options;if(Bt){for(Z=e;F(Z,`position`)===`static`&&F(Z,`transform`)===`none`&&Z!==document;)Z=Z.parentNode;Z!==document.body&&Z!==document.documentElement?(Z===document&&(Z=I()),t.top+=Z.scrollTop,t.left+=Z.scrollLeft):Z=I(),It=Ze(Z)}G=U.cloneNode(!0),P(G,n.ghostClass,!1),P(G,n.fallbackClass,!0),P(G,n.dragClass,!0),F(G,`transition`,``),F(G,`transform`,``),F(G,`box-sizing`,`border-box`),F(G,`margin`,0),F(G,`top`,t.top),F(G,`left`,t.left),F(G,`width`,t.width),F(G,`height`,t.height),F(G,`opacity`,`0.8`),F(G,`position`,Bt?`absolute`:`fixed`),F(G,`zIndex`,`100000`),F(G,`pointerEvents`,`none`),Q.ghost=G,e.appendChild(G),F(G,`transform-origin`,Ot/parseInt(G.style.width)*100+`% `+kt/parseInt(G.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(V(`dragStart`,this,{evt:e}),Q.eventCanceled){this._onDrop();return}V(`setupClone`,this),Q.eventCanceled||(q=at(U),q.removeAttribute(`id`),q.draggable=!1,q.style[`will-change`]=``,this._hideClone(),P(q,this.options.chosenClass,!1),Q.clone=q),n.cloneId=ln(function(){V(`clone`,n),!Q.eventCanceled&&(n.options.removeCloneOnHide||K.insertBefore(q,U),n._hideClone(),H({sortable:n,name:`clone`}))}),!t&&P(U,i.dragClass,!0),t?(Ct=!0,n._loopId=setInterval(n._emulateDragOver,50)):(M(document,`mouseup`,n._onDrop),M(document,`touchend`,n._onDrop),M(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,U)),j(document,`drop`,n),F(U,`transform`,`translateZ(0)`)),St=!0,n._dragStartId=ln(n._dragStarted.bind(n,t,e)),j(document,`selectstart`,n),At=!0,window.getSelection().removeAllRanges(),ze&&F(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=Q.active,l=xt===s,u=o.sort,d=Y||c,f,p=this,m=!1;if(Lt)return;function h(o,s){V(o,p,O({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return $t(K,t,U,r,n,L(n),e,i)},changed:ee},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(P(U,Y?Y.options.ghostClass:c.options.ghostClass,!1),P(U,o.ghostClass,!0)),Y!==p&&p!==Q.active?Y=p:p===Q.active&&Y&&(Y=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===U&&!U.animated||n===t&&!n.animated)&&(jt=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(U.parentNode[B]._isOutsideThisEl(e.target),!r&&Xt(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function ee(){J=R(U),bt=R(U,o.draggable),H({sortable:p,name:`change`,toEl:t,newIndex:J,newDraggableIndex:bt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=N(n,o.draggable,t,!0),h(`dragOver`),Q.eventCanceled)return m;if(U.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(Ct=!1,c&&!o.disabled&&(l?u||(a=W!==K):Y===this||(this.lastPutMode=xt.checkPull(this,c,U,e))&&s.checkPut(this,c,U,e))){if(f=this._getDirection(e,n)===`vertical`,r=L(U),h(`dragOverValid`),Q.eventCanceled)return m;if(a)return W=K,g(),this._hideClone(),h(`revert`),Q.eventCanceled||(ht?K.insertBefore(U,ht):K.appendChild(U)),_(!0);var v=Xe(t,o.draggable);if(!v||rn(e,f,this)&&!v.animated){if(v===U)return _(!1);if(v&&t===e.target&&(n=v),n&&(i=L(n)),$t(K,t,U,r,n,i,e,!!n)!==!1)return g(),v&&v.nextSibling?t.insertBefore(U,v.nextSibling):t.appendChild(U),W=t,ee(),_(!0)}else if(v&&nn(e,f,this)){var te=Ye(t,0,o,!0);if(te===U)return _(!1);if(n=te,i=L(n),$t(K,t,U,r,n,i,e,!1)!==!1)return g(),t.insertBefore(U,te),W=t,ee(),_(!0)}else if(n.parentNode===t){i=L(n);var y=0,b,ne=U.parentNode!==t,x=!Gt(U.animated&&U.toRect||r,n.animated&&n.toRect||i,f),S=f?`top`:`left`,C=Je(n,`top`,`top`)||Je(U,`top`,`top`),re=C?C.scrollTop:void 0;jt!==n&&(b=i[S],Nt=!1,Pt=!x&&o.invertSwap||ne),y=an(e,n,i,f,x?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Pt,jt===n);var w;if(y!==0){var ie=R(U);do ie-=y,w=W.children[ie];while(w&&(F(w,`display`)===`none`||w===G))}if(y===0||w===n)return _(!1);jt=n,Mt=y;var T=n.nextElementSibling,E=!1;E=y===1;var ae=$t(K,t,U,r,n,i,e,E);if(ae!==!1)return(ae===1||ae===-1)&&(E=ae===1),Lt=!0,setTimeout(tn,30),g(),E&&!T?t.appendChild(U):n.parentNode.insertBefore(U,E?T:n),C&&it(C,0,re-C.scrollTop),W=U.parentNode,b!==void 0&&!Pt&&(Ft=Math.abs(b-L(n)[S])),ee(),_(!0)}if(t.contains(U))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){M(document,`mousemove`,this._onTouchMove),M(document,`touchmove`,this._onTouchMove),M(document,`pointermove`,this._onTouchMove),M(document,`dragover`,Xt),M(document,`mousemove`,Xt),M(document,`touchmove`,Xt)},_offUpEvents:function(){var e=this.el.ownerDocument;M(e,`mouseup`,this._onDrop),M(e,`touchend`,this._onDrop),M(e,`pointerup`,this._onDrop),M(e,`pointercancel`,this._onDrop),M(e,`touchcancel`,this._onDrop),M(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(J=R(U),bt=R(U,n.draggable),V(`drop`,this,{evt:e}),W=U&&U.parentNode,J=R(U),bt=R(U,n.draggable),Q.eventCanceled){this._nulling();return}St=!1,Pt=!1,Nt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),un(this.cloneId),un(this._dragStartId),this.nativeDraggable&&(M(document,`drop`,this),M(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ze&&F(document.body,`user-select`,``),F(U,`transform`,``),e&&(At&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),G&&G.parentNode&&G.parentNode.removeChild(G),(K===W||Y&&Y.lastPutMode!==`clone`)&&q&&q.parentNode&&q.parentNode.removeChild(q),U&&(this.nativeDraggable&&M(U,`dragend`,this),en(U),U.style[`will-change`]=``,At&&!St&&P(U,Y?Y.options.ghostClass:this.options.ghostClass,!1),P(U,this.options.chosenClass,!1),H({sortable:this,name:`unchoose`,toEl:W,newIndex:null,newDraggableIndex:null,originalEvent:e}),K===W?J!==vt&&J>=0&&(H({sortable:this,name:`update`,toEl:W,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})):(J>=0&&(H({rootEl:W,name:`add`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`remove`,toEl:W,originalEvent:e}),H({rootEl:W,name:`sort`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})),Y&&Y.save()),Q.active&&((J==null||J===-1)&&(J=vt,bt=yt),H({sortable:this,name:`end`,toEl:W,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){V(`nulling`,this),K=U=W=G=ht=q=gt=_t=Tt=X=At=J=bt=vt=yt=jt=Mt=Y=xt=Q.dragged=Q.ghost=Q.clone=Q.active=null;var e=this.el;Rt.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Rt.length=Et=Dt=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:U&&(this._onDragOver(e),Qt(e));break;case`selectstart`:e.preventDefault()}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],N(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||sn(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];N(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return N(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=ft.modifyOption(this,e,t);n[e]=r===void 0?t:r,e===`group`&&qt(n)},destroy:function(){V(`destroy`,this);var e=this.el;e[B]=null,M(e,`mousedown`,this._onTapStart),M(e,`touchstart`,this._onTapStart),M(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(M(e,`dragover`,this),M(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),wt.splice(wt.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!_t){if(V(`hideClone`,this),Q.eventCanceled)return;F(q,`display`,`none`),this.options.removeCloneOnHide&&q.parentNode&&q.parentNode.removeChild(q),_t=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(_t){if(V(`showClone`,this),Q.eventCanceled)return;U.parentNode==K&&!this.options.group.revertClone?K.insertBefore(q,U):ht?K.insertBefore(q,ht):K.appendChild(q),this.options.group.revertClone&&this.animate(U,q),F(q,`display`,``),_t=!1}}};function Qt(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function $t(e,t,n,r,i,a,o,s){var c,l=e[B],u=l.options.onMove,d;return window.CustomEvent&&!A&&!Le?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||L(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function en(e){e.draggable=!1}function tn(){Lt=!1}function nn(e,t,n){var r=L(Ye(n.el,0,n.options,!0)),i=ot(n.el,n.options,G),a=10;return t?e.clientX<i.left-a||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-a||e.clientY<r.bottom&&e.clientX<r.left}function rn(e,t,n){var r=L(Xe(n.el,n.options.draggable)),i=ot(n.el,n.options,G),a=10;return t?e.clientX>i.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function an(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&Ft<l*i){if(!Nt&&(Mt===1?c>u+l*a/2:c<d-l*a/2)&&(Nt=!0),Nt)f=!0;else if(Mt===1?c<u+Ft:c>d-Ft)return-Mt}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return on(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function on(e){return R(U)<R(e)?1:-1}function sn(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function cn(e){Rt.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&Rt.push(r)}}function ln(e){return setTimeout(e,0)}function un(e){return clearTimeout(e)}zt&&j(document,`touchmove`,function(e){(Q.active||St)&&e.cancelable&&e.preventDefault()}),Q.utils={on:j,off:M,css:F,find:qe,is:function(e,t){return!!N(e,t,e,!1)},extend:$e,throttle:nt,closest:N,toggleClass:P,clone:at,index:R,nextTick:ln,cancelNextTick:un,detectDirection:Wt,getChild:Ye,expando:B},Q.get=function(e){return e[B]},Q.mount=function(){var e=[...arguments];e[0].constructor===Array&&(e=e[0]),e.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(Q.utils=O(O({},Q.utils),e.utils)),ft.mount(e)})},Q.create=function(e,t){return new Q(e,t)},Q.version=Ie;var $=[],dn,fn,pn=!1,mn,hn,gn,_n;function vn(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?j(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?j(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?j(document,`touchmove`,this._handleFallbackAutoScroll):j(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?M(document,`dragover`,this._handleAutoScroll):(M(document,`pointermove`,this._handleFallbackAutoScroll),M(document,`touchmove`,this._handleFallbackAutoScroll),M(document,`mousemove`,this._handleFallbackAutoScroll)),bn(),yn(),rt()},nulling:function(){gn=fn=dn=pn=_n=mn=hn=null,$.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(gn=e,t||this.options.forceAutoScrollFallback||Le||A||ze){xn(e,this.options,a,t);var o=z(a,!0);pn&&(!_n||r!==mn||i!==hn)&&(_n&&bn(),_n=setInterval(function(){var a=z(document.elementFromPoint(r,i),!0);a!==o&&(o=a,yn()),xn(e,n.options,a,t)},10),mn=r,hn=i)}else{if(!this.options.bubbleScroll||z(a,!0)===I()){yn();return}xn(e,this.options,z(a,!1),!1)}}},D(e,{pluginName:`scroll`,initializeByDefault:!0})}function yn(){$.forEach(function(e){clearInterval(e.pid)}),$=[]}function bn(){clearInterval(_n)}var xn=nt(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=I(),l=!1,u;fn!==n&&(fn=n,yn(),dn=t.scroll,u=t.scrollFn,dn===!0&&(dn=z(n,!0)));var d=0,f=dn;do{var p=f,m=L(p),h=m.top,g=m.bottom,_=m.left,ee=m.right,v=m.width,te=m.height,y=void 0,b=void 0,ne=p.scrollWidth,x=p.scrollHeight,S=F(p),C=p.scrollLeft,re=p.scrollTop;p===c?(y=v<ne&&(S.overflowX===`auto`||S.overflowX===`scroll`||S.overflowX===`visible`),b=te<x&&(S.overflowY===`auto`||S.overflowY===`scroll`||S.overflowY===`visible`)):(y=v<ne&&(S.overflowX===`auto`||S.overflowX===`scroll`),b=te<x&&(S.overflowY===`auto`||S.overflowY===`scroll`));var w=y&&(Math.abs(ee-i)<=o&&C+v<ne)-(Math.abs(_-i)<=o&&!!C),ie=b&&(Math.abs(g-a)<=o&&re+te<x)-(Math.abs(h-a)<=o&&!!re);if(!$[d])for(var T=0;T<=d;T++)$[T]||($[T]={});($[d].vx!=w||$[d].vy!=ie||$[d].el!==p)&&($[d].el=p,$[d].vx=w,$[d].vy=ie,clearInterval($[d].pid),(w!=0||ie!=0)&&(l=!0,$[d].pid=setInterval(function(){r&&this.layer===0&&Q.active._onTouchMove(gn);var t=$[this.layer].vy?$[this.layer].vy*s:0,n=$[this.layer].vx?$[this.layer].vx*s:0;(typeof u!=`function`||u.call(Q.dragged.parentNode[B],n,t,e,gn,$[this.layer].el)===`continue`)&&it($[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=z(f,!1)));pn=l}},30),Sn=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function Cn(){}Cn.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Ye(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Sn},D(Cn,{pluginName:`revertOnSpill`});function wn(){}wn.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Sn},D(wn,{pluginName:`removeOnSpill`}),Q.mount(new vn),Q.mount(wn,Cn);var Tn={animation:180,bubbleScroll:!1,delay:150,delayOnTouchOnly:!0,fallbackTolerance:4,forceAutoScrollFallback:!0,scrollSensitivity:56,scrollSpeed:18};function En(e,t,n){return[...e.querySelectorAll(t)].map(e=>e.dataset[n]).filter(e=>e!==void 0)}function Dn(e){return e.item.nextSibling}function On(e,t,n=null){let{item:r,oldIndex:i,newIndex:a}=t;if(i==null||a==null||i===a)return;if(r.parentNode?.removeChild(r),n){e.insertBefore(r,n);return}let o=e.children;i>=o.length?e.appendChild(r):e.insertBefore(r,o[i]??null)}function kn(e,t){if(t){e.dataset.dragging=`true`;return}delete e.dataset.dragging}function An(e,t){let n=t==null?void 0:e[t];if(!n)return{movedId:void 0,movedIndex:-1,afterId:null,beforeId:null};let r=e.indexOf(n);return{movedId:n,movedIndex:r,afterId:r>0?e[r-1]:null,beforeId:r>=0&&r<e.length-1?e[r+1]:null}}export{On as a,Te as c,Se as d,ne as f,Tn as i,Oe as l,An as n,kn as o,En as r,Q as s,Dn as t,we as u};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./lit-DW8VmJAT.js";var n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=e=>(...t)=>({_$litDirective$:e,values:t}),i=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},a=class extends i{constructor(t){if(super(t),this.it=e,t.type!==n.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(n){if(n===e||n==null)return this._t=void 0,this.it=n;if(n===t)return n;if(typeof n!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(n===this.it)return this._t;this.it=n;let r=[n];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};a.directiveName=`unsafeHTML`,a.resultType=1;var o=r(a);export{n as a,i,o as n,r,a as t};
1
+ import{n as e,r as t}from"./lit-Bw_voPoW.js";var n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=e=>(...t)=>({_$litDirective$:e,values:t}),i=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},a=class extends i{constructor(t){if(super(t),this.it=e,t.type!==n.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(n){if(n===e||n==null)return this._t=void 0,this.it=n;if(n===t)return n;if(typeof n!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(n===this.it)return this._t;this.it=n;let r=[n];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};a.directiveName=`unsafeHTML`,a.resultType=1;var o=r(a);export{n as a,i,o as n,r,a as t};
@@ -0,0 +1 @@
1
+ import{c as e,f as t,n,r,t as i}from"./footnote-rail-B08scyhW.js";import{u as a}from"./lit-Bw_voPoW.js";import{r as o,t as s}from"./unsafe-html-CWos3v6N.js";import{l as c,u as l}from"./types-D5iF3H1a.js";function u(r){n(r),e(r),t(r),i(r)}function d(){return document.querySelector(`jant-compose-dialog`)}async function f(){let e=d();return e?(await r(),e):null}function p(){let e=d();if(!e)return null;if(e.labels)return e.labels;let t=e.getAttribute(`labels`);if(!t)return null;try{return JSON.parse(t)}catch{return null}}function m(){return document.querySelector(`[data-collection-mode][data-collection-id]`)?.dataset.collectionId||void 0}function h(e=document){if(e===document){let e=document.querySelector(`.thread-group-detail article[data-post]:hover`);if(e)return e}return e.querySelector(`[data-post-current] article[data-post]`)||e.querySelector(`[data-post-view] article[data-post]`)||(e===document?document.querySelector(`article[data-post]:hover`):null)}function g(e){let t=e.querySelector(`.thread-group-detail`);if(!t)return null;let n=t.querySelectorAll(`.thread-detail-item article[data-post]`);return n.length>0?n.item(n.length-1):null}function _(e=document){let t=g(e);if(t)return t;if(e===document){let e=document.querySelector(`.thread-group-detail article[data-post]:hover`);if(e)return e}return h(e)}function v(e){let t=e.closest(`[data-post-view]`)?.dataset.postViewId;if(t)return{kind:`post-view`,id:t};let n=e.closest(`[data-timeline-item]`),r=n?.dataset.threadRootId??e.dataset.threadRootId??e.dataset.postId;if(n&&r)return{kind:`timeline-item`,id:r};let i=e.dataset.postId;return i?{kind:`post-card`,id:i}:null}function y(e){let t=e.cloneNode(!0);t.querySelector(`[data-post-meta]`)?.remove(),t.querySelector(`.post-status-badges`)?.remove();let n=e.querySelector(`time.dt-published`);return{contentHtml:t.innerHTML,dateText:n?.textContent?.trim()??``}}async function b(e){await(await f())?.openNew(e)}async function x(e){await(await f())?.openEdit(e)}async function S(e){await(await f())?.openDraft(e)}async function C(e){let t=e.dataset.postId;if(!t)return;let n=await f();if(!n)return;let r=e.dataset.threadDraftTailId;if(r){a(`Picking up the unfinished draft at the end of this thread.`),await n.openEdit(r);return}let i=e.dataset.threadRootId??t;await n.openReply(t,y(e),i,v(e)??void 0)}async function w(e){let t=await fetch(e,{headers:{Accept:`text/html`}});return t.ok?t.text():null}async function T(e){try{let t=document.querySelector(`[data-timeline-item][data-thread-root-id="${e}"]`)?.querySelector(`[data-timeline-item-content]`);if(!t)return!1;let n=await w(`/_/timeline-item/${encodeURIComponent(e)}`);return n?(t.innerHTML=n,u(t),!0):!1}catch{return!1}}async function E(e){try{let t=document.querySelector(`article[data-post-id="${e}"]`)?.closest(`[data-timeline-item]`),n=await w(`/_/post-card/${encodeURIComponent(e)}`);if(!n)return!1;if(t){let e=t.querySelector(`[data-timeline-item-content]`);return e?(e.innerHTML=n,u(e),!0):!1}let r=document.querySelector(`article[data-post-id="${e}"]`);if(!r)return!1;r.outerHTML=n;let i=document.querySelector(`article[data-post-id="${e}"]`);return i&&u(i),!0}catch{return!1}}async function D(e){try{let t=document.querySelector(`[data-post-view][data-post-view-id="${e}"]`);if(!t)return!1;let n=await w(`/_/post-view/${encodeURIComponent(e)}`);if(!n)return!1;t.outerHTML=n;let r=document.querySelector(`[data-post-view][data-post-view-id="${e}"]`);return r&&u(r),!0}catch{return!1}}async function O(e){let t=v(e);return t?t.kind===`timeline-item`?T(t.id):t.kind===`post-view`?D(t.id):E(t.id):!1}function k(e,t){return c([e.title,e.slug],t)}function A(e,t){if(e.length===0)return[];let n=new Set(t),r=[],i=[];for(let t of e)n.has(t.id)?r.push(t.id):i.push(t.id);return[...r,...i]}function j(e,t){if(e.length===0||t.length===0)return[...e];let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set;for(let e of t){let t=n.get(e);t&&!i.has(e)&&(r.push(t),i.add(e))}for(let t of e)i.has(t.id)||r.push(t);return r}function M(e,t){let n=l(t);return n?e.map((e,t)=>({item:e,index:t,rank:k(e,n)})).filter(e=>e.rank!==null).sort((e,t)=>e.rank-t.rank||e.index-t.index).map(e=>e.item):[...e]}var N=class extends s{};N.directiveName=`unsafeSVG`,N.resultType=2;var P=o(N);export{C as _,O as a,T as c,d,h as f,b as g,x as h,A as i,f as l,S as m,j as n,E as o,_ as p,M as r,D as s,P as t,m as u,p as v};